/* ============================================================
   settings1016.css — UI-1016 (FINAL-1016 Part B2): the global sidebar and the ONE
   design every Super Admin Settings page follows. Design: docs/design/super-admin-1014/
   (SUPER_ADMIN_UI_UX_SPEC.md); map: docs/plans/UI-1016-MAP.md.

   The same token contract as mgmt.css: the app's own colours (--m-*), no raw colour
   in a rule, every new token defined for light, dark and "system" dark. The
   prototype's indigo is the app's accent here, as Part B2 asks.
   ============================================================ */
:root{
  /* the six category accents (design §8; CC-SETTINGS-1111 adds Contact Centre), as tokens; always shown beside the category's name and icon */
  --st-org-bg:#eef0ff; --st-org:#4a4cc0;
  --st-ai-bg:#f3edff;  --st-ai:#71489f;
  --st-int-bg:#e6f5f1; --st-int:#17735f;
  --st-wf-bg:#fff1df;  --st-wf:#94541a;
  --st-sec-bg:#eaf2fc; --st-sec:#3b6aa6;
  --st-cc-bg:#fdecef;  --st-cc:#a23a55;
  --st-changed:#fff7e6; --st-changed-line:#f0d49c;
  --st-focus:0 0 0 3px rgba(47,93,74,.28);
  /* shadows, the same in both themes (PARITY-UI-1026 Part 3: out of the rules, into tokens) */
  --st-sh-card:0 1px 2px rgba(20,22,20,.04); --st-sh-lift:0 8px 22px rgba(33,37,34,.09); --st-sh-knob:0 1px 2px rgba(0,0,0,.2); --st-sh-pop:0 6px 18px rgba(33,37,34,.08);
}
:root[data-theme="dark"]{
  --st-org-bg:#25264a; --st-org:#b9baff;
  --st-ai-bg:#2e2540;  --st-ai:#d4bbf5;
  --st-int-bg:#1b332d; --st-int:#8fdcc5;
  --st-wf-bg:#3a2b19;  --st-wf:#f1bf84;
  --st-sec-bg:#1d2a3b; --st-sec:#a9c8ef;
  --st-cc-bg:#3b1f27;  --st-cc:#f2a9bc;
  --st-changed:#352b17; --st-changed-line:#6b5426;
  --st-focus:0 0 0 3px rgba(134,194,163,.35);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --st-org-bg:#25264a; --st-org:#b9baff;
    --st-ai-bg:#2e2540;  --st-ai:#d4bbf5;
    --st-int-bg:#1b332d; --st-int:#8fdcc5;
    --st-wf-bg:#3a2b19;  --st-wf:#f1bf84;
    --st-sec-bg:#1d2a3b; --st-sec:#a9c8ef;
    --st-cc-bg:#3b1f27;  --st-cc:#f2a9bc;
    --st-changed:#352b17; --st-changed-line:#6b5426;
    --st-focus:0 0 0 3px rgba(134,194,163,.35);
  }
}

/* ---------------- the global sidebar: 254 px open, 72 px collapsed, groups that open and close ---------------- */
.v1.nui.sm-on{grid-template-columns:254px minmax(0,1fr)}
.v1.nui.sm-on.sm-collapsed{grid-template-columns:72px minmax(0,1fr)}
.v1.nui.sm-on .sb{gap:10px}
.sm-collapse{transform:none}
.sm-scroll{display:flex;flex-direction:column;gap:4px;min-height:0;flex:1 1 auto;overflow-y:auto;margin:0 -4px;padding:0 4px}
.sm-top{display:flex;flex-direction:column;margin-bottom:4px}
.sm-gtrigger{display:grid;grid-template-columns:18px 1fr auto;align-items:center;gap:10px;width:100%;min-height:34px;padding:0 10px;
  border:0;border-radius:8px;background:transparent;color:var(--m-text);font:600 12.5px var(--m-font);text-align:left;cursor:pointer}
.sm-gtrigger svg{color:var(--m-text-3)}
.sm-gtrigger:hover{background:var(--m-hover)}
.sm-gtrigger:focus-visible,.v1.nui.sm-on .sb a.sm-item:focus-visible,.sm-collapse:focus-visible,.sm-menu-btn:focus-visible{outline:2px solid var(--m-accent);outline-offset:1px;box-shadow:var(--st-focus)}
.sm-group.has-active > .sm-gtrigger{color:var(--m-accent-ink)}
.sm-group.has-active > .sm-gtrigger svg{color:var(--m-accent)}
.sm-chev{display:grid;place-items:center;color:var(--m-muted);transition:transform .15s ease}
.sm-gtrigger.is-open .sm-chev{transform:rotate(90deg)}
.sm-gitems{display:flex;flex-direction:column;gap:1px;margin:2px 0 6px 19px;padding-left:8px;border-left:1px solid var(--m-line)}
.sm-gitems[hidden]{display:none}
/* FIX-1008b: the whole menu shows without scrolling — one step tighter, then two, then three (mgmt.js fitSideMenu) */
.v1.nui.sm-on .sb.sm-tight .sm-gtrigger{min-height:28px}
.v1.nui.sm-on .sb.sm-tight .sm-gitems{margin-bottom:3px}
.v1.nui.sm-on .sb.sm-tighter .sm-gtrigger{min-height:24px;font-size:12px}
.v1.nui.sm-on .sb.sm-tighter .sm-gitems{margin:0 0 2px 19px}
.v1.nui.sm-on .sb.sm-tighter .sm-scroll{gap:2px}
.v1.nui.sm-on .sb.sm-tightest .sm-gtrigger{min-height:21px;font-size:11.5px}
.v1.nui.sm-on .sb.sm-tightest .sm-gitems{margin:0 0 1px 19px}
.v1.nui.sm-on .sb.sm-tightest .sm-scroll{gap:1px}
.v1.nui.sm-on .sb.sm-tightest .sm-top{margin-bottom:1px}
/* the active item: pale accent, accent text, stronger weight and an inset bar (not colour alone) */
.v1.nui.sm-on .sb a.sm-item[aria-current="page"]{box-shadow:inset 3px 0 0 var(--m-accent)}
/* collapsed: Dashboard and the group icons only; Administration (or the group holding the page) keeps its family mark */
.sm-collapsed .sm-gitems,.sm-collapsed .sm-chev{display:none !important}
.sm-collapsed .sm-scroll{align-items:center}
.sm-collapsed .sm-top{width:100%;align-items:center}
.sm-collapsed .sm-gtrigger{width:44px;height:40px;grid-template-columns:1fr;justify-items:center;padding:0}
.sm-collapsed .sm-group.has-active > .sm-gtrigger{background:var(--m-accent-pale)}
.sm-collapsed .sm-group{border-top:0;padding-top:0}
/* the phone: the menu is a drawer behind the header's button */
.sm-menu-btn{display:none;width:40px;height:40px;border:1px solid var(--m-line);border-radius:9px;background:var(--m-surface);color:var(--m-text);
  align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;padding:0}
@media (max-width:700px){
  .v1.nui.sm-on,.v1.nui.sm-on.sm-collapsed{grid-template-columns:minmax(0,1fr)}
  .v1.nui.sm-on .hd{grid-column:1}
  .v1.nui.sm-on .page{grid-column:1}
  .sm-menu-btn{display:inline-flex}
  /* the header keeps every control; on a phone it wraps onto a second line rather than run off the screen */
  .v1.nui.sm-on{grid-template-rows:auto minmax(0,1fr)}
  .v1.nui.sm-on .hd{height:auto;min-height:52px;flex-wrap:wrap;row-gap:8px;padding:8px 12px}
  .v1.nui.sm-on .sb{position:fixed;left:0;top:0;bottom:0;width:254px;z-index:60;transform:translateX(-105%);transition:transform .18s ease;box-shadow:var(--m-shadow)}
  .v1.nui.sm-on.sm-drawer .sb{transform:none}
  .v1.nui.sm-on.sm-drawer::after{content:'';position:fixed;inset:0;background:var(--m-scrim);z-index:55}
  /* in the drawer the menu is always drawn open, whatever the desktop choice */
  .sm-collapsed .sb .sm-brand-text,.sm-collapsed .sb .sm-text{display:revert}
  .sm-collapsed .sm-gitems:not([hidden]){display:flex !important}
  .sm-collapsed .sm-chev{display:grid !important}
  .sm-collapsed .sm-gtrigger{width:100%;height:auto;min-height:34px;grid-template-columns:18px 1fr auto;justify-items:stretch;padding:0 10px}
  .v1.nui.sm-on.sm-collapsed .sb a.sm-item{width:auto;height:33px;grid-template-columns:18px 1fr auto;justify-items:stretch;padding:0 10px}
  .sm-collapsed .sm-scroll,.sm-collapsed .sm-top{align-items:stretch}
  .sm-collapse{display:none}
}
@media (prefers-reduced-motion: reduce){ .sm-chev,.v1.nui.sm-on .sb,.st-card-link{transition:none !important} }

/* ---------------- Settings: one design for every page ---------------- */
/* SETTINGS-1028 G1 */
.st{font-family:var(--m-font);color:var(--m-text);width:100%;max-width:calc(1540px / var(--ui-scale, 1));margin:0;padding:0 0 32px}
.st *{box-sizing:border-box}
.st-landing{max-width:calc(1480px / var(--ui-scale, 1))}
.st-eyebrow{font-size:11px;font-weight:700;letter-spacing:.12em;color:var(--m-muted);text-transform:uppercase;margin:0 0 6px}
.st-title{font-size:34px;line-height:1.15;letter-spacing:-.035em;font-weight:650;margin:0 0 8px;color:var(--m-strong)}
.st-title:focus,.st h2:focus{outline:none}
.st-lede{font-size:15px;color:var(--m-text-2);margin:0 0 22px}
/* the search over all 40 pages (and every setting's words) */
.st-searchwrap{position:relative;margin-bottom:28px}
.st-search{display:flex;align-items:center;gap:12px;height:54px;padding:0 16px;border:1px solid var(--m-line);border-radius:12px;background:var(--m-surface);
  box-shadow:var(--st-sh-card)}
.st-search:focus-within{border-color:var(--m-accent);box-shadow:var(--st-focus)}
.st-search svg{color:var(--m-muted);flex-shrink:0}
.st-search input{flex:1;min-width:0;border:0 !important;outline:none;background:transparent !important;font:15px var(--m-font);color:var(--m-text);box-shadow:none !important;padding:0;height:100%}
.st-search kbd{font:600 11px var(--m-font);color:var(--m-text-3);background:var(--m-chip);border:1px solid var(--m-line);border-radius:6px;padding:3px 7px;white-space:nowrap}
.st-search.st-search-sm{height:40px;border-radius:9px;padding:0 10px;gap:8px;margin-bottom:10px}
.st-search.st-search-sm input{font-size:13px}
.st-search.st-search-sm kbd{display:none}
.st-results{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:30;background:var(--m-surface);border:1px solid var(--m-line);border-radius:12px;
  box-shadow:var(--m-shadow);padding:6px;max-height:min(460px,calc(70 * var(--vh)));overflow:auto}
.st-results[hidden]{display:none}
.st-results .st-rhead{font-size:10.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--m-muted);padding:8px 10px 4px}
.st .cs-hits{display:flex;flex-direction:column;gap:2px}
.st .cs-hit{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;text-align:left;background:transparent;border:0;border-radius:9px;
  padding:8px 10px;font:inherit;color:var(--m-text);cursor:pointer}
.st .cs-hit:hover,.st .cs-hit:focus-visible,.st .cs-hit.is-sel{background:var(--m-hover);outline:none}
.st .cs-hit:focus-visible{box-shadow:var(--st-focus)}
.st .cs-hit b{display:block;font-size:13.5px;font-weight:600}
.st .cs-hit .dim{display:block;font-size:12px;color:var(--m-text-2)}
.st .cs-hit > svg{color:var(--m-muted)}
.st-empty-search{display:flex;flex-direction:column;align-items:center;gap:4px;padding:22px 12px;text-align:center;color:var(--m-text-2)}
.st-empty-search b{color:var(--m-text);font-size:14px}
/* the category icon and accents */
.st-icon{width:44px;height:44px;border-radius:11px;display:grid;place-items:center;flex-shrink:0}
.st-icon.sm{width:34px;height:34px;border-radius:9px}
.st-c-organisation .st-icon,.st-icon.st-c-organisation{background:var(--st-org-bg);color:var(--st-org)}
.st-c-ai .st-icon,.st-icon.st-c-ai{background:var(--st-ai-bg);color:var(--st-ai)}
.st-c-integrations .st-icon,.st-icon.st-c-integrations{background:var(--st-int-bg);color:var(--st-int)}
.st-c-workflow .st-icon,.st-icon.st-c-workflow{background:var(--st-wf-bg);color:var(--st-wf)}
.st-c-security .st-icon,.st-icon.st-c-security{background:var(--st-sec-bg);color:var(--st-sec)}
.st-c-contact_centre .st-icon,.st-icon.st-c-contact_centre{background:var(--st-cc-bg);color:var(--st-cc)}
/* the landing: "Browse by category", five cards (3 + 2 on a six-column grid) */
.st-sechead{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin:0 0 14px}
.st-sechead h2{font-size:18px;font-weight:600;letter-spacing:-.015em;margin:0 0 3px}
.st-sechead p{margin:0;font-size:13px;color:var(--m-text-2)}
.st-sechead > span{font-size:12.5px;color:var(--m-text-2);white-space:nowrap}
.st-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:16px}
.st-grid > .st-card-link{grid-column:span 2}
.st-grid > .st-card-link:nth-child(n+4){grid-column:span 3}
.st-card-link{display:flex;gap:16px;align-items:flex-start;padding:22px;background:var(--m-surface);border:1px solid var(--m-line);border-radius:13px;
  color:inherit;text-decoration:none;min-height:168px;transition:box-shadow .15s ease,border-color .15s ease,transform .15s ease}
.st-card-link:hover{border-color:var(--m-accent-pale);box-shadow:var(--st-sh-lift);transform:translateY(-1px)}
.st-card-link:focus-visible{outline:2px solid var(--m-accent);outline-offset:2px}
.st-card-body{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1;height:100%}
.st-card-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.st-card-head strong{font-size:16px;font-weight:600;color:var(--m-strong)}
.st-card-head small{font-size:12px;color:var(--m-text-2);white-space:nowrap}
.st-card-desc{font-size:13px;line-height:1.5;color:var(--m-text-2)}
.st-card-act{margin-top:auto;padding-top:8px;display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;color:var(--m-accent)}
.st-other{margin-top:14px;font-size:13px}
.st-note{display:flex;align-items:center;gap:14px;margin-top:22px;padding:16px 18px;border:1px solid var(--m-line);border-radius:12px;background:var(--m-surface)}
.st-note > span{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;background:var(--m-chip);color:var(--m-text-2);flex-shrink:0}
.st-note strong{font-size:14px}
.st-note p{margin:2px 0 0;font-size:12.5px;color:var(--m-text-2)}
.st-note a{margin-left:auto;white-space:nowrap}
/* the category view: breadcrumb, header, a secondary list of only this category's pages, the page */
.st-crumb{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--m-text-2);margin:0 0 14px}
.st-crumb a{color:var(--m-accent);font-weight:600;text-decoration:none}
.st-crumb a:hover{text-decoration:underline}
.st-crumb svg{color:var(--m-muted)}
.st-cathead{display:flex;gap:14px;align-items:center;margin-bottom:20px}
.st-cathead h1{font-size:28px;letter-spacing:-.03em;font-weight:650;margin:0 0 3px;color:var(--m-strong)}
.st-cathead p{margin:0;font-size:13.5px;color:var(--m-text-2)}
/* SETTINGS-1030: the menu is a 255 px column left of the content, sticky in its own column, solid (test/settingsOverlap1030) */
.st .cs.st-layout{display:grid;grid-template-columns:255px minmax(0,1fr);gap:22px;align-items:start}
.st .cs-nav{position:sticky;top:calc(var(--hd-h, 64px) + 8px);z-index:2;display:flex;flex-direction:column;gap:2px;background:var(--m-surface);border:1px solid var(--m-line);border-radius:12px;padding:12px;
  max-height:calc(100 * var(--vh) - var(--hd-h, 64px) - 24px);overflow:auto}
.st .cs-group{display:flex;flex-direction:column;gap:2px;min-width:0}
.st .cs-gtitle{display:flex;justify-content:space-between;align-items:baseline;font-size:12px;font-weight:700;letter-spacing:0;text-transform:none;color:var(--m-text);padding:4px 8px 8px}
.st .cs-gtitle small{font-weight:500;color:var(--m-muted)}
.st .cs-item{display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;text-align:left;background:none;border:0;border-radius:8px;padding:8px 10px;
  font:13px var(--m-font);color:var(--m-text-2);cursor:pointer;min-height:34px}
.st .cs-item:hover{background:var(--m-hover);color:var(--m-text)}
.st .cs-item:focus-visible{outline:2px solid var(--m-accent);outline-offset:-2px}
.st .cs-item[aria-current="page"]{background:var(--m-accent-pale);color:var(--m-accent-ink);font-weight:600;box-shadow:inset 3px 0 0 var(--m-accent)}
.st .cs-item svg{flex-shrink:0}
.st-back{display:flex;align-items:center;gap:6px;margin-top:8px;padding:9px 10px 2px;border-top:1px solid var(--m-line-2);font-size:12.5px;font-weight:600;color:var(--m-accent);text-decoration:none}
.st-back:hover{text-decoration:underline}
/* SETTINGS-1030: a page's first row: help and buttons, no heading */
.st .st-sechd.st-toprow{align-items:center}
.st .st-sechd.st-toprow > div:first-child{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
/* the page template */
.st .cs-main{min-width:0;display:flex;flex-direction:column;gap:16px}
.st-phead{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:20px 22px;background:var(--m-surface);border:1px solid var(--m-line);border-radius:12px}
.st-plabel{display:block;font-size:10.5px;font-weight:700;letter-spacing:.12em;color:var(--m-muted);text-transform:uppercase;margin-bottom:4px}
.st .cs-main .st-phead h2{font-size:22px;letter-spacing:-.02em;font-weight:650;margin:0 0 4px}
.st .cs-main .st-phead p{margin:0;font-size:13px;color:var(--m-text-2)}
.st-saved{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:var(--m-ok);white-space:nowrap;padding:5px 10px;border-radius:999px;background:var(--m-t-green)}
.st-saved.dirty{color:var(--m-high);background:var(--m-high-bg)}
/* sections are cards with a heading; a panel's own headings divide it into sections */
.st .card.pane,.st .st-card{background:var(--m-surface);border:1px solid var(--m-line);border-radius:12px;padding:20px 22px;box-shadow:none;margin:0}
.st .card.pane > h3:first-child,.st .st-card-h,.st .cs-panel > h3:first-child,.st .cs-panel > div > h3:first-child{font-size:16px;font-weight:600;letter-spacing:-.01em;margin:0 0 4px;color:var(--m-strong)}
.st .cs-panel h3:not(:first-child){font-size:15px;font-weight:600;margin:22px -22px 10px;padding:16px 22px 0;border-top:1px solid var(--m-line-2)}
.st .cs-panel h4{font-size:13.5px;font-weight:600;margin:16px 0 8px}
.st-card-sub{margin:0 0 6px;font-size:12.5px;color:var(--m-text-2)}
/* one row per setting: label and help on the left, the control on the right, range and Reset under it */
.st .cs-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,auto);gap:20px;padding:14px 10px;margin:0 -10px;border-bottom:1px solid var(--m-line-2);border-radius:0}
.st .cs-row:last-child{border-bottom:0}
.st .cs-row.cs-changed{background:var(--st-changed);box-shadow:inset 3px 0 0 var(--st-changed-line);border-radius:8px}
.st .cs-row.st-invalid{box-shadow:inset 3px 0 0 var(--m-danger)}
.st .cs-row.cs-flash{outline:2px solid var(--m-accent);border-radius:8px}
.st .cs-what label{font-weight:600;font-size:13.5px;color:var(--m-text)}
.st .cs-desc{font-size:12.5px;line-height:1.5;margin-top:3px;color:var(--m-text-2)}
.st .cs-what .cs-state{color:var(--m-muted) !important;font-size:11.5px}
.st .cs-ctl{display:flex;flex-direction:column;align-items:flex-end;gap:5px;min-width:0}
.st-range{font-size:11.5px;color:var(--m-text-2)}
.st .cs-reset{font-size:12px;color:var(--m-accent);background:none;border:0;padding:0;cursor:pointer;font-weight:600}
.st .cs-reset:hover{text-decoration:underline}
.st-err{font-size:12px;font-weight:600;color:var(--m-danger);max-width:320px;text-align:right}
.st-err:empty{display:none}
/* a panel's own form fields (Escalation teams' "Add a team") and own rows (Service levels' Weekend) take the row's shape */
.st .field{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,1.4fr);gap:4px 20px;align-items:center;padding:12px 0;border-bottom:1px solid var(--m-line-2)}
.st .field > label{font-weight:600;font-size:13.5px;color:var(--m-text)}
.st .field > input,.st .field > select{width:100%}
.st .field > .dim{grid-column:2;font-size:12px;color:var(--m-text-2)}
.st .field + button.primary,.st .field + .primary{margin-top:14px}
.st .cs-row.st-row-own{margin:0;padding:12px 0}
.st .cs-row.st-row-own .cs-desc{margin:4px 0 0}
.st .cs-row.st-row-own .cs-ctl{flex-direction:row;align-items:center;gap:14px}
.st #escAdminTeams h4,.st #slaWeekend h4{font-size:13.5px;font-weight:600;margin:18px 0 6px}
/* the careful settings: their own card */
.st .cs-careful{border:1px solid var(--m-danger-line);background:var(--m-danger-pale);border-radius:12px;padding:16px 22px;margin-top:0}
.st .cs-careful h4{margin:0 0 3px;color:var(--m-danger);font-size:14px}
.st .cs-careful .cs-row{border-bottom-color:var(--m-danger-line)}
/* one style per control, on every page */
.st input[type=text],.st input[type=email],.st input[type=url],.st input[type=number],.st input[type=time],.st input[type=date],.st input[type=password],.st input[type=search]:not(.st-search input),.st select,.st textarea{
  font:13px var(--m-font);color:var(--m-text);background:var(--m-input);border:1px solid var(--m-line);border-radius:8px;min-height:34px;padding:6px 10px}
.st textarea{min-height:80px;line-height:1.5}
.st input:focus-visible,.st select:focus-visible,.st textarea:focus-visible{outline:none;border-color:var(--m-accent);box-shadow:var(--st-focus)}
.st input:disabled,.st select:disabled,.st textarea:disabled{opacity:.6}
.st input[type=checkbox],.st input[type=radio]{accent-color:var(--m-accent);width:16px;height:16px}
.st .cs-num input[type=number]{width:110px}
.st .cs-toggle{display:inline-flex;align-items:center;gap:10px;cursor:pointer}
.st .cs-slider{width:40px;height:23px;border-radius:12px;background:var(--m-offline)}
.st .cs-slider::after{top:3px;left:3px;width:17px;height:17px;background:var(--m-surface);box-shadow:var(--st-sh-knob)}
.st .cs-toggle input:checked+.cs-slider{background:var(--m-accent)}
.st .cs-toggle input:checked+.cs-slider::after{left:20px}
.st .cs-toggle input:focus-visible+.cs-slider{outline:2px solid var(--m-accent);outline-offset:2px}
.st button.primary,.st .btn.primary{background:var(--m-accent);border:1px solid var(--m-accent);color:var(--m-on-accent);border-radius:8px;font:600 13px var(--m-font);min-height:34px;padding:0 14px}
.st button.ghost,.st .btn-s,.st button.btn-s{background:var(--m-surface);border:1px solid var(--m-line);color:var(--m-text);border-radius:8px;font:600 12.5px var(--m-font);min-height:32px;padding:0 12px}
.st button.ghost:hover,.st .btn-s:hover{background:var(--m-hover)}
.st button:focus-visible,.st a:focus-visible{outline:2px solid var(--m-accent);outline-offset:2px}
.st .danger-outline{border-color:var(--m-danger-line) !important;color:var(--m-danger) !important}
/* tables and lists (inboxes, people, templates, rules …): one style */
.st table{width:100%;border-collapse:separate;border-spacing:0;font-size:13px}
.st table th{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--m-muted);background:var(--m-th);text-align:left;padding:9px 10px;border-bottom:1px solid var(--m-line)}
.st table th:first-child{border-top-left-radius:8px}
.st table th:last-child{border-top-right-radius:8px}
.st table td{padding:9px 10px;border-bottom:1px solid var(--m-line-2);vertical-align:middle}
.st table tbody tr:hover td{background:var(--m-row-hover)}
.st table tbody tr:last-child td{border-bottom:0}
.st .chip{border-radius:999px}
.st .banner{border-radius:10px}
/* states, the same everywhere: loading, empty, error with Retry, saved */
.st-skel{display:flex;flex-direction:column;gap:12px}
.st-skel i{display:block;height:14px;border-radius:7px;background:linear-gradient(90deg,var(--m-chip),var(--m-hover),var(--m-chip));background-size:200% 100%;animation:stShimmer 1.2s linear infinite}
.st-skel i.h{height:22px;width:40%}
.st-skel i.w{width:85%}
.st-skel i.m{width:60%}
@keyframes stShimmer{from{background-position:200% 0}to{background-position:-200% 0}}
@media (prefers-reduced-motion: reduce){ .st-skel i{animation:none} }
.st .cs-empty{border:1px dashed var(--m-line);border-radius:12px;padding:20px;color:var(--m-text-2);display:flex;gap:12px;align-items:center;flex-wrap:wrap;background:var(--m-surface);font-size:13px}
.st .cs-empty::before{content:'';width:8px;height:8px;border-radius:50%;background:var(--m-offline);flex-shrink:0}
.st-error{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:16px 18px;border:1px solid var(--m-danger-line);background:var(--m-danger-pale);color:var(--m-danger);border-radius:12px;font-size:13px}
.st-error button{margin-left:auto}
/* one sticky save bar per page: "n unsaved changes · Discard · Save" */
.st .cs-bar{position:sticky;bottom:12px;z-index:20;display:flex;gap:10px;align-items:center;margin:0;padding:10px 12px 10px 18px;
  background:var(--m-surface);border:1px solid var(--m-line);border-radius:12px;box-shadow:var(--st-sh-pop);font-size:13px}
.st .cs-bar.dirty{border-color:var(--st-changed-line);background:var(--st-changed)}
/* with nothing to save it sits at the foot of the page, and floats over the page only while there is something to save */
.st .cs-bar:not(.dirty){position:static;box-shadow:none}
.st .cs-bar .dim{color:var(--m-text-2)}

/* ---------------- UI-SETTINGS-1024: the one page template ----------------
   The breadcrumb and the header in the same place on every page; the category menu (Overview first) on every page of
   a category, a "Pages in …" dropdown below 1100 px; menu + content at most 1180 px; the save bar only with unsaved
   changes, held to the foot of the content column; wide tables scroll inside their own box, first column kept. */
.st.st-page{max-width:calc(1540px / var(--ui-scale, 1))}
.st-cathead .st-icon{width:44px;height:44px;flex-shrink:0}
.st-cathead h1{overflow-wrap:anywhere}
/* the focus is put on the h1 when a page opens (for screen readers); it is not a control, so no ring */
.st-cathead h1:focus,#stTitle:focus{outline:none;box-shadow:none}
.st .cs-dd{display:none}
.st .cs-dd > summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:6px;padding:9px 10px;border:1px solid var(--m-line);border-radius:8px;
  font:600 13px var(--m-font);color:var(--m-text);background:var(--m-surface)}
.st .cs-dd > summary::-webkit-details-marker{display:none}
.st .cs-dd > summary::after{content:'▾';margin-left:auto;color:var(--m-muted)}
.st .cs-dd[open] > summary::after{content:'▴'}
.st .cs-dd-list{display:flex;flex-direction:column;gap:2px;margin-top:6px}
.st .cs-ddi{display:block;width:100%;text-align:left;background:none;border:0;border-radius:8px;padding:9px 10px;font:13px var(--m-font);color:var(--m-text-2);cursor:pointer;min-height:36px;overflow-wrap:anywhere}
.st .cs-ddi:hover{background:var(--m-hover);color:var(--m-text)}
.st .cs-ddi[aria-current="page"]{background:var(--m-accent-pale);color:var(--m-accent-ink);font-weight:600}
.st .cs-bar[hidden]{display:none !important}
.st .cs-bar{bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}
.st-saved-now{display:inline-flex;align-items:center;gap:6px;font-weight:600;color:var(--m-ok)}
.st .cs-main > *{max-width:100%;min-width:0}
.st .cs-main .card.pane,.st .cs-main .st-card,.st .cs-main .cs-panel{min-width:0}
.st .cs-main label,.st .cs-main .cs-item,.st .cs-main h3,.st .cs-main h4{overflow-wrap:anywhere}
/* SETTINGS-1028 G2 */
.st .cs-main th,.st .cs-main td,.st .cs-main td *,.st .cs-main th *{overflow-wrap:normal;word-break:normal}
.st .cs-main th{white-space:nowrap}
.st .cs-main td.num,.st .cs-main th.num{white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
.st .cs-main td .badge,.st .cs-main td .chip,.st .cs-main td [data-badge],.st .cs-main td button,.st .cs-main td .btn-s{white-space:nowrap}
.st .st-tscroll{max-width:100%;overflow-x:auto;position:relative}
/* a toggle's hidden checkbox is placed absolutely: held inside its own toggle, it cannot stretch the page from inside a scroll box */
.st .cs-toggle{position:relative}
/* a panel's own rows of buttons and fields wrap rather than run off the right edge on a phone */
.st .cs-main div[style*="display:flex"]{flex-wrap:wrap}
.st .st-tscroll > table{min-width:100%;width:max-content;max-width:none}
.st .st-tscroll > table th:first-child,.st .st-tscroll > table td:first-child{position:sticky;left:0;z-index:1;background:var(--m-surface)}
.st .st-tscroll > table th:first-child{background:var(--m-th)}
.st-ov-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin-top:12px}
.st-ov-card{display:flex;flex-direction:column;gap:6px;min-height:112px;padding:14px 16px;text-align:left;border:1px solid var(--m-line);border-radius:12px;
  background:var(--m-surface);color:var(--m-text);font:13px var(--m-font);cursor:pointer}
.st-ov-card:hover{background:var(--m-hover)}
.st-ov-card:focus-visible{outline:2px solid var(--m-accent);outline-offset:2px}
.st-ov-card b{font-size:14px;overflow-wrap:anywhere}
.st-ov-card .dim{font-size:12.5px;line-height:1.45;color:var(--m-text-2)}
/* the dialogs a Settings page opens (risky confirmations and the before → after) */
body.st-on .modal{font-family:var(--m-font);border-radius:14px;border:1px solid var(--m-line);background:var(--m-surface);color:var(--m-text);box-shadow:var(--m-shadow);padding:22px 24px}
body.st-on .modal h3{font-size:18px;font-weight:650;letter-spacing:-.015em;margin:0 0 10px}
body.st-on .modal .actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
body.st-on .modal button.primary{background:var(--m-accent);border-color:var(--m-accent);color:var(--m-on-accent);border-radius:8px}
body.st-on .modal button.ghost{border-radius:8px}
body.st-on .modal table th{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--m-muted);text-align:left}
body.st-on .modal input{border-radius:8px}
body.st-on .modal .cs-careful{border-radius:10px}

/* ---------------- widths: 1366 / 1600 desktop, tablet, phone ---------------- */
@media (max-width:1100px){
  .st-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .st-grid > .st-card-link,.st-grid > .st-card-link:nth-child(n+4){grid-column:span 1}
  /* UI-SETTINGS-1024: below 1100 px the category's menu is a "Pages in …" dropdown above the content, same place on every page */
  .st .cs.st-layout{grid-template-columns:minmax(0,1fr)}
  .st .cs-nav{position:static;max-height:none}
  .st .cs-nav .cs-group{display:none}
  .st .cs-dd{display:block}
}
@media (max-width:900px){
  .st .field{grid-template-columns:minmax(0,1fr)}
  .st .field > .dim{grid-column:1}
  .st .cs-row.st-row-own .cs-ctl{justify-content:flex-start}
  .st .cs-row{grid-template-columns:minmax(0,1fr)}
  .st .cs-ctl{align-items:flex-start}
  .st-err{text-align:left}
}
@media (max-width:640px){
  .st-grid{grid-template-columns:minmax(0,1fr)}
  .st-title{font-size:28px}
  .st-phead{flex-direction:column}
  .st-sechead{flex-direction:column;align-items:flex-start}
  .st-note{flex-direction:column;align-items:flex-start}
  .st-note a{margin-left:0}
  .st .card.pane,.st .st-card,.st .cs-careful{padding:16px}
  .st .cs-panel h3:not(:first-child){margin-left:-16px;margin-right:-16px;padding-left:16px;padding-right:16px}
  .st table{display:block;overflow-x:auto}
}

/* ---- SETTINGS-1028 (docs/design/SETTINGS-GAPS-1028.md) ---- */
/* G12 */
.sm-collapsed .sm-logo{justify-content:center;align-items:center;padding:3px;width:38px;height:38px;box-sizing:border-box}
.sm-collapsed .sm-logo-mark{width:32px;height:32px;min-width:32px;flex:none;object-fit:contain;max-width:none}
