/* Student Settings — S3.2 Settings Workspace (approved 30 Oct 2026).
   Navigation lives on a light tray; settings live on the page. Desktop: the
   tray beside the open category's real controls. Phone (the shell's 768px
   breakpoint): the tray is the category screen and each category opens as a
   page. Choosing a category opens its page: the previous one fades away while
   the next opens a few pixels forward from the selected category's height.

   Class names keep those of the approved prototype (tools/settings-variants-
   review: sx- shared controls, s3- workspace parts, s31- selected chip, s32-
   page motion) so the product and the approved design compare rule for rule.

   Part 1: shared control vocabulary. Part 2: the workspace. */

/* ===================== Part 1: shared control vocabulary =====================
   Tokens follow the released MP2 passport (styles/profile-mp2.css). */
body.student-settings-page { background: #fff; }
body.student-settings-page .app-inner.sx-page { max-width: 1240px !important; }

/* Dialogs open on the body, outside .sx, so they carry the tokens too:
   without them a primary or danger button paints white on white. */
.sx, .sx-dialog {
  --ink: #16233f; --navy: #081f47; --action: #1559b0; --focus: #1f6fd6; --muted: #56677a;
  --rule: #dfe4ec; --rule-strong: #c4d0df; --paper: #f6f8fb; --ok: #18583a; --ok-bg: #e9f4ef;
  --warn: #7a4b08; --warn-bg: #fdf5e6; --bad: #a1271b; --bad-bg: #fbeceb;
}
.sx {
  position: relative; min-width: 0; color: var(--ink);
  font: 16px/1.55 'IBM Plex Sans', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  /* break-word wraps a token only when it would overflow, without shrinking
     min-content: "anywhere" on the whole root let flex and grid columns
     collapse below one word, which stacked titles letter by letter (S1 list). */
  overflow-wrap: break-word;
}
.sx-dialog { overflow-wrap: break-word; }
/* Emails have no natural break points: only they may break anywhere. */
.sx-value, .sx-email, .sx-dev-name, .sx-done-title { overflow-wrap: anywhere; }
/* Deep-link targets clear the sticky top bar (desktop) and capsule pill (phone). */
.sx [id] { scroll-margin-top: 88px; }
.sx *, .sx-dialog * { box-sizing: border-box; }
/* The reset is anchored to .sx (a route stylesheet may not open with an
   element or pseudo-class) and sits above every single-class margin rule, so
   those still win by order (a `.sx p` reset silently zeroed .sx-desc,
   .sx-status, .sx-group-note…). Computed styles match the approved design. */
.sx :where(h1, h2, h3, p, ul, dl) { margin: 0; }
.sx :where(ul) { padding: 0; list-style: none; }
.sx a { color: var(--action); text-decoration: none; text-underline-offset: 4px; }
.sx a:hover { text-decoration: underline; }
/* Zero-weight inheritance: each control's own class decides its type and
   colour (a `.sx button` rule outranked .sx-btn, .s3-signout and .sx-retry). */
.sx :where(button, input, select) { font: inherit; color: inherit; }
.sx ::selection, .sx-dialog ::selection { background: #d9e9ff; color: var(--navy); }
.sx :focus-visible, .sx-dialog :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.sx [tabindex="-1"]:focus { outline: none; }
.sx-ico { width: 20px; height: 20px; flex: none; }
.sx-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- rows ---------- */
.sx-rows { border-bottom: 1px solid var(--rule); }
.sx-row { display: grid; grid-template-columns: minmax(0, 1fr) fit-content(55%); align-items: center; column-gap: 32px; row-gap: 14px; padding: 20px 0; border-top: 1px solid var(--rule); }
.sx-row-text { min-width: 0; }
.sx-label { display: block; font-size: 15.5px; font-weight: 500; line-height: 1.4; color: var(--ink); }
.sx-row--switch .sx-label, .sx-row--select .sx-label { cursor: pointer; }
.sx-desc { margin-top: 4px; font-size: 14px; line-height: 1.55; color: var(--muted); max-width: 62ch; overflow-wrap: anywhere; }
.sx-offnote { color: var(--ink); font-weight: 500; }
.sx-value { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.sx-verified { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; color: var(--ok); font-size: 13px; }
.sx-verified .sx-ico { width: 15px; height: 15px; }
.sx-scope { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.sx-scope .sx-ico { width: 15px; height: 15px; }
.sx-row-control { display: flex; justify-content: flex-end; min-width: 0; }
.sx-row--wide { grid-template-columns: minmax(0, 1fr); }
.sx-row--wide .sx-row-control { justify-content: flex-start; }
.sx-row-value { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; text-align: right; }
.sx-row-value span { display: flex; flex-direction: column; align-items: flex-end; }
.sx-row-value small { font-size: 13px; font-weight: 400; color: var(--muted); }
.sx-row-value .sx-ico { width: 18px; height: 18px; color: var(--muted); }
.sx-row--fact .sx-row-value .sx-ico { order: -1; }

/* ---------- status ---------- */
.sx-status { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.sx-status:empty { display: none; }
.sx-status .sx-ico { width: 16px; height: 16px; }
.sx-status.is-saved { color: var(--ok); }
.sx-status.is-error { color: var(--bad); }
.sx-retry { border: 0; background: none; padding: 4px 4px; min-height: 44px; margin: -10px 0; color: var(--action); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sx-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #c4d0df; border-top-color: var(--action); animation: sx-spin .8s linear infinite; }
@keyframes sx-spin { to { transform: rotate(360deg); } }

/* ---------- switch (button role=switch, 44px target) ---------- */
.sx-switch { position: relative; width: 52px; height: 44px; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; flex: none; border-radius: 999px; }
.sx-switch::before { content: ""; position: absolute; left: 2px; top: 8px; width: 48px; height: 28px; border-radius: 999px; background: #7b8aa1; transition: background-color 160ms ease; }
.sx-switch::after { content: ""; position: absolute; left: 5px; top: 11px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(8, 31, 71, .32); transition: transform 160ms cubic-bezier(.2, .8, .2, 1); }
.sx-switch[aria-checked="true"]::before { background: var(--action); }
.sx-switch[aria-checked="true"]::after { transform: translateX(20px); }
.sx-switch:hover::before { background: #66768e; }
.sx-switch[aria-checked="true"]:hover::before { background: #0f4a96; }
.sx-switch:disabled { cursor: not-allowed; opacity: .5; }
.sx-switch:focus-visible { outline-offset: 0; }

/* ---------- segmented choice (native radios) ---------- */
.sx-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: var(--paper); border: 1px solid var(--rule); max-width: 100%; }
.sx-seg-opt { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; min-width: 88px; padding: 6px 14px; border-radius: 7px; border: 1px solid transparent; color: #34465f; font-size: 14px; font-weight: 500; line-height: 1.25; cursor: pointer; text-align: center; transition: background-color 160ms, color 160ms; }
.sx-seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sx-seg-hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.sx-seg-opt:hover { background: #edf1f7; }
.sx-seg-opt:has(input:checked) { background: #fff; border-color: #b7c5d7; color: var(--navy); box-shadow: 0 1px 2px rgba(8, 31, 71, .08); }
.sx-seg-opt:has(input:checked) .sx-seg-main { font-weight: 600; }
.sx-seg-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.sx-seg-opt:has(input:disabled) { opacity: .55; cursor: not-allowed; }

/* ---------- select, fields, buttons ---------- */
.sx-select { min-height: 44px; min-width: 168px; max-width: 100%; padding: 0 40px 0 14px; border: 1px solid #b7c5d7; border-radius: 8px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2356677a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; appearance: none; color: var(--ink); font-size: 15px; cursor: pointer; }
.sx-select:hover { border-color: #8fa1ba; }
.sx-select:disabled { background-color: var(--paper); color: var(--muted); cursor: not-allowed; }
.sx-field { display: grid; gap: 6px; max-width: 440px; }
.sx-field label { font-size: 14px; font-weight: 500; }
.sx-field input { min-height: 46px; padding: 0 14px; border: 1px solid #b7c5d7; border-radius: 8px; background: #fff; font-size: 16px; color: var(--ink); }
.sx-field input:hover { border-color: #8fa1ba; }
.sx-field input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.sx-field-error { font-size: 13.5px; color: var(--bad); }
.sx-field-error:empty { display: none; }
.sx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid #b7c5d7; background: #fff; color: var(--ink) !important; font-size: 14px; font-weight: 500; line-height: 1.3; white-space: nowrap; cursor: pointer; text-decoration: none !important; transition: background-color 160ms, border-color 160ms, color 160ms; }
.sx-btn:hover { background: var(--paper); border-color: #8fa1ba; }
.sx-btn:disabled { opacity: .6; cursor: progress; }
.sx-btn--primary { background: var(--navy); border-color: var(--navy); color: #fff !important; }
.sx-btn--primary:hover { background: var(--action); border-color: var(--action); }
.sx-btn--quiet { border-color: transparent; background: none; color: var(--action) !important; padding-inline: 10px; }
.sx-btn--quiet:hover { background: #eef3fa; border-color: transparent; }
.sx-btn--danger { border-color: #e2b5b0; color: var(--bad) !important; }
.sx-btn--danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.sx-btn--danger-solid { background: var(--bad); border-color: var(--bad); color: #fff !important; }
.sx-btn--danger-solid:hover { background: #861d13; border-color: #861d13; }
.sx-textlink { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--action) !important; font-size: 14.5px; font-weight: 500; cursor: pointer; }
.sx-textlink .sx-ico { width: 18px; height: 18px; }
.sx-textlink:hover { text-decoration: underline; }

/* ---------- groups ---------- */
.sx-group { margin-top: 40px; }
.sx-group-title { font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; color: var(--ink); }
.sx-group-note { margin-top: 4px; font-size: 13.5px; color: var(--muted); max-width: 62ch; }
.sx-group .sx-rows { margin-top: 10px; }

/* ---------- notifications ---------- */
.sx-device { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 12px; background: var(--paper); }
.sx-device-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #fff; color: var(--action); flex: none; }
.sx-device--ok .sx-device-ico { color: var(--ok); }
.sx-device--warn { background: var(--warn-bg); }
.sx-device--warn .sx-device-ico { color: var(--warn); }
.sx-device-text { flex: 1; min-width: 0; }
.sx-device-title { font-size: 15px; font-weight: 500; }
.sx-device-body { font-size: 13.5px; color: var(--muted); }
.sx-always { margin-top: 40px; padding: 22px 24px; border-radius: 12px; background: var(--paper); }
.sx-always-list { display: grid; gap: 16px; margin-top: 16px; }
.sx-always-list li { display: flex; gap: 14px; }
.sx-always-list .sx-ico { margin-top: 2px; color: var(--muted); }
.sx-always-title { font-size: 14.5px; font-weight: 500; }
.sx-always .sx-desc { margin-top: 2px; font-size: 13.5px; }
.sx-devlist { margin-top: 10px; border-bottom: 1px solid var(--rule); }
.sx-dev { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule); }
.sx-dev-ico { color: var(--muted); display: flex; }
.sx-dev-text { flex: 1; min-width: 0; }
.sx-dev-name { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.sx-dev-now { font-size: 13px; color: var(--muted); padding-inline: 10px; }
.sx-dev-empty { padding: 16px 0; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.sx-aside { display: flex; gap: 10px; margin-top: 20px; font-size: 13.5px; color: var(--muted); max-width: 66ch; }
.sx-aside .sx-ico { width: 18px; height: 18px; margin-top: 1px; }

/* ---------- accessibility preview ---------- */
.sx-preview { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: baseline; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--rule); max-width: 460px; }
.sx-preview-time { grid-row: span 2; font-size: 22px; font-weight: 500; color: var(--action); letter-spacing: -.02em; }
.sx-preview-title { font-size: 17px; font-weight: 500; }
.sx-preview-meta { font-size: 13.5px; color: var(--muted); }

/* ---------- account / university ---------- */
.sx-bridge { display: flex; align-items: center; gap: 14px; margin-top: 40px; padding: 18px 20px; border: 1px solid var(--rule); border-radius: 12px; color: var(--ink) !important; text-decoration: none !important; transition: border-color 160ms, background-color 160ms; }
.sx-bridge:hover { border-color: #b7c5d7; background: var(--paper); }
.sx-bridge-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; flex: none; }
.sx-bridge-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sx-bridge-title { font-size: 15px; font-weight: 500; }
.sx-bridge-desc { font-size: 13.5px; color: var(--muted); }
.sx-bridge-arrow { color: var(--action); }
.sx-managed { margin-top: 28px; padding: 20px 22px; border-radius: 12px; background: var(--paper); }
.sx-managed-title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; }
.sx-managed-title .sx-ico { width: 17px; height: 17px; color: var(--muted); }
.sx-managed-actions { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 10px; }

/* ---------- privacy ---------- */
.sx-links { margin-top: 10px; border-bottom: 1px solid var(--rule); }
.sx-link { display: flex; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--rule); color: var(--ink) !important; font-size: 15px; }
.sx-link .sx-ico { color: var(--muted); }
.sx-link .sx-link-arrow { margin-left: auto; color: var(--action); }
.sx-danger { margin-top: 56px; }
.sx-danger .sx-group-title { color: var(--bad); }

/* ---------- sub-views ---------- */
.sx-view-title { font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.sx-lede { margin-top: 8px; font-size: 15.5px; color: var(--muted); max-width: 60ch; }
.sx-form { display: grid; gap: 18px; margin-top: 28px; }
.sx-form-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.sx-done { display: flex; gap: 16px; margin-top: 28px; padding: 20px 22px; border-radius: 12px; background: var(--ok-bg); }
.sx-done > .sx-ico { color: var(--ok); margin-top: 2px; }
.sx-done-title { font-size: 16px; font-weight: 600; }
.sx-done .sx-btn { margin-top: 14px; }
.sx-consequences { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--rule); }
.sx-consequences h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.sx-consequences li { position: relative; padding: 7px 0 7px 18px; font-size: 14.5px; line-height: 1.5; color: #34465f; border-top: 1px solid #edf0f5; }
.sx-consequences li:first-child { border-top: 0; }
.sx-consequences li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: #9aaac0; }
.sx-before { display: grid; gap: 12px; margin-top: 28px; padding: 20px 22px; border-radius: 12px; background: var(--paper); }
.sx-before p { display: flex; gap: 12px; font-size: 14.5px; line-height: 1.5; color: #34465f; }
.sx-before b { color: var(--ink); font-weight: 600; }
.sx-before .sx-ico { margin-top: 1px; color: var(--muted); }

/* ---------- page states ---------- */
.sx-offline { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; padding: 14px 18px; border-radius: 10px; background: var(--warn-bg); color: #4d3608; font-size: 14px; }
.sx-offline .sx-ico { color: var(--warn); }
.sx-loading { display: grid; gap: 0; }
.sx-skel { display: grid; gap: 8px; padding: 22px 0; border-top: 1px solid var(--rule); }
.sx-skel span { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef2f7, #f6f8fb, #eef2f7); background-size: 200% 100%; animation: sx-shimmer 1.4s ease-in-out infinite; }
.sx-skel span:first-child { width: 34%; height: 14px; }
.sx-skel span:last-child { width: 62%; }
@keyframes sx-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sx-state { display: grid; justify-items: start; gap: 10px; padding: 40px 0; }
.sx-state-ico { color: var(--bad); }
.sx-state-title { font-size: 20px; font-weight: 600; }
.sx-state .sx-btn { margin-top: 8px; }


/* ---------- dialog ---------- */
.sx-dialog { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 14px; color: #16233f; box-shadow: 0 24px 60px -18px rgba(8, 31, 71, .45); font: 16px/1.55 'IBM Plex Sans', system-ui, sans-serif; }
.sx-dialog::backdrop { background: rgba(8, 31, 71, .42); }
.sx-dialog-form { display: grid; gap: 14px; padding: 26px 26px 22px; }
.sx-dialog h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.sx-dialog p { margin: 0; font-size: 15px; color: #34465f; }
.sx-dialog .sx-field { max-width: none; }
.sx-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* ---------- narrow columns ----------
   Rows respond to the panel or page they sit in (container sx, set by the
   workspace styles below), with a viewport fallback. */
@container sx (max-width: 520px) {
  .sx-row { column-gap: 16px; padding: 18px 0; }
  .sx-row--choice, .sx-row--action, .sx-row--select, .sx-row--fact { grid-template-columns: minmax(0, 1fr); }
  .sx-row--choice .sx-row-control, .sx-row--action .sx-row-control, .sx-row--select .sx-row-control { justify-content: flex-start; }
  .sx-row--fact .sx-row-value { justify-content: flex-start; text-align: left; }
  .sx-row--fact .sx-row-value span { align-items: flex-start; }
  .sx-seg { display: flex; width: 100%; }
  .sx-seg-opt { flex: 1 1 auto; min-width: 0; padding-inline: 8px; }
  .sx-select { width: 100%; }
  .sx-consequences { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sx-btn { white-space: normal; }
}
@media (max-width: 560px) {
  .sx-row { column-gap: 16px; padding: 18px 0; }
  .sx-row--choice, .sx-row--action, .sx-row--select { grid-template-columns: minmax(0, 1fr); }
  .sx-row--choice .sx-row-control, .sx-row--action .sx-row-control, .sx-row--select .sx-row-control { justify-content: flex-start; }
  .sx-row--fact { grid-template-columns: minmax(0, 1fr); }
  .sx-row--fact .sx-row-value { justify-content: flex-start; text-align: left; }
  .sx-row--fact .sx-row-value span { align-items: flex-start; }
  .sx-seg { display: flex; width: 100%; }
  .sx-seg-opt { flex: 1 1 auto; min-width: 0; padding-inline: 8px; }
  .sx-select { width: 100%; }
  .sx-consequences { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sx-btn { white-space: normal; }
}

@media (forced-colors: active) {
  .sx-switch::before { background: Canvas; border: 1px solid ButtonText; }
  .sx-switch[aria-checked="true"]::before { background: Highlight; }
  .sx-switch::after { background: ButtonText; box-shadow: none; }
  .sx-switch[aria-checked="true"]::after { background: HighlightText; }
  .sx-seg-opt:has(input:checked) { outline: 2px solid Highlight; }
  .sx-device, .sx-always, .sx-managed, .sx-before { border: 1px solid CanvasText; }
}

@media (prefers-reduced-motion: reduce) {
  .sx *, .sx *::before, .sx *::after { transition: none !important; animation: none !important; }
}

/* ===================== Part 2: the workspace ===================== */
/* Registered so the tile's blue detail eases with its colour change. */
@property --s3-accent { syntax: "<color>"; inherits: true; initial-value: #1f6fd6; }
#sx-root.sx-s32 {
  container: s3 / inline-size;
  --s3-tray: #f4f7fb;
  --s3-tray-rule: #e2e8f0;
  --s3-tile-rule: #dce4ee;
  --s3-chip-rule: #d3ddea;
  --s3-divider: #e6ebf1;
  --s3-slate: #34465f;
  --s3-accent: #1f6fd6;
  accent-color: var(--action);
}
.sx-s32 input { caret-color: var(--action); }

/* ---------- glyphs and tiles ---------- */
.s3-glyph { width: 18px; height: 18px; flex: none; }
.s3-glyph-accent { stroke: var(--s3-accent); }
.s3-tile { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1px var(--s3-tile-rule); color: var(--navy); transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease, --s3-accent 160ms ease; }
.s3-tray { background: var(--s3-tray); border-radius: 16px; }

/* ---------- desktop workspace ---------- */
.s3-workspace { display: grid; grid-template-columns: 280px minmax(0, 720px); column-gap: 48px; align-items: start; }
.s3-panel { min-width: 0; container: sx / inline-size; }
/* isolation: the group dividers paint beneath the sliding selected chip. */
.s3-nav { position: sticky; top: 88px; padding: 8px; isolation: isolate; }

/* who is signed in: the passport's initials, one way into My profile */
.s3-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13.5px; font-weight: 500; letter-spacing: -.01em; }
.s3-who { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; align-items: center; min-height: 56px; padding: 8px 10px; border-radius: 11px; color: var(--ink) !important; text-decoration: none !important; transition: background-color 160ms ease; }
.s3-who-text { display: flex; flex-direction: column; min-width: 0; }
.s3-who-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.s3-who-link { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--action); }
.s3-who:hover { background: rgba(8, 31, 71, .045); }
.s3-who:hover .s3-who-link { text-decoration: underline; text-underline-offset: 3px; }

/* categories: three groups parted by an inset rule, no labels */
.s3-nav-list { position: relative; display: grid; gap: 2px; margin-top: 7px; padding-top: 7px; }
.s3-nav-list::before { content: ""; position: absolute; top: 0; left: 10px; right: 10px; z-index: -1; border-top: 1px solid var(--s3-tray-rule); }
.s3-nav-item { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; align-items: center; min-height: 48px; padding: 7px 10px; border: 1px solid transparent; border-radius: 11px; color: var(--s3-slate) !important; font-size: 15px; font-weight: 500; line-height: 1.3; text-decoration: none !important; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
.s3-nav-label { min-width: 0; text-wrap: balance; }
.s3-nav-item:hover { background: rgba(8, 31, 71, .045); color: var(--ink) !important; }
.s3-nav-item:active { background: rgba(8, 31, 71, .07); }
/* the open category: a white chip on the tray, its tile turned navy */
.s3-nav-item[aria-current="page"] { background: #fff; border-color: var(--s3-chip-rule); color: var(--navy) !important; font-weight: 600; }
.s3-nav-item[aria-current="page"] .s3-tile { background: var(--navy); box-shadow: none; color: #fff; --s3-accent: #8fbaff; }
.sx-s32 .s3-nav-item:focus-visible, .sx-s32 .s3-who:focus-visible { outline-offset: 2px; border-radius: 11px; }

/* loading keeps the workspace's shape, so nothing jumps when it arrives */
.s3-nav--skeleton { display: grid; gap: 12px; padding: 16px 14px; }
.s3-nav--skeleton span { display: block; height: 30px; border-radius: 9px; background: linear-gradient(90deg, #e8edf4, #f0f3f8, #e8edf4); background-size: 200% 100%; animation: sx-shimmer 1.4s ease-in-out infinite; }
.s3-nav--skeleton span:first-child { height: 40px; margin-bottom: 6px; }

/* ---------- the open category ---------- */
.s3-head { margin-bottom: 28px; }
.s3-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px 0 8px -8px; padding: 0 10px 0 2px; border-radius: 8px; color: var(--action) !important; font-size: 14px; font-weight: 500; text-decoration: none !important; }
.s3-back .sx-ico { width: 18px; height: 18px; transition: transform 160ms cubic-bezier(.16, 1, .3, 1); }
.s3-back:hover .sx-ico { transform: translateX(-3px); }
.s3-head-main { display: flex; align-items: flex-start; gap: 16px; }
.s3-marker { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--navy); color: #fff; --s3-accent: #8fbaff; }
.s3-marker .s3-glyph { width: 24px; height: 24px; } /* the tile's glyph-to-box ratio, so the flight doesn't jump */
.s3-head--danger .s3-marker { --s3-accent: #ffb2a6; }
.s3-head-text { min-width: 0; padding-top: 6px; }
.s3-title { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.s3-lede { margin-top: 6px !important; max-width: 60ch; font-size: 15px; line-height: 1.55; color: var(--s3-slate); }
.s3-saveline { display: flex; align-items: center; gap: 7px; min-height: 20px; margin-top: 10px !important; font-size: 13px; color: var(--muted); }
.s3-saveline .sx-ico { width: 15px; height: 15px; }
.s3-saveline.is-saved { color: var(--ok); }
.s3-saveline.is-failed { color: var(--bad); }

/* rows: hairlines between settings only, never a box per setting */
.s3-body { min-width: 0; }
.sx-s32 .s3-body .sx-group { margin-top: 36px; }
.sx-s32 .s3-body .sx-group-title { font-size: 16px; }
.sx-s32 .s3-body .sx-rows, .sx-s32 .s3-body .sx-devlist, .sx-s32 .s3-body .sx-links { margin-top: 6px; border-bottom: 0; }
.sx-s32 .s3-body .sx-row { padding: 18px 0; border-top: 0; }
.sx-s32 .s3-body .sx-row + .sx-row { border-top: 1px solid var(--s3-divider); }
.sx-s32 .s3-body .sx-dev, .sx-s32 .s3-body .sx-dev-empty, .sx-s32 .s3-body .sx-link { border-top: 0; }
.sx-s32 .s3-body .sx-dev + .sx-dev, .sx-s32 .s3-body .sx-links li + li .sx-link { border-top: 1px solid var(--s3-divider); }
/* the header's own margin is the only space above a category's first block */
.sx-s32 .s3-body > .sx-group:first-child, .sx-s32 .s3-body > .sx-rows:first-child, .sx-s32 .s3-body > .sx-links:first-child { margin-top: 0; }
.sx-s32 .s3-head + .sx-offline { margin: -8px 0 24px; }
.sx-s32 .s3-body .sx-device { margin-bottom: 4px; border-radius: 14px; }
.sx-s32 .s3-body .sx-device + .sx-group { margin-top: 28px; }
.sx-s32 .s3-body .sx-preview { margin-top: 2px; border-color: var(--s3-divider); border-radius: 14px; }
.sx-s32 .s3-body .sx-select { min-width: 200px; border-radius: 10px; }
.sx-s32 .s3-body .sx-seg { border-radius: 12px; }
.sx-s32 .s3-body .sx-seg-opt { border-radius: 9px; }

/* essentials: one paper band, its three facts side by side when there's room */
.sx-s32 .s3-body .sx-always { margin-top: 40px; padding: 22px 24px 24px; border-radius: 14px; }
@container sx (min-width: 600px) {
  .sx-s32 .s3-body .sx-always-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 18px; }
  .sx-s32 .s3-body .sx-always-list li { flex-direction: column; gap: 10px; }
}

/* university: MP2's record, small labels over values; read-only by design */
.sx-s32 .s3-record { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.sx-s32 .s3-body .s3-record .sx-row--fact { grid-template-columns: minmax(0, 1fr); row-gap: 2px; align-content: start; padding: 14px 0 16px; border-top: 1px solid var(--s3-divider); }
.sx-s32 .s3-body .s3-record .sx-row--fact:nth-child(-n + 2) { border-top: 0; padding-top: 4px; }
.sx-s32 .s3-record .sx-row-text { display: contents; }
.sx-s32 .s3-record .sx-label { order: 1; font-size: 13px; font-weight: 400; color: var(--muted); }
.sx-s32 .s3-record .sx-row-value { order: 2; justify-content: flex-start; text-align: left; font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.sx-s32 .s3-record .sx-row-value span { align-items: flex-start; }
.sx-s32 .s3-record .sx-row-value small { font-size: 13.5px; letter-spacing: 0; }
.sx-s32 .s3-record .sx-row-value .sx-ico { width: 17px; height: 17px; }
.sx-s32 .s3-record .sx-desc { order: 3; margin-top: 2px; font-size: 13.5px; }
.sx-s32 .s3-body .sx-managed { margin-top: 20px; border-radius: 14px; }

/* help: two destinations and the tour */
.s3-link { min-height: 64px; padding: 10px 0; }
.s3-link-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.s3-link-title { font-size: 15px; font-weight: 500; line-height: 1.35; }
.s3-link-desc { font-size: 13.5px; line-height: 1.45; color: var(--muted); }
/* hover underlines the destination's name only, never its description */
.sx-s32 .s3-link:hover { text-decoration: none; }
.s3-link:hover .s3-link-title { color: var(--action); text-decoration: underline; text-underline-offset: 3px; }

/* deletion: its own ruled block, unlike any preference */
.sx-s32 .s3-body .sx-danger { margin-top: 48px; padding: 20px 22px 22px; border: 1px solid #ecd3cf; border-radius: 14px; background: #fffbfa; }
.sx-s32 .s3-body .sx-danger .sx-rows { margin-top: 6px; }
.sx-s32 .s3-body .sx-danger .sx-row { padding: 0; }
.sx-s32 .sx-subview--delete .sx-consequences { border-top-color: var(--s3-divider); }

.s3-aside { display: flex; gap: 10px; margin-top: 20px !important; max-width: 62ch; font-size: 14px; line-height: 1.55; color: var(--muted); }
.s3-aside .sx-ico { width: 18px; height: 18px; margin-top: 2px; }
.s3-aside a { font-weight: 500; }

/* inline email change: the row opens into the form */
.sx-s32 .s3-expanded { display: block; }
.s3-expanded-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.s3-expanded .sx-subview { margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--s3-divider); }
.s3-expanded .sx-lede { margin-top: 0; font-size: 14px; }
.s3-expanded .sx-form { margin-top: 16px; gap: 14px; }

/* supporting information on request */
.s3-details { margin-top: 10px; border-radius: 14px; background: var(--paper); }
.s3-details summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px; border-radius: 14px; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; list-style: none; }
.s3-details summary::-webkit-details-marker { display: none; }
.s3-details summary::before { content: ""; width: 7px; height: 7px; margin-top: -3px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform 180ms cubic-bezier(.16, 1, .3, 1); }
.s3-details[open] summary::before { transform: rotate(45deg); margin-top: -6px; }
.s3-details ul { margin: 0 !important; padding: 0 18px 14px 38px !important; list-style: disc !important; }
.s3-details li { margin: 4px 0; font-size: 14px; color: var(--s3-slate); }
.sx-s32 .s3-details summary:focus-visible { border-radius: 14px; }

.s3-state { max-width: 720px; }

/* ---------- phone: the category screen and its pages ---------- */
.s3-page { min-width: 0; container: sx / inline-size; }
.s3-whorow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 14px; align-items: center; min-height: 76px; padding: 14px 14px 14px 12px; border-radius: 16px; background: var(--s3-tray); color: var(--ink) !important; text-decoration: none !important; }
.s3-whorow .s3-avatar { width: 44px; height: 44px; font-size: 15px; }
.s3-whorow-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.s3-whorow-name { font-size: 16px; font-weight: 600; line-height: 1.3; }
.s3-whorow-email { font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.s3-whorow-trail { display: flex; align-items: center; gap: 2px; color: var(--action); font-size: 14px; font-weight: 500; white-space: nowrap; }
.s3-whorow-trail .s3-chev { color: var(--action); }
.sx-s32 .s3-whorow:focus-visible { border-radius: 16px; }
.s3-section { margin-top: 28px; }
.s3-section-title { margin: 0 0 10px 4px !important; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.s3-list { padding: 4px; }
.s3-row { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 14px; align-items: center; min-height: 68px; padding: 12px; border-radius: 12px; transition: background-color 160ms ease; }
/* dividers start at the text column, so the tiles read as one stack */
.s3-row + .s3-row::before { content: ""; position: absolute; top: 0; left: 66px; right: 12px; border-top: 1px solid var(--s3-tray-rule); }
.s3-list .s3-tile { width: 40px; height: 40px; border-radius: 11px; }
.s3-list .s3-glyph { width: 22px; height: 22px; }
.s3-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s3-row-link { font-size: 16px; font-weight: 500; line-height: 1.3; letter-spacing: -.005em; color: var(--ink) !important; text-decoration: none !important; }
.s3-row-desc { font-size: 14px; line-height: 1.45; color: var(--muted); }
.s3-lock { width: 14px; height: 14px; margin: 0 5px -2px 0; }
.s3-chev { width: 18px; height: 18px; color: #8d9bb0; transition: transform 160ms cubic-bezier(.16, 1, .3, 1), color 160ms; }
/* the whole row is the target; the link carries the name */
.s3-row-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 12px; }
.s3-row > .s3-tile, .s3-row > .s3-chev, .s3-row-desc { pointer-events: none; }
.s3-row-link:focus-visible { outline: none; }
.s3-row-link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; }
.s3-row:hover { background: rgba(8, 31, 71, .035); }
.s3-row:active { background: rgba(8, 31, 71, .06); }
.s3-row:hover .s3-chev { color: var(--action); transform: translateX(3px); }
.s3-signout { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 24px; padding: 0 4px; border: 0; border-top: 1px solid var(--rule); background: none; color: var(--bad); font: inherit; font-size: 16px; font-weight: 500; cursor: pointer; }
#sx-root[data-layout="phone"] .s3-title { font-size: 26px; }
#sx-root[data-layout="phone"] .s3-head { margin-bottom: 24px; }

/* ---------- controls and feedback (S2.1's) ---------- */
.sx-s32 .sx-switch[aria-checked="true"]::after {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 6.3 5 8.6l4.4-5' fill='none' stroke='%231559b0' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.sx-s32 .sx-status.is-saved .sx-ico path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: s3-draw 260ms 40ms cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes s3-draw { to { stroke-dashoffset: 0; } }
.s3-flash { animation: s3-flash 1200ms ease-out; }
.s3-flash-static { background-color: var(--bad-bg); }
@keyframes s3-flash { from { background-color: var(--bad-bg); } to { background-color: transparent; } }

/* ---------- motion: nothing travels; the tray stays still ---------- */
/* The selected chip is one element under the links, moved by transform; the
   open link's own chip gives way to it once it is placed. */
.s3-nav-item, .s3-who { position: relative; z-index: 1; }
.s31-indicator { position: absolute; top: 0; left: 0; z-index: 0; box-sizing: border-box; border: 1px solid var(--s3-chip-rule); border-radius: 11px; background: #fff; pointer-events: none; transition: transform 200ms cubic-bezier(.33, 1, .68, 1); }
.s31-indicator.is-instant { transition: none; }
.s3-nav:not(.has-indicator) .s31-indicator { visibility: hidden; }
.s3-nav.has-indicator .s3-nav-item[aria-current="page"], .s3-nav.has-indicator .s3-nav-item[aria-current="page"]:hover { background: transparent; border-color: transparent; }
/* Pages: the open one sits in the flow; the one being closed is an inert layer
   over it, at its old place, until its fade ends (the script animates both,
   transform and opacity only). While a page opens, its frame clips whatever
   runs past it, so the document never grows and nothing scrolls sideways;
   the panel clips only downward, so the page's opening offset still shows. */
.s3-panel { position: relative; }
.s32-page { min-width: 0; }
.s32-leaving { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.s3-panel.s32-moving { overflow-y: clip; }
#sx-root.s32-moving { overflow: clip; }
.s3-opening-email .s3-expanded .sx-subview { animation: s3-open 220ms cubic-bezier(.16, 1, .3, 1); }
@keyframes s3-open { from { opacity: .3; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@supports (interpolate-size: allow-keywords) {
  .s3-details { interpolate-size: allow-keywords; }
  .s3-details::details-content { block-size: 0; overflow: hidden; transition: block-size 240ms cubic-bezier(.16, 1, .3, 1), content-visibility 240ms allow-discrete; }
  .s3-details[open]::details-content { block-size: auto; }
}

/* ---------- composition by the root's own width ---------- */
/* Mid: 1024px beside the sidebar (about 712px), the 769–1023px drawer range
   and Larger text at 1440. The tray tightens; the panel keeps the rest. */
@container s3 (max-width: 899px) {
  .s3-workspace { grid-template-columns: 256px minmax(0, 1fr); column-gap: 32px; }
  .s3-nav { padding: 6px; }
  .s3-who { padding: 8px; }
  .s3-nav-item { grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; padding: 7px 8px; font-size: 14.5px; }
  .s3-nav .s3-tile { width: 30px; height: 30px; border-radius: 8px; }
  .s3-nav .s3-glyph { width: 17px; height: 17px; }
}
/* A desktop root this narrow happens with Large or Larger text at 1024–1141px
   and in the drawer range: the tray sits above the panel, two categories to a
   line, and a category change brings the opened page up under the top bar. */
@container s3 (max-width: 639px) {
  .s3-workspace { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .s3-nav { position: relative; top: 0; }
  .s3-nav-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Content answers to the panel or page it sits in (container sx): beside the
   tray at 1024px the panel is as narrow as a large phone. */
@container sx (max-width: 520px) {
  .sx-s32 .s3-record { grid-template-columns: minmax(0, 1fr); }
  .sx-s32 .s3-body .s3-record .sx-row--fact:nth-child(2) { border-top: 1px solid var(--s3-divider); padding-top: 14px; }
}
@container sx (max-width: 420px) {
  .s3-body .sx-device { flex-wrap: wrap; }
  .s3-body .sx-device > .sx-btn { margin-left: 54px; }
  .sx-s32 .s3-body .sx-always { padding: 18px 18px 20px; }
}
/* the smallest phones: the trail keeps its chevron, the marker shrinks */
@container s3 (max-width: 420px) {
  .s3-trail-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .s3-marker { width: 40px; height: 40px; border-radius: 11px; }
  .s3-marker .s3-glyph { width: 22px; height: 22px; }
  .s3-head-text { padding-top: 4px; }
  #sx-root[data-layout="phone"] .s3-title { font-size: 24px; }
}

/* the shell's phone layout: focus that clears the bottom navigation */
@media (max-width: 768px) {
  .sx-s32 .s3-row, .sx-s32 .sx-row, .sx-s32 .sx-btn, .sx-s32 .s3-whorow { scroll-margin-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
@media (forced-colors: active) {
  .s3-avatar, .s3-marker, .s3-tile, .s3-tray, .s3-details, .s3-whorow { border: 1px solid CanvasText; }
  .s3-nav-item[aria-current="page"] { outline: 2px solid Highlight; }
  .s31-indicator { display: none; }
  /* the tick drawn into the thumb would hide the system's contrast colour */
  .sx-s32 .sx-switch[aria-checked="true"]::after { background: HighlightText; }
}
@media (prefers-reduced-motion: reduce) {
  /* No opening movement or sliding chip: the script plays a 120ms fade instead. */
  .s31-indicator { transition: none; }
  .s3-opening-email .s3-expanded .sx-subview { animation: s3-fade 120ms linear !important; }
  .sx-s32 .sx-status.is-saved .sx-ico path { animation: none !important; stroke-dashoffset: 0; }
  .s3-details::details-content { transition: none !important; }
  @keyframes s3-fade { from { opacity: .6; } to { opacity: 1; } }
}
