/* ============================================================
   SETTINGS: the page and its admin tabs (js/settings.js and the
   js/*-admin.js modules that paint into its panes, js/connections.js).
   Moved out of css/design-system.css for Mythril Version 1 (Nov 2026) and
   linked directly after it, so the cascade order is what it always was.
   ============================================================ */
/* ── Settings (KAN-118): how the portal reaches the signed-in person ──────
   One column, sections divided by rules, a switch per channel. The switch
   is a real button — a tab stop, Space and Enter flip it — with a visible
   focus ring; gold means on, the button border colour means off. */
.set-section{ margin-top:34px; }
.set-tabs + .set-section{ margin-top:6px; }
.set-h{ font-family:var(--font-serif); font-size:20px; font-weight:600; color:var(--text-head); margin:0; }
.set-p{ margin:6px 0 0; font-size:14px; line-height:1.5; color:var(--text-muted); max-width:62ch; }
.set-p b, .set-meta b, .set-facts dd b{ font-weight:600; color:var(--text-head); }
.set-rows{ margin-top:14px; }
.set-row{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 32px; align-items:start; padding:20px 0; border-top:1px solid var(--rule); }
.set-row:first-child{ border-top:0; padding-top:4px; }
.set-k{ font-size:15px; font-weight:600; color:var(--text-head); }
.set-v{ font-size:13.5px; color:var(--text-body); line-height:1.5; max-width:62ch; }
.set-meta{ font-size:12.5px; line-height:1.55; color:var(--text-muted); margin-top:2px; }
.set-ok{ color:var(--green-ink); font-weight:600; }
.set-warn{ color:var(--amber-ink); font-weight:600; }
.set-link{ color:var(--gold-ink); font-weight:600; text-decoration:none; }
.set-link:hover{ text-decoration:underline; }
.set-foot{ margin:28px 0 0; font-size:12.5px; color:var(--text-faint); }
.set-facts{ margin:14px 0 0; }
.set-facts > div{ display:grid; grid-template-columns:220px minmax(0,1fr); gap:24px; padding:12px 0; border-top:1px solid var(--rule); font-size:13.5px; line-height:1.5; }
.set-facts > div:first-child{ border-top:0; }
.set-facts dt{ color:var(--text-muted); font-weight:600; }
.set-facts dd{ margin:0; color:var(--text-body); overflow-wrap:anywhere; }
.set-facts + .set-p{ margin-top:18px; }
/* Copies on the portal's email to this person: the list, the open request, the form. */
.set-row-copies{ grid-template-columns:minmax(0,1fr); }
/* A switch sits beside its words, not at the far edge of a wide screen
   (Mendel, 10/28/26: on his monitor "Stay logged in" read as having no switch). */
.set-row-switch{ grid-template-columns:minmax(0,72ch) auto; justify-content:start; }
.set-linkbtn{ background:none; border:0; padding:0; font:inherit; font-size:inherit; cursor:pointer; }
.set-copies-req b{ font-weight:600; color:var(--text-head); }
.set-copies-form{ margin-top:12px; padding:14px 16px; border:0; border-radius:var(--my-r); background:var(--surface-2); max-width:520px; }
.set-copies-form .set-label{ margin-bottom:8px; }
.set-copies-input{ display:block; width:100%; margin-bottom:8px; }
.set-copies-note{ width:100%; }
.set-copies-form .set-field{ margin-top:6px; }
.set-copies-form .set-status{ margin-top:8px; }
.set-copies-acts{ margin-top:12px; justify-content:flex-start; }
.set-reqs{ margin:14px 0 4px; }
.set-req{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px 24px; align-items:start; padding:14px 16px; border:0; border-radius:var(--my-r); background:color-mix(in oklab, var(--gold) 12%, var(--surface)); }
.set-req + .set-req{ margin-top:8px; }
.set-req-body{ min-width:0; }
.set-req-line{ font-size:13.5px; color:var(--text-body); line-height:1.5; overflow-wrap:anywhere; }
.set-req-line b{ font-weight:600; color:var(--text-head); }
.set-req-note{ margin-top:8px; width:100%; max-width:420px; }
.set-req .req-status{ margin-top:6px; }
/* A phone stacks the request: its words, the reply box, then Approve and Decline. */
@media (max-width:640px){ .set-req{ grid-template-columns:minmax(0,1fr); } .set-req-note{ max-width:none; } }
.set-input-cc{ width:220px; }
.set-cc-asked{ margin-left:6px; }
/* The switch (Mythril Version 1): a Mac's, royal when on, grey when off,
   the knob springs across and stretches while pressed. */
.lh-switch{ grid-row:span 3; margin-top:2px; width:46px; height:28px; padding:0; border:0; border-radius:14px; background:var(--royal); position:relative; cursor:pointer; flex-shrink:0; transition:background-color .22s ease-out; }
[data-theme="dark"] .lh-switch{ background:#4f74d6; }
.lh-switch-knob{ position:absolute; top:3px; left:21px; width:22px; height:22px; border-radius:11px; background:#fff; box-shadow:0 2px 5px rgba(15,19,30,.3), 0 0 0 .5px rgba(15,19,30,.06); transition:left .36s var(--my-spring), width .2s ease-out; }
.lh-switch:active .lh-switch-knob{ width:26px; left:17px; }
.lh-switch[aria-checked="false"]{ background:color-mix(in oklab, var(--text-strong) 16%, transparent); }
[data-theme="dark"] .lh-switch[aria-checked="false"]{ background:color-mix(in oklab, var(--text-strong) 22%, transparent); }
.lh-switch[aria-checked="false"] .lh-switch-knob{ left:3px; }
.lh-switch[aria-checked="false"]:active .lh-switch-knob{ left:3px; }
.lh-shell .lh-switch:focus-visible{ outline:2px solid var(--gold-dark); outline-offset:3px; box-shadow:none; }
.lh-switch[disabled]{ opacity:.6; cursor:progress; }
.lh-switch[aria-disabled="true"]{ opacity:.45; cursor:not-allowed; }
.lh-switch[aria-busy="true"]{ opacity:.6; cursor:progress; }
.set-toast{ position:fixed; left:50%; bottom:28px; z-index:265; transform:translate(-50%, 14px) scale(.98); opacity:0; pointer-events:none; display:inline-flex; align-items:center; min-height:44px; padding:0 16px; box-sizing:border-box; border-radius:14px; font:500 14px/1.3 var(--font-sans); color:var(--text-strong); background:color-mix(in oklab, var(--surface) 90%, transparent); box-shadow:var(--my-pop-shadow); -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px); transition:opacity .2s ease-out, transform .42s var(--my-sheet); }
html.my-solid .set-toast{ background:var(--surface); -webkit-backdrop-filter:none; backdrop-filter:none; }
.set-toast.is-on{ opacity:1; transform:translate(-50%, 0) scale(1); }
@media (prefers-reduced-motion: reduce){ .lh-switch, .lh-switch-knob, .set-toast{ transition:none; } }

/* ---------- Settings: the tabs that came over from Admin Settings (9/17/26) ----------
   Team, Installers, Email wording, API & lead sources — drawn in the Settings
   page's own grammar: one column, hairline rows, tokens only (so dark mode
   needs no second rule), a state as a word in the row's own ink, and gold on
   at most one filled action per view. The modules paint into static panes
   under #settingsRoot; js/settings.js shows one at a time. */
.lh-settings-panes[hidden], .lh-settings-pane[hidden]{ display:none !important; }
.lh-settings-pane .set-section:first-child, .lh-settings-pane .set-editor:first-child{ margin-top:6px; }
.set-editor + .set-editor{ margin-top:38px; padding-top:34px; border-top:1px solid var(--rule-strong); }

/* buttons: the small row-level size, the quiet secondary, the one that removes */
.ds-btn-sm{ padding:7px 12px; font-size:11.5px; gap:6px; }
.ds-btn-quiet{ border-color:transparent; color:var(--text-muted); }
.ds-btn-quiet:hover{ border-color:var(--border-btn); color:var(--text-head); }
.ds-btn-danger:hover{ border-color:var(--red); color:var(--red); }
.ds-btn:disabled{ opacity:.5; cursor:not-allowed; }
.ds-btn:focus-visible{ outline:2px solid var(--gold-dark); outline-offset:2px; }
.ds-btn[hidden]{ display:none; }

/* status lines: one span, its ink says which */
.set-status{ font-size:12.5px; line-height:1.5; }
.set-status.ok{ color:var(--green-ink); }
.set-status.err{ color:var(--red-ink); }
.set-note{ margin:14px 0 0; font-size:12.5px; line-height:1.55; color:var(--text-muted); max-width:72ch; }
.set-note b{ font-weight:600; color:var(--text-head); }

/* fields */
.set-field{ display:block; margin-top:14px; min-width:0; }
.set-label{ display:block; font-size:12.5px; font-weight:600; color:var(--text-head); margin-bottom:6px; }
.set-input, .set-select, .set-textarea{ font:inherit; font-size:14px; line-height:1.4; color:var(--text-strong); background:color-mix(in oklab, var(--surface) 70%, transparent); border:0; border-radius:10px; padding:9px 12px; max-width:100%; box-sizing:border-box; box-shadow:inset 0 0 0 1px var(--hairline); transition:box-shadow .2s, background .2s; }
.set-input:hover, .set-select:hover, .set-textarea:hover{ box-shadow:inset 0 0 0 1.5px var(--gold); }
.set-field .set-input, .set-field .set-textarea, .set-field .set-select{ width:100%; }
.set-input:focus, .set-select:focus, .set-textarea:focus{ outline:none; background:var(--surface); box-shadow:inset 0 0 0 1.5px color-mix(in oklab, var(--text-strong) 34%, transparent); }
.set-input::placeholder, .set-textarea::placeholder{ color:var(--text-faint); }
.set-input:disabled, .set-select:disabled{ opacity:.55; cursor:not-allowed; }
.set-textarea{ resize:vertical; }
.set-check{ display:inline-flex; align-items:center; gap:8px; margin-top:14px; font-size:13.5px; color:var(--text-body); cursor:pointer; }
.set-color{ width:44px; height:34px; padding:2px; border:1px solid var(--hairline); border-radius:8px; background:var(--surface); cursor:pointer; }

/* the team: tabular data stays a table, drawn flat */
.set-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin:14px 0 4px; }
.set-count{ font-size:13px; color:var(--text-muted); }
.set-count b{ font-weight:600; color:var(--text-head); }
.set-count .set-pend{ color:var(--amber-ink); }
.set-table-wrap{ overflow-x:auto; margin-top:8px; }
.set-table{ width:100%; border-collapse:collapse; font-size:13.5px; }
.set-table th{ text-align:left; padding:0 10px 9px 0; font-size:11.5px; font-weight:600; color:var(--text-faint); border-bottom:1px solid var(--rule-strong); white-space:nowrap; }
.set-table td{ padding:11px 10px 11px 0; border-bottom:1px solid var(--rule); vertical-align:middle; }
.set-table th:last-child, .set-table td:last-child{ padding-right:0; }
.set-tr:hover td{ background:var(--hover); }
.set-table .set-input, .set-table .set-select{ border-color:transparent; background:transparent; transition:border-color .14s, background .14s; }
.set-table .set-input:hover, .set-table .set-select:hover, .set-table .set-input:focus, .set-table .set-select:focus,
.set-tr-add .set-input, .set-tr-add .set-select{ border-color:var(--hairline); background:var(--surface); }
@media (hover:none){ .set-table .set-input, .set-table .set-select{ border-color:var(--hairline); background:var(--surface); } }
.set-tr-pending td{ background:var(--gold-faint); }
.set-tr-denied .set-who-name{ color:var(--text-faint); }
.set-tr-add td{ background:var(--surface-2); }
.set-who{ display:flex; align-items:center; gap:10px; min-width:200px; }
.set-who-text{ display:flex; flex-direction:column; min-width:0; gap:1px; }
.set-who-form{ gap:6px; width:100%; }
.set-who-form .set-input{ min-width:0; width:100%; max-width:240px; }
.set-who-name{ font-size:13.5px; font-weight:600; color:var(--text-head); }
.set-who-sub{ font-size:12px; color:var(--text-muted); overflow-wrap:anywhere; }
.set-who-sub em{ font-style:normal; color:var(--gold-dark); }
.set-photo{ width:28px; height:28px; border-radius:6px; border:1px solid var(--hairline); object-fit:cover; flex-shrink:0; background:var(--sidebar-deep); }
.set-state{ font-size:12.5px; font-weight:600; white-space:nowrap; }
.set-state-pending{ color:var(--amber-ink); }
.set-state-active{ color:var(--text-muted); font-weight:500; }
.set-state-denied{ color:var(--red-ink); }
.set-lock{ font-size:11.5px; color:var(--text-faint); margin-left:6px; }
.set-input-phone{ width:124px; }
.set-when{ font-size:12.5px; color:var(--text-muted); white-space:nowrap; font-variant-numeric:tabular-nums; }
.set-td-actions{ text-align:right; }
.set-actions{ display:inline-flex; gap:4px; justify-content:flex-end; white-space:nowrap; }
.set-status-row td{ padding:2px 0 10px; border-bottom:1px solid var(--rule); }
.set-status-row.hidden, .set-tr-add.hidden{ display:none; }
/* Team: the search box beside Add person, and what it hides (10/8/26). */
.set-toolbar-end{ display:flex; align-items:center; gap:8px; }
.set-search{ width:240px; }
.set-tr-filtered{ display:none; }
.set-empty-row td{ padding:18px 0; font-size:13.5px; color:var(--text-muted); border-bottom:1px solid var(--rule); }
.set-empty-row.hidden, .set-perm-row.hidden{ display:none; }
/* One person's permissions, opened under their row: hairline lines, a name
   and a sentence on the left, the choice on the right. */
.set-perms-link{ display:block; margin:2px 0 0 11px; font-size:12px; text-align:left; }
.set-perms-all{ color:var(--text-faint); }
.set-perm-row td{ padding:4px 0 16px; border-bottom:1px solid var(--rule); background:var(--surface-2); }
/* The panel stays in view when the table scrolls sideways. */
.set-perms{ position:sticky; left:0; max-width:860px; padding:6px 16px 0 16px; }
.set-perms-lead{ margin:6px 0 4px; }
.set-perm-line{ display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:6px 24px; align-items:center; padding:10px 0; border-top:1px solid var(--rule); }
.set-perm-line:first-of-type{ border-top:0; }
.set-perm-text{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.set-perm-name{ font-size:13.5px; font-weight:600; color:var(--text-head); }
.set-perm-detail{ font-size:12.5px; line-height:1.5; color:var(--text-muted); }
.set-perm-row .set-perm-pick{ width:100%; border-color:var(--hairline); background:var(--surface); }
/* Roles: each role's permissions as a checklist, grouped. */
.set-role-perms{ margin-top:10px; }
.set-perm-group{ margin-top:14px; }
.set-perm-group .set-label{ margin-bottom:2px; }
.set-perm{ display:flex; align-items:flex-start; gap:10px; margin-top:10px; }
.set-perm input{ margin-top:3px; }
.set-perm input:disabled + .set-perm-text{ opacity:.55; }
.set-role-admin .set-inst-name{ color:var(--text-head); }
.set-role-admin:hover{ background:transparent; border-left-color:transparent; padding-left:0; }
.set-role-custom{ margin-top:30px; }
#rolesContainer .set-inst-fields{ grid-template-columns:minmax(0,1fr) 220px; }

/* installers: a line each, its fields open in place */
.set-list{ margin-top:4px; }
.set-inst{ padding:16px 0; border-top:1px solid var(--rule); transition:background .14s, padding-left .14s; }
.set-inst:hover{ background:var(--hover); border-radius:var(--my-r); }
/* An open editor is a place to type, not a row to point at. */
.set-inst:has(> .set-inst-edit:not([hidden])), .set-inst:has(> .set-inst-edit:not([hidden])):hover{ background:none; }
/* Checkboxes and radios on these pages take the royal accent: gold is kept
   for the one main action of each view. */
#settingsScreen input[type="checkbox"], #settingsScreen input[type="radio"]{ accent-color:var(--royal); }
.set-inst:first-child{ border-top:0; padding-top:6px; }
.set-inst-head{ display:flex; align-items:center; gap:12px; }
.set-swatch{ width:12px; height:12px; border-radius:4px; flex-shrink:0; }
.set-inst-main{ flex:1; min-width:0; }
.set-inst-name{ font-size:15px; font-weight:600; color:var(--text-head); }
.set-inst-off{ display:inline-block; font-size:12px; font-weight:500; color:var(--amber-ink); margin-left:8px; }
.set-inst-meta{ font-size:12.5px; color:var(--text-muted); margin-top:3px; overflow-wrap:anywhere; }
.set-inst-edit{ margin-top:6px; padding-left:24px; }
.set-inst-edit[hidden]{ display:none; }
.set-inst-fields{ display:grid; grid-template-columns:minmax(0,1fr) 140px; gap:0 24px; }
.set-field-wide{ grid-column:1 / -1; }
.set-add{ margin-top:22px; padding-top:20px; border-top:1px solid var(--rule-strong); }
.set-add .set-inst-edit{ padding-left:0; margin-top:0; }

/* the email editors */
.tpl-actions{ display:flex; align-items:center; gap:8px; margin-top:16px; flex-wrap:wrap; }
.tpl-actions .set-status{ margin-left:4px; }
.tpl-note{ margin:12px 0 0; font-size:12.5px; color:var(--gold-ink); }
.tpl-textarea{ min-height:260px; font-size:13.5px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }
.tpl-placeholders{ display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 0; margin-top:10px; }
.tpl-ph-label{ font-size:12.5px; color:var(--text-muted); margin-right:10px; }
.tpl-chip{ font:inherit; font-size:12.5px; font-weight:600; padding:0; border:0; background:transparent; color:var(--gold-ink); cursor:pointer; }
.tpl-chip:hover{ text-decoration:underline; text-underline-offset:3px; }
.tpl-chip:focus-visible{ outline:2px solid var(--gold-dark); outline-offset:3px; border-radius:2px; }
.tpl-chip + .tpl-chip::before{ content:"·"; color:var(--text-faint); margin:0 7px; font-weight:400; }
.tpl-preview-head{ font-size:12.5px; font-weight:600; color:var(--text-head); margin:18px 0 6px; }
.tpl-preview{ border-top:1px solid var(--rule-strong); border-bottom:1px solid var(--rule-strong); padding:14px 0; max-height:320px; overflow-y:auto; }
.tpl-preview-subj{ font-size:13px; color:var(--text-head); margin-bottom:8px; }
.tpl-preview-subj b{ font-weight:600; }
.tpl-preview-body{ margin:0; font-family:inherit; font-size:13px; line-height:1.55; color:var(--text-body); white-space:pre-wrap; overflow-wrap:anywhere; }
/* the client close-out email's setup (js/email-templates-admin.js, KAN-35) */
.set-h3{ font-size:14px; font-weight:600; color:var(--text-head); margin:22px 0 4px; }
.tpl-co-mats{ list-style:none; margin:8px 0 10px; padding:0; border-top:1px solid var(--rule-strong); }
.tpl-co-mat{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; border-bottom:1px solid var(--rule-strong); font-size:13px; color:var(--text-body); overflow-wrap:anywhere; }
.tpl-co-none{ color:var(--text-muted); }
.tpl-co-add{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; align-items:center; }
.tpl-co-add input[type="file"]{ font-size:12.5px; color:var(--text-muted); }
.tpl-co-add .ds-btn{ justify-self:start; }
@media (max-width:640px){ .tpl-co-add{ grid-template-columns:1fr; } }
@media (max-width:640px){
  .set-toolbar{ flex-direction:column; align-items:stretch; }
  .set-toolbar .ds-btn{ justify-content:center; min-height:44px; }
  .set-toolbar-end{ flex-direction:column; align-items:stretch; }
  .set-search{ width:100%; min-height:44px; }
  .set-perm-line{ grid-template-columns:1fr; }
  .set-inst-fields{ grid-template-columns:1fr; }
  .set-inst-edit{ padding-left:0; }
  .set-actions{ flex-wrap:nowrap; justify-content:flex-start; }
  .set-who-sub{ white-space:nowrap; }
  .set-actions .ds-btn, .set-inst-head .ds-btn, .tpl-actions .ds-btn{ width:auto; min-height:36px; }
  .set-input, .set-select, .set-textarea, .tpl-textarea{ font-size:16px; }
}

/* Headshots on Settings (js/headshots.js, Oct 22 2026). */
/* ---------- Settings → Team: the person's bubble is the button ---------- */
.set-hs{
  position:relative; flex-shrink:0; width:36px; height:36px; padding:0; border-radius:50%;
  border:1px solid var(--rule-strong); background:var(--surface-2); color:var(--text-muted);
  font:600 12px/1 var(--font-sans); display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer; overflow:hidden;
}
.set-hs:hover{ border-color:var(--gold); color:var(--gold-dark); }
.set-hs:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
.set-hs:disabled{ cursor:default; }
.set-hs.is-missing{ border-style:dashed; }
.set-hs img{ width:100%; height:100%; object-fit:cover; display:block; }

/* ---------- Settings → Account ---------- */
.set-hs-mine{ display:inline-flex; align-items:center; gap:12px; }
.set-hs-mine .set-hs{ width:40px; height:40px; }

/* ---------- Settings, redesigned (LIO-252, Nick 10/30/26: "this is fine") ----------
   After Mobbin references (Vanta, Featurebase and Twenty for a settings menu
   of its own beside the rail; Unify and AirOps for notifications as a grid of
   what by channel; Homerun and Klaviyo for content in bordered cards; Zendesk
   for a person's access as rows of what and level). A settings menu, then the
   page: the menu becomes a row of tabs over the page under 1440px, so the
   Team table keeps its full width and an email is never cut off or wrapped.
   #settingsRoot is display:contents, so the menu it paints and the panes
   after it share the one grid. Prefix sx- (st- is taken elsewhere). */
/* Mythril Version 1 (Nov 2026): the page's tabs sit in its glass bar across
   the top (.my-bar, .my-tabs), what is yours then what runs the company,
   the page full width under it. The bar scrolls sideways when the tabs
   outrun the window, and stops short of the bell. */
#settingsScreen > main.sx-page{ padding:calc(var(--bell-top) + var(--bell-size) / 2 - 30px) var(--page-gutter) 0; overflow:visible; display:block; }
.sx-page > #settingsRoot{ display:contents; }
/* The bar's centre sits on the bell's line (43px down): a 60px bar at 13px. */
.sx-side{ position:sticky; top:calc(var(--bell-top) + var(--bell-size) / 2 - 30px); z-index:6; margin-right:max(0px, var(--bar-end) - var(--page-gutter)); gap:0; min-height:60px; box-sizing:border-box; padding:0 var(--bell-dock) 0 8px; }
/* The bar names the screen, then its two groups (Mythril Version 1). */
.sx-side-title{ flex:0 0 auto; margin:0 14px 0 12px; font:600 21px/1 var(--font-serif); letter-spacing:-.015em; color:var(--text-head); }
.sx-nav{ flex:1 1 auto; min-width:0; gap:0; overflow-x:auto; scrollbar-width:none; padding:10px 0; scroll-padding:0 40px; }
/* Where the tabs outrun the bar, its edges fade so the rest reads as more. */
.sx-nav.is-more-end{ -webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.sx-nav.is-more-start{ -webkit-mask-image:linear-gradient(90deg, transparent, #000 48px); mask-image:linear-gradient(90deg, transparent, #000 48px); }
.sx-nav.is-more-start.is-more-end{ -webkit-mask-image:linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image:linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.sx-page a.my-tab{ padding:0 12px; }
.sx-nav::-webkit-scrollbar{ display:none; }
/* The pages of the group in view: a quiet row under the bar. */
.sx-sub{ gap:2px; margin:12px 0 0; padding:0 6px; overflow-x:auto; scrollbar-width:none; scroll-padding:0 40px; }
.sx-sub::-webkit-scrollbar{ display:none; }
.sx-sub a.my-tab{ height:32px; border-radius:9px; }
.sx-sub.is-more-end{ -webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.sx-sub.is-more-start{ -webkit-mask-image:linear-gradient(90deg, transparent, #000 48px); mask-image:linear-gradient(90deg, transparent, #000 48px); }
.sx-sub.is-more-start.is-more-end{ -webkit-mask-image:linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image:linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.sx-head-part{ margin-top:44px; }
.sx-h2.sx-h2-part{ font-size:24px; scroll-margin-top:96px; }
.sx-page a.my-tab{ display:inline-flex; align-items:center; gap:8px; text-decoration:none; }
.sx-page a.my-tab svg{ flex:0 0 auto; opacity:.7; }
.sx-page a.my-tab[aria-current]{ color:var(--royal-ink); font-weight:600;
  background:linear-gradient(180deg, color-mix(in oklab, var(--royal) 13%, transparent), color-mix(in oklab, var(--royal) 8%, transparent));
  box-shadow:inset 0 0 0 1px color-mix(in oklab, var(--royal) 26%, transparent), inset 0 1px 0 rgba(255,255,255,.7), 0 6px 14px -8px color-mix(in oklab, var(--royal) 55%, transparent); }
[data-theme="dark"] .sx-page a.my-tab[aria-current]{ color:#f3e2b3;
  background:linear-gradient(180deg, rgba(226,194,122,.2), rgba(226,194,122,.1));
  box-shadow:inset 0 0 0 1px rgba(226,194,122,.34), inset 0 1px 0 rgba(255,255,255,.14), 0 6px 16px -8px rgba(226,194,122,.5); }
.sx-page a.my-tab[aria-current] svg{ opacity:1; }
.sx-page a.my-tab:focus-visible{ outline:2px solid color-mix(in oklab, var(--gold-dark) 80%, var(--text-strong)); outline-offset:-2px; }
.sx-body, .sx-page > #settingsPanes{ min-width:0; box-sizing:border-box; padding-left:6px; padding-right:6px; }
.sx-body{ padding-top:30px; padding-bottom:22px; }
.sx-page > #settingsPanes{ padding-bottom:120px; }
.sx-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:24px; }
.sx-h2{ margin:0; font:600 30px/1.15 var(--font-serif); letter-spacing:-.015em; color:var(--text-head); }
.sx-h2:focus{ outline:none; }
.sx-lede{ margin:6px 0 0; font-size:15px; line-height:1.5; color:var(--text-muted); max-width:76ch; }
.sx-part{ margin-top:28px; }
.sx-h3{ margin:0 0 10px 4px; font-size:13.5px; font-weight:600; color:var(--text-muted); }
.sx-p{ margin:0 4px 12px; font-size:14px; line-height:1.55; color:var(--text-body); max-width:76ch; }
.sx-foot{ margin:12px 4px 0; font-size:13px; line-height:1.55; color:var(--text-muted); max-width:90ch; }
.sx-foot b{ font-weight:600; color:var(--text-body); }

/* cards: every group of rows sits in one, a grouped list like a Mac's
   system settings: one white sheet, a soft lifted shadow, a hairline
   between rows and none around them. */
.sx-card{ background:var(--surface); border:0; border-radius:var(--my-r-lg); box-shadow:var(--ds-shadow-card); }
.sx-card-flush{ overflow:hidden; }
.sx-rows{ padding:0 20px; }
.sx-row{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:3px 32px; align-items:center; min-height:56px; box-sizing:border-box; padding:14px 0; border-bottom:1px solid var(--rule); }
.sx-row:last-child{ border-bottom:0; }
.sx-row-k{ font-size:14.5px; font-weight:500; color:var(--text-strong); }
.sx-row-d{ grid-column:1; font-size:14px; line-height:1.5; color:var(--text-body); max-width:72ch; }
.sx-row-m{ grid-column:1; font-size:13px; line-height:1.45; color:var(--text-muted); max-width:62ch; }
.sx-row-c{ grid-column:2; grid-row:1 / span 3; display:flex; align-items:center; gap:8px; justify-self:end; }
.sx-row .lh-switch, .sx-matrix .lh-switch{ grid-row:auto; margin:0; }
.sx-facts{ margin:0; padding:0 20px; }
.sx-facts > div{ display:grid; grid-template-columns:180px minmax(0,1fr); gap:24px; min-height:56px; box-sizing:border-box; padding:12px 0; border-bottom:1px solid var(--rule); align-items:center; }
.sx-facts > div:last-child{ border-bottom:0; }
.sx-facts dt{ font-size:14px; color:var(--text-muted); }
.sx-facts dd{ margin:0; font-size:14.5px; color:var(--text-strong); }

/* Appearance and Accessibility: the theme as a segmented control, the
   glass as a slider over a live preview. */
.sx-seg{ flex:none; display:flex; gap:2px; padding:3px; border-radius:11px; background:color-mix(in oklab, var(--text-strong) 7%, transparent); }
.sx-seg button{ height:30px; padding:0 13px; border:0; border-radius:8px; background:none; cursor:pointer; font:500 13px/1 var(--font-sans); color:var(--text-body); transition:background-color .2s ease-out, color .2s ease-out, box-shadow .2s ease-out; }
.sx-seg button:hover{ color:var(--text-strong); }
.sx-seg button[aria-checked="true"]{ background:var(--surface); color:var(--text-strong); box-shadow:0 1px 3px rgba(15,19,30,.14), 0 0 0 .5px rgba(15,19,30,.06); }
[data-theme="dark"] .sx-seg button[aria-checked="true"]{ background:#2a3450; }
.sx-seg button:focus-visible{ outline:2px solid color-mix(in oklab, var(--gold-dark) 80%, var(--text-strong)); outline-offset:1px; }
.sx-row-wide{ grid-template-columns:minmax(0,1fr); gap:6px; padding:16px 0 18px; transition:opacity .2s ease-out; }
.sx-row-wide.is-off{ opacity:.45; }
.sx-slide{ max-width:520px; margin-top:10px; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:12px; font-size:12.5px; color:var(--text-muted); }
.sx-slide input[type="range"]{ width:100%; height:22px; accent-color:var(--royal); }
.sx-glass-pv{ position:relative; height:132px; max-width:640px; margin-top:12px; border-radius:14px; overflow:hidden; background:var(--canvas); }
.sx-glass-bg{ position:absolute; inset:0; display:grid; grid-template-columns:1.2fr 1.4fr 1.8fr .8fr; align-content:center; gap:10px 14px; padding:0 18px; font-size:13.5px; font-weight:500; color:var(--text-strong);
  background:linear-gradient(90deg, rgb(43 74 140 / .16) 0 18%, transparent 18% 40%, rgb(201 160 63 / .22) 40% 58%, transparent 58% 80%, rgb(63 154 107 / .18) 80%); }
.sx-glass-bg span:nth-child(2){ color:var(--royal-ink); }
.sx-glass-bg span:nth-child(4){ color:var(--gold-dark); }
.sx-glass-pane{ position:absolute; left:50%; top:50%; width:58%; height:62px; transform:translate(-50%, -50%); border-radius:18px; display:grid; place-items:center; font:600 14px/1 var(--font-serif); color:var(--text-strong);
  background:var(--my-glass); box-shadow:var(--my-glass-shadow); -webkit-backdrop-filter:blur(calc(4px + var(--my-gl, .6) * 26px)) saturate(1.6); backdrop-filter:blur(calc(4px + var(--my-gl, .6) * 26px)) saturate(1.6); }
html.my-solid .sx-glass-pane{ background:var(--surface); -webkit-backdrop-filter:none; backdrop-filter:none; }

/* tables: the Mythril table (foundation.md, THE TABLE). A 34px head in 12px
   medium, 40px rows of one line each, cells centred and text columns left,
   a line under every row and a divider between every column. Nothing wraps
   and nothing is cut: a table wider than its sheet scrolls sideways. */
.sx-card-flush:has(> table.sx-table){ overflow-x:auto; scrollbar-width:thin; scrollbar-color:var(--hairline) transparent; }
table.sx-table{ width:100%; border-collapse:separate; border-spacing:0; font-size:13.5px; }
.sx-table th, .sx-table td{ border-right:1px solid var(--rule); border-bottom:1px solid var(--hairline); text-align:center; vertical-align:middle; white-space:nowrap; }
.sx-table th:last-child, .sx-table td:last-child{ border-right:0; }
.sx-table th{ height:34px; padding:0 10px; font-size:12px; font-weight:500; letter-spacing:0; text-transform:none; color:var(--text-muted); background:var(--surface); border-bottom-color:var(--rule-strong); }
.sx-table td{ height:40px; padding:0 12px; color:var(--text-strong); font-variant-numeric:tabular-nums; }
.sx-table th:first-child, .sx-table td:first-child, .sx-table .sx-left{ text-align:left; }
.sx-table td:first-child, .sx-table th:first-child{ padding-left:16px; }
.sx-table tbody tr:hover td{ background:var(--hover); }
.sx-table tbody tr:last-child td{ border-bottom:0; }
.sx-table .sx-num{ text-align:center; font-variant-numeric:tabular-nums; }
.sx-table .sx-c{ width:96px; }
.sx-table td.sx-faint{ color:var(--text-muted); }
.sx-table td.sx-desc{ color:var(--text-body); }
.sx-mx-fixed{ font-size:12.5px; color:var(--text-muted); }
.sx-mx-off{ font-size:12.5px; color:var(--text-faint); }
/* The Notifications matrix: what each row covers sits in its hover card. */
.sx-matrix td:first-child{ padding-right:24px; font-weight:500; }
.sx-matrix td:first-child[title]{ cursor:default; }
.sx-matrix .sx-row-m{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.sx-matrix .sx-row-m#setSurveySlackHint{ position:static; width:auto; height:auto; overflow:visible; clip:auto; display:inline; margin-left:10px; font-weight:400; font-size:12.5px; }
.sx-matrix .lh-switch{ vertical-align:middle; }
.sx-matrix .sx-row-k{ display:inline; font-size:13.5px; }
tr.sx-tr-link{ cursor:pointer; transition:background .14s ease-out; }
tr.sx-tr-link:hover td{ background:var(--surface-2); }
tr.sx-tr-link:focus-visible{ outline:2px solid var(--gold); outline-offset:-2px; }
.sx-chev{ width:28px; color:var(--text-faint); }
tr.sx-flash td{ animation:sx-flash 1.2s ease-out; }
@keyframes sx-flash{ from{ background:var(--gold-faint); } to{ background:transparent; } }

/* the Team table: it fits the screen. The person column takes what the
   labels leave, the labels keep their width, and an email never wraps. */
.sx-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin:0 0 12px; flex-wrap:wrap; }
.sx-count{ font-size:13.5px; color:var(--text-muted); }
.sx-count b{ color:var(--text-strong); font-weight:600; }
.sx-count .set-pend{ color:var(--amber-ink); }
.sx-tools{ display:flex; gap:10px; align-items:center; }
.sx-search{ width:260px; }
.sx-people td:not(:first-child), .sx-people th:not(:first-child){ width:1%; }
.sx-who{ display:flex; align-items:center; gap:10px; min-width:0; }
.sx-who-btn{ display:flex; align-items:baseline; gap:8px; min-width:0; background:none; border:0; padding:0; font:inherit; text-align:left; cursor:pointer; color:inherit; white-space:nowrap; }
.sx-who-name, .sx-who-sub{ white-space:nowrap; }
.sx-who-name{ font-weight:600; color:var(--text-strong); }
.sx-who-sub{ font-size:12.5px; color:var(--text-muted); }
.sx-who-roles{ display:none; font-size:12.5px; color:var(--text-body); margin-top:2px; }
.sx-who-btn:hover .sx-who-name{ color:var(--gold-dark); }
.sx-who-btn:focus-visible{ outline:2px solid var(--gold); outline-offset:3px; border-radius:6px; }
.sx-people .set-hs{ width:24px; height:24px; font-size:10px; }
.sx-people tr.set-tr-denied .sx-who-name{ color:var(--text-muted); }
.sx-people tr.set-tr-filtered{ display:none; }
.sx-plain{ font-size:13.5px; color:var(--text-strong); }
@media (max-width:1560px){ .sx-people .sx-hide-md{ display:none; } }

/* Soft CRM-style labels (as .crm-stchip on the board): the colour as a pale
   wash, the word a darker mix of it. A picker label hides a native select
   over itself, so a click opens the choices and the keyboard still works. */
.sx-pill{ --chip:#8a8f99; position:relative; display:inline-flex; align-items:center; gap:5px; max-width:100%; min-height:24px; padding:0 9px; box-sizing:border-box; border-radius:7px; font-size:12.5px; font-weight:600; line-height:1.2; white-space:nowrap; background:color-mix(in oklab, var(--chip) 16%, transparent); color:color-mix(in oklab, var(--chip) 72%, var(--text-strong)); }
.sx-pill > span{ overflow:hidden; text-overflow:ellipsis; }
.sx-pill svg{ width:12px; height:12px; flex:0 0 auto; opacity:.55; }
.sx-pill-empty{ background:transparent; color:var(--text-faint); box-shadow:inset 0 0 0 1px var(--hairline); }
.sx-pill-pick{ cursor:pointer; transition:filter .12s ease-out, box-shadow .12s ease-out; }
.sx-pill-pick:hover{ filter:brightness(.97); }
.sx-pill-pick:hover svg{ opacity:.9; }
.sx-pill-pick select{ position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; font-size:16px; border:0; appearance:none; }
.sx-pill-pick select:disabled{ cursor:progress; }
.sx-pill-pick:focus-within{ box-shadow:0 0 0 2px var(--surface), 0 0 0 4px var(--gold); }
[data-theme="dark"] .sx-pill{ background:color-mix(in oklab, var(--chip) 24%, var(--surface)); color:color-mix(in oklab, var(--chip) 45%, #fff); }
[data-theme="dark"] .sx-pill-empty{ background:transparent; color:var(--text-faint); }
[data-theme="dark"] .sx-pill-pick:hover{ filter:brightness(1.12); }

/* tabs inside a page (Roles): a segmented control, the current one raised. */
.sx-tabs{ display:inline-flex; gap:2px; margin-top:4px; padding:3px; border-radius:11px; background:color-mix(in oklab, var(--text-strong) 7%, transparent); }
.sx-tabs button{ height:32px; padding:0 14px; border:0; border-radius:8px; background:none; font:500 13.5px/1 var(--font-sans); color:var(--text-body); cursor:pointer; transition:background-color .2s ease-out, color .2s ease-out, box-shadow .2s ease-out; }
.sx-tabs button:hover{ color:var(--text-strong); }
.sx-tabs button[aria-selected="true"]{ background:var(--surface); color:var(--text-strong); font-weight:600; box-shadow:0 1px 3px rgba(15,19,30,.14), 0 0 0 .5px rgba(15,19,30,.06); }
[data-theme="dark"] .sx-tabs button[aria-selected="true"]{ background:#2a3450; }
.sx-tabs button:focus-visible{ outline:2px solid color-mix(in oklab, var(--gold-dark) 80%, var(--text-strong)); outline-offset:1px; }
.sx-tab-top{ display:flex; align-items:center; justify-content:space-between; gap:16px; margin:14px 0 12px; flex-wrap:wrap; }
.sx-tab-lede{ margin:0; font-size:13.5px; color:var(--text-body); }
.sx-roles td:first-child{ width:1%; padding-right:28px; }
.sx-roles td.sx-desc{ text-align:left; }
.sx-roles th:nth-child(2){ text-align:left; }

/* dialogs: centred, over a scrim */
.sx-scrim{ position:fixed; inset:0; z-index:9000; display:flex; align-items:center; justify-content:center; padding:24px; box-sizing:border-box; background:rgba(13,18,32,.42); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }
.sx-scrim[hidden]{ display:none; }
.sx-dialog{ width:min(560px,100%); max-height:calc(100vh - 48px); max-height:calc(100dvh - 48px); overflow:auto; box-sizing:border-box; padding:22px 24px 20px; background:var(--surface); color:var(--text-body); border:0; border-radius:var(--my-r-xl); box-shadow:var(--my-pop-shadow); animation:myRise .42s var(--my-sheet) both; transform-origin:50% 40%; }
[data-theme="dark"] .sx-dialog{ background:#1e2745; }
.sx-dialog.is-wide{ width:min(720px,100%); }
.sx-dialog:focus{ outline:none; }
@keyframes sx-rise{ from{ opacity:0; transform:translateY(26px) scale(.9); } 15%{ opacity:1; } to{ opacity:1; transform:none; } }
.sx-scrim:not([hidden]){ animation:lh-screen-in .26s ease-out; }
.sx-d-head{ display:flex; align-items:center; gap:14px; }
.sx-d-head .set-hs{ width:48px; height:48px; font-size:15px; }
.sx-d-title{ margin:0; font-family:var(--font-serif); font-size:21px; font-weight:600; color:var(--text-head); line-height:1.2; }
.sx-d-sub{ font-size:13px; color:var(--text-muted); margin-top:2px; }
.sx-d-x{ margin-left:auto; align-self:flex-start; width:36px; height:36px; border:0; border-radius:8px; background:transparent; color:var(--text-muted); cursor:pointer; font-size:20px; line-height:1; flex:0 0 auto; }
.sx-d-x:hover{ background:var(--surface-2); color:var(--text-head); }
.sx-d-x:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
.sx-f{ margin-top:18px; }
.sx-f-k{ display:block; font-size:13px; font-weight:600; color:var(--text-head); margin-bottom:6px; }
.sx-f .set-select, .sx-f .set-input, .sx-f .set-textarea{ width:100%; box-sizing:border-box; }
.sx-f-help{ margin:3px 0 0; font-size:12.5px; line-height:1.45; color:var(--text-body); }
.sx-f-lock{ margin:4px 0 0; font-size:12.5px; color:var(--text-muted); }
.sx-f-pair{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.sx-d-foot{ display:flex; align-items:center; gap:8px; margin:22px 0 0; padding:0; flex-wrap:wrap; }
.sx-d-foot .set-status{ flex-basis:100%; order:-1; }
.sx-grow{ flex:1; }
.sx-access{ margin-top:20px; border:0; border-radius:var(--my-r); overflow:hidden; box-shadow:inset 0 0 0 1px var(--rule); }
.sx-access-h, .sx-access-r{ display:grid; grid-template-columns:minmax(0,1fr) 190px; gap:16px; padding:12px 14px; }
.sx-access-h{ padding-top:9px; padding-bottom:9px; background:none; border-bottom:1px solid var(--rule-strong); font-size:13px; color:var(--text-muted); }
.sx-access-r{ align-items:center; border-bottom:1px solid var(--rule); }
.sx-access-r:last-child{ border-bottom:0; }
.sx-access-r .set-select{ width:100%; }
.sx-dialog .set-perms{ margin-top:14px; }
.sx-dialog .set-perm-group + .set-perm-group{ margin-top:10px; }

/* the switch must not be stretched by the phone's touch-target rule */
body.lh-shell button.lh-switch{ min-width:46px; min-height:28px; max-height:28px; box-sizing:border-box; }

@media (max-width:640px){
  #settingsScreen > main.sx-page{ padding-top:12px; }
  .sx-side{ top:8px; margin-right:0; padding:0 6px; }
  .sx-page a.my-tab{ min-height:44px; }
  .sx-page a.my-tab svg{ display:none; }
  .sx-body{ padding-top:22px; }
  .sx-page > #settingsPanes{ padding-bottom:140px; }
  .sx-h2{ font-size:25px; }
  .sx-head{ flex-direction:column; align-items:stretch; }
  .sx-facts > div{ grid-template-columns:1fr; gap:4px; }
  .sx-toolbar .ds-btn{ min-height:44px; }
  .sx-search{ width:100%; min-height:44px; font-size:16px; }
  .sx-tools{ width:100%; }
  .sx-tools .set-input{ flex:1; }
  #settingsScreen table.sx-matrix, #settingsScreen table.sx-roles{ display:table; }
  .sx-matrix .sx-c{ width:58px; padding-left:6px; padding-right:6px; }
  .sx-matrix td:first-child{ padding-right:12px; }
  .sx-access-h, .sx-access-r{ grid-template-columns:1fr; }
  .sx-access-h span:last-child{ display:none; }
  .sx-f-pair{ grid-template-columns:1fr; }
  .sx-dialog{ padding:20px 16px 16px; }
  .sx-d-foot{ margin:20px 0 0; }
  .sx-row:has(.sx-seg){ grid-template-columns:minmax(0,1fr); }
  .sx-row:has(.sx-seg) .sx-row-c{ grid-column:1; grid-row:auto; justify-self:start; margin-top:8px; }
  .sx-glass-bg{ grid-template-columns:1fr 1fr; font-size:12.5px; }
}
@media (prefers-reduced-motion:reduce){
  .sx-dialog, tr.sx-flash td{ animation:none; }
  .sx-nav a, tr.sx-tr-link, .sx-pill-pick, .sx-seg button, .sx-row-wide{ transition:none; }
}
.sx-row-form{ padding:0 0 16px; }
.sx-row-form .set-copies-form{ margin-top:0; }
/* The tabs drawn by their own modules sit in the same cards. */
.sx-page .set-list{ margin-top:0; padding:0 20px; background:var(--surface); border:0; border-radius:var(--my-r-lg); box-shadow:var(--ds-shadow-card); }
.sx-page .set-list > .set-inst:first-child{ border-top:0; padding-top:16px; }
.sx-page .set-add{ margin-top:16px; padding-top:0; border-top:0; }
.sx-page .set-editor{ padding:20px 24px 24px; background:var(--surface); border:0; border-radius:var(--my-r-lg); box-shadow:var(--ds-shadow-card); }
.sx-page .set-editor + .set-editor{ margin-top:24px; padding-top:20px; border-top:0; }
.sx-page .lh-settings-pane .set-section:first-child, .sx-page .lh-settings-pane .set-editor:first-child{ margin-top:0; }
@media (max-width:640px){ .sx-page .set-list{ padding:0 14px; } .sx-page .set-editor{ padding:16px; } }

/* Project coordinators (js/coordinators-admin.js), under Team: the same
   grouped list as every other Settings section, with room above it. */
#coordinatorsContainer .set-section{ margin-top:48px; }
#coordinatorsContainer .set-h{ font-size:22px; }
#coordinatorsContainer .set-p{ margin-left:0; }
#coordinatorsContainer .set-rows{ margin-top:16px; padding:0 20px; background:var(--surface); border-radius:var(--my-r-lg); box-shadow:var(--ds-shadow-card); }
#coordinatorsContainer .set-row,
#coordinatorsContainer .set-row:first-child{ align-items:center; padding:14px 0; min-height:56px; box-sizing:border-box; }
#coordinatorsContainer .set-row + .set-row{ border-top:1px solid var(--rule); }
#coordinatorsContainer .set-select{ min-width:180px; }
@media (max-width:640px){
  #coordinatorsContainer .set-rows{ padding:0 14px; }
  #coordinatorsContainer .set-row{ grid-template-columns:minmax(0,1fr); }
}
