/* Admin settings' Organization pages (GitHub issue 203, part 1d, build C1; public/js/app/settings-org.js): one
   sentence of help with "Learn more", lists with their own dialogs, and tables that are one card a row on a phone.
   Sizes are the tokens' (public/tokens.css); colors the page's own, so light and dark both follow them. */

/* ---------------------------------------------------------------------------------- One sentence of help */
.settings-help { margin:0; color:var(--ink-2); font-size:var(--text-md); line-height:var(--leading-normal); }
.settings-learn-more { margin:var(--space-75) 0 0; color:var(--ink-2); font-size:var(--text-sm); line-height:var(--leading-normal); }
.settings-learn-more > summary { display:inline-flex; align-items:center; gap:var(--space-50); color:var(--spruce-dark); font-weight:var(--weight-semibold); cursor:pointer; list-style:none; }
.settings-learn-more > summary::-webkit-details-marker { display:none; }
.settings-learn-more > summary::after { content:'›'; transition:transform .15s ease; }
.settings-learn-more[open] > summary::after { transform:rotate(90deg); }
.settings-learn-more > summary:focus-visible { outline:2px solid var(--spruce); outline-offset:var(--space-25); border-radius:var(--radius-sm); }
.settings-learn-more-body { margin:var(--space-100) 0 0; padding:var(--space-150) var(--space-200); border-left:var(--space-50) solid var(--line); background:var(--surface-2); border-radius:0 var(--radius-md) var(--radius-md) 0; }
.settings-learn-more-body p { margin:0 0 var(--space-100); }
.settings-learn-more-body p:last-child, .settings-learn-more-body ul:last-child { margin-bottom:0; }
.settings-learn-more-body ul { margin:0 0 var(--space-100); padding-left:var(--space-250); }
/* Inside a page heading too, whose own rule (.catalog-heading p) takes every paragraph's space away. */
#settingsView .settings-learn-more-body > :is(p, ul):not(:last-child) { margin-bottom:var(--space-100); }

/* ---------------------------------------------------------------------------------- A list and its rows */
.settings-list-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-150); margin:0 0 var(--space-150); }
.settings-list-head h3 { margin:0; color:var(--ink); font-size:var(--text-lg); font-weight:var(--weight-semibold); }
.settings-list-head .create-button { min-height:var(--control-height); }
.settings-list { display:grid; gap:0; margin:0; padding:0; list-style:none; border:var(--control-border-width) solid var(--line); border-radius:var(--radius-lg); background:var(--surface); }
.settings-list-row { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-150) var(--space-200); padding:var(--space-150) var(--space-200); border-top:var(--control-border-width) solid var(--line); }
.settings-list-row:first-child { border-top:0; }
.settings-list-main { display:flex; flex-direction:column; gap:var(--space-25); flex:1 1 18rem; min-width:0; }
.settings-list-main b { color:var(--ink); font-size:var(--text-md); font-weight:var(--weight-semibold); }
.settings-list-main small { color:var(--muted); font-size:var(--text-sm); line-height:var(--leading-normal); overflow-wrap:anywhere; }
.settings-list-actions { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-100); margin-left:auto; }
.settings-list-empty { margin:0; padding:var(--space-250) var(--space-200); color:var(--muted); font-size:var(--text-sm); text-align:center; }
.settings-list-row.is-new { background:var(--spruce-pale); }

/* ---------------------------------------------------------------------------------- A list item's dialog */
.settings-item-dialog { width:min(var(--dialog-width), 100%); }
.settings-item-dialog.is-wide { width:min(var(--dialog-width-wide), 100%); }
.settings-item-dialog-body > :first-child { margin-top:0; }
.settings-item-dialog-error[hidden] { display:none; }
.settings-item-dialog-error { margin:var(--space-200) 0 0; }
.settings-item-dialog-footer { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:var(--space-100); }
.settings-item-dialog-actions { display:inline-flex; flex-wrap:wrap; gap:var(--space-100); }
.settings-item-dialog-actions .save-button, .settings-item-dialog-actions .outline-button, .settings-item-dialog-footer > .outline-button { width:auto; margin:0; }

/* ---------------------------------------------------------------------------------- Single sign-on */
/* Each tab has its own sentence of help under the title: the one for the tab that is open shows. */
#ssoSettingsPanel .sso-tab-help { display:none; }
#ssoSettingsPanel:not([data-settings-tab]) .sso-tab-help[data-sso-help="microsoft"],
#ssoSettingsPanel[data-settings-tab="microsoft"] .sso-tab-help[data-sso-help="microsoft"],
#ssoSettingsPanel[data-settings-tab="other-providers"] .sso-tab-help[data-sso-help="other-providers"],
#ssoSettingsPanel[data-settings-tab="two-step"] .sso-tab-help[data-sso-help="two-step"],
#ssoSettingsPanel[data-settings-tab="passwords"] .sso-tab-help[data-sso-help="passwords"],
#ssoSettingsPanel[data-settings-tab="accounts"] .sso-tab-help[data-sso-help="accounts"] { display:block; }
/* Labels above their fields, as on every settings page. */
.sso-config-card > .ai-field, .sso-redirect-field { display:flex; flex-direction:column; gap:var(--space-50); margin:var(--space-200) 0 0; }
.sso-config-card > .ai-field > input { max-width:28rem; }
.sso-field-label { color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
.sso-redirect-field small, .sso-config-card > .ai-field > small { color:var(--muted); font-size:var(--text-xs); }
.sso-provider-row .sso-check-result { margin:var(--space-75) 0 0; }
.sso-provider-row .ai-settings-problem { margin:var(--space-75) 0 0; }

/* ---------------------------------------------------------------------------------- A number and its range */
/* Limits and Files: the box, and beside it the range in the field's own unit ("2,000 to 200,000 characters"). */
.limits-input-row { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-100) var(--space-150); }
.limits-input-row > input { flex:0 1 12rem; }
.limits-range { color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-regular); white-space:nowrap; }
/* Limits › Amounts by workspace, role and person (docs/adr/0154): one row each, its fields wrapping on a phone. */
.limits-overrides { display:grid; gap:var(--space-200); margin-top:var(--space-150); }
.limits-override-list { display:grid; gap:var(--space-100); justify-items:start; min-width:0; }
.limits-override-list > h4 { margin:0; font-size:var(--text-sm); }
.limits-override-list > .wf-hint { margin:0; }
.limits-override-row { display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--space-100) var(--space-150); width:100%; min-width:0; }
.limits-override-row label { display:flex; flex-direction:column; gap:var(--space-50); color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-semibold); min-width:0; }
.limits-override-who { flex:1 1 16rem; }
.limits-override-who :is(select, input) { width:100%; min-width:0; }
.limits-override-amount { flex:0 1 9rem; }
.limits-override-amount input { width:100%; }
.limits-size-notice { margin:var(--space-75) 0 0; padding:var(--space-100) var(--space-150); border-left:3px solid var(--warn-ink); border-radius:var(--radius-sm); background:var(--surface-2); color:var(--ink); font-size:var(--text-sm); }
.limits-size-confirm p { margin:0 0 var(--space-75); }
.limits-size-confirm .outline-button { white-space:normal; }

/* ---------------------------------------------------------------------------------- A status beside a heading */
/* A page's status beside its help stays on one line, at any width ("Not set up", not three lines). */
#settingsView .settings-frame-panel > .catalog-heading :is(.ai-pill, .sso-status) { flex:none; white-space:nowrap; }
/* An action with why it can't be used now beside it ("Back up now" · Set the backup passphrase first). */
.backup-run-row { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-100) var(--space-150); }
.backup-run-row .wf-hint { margin:0; }

/* Moving an item up or down its list: two small buttons beside its Change. */
.settings-list-actions .settings-move { min-width:var(--control-height); padding-inline:var(--space-100); }
.settings-list-actions .settings-move:disabled { opacity:.35; cursor:default; }

/* ---------------------------------------------------------------------------------- Users */
/* A profile field's dialog: its form is the dialog's body, without a box of its own. */
.settings-item-dialog .person-field-form { margin:0; padding:0; border:0; background:none; }
/* The lists' filters, folded into one "Filters" button beside the search box; open, they take the row below it. */
.people-toolbar .people-filter-menu { flex:0 0 auto; }
.people-toolbar .people-filter-menu[open] { flex-basis:100%; }
.people-filter-menu > summary { display:inline-flex; align-items:center; gap:var(--space-50); min-height:var(--control-height); list-style:none; cursor:pointer; }
.people-filter-menu > summary::-webkit-details-marker { display:none; }
.people-filter-menu > summary::after { content:'▾'; margin-left:var(--space-50); line-height:1; }
.people-filter-count { color:var(--spruce-dark); font-weight:var(--weight-semibold); }
.people-filter-menu-body { display:grid; gap:var(--space-150); margin:var(--space-150) 0 0; padding:var(--space-150) var(--space-200); border:var(--control-border-width) solid var(--line); border-radius:var(--radius-lg); background:var(--surface-2); }
/* Users and Requesters: a row opens the person, and its Edit is a button of the usual size. */
.people-table tbody tr[data-user-id], .people-table tbody tr[data-requester-row] { cursor:pointer; }
.user-directory-panel .directory-row-edit, .requester-directory-panel .directory-row-edit { padding:var(--space-75) var(--space-150); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
/* A table that fits its card (the owner's AJ5, GitHub issue 203, 1e): one line a person, about 48 px, the name, role,
   status and last sign-in, and Edit at the end of every row, always in view. The rest is in the person's dialog. */
.people-compact { table-layout:auto; }
.people-compact th, .people-compact td { vertical-align:middle; }
.user-directory-panel .tableWrap .people-compact td, .requester-directory-panel .tableWrap .people-compact td { padding-top:var(--space-100); padding-bottom:var(--space-100); }
.people-compact td.people-name { max-width:0; width:34%; overflow:hidden; overflow-wrap:break-word; white-space:normal; }
.people-compact td.people-name b { color:var(--ink); font-weight:var(--weight-semibold); }
.people-compact td.people-name .vip-badge, .people-compact td.people-name [class*="vip"] { margin-left:var(--space-75); }
.people-compact td.people-roles { display:table-cell; max-width:0; width:30%; overflow:hidden; white-space:nowrap; }
.people-compact td.people-roles > * + * { margin-left:var(--space-50); }
.people-compact td.people-roles > :is(.user-role-badge, .requester-access-badge, .requester-source-badge, .requester-archived-badge, .sign-in-badge, .people-more) { vertical-align:middle; }
.people-compact td.people-roles > .user-role-badge:first-child { display:inline-block; max-width:100%; overflow:hidden; overflow-wrap:break-word; line-height:var(--leading-normal); }
.people-compact td.people-roles > .user-role-badge:first-child:has(+ .people-more) { max-width:calc(100% - var(--space-500)); }
.people-compact td.people-select input, .people-compact th.people-select input { vertical-align:middle; }
.people-compact .people-none { color:var(--muted); }
.people-compact .people-more { display:inline-block; margin-top:0; padding:var(--space-50) var(--space-75); border-radius:var(--radius-xl); background:var(--surface-2); color:var(--ink-2); font-size:var(--text-2xs); font-weight:var(--weight-bold); line-height:var(--leading-normal); cursor:help; }
.people-compact td.people-when { color:var(--ink-2); white-space:nowrap; }
.people-compact :is(th, td).people-two-step, .people-compact td.people-status .settings-chip { white-space:nowrap; }
.people-compact :is(th, td).people-row-actions { width:1%; text-align:right; white-space:nowrap; }
.user-directory-panel .people-compact td.people-row-actions, .requester-directory-panel .people-compact td.people-row-actions { display:table-cell; min-width:0; }
#systemUsersTable td.people-row-actions, #requesterUsersTable td.people-row-actions { min-width:0; }
#systemUsersTable .directory-row-edit, #requesterUsersTable .directory-row-edit { display:inline-flex; margin:0; }
/* On a phone: a short list, each person on two lines (the name, and whether they can sign in when it isn't the usual;
   then their roles), Edit on the right, the box that chooses them on the left. No label before each value: the order
   says what each is. When they last signed in is in their dialog. */
@media (max-width:700px) {
  .people-compact.settings-stack tr { display:grid; grid-template-columns:auto minmax(0, 1fr) auto auto; grid-template-areas:'pick name status edit' 'pick more more edit' 'pick step step edit'; align-items:center; column-gap:var(--space-100); row-gap:var(--space-50); margin:0; padding:var(--space-100) 0; border:0; border-bottom:var(--control-border-width) solid var(--line); border-radius:0; background:none; }
  .people-compact.settings-stack tr:last-child { border-bottom:0; }
  .people-compact.settings-stack td { display:block; width:auto; max-width:none; padding:0; border:0; }
  .people-compact.settings-stack td + td { border-top:0; }
  .people-compact.settings-stack td::before { content:none; }
  .people-compact.settings-stack td.people-select { grid-area:pick; }
  .people-compact.settings-stack td.people-name { grid-area:name; overflow:hidden; overflow-wrap:break-word; white-space:normal; }
  .people-compact.settings-stack td.people-status { grid-area:status; }
  .people-compact.settings-stack td.people-status:has(.is-ok) { display:none; }
  .people-compact.settings-stack td.people-roles { grid-area:more; display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50); font-size:var(--text-sm); }
  .people-compact.settings-stack td.people-roles > * + * { margin-left:0; }
  .people-compact.settings-stack td.people-when { display:none; }
  /* Two-step sign-in (GitHub issue 484, part 1): said on its own line when it isn't set up, and not at all when it is. */
  .people-compact.settings-stack td.people-two-step { grid-area:step; }
  .people-compact.settings-stack td.people-two-step:is(:empty, :has(.is-ok)) { display:none; }
  .people-compact.settings-stack td.people-row-actions { grid-area:edit; }
  .people-compact.settings-stack td.login-history-empty { grid-column:1 / -1; }
}
/* The editors' fields read in the regular weight, as every other page's do; their labels stay as they are. */
.user-editor-modal label :is(input, select, textarea) { font-weight:var(--weight-regular); }

/* ---------------------------------------------------------------------------------- Roles & permissions */
/* A compact role list on the left, and on the right what the open tab is about: the role's permissions (Roles) or its
   field access (Field access), with its preview under it (the owner's AJ5, GitHub issue 203, 1e: Field access sat
   under the whole role list, 2,400 px down). Each role a line: its name and how many people have it. */
#rolesSettingsPanel .roles-layout { grid-template-columns:minmax(11rem, 13.5rem) minmax(0, 1fr); align-items:start; }
#rolesSettingsPanel .roles-layout > .role-list-panel { grid-column:1; grid-row:1 / span 3; padding:var(--space-150); }
#rolesSettingsPanel .roles-layout > :is(.permission-matrix-panel, .fa-panel, .role-preview-panel) { grid-column:2; min-width:0; }
#rolesSettingsPanel .roles-layout > :is(.permission-matrix-panel, .fa-panel) { grid-row:1; }
#rolesSettingsPanel .roles-layout > .role-preview-panel { grid-row:2; }
/* Field access says which role it is for, and its three choices take only the room they need. */
#rolesSettingsPanel .fa-role-name { margin:0 0 var(--space-25); color:var(--muted); font-size:var(--text-xs); font-weight:var(--weight-semibold); letter-spacing:.04em; text-transform:uppercase; }
#rolesSettingsPanel .fa-table td:not(:first-child), #rolesSettingsPanel .fa-table th:not(:first-child) { width:6.5rem; white-space:normal; }
#rolesSettingsPanel .role-list-panel .panel-heading { margin:0 0 var(--space-100); padding:0 var(--space-50); }
#rolesSettingsPanel .role-list-panel .panel-heading h2 { font-size:var(--text-lg); }
#rolesSettingsPanel .role-list { gap:var(--space-25); margin:0 0 var(--space-150); }
#rolesSettingsPanel .role-list-item { display:flex; flex-direction:column; align-items:stretch; gap:var(--space-25); padding:var(--space-75) var(--space-100); border-color:transparent; border-radius:var(--radius-md); background:none; }
#rolesSettingsPanel .role-list-item:hover { border-color:transparent; background:var(--hover-bg); }
#rolesSettingsPanel .role-list-item.active { border-color:transparent; background:var(--spruce-pale); }
#rolesSettingsPanel .role-list-item.active b { color:var(--spruce-dark); }
#rolesSettingsPanel .role-list-item b { overflow:hidden; font-size:var(--text-sm); font-weight:var(--weight-semibold); line-height:var(--leading-tight); overflow-wrap:break-word; white-space:normal; }
#rolesSettingsPanel .role-list-item small.role-member-count { margin:0; font-size:var(--text-xs); line-height:var(--leading-tight); }
#rolesSettingsPanel .role-list-heading { margin:var(--space-150) var(--space-100) var(--space-50); }
#rolesSettingsPanel .role-list-heading:first-child { margin-top:0; }
/* Creating a role: closed until it is wanted, under the list. */
#rolesSettingsPanel .role-create-box { display:block; padding-top:var(--space-150); }
#rolesSettingsPanel .role-create-box > summary { display:inline-flex; align-items:center; gap:var(--space-75); min-height:var(--control-height-sm); padding:0 var(--space-100); border-radius:var(--radius-md); color:var(--spruce); font-size:var(--text-sm); font-weight:var(--weight-semibold); list-style:none; cursor:pointer; }
#rolesSettingsPanel .role-create-box > summary::-webkit-details-marker { display:none; }
#rolesSettingsPanel .role-create-box > summary::before { content:'+'; font-size:var(--text-lg); line-height:1; }
#rolesSettingsPanel .role-create-box > summary:hover { background:var(--hover-bg); }
#rolesSettingsPanel .role-create-fields { display:grid; gap:var(--space-100); margin-top:var(--space-100); }
#rolesSettingsPanel .role-create-fields :is(input, select, textarea) { width:100%; padding:var(--space-100) var(--space-150); font-size:var(--text-sm); }
#rolesSettingsPanel .role-create-fields button { justify-self:start; }
/* The editor's header: the role's name and what it is for, Duplicate and Delete side by side, and why Delete can't be
   used when it can't. */
#rolesSettingsPanel .role-permission-actions { flex-wrap:wrap; align-items:flex-start; }
#rolesSettingsPanel .role-permission-actions .disabled-reason { flex-basis:100%; max-width:22rem; margin:0; text-align:right; }
/* The list to pick a role from, on a phone; the list itself elsewhere. */
#rolesSettingsPanel .role-picker { display:none; }
@media (max-width:700px) {
  #rolesSettingsPanel .roles-layout { grid-template-columns:minmax(0, 1fr); }
  #rolesSettingsPanel .roles-layout > :is(.permission-matrix-panel, .fa-panel, .role-preview-panel) { grid-row:auto; }
  #rolesSettingsPanel .fa-table td:not(:first-child), #rolesSettingsPanel .fa-table th:not(:first-child) { width:auto; }
  #rolesSettingsPanel .roles-layout > :is(.role-list-panel, .permission-matrix-panel, .fa-panel, .role-preview-panel) { grid-column:1; grid-row:auto; }
  #rolesSettingsPanel .role-list-panel .panel-heading, #rolesSettingsPanel .role-list { display:none; }
  #rolesSettingsPanel .role-picker { display:flex; flex-direction:column; gap:var(--space-50); color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
  #rolesSettingsPanel .role-create-box { padding-top:var(--space-100); }
  #rolesSettingsPanel .role-permission-actions .disabled-reason { text-align:left; }
}
/* The page's sentence of help is the Roles tab's; Field access says its own in its panel. */
#rolesSettingsPanel[data-settings-tab="field-access"] > .catalog-heading .roles-help { display:none; }
/* The matrix has room inside its box, as the card around it does (the 2026-10-16 review). */
.permission-matrix { padding:var(--space-150) var(--space-250); }
/* A role that can't be changed (the Administrator, or a role read by someone who doesn't change roles): its levels in
   words, not lists that don't open. */
.role-level-text { flex:0 0 150px; width:150px; padding:var(--space-75) var(--space-100); color:var(--ink); font-size:var(--text-md); }
@media (max-width:640px) { .role-level-text { flex:1 1 0; width:auto; } .permission-matrix { padding:var(--space-100) var(--space-150); } }
/* Field access on a phone: one row a field, its three choices under its name. */
@media (max-width:700px) {
  .fa-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .fa-table, .fa-table tbody { display:block; width:100%; }
  .fa-table tr { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:var(--space-50) var(--space-100); padding:var(--space-100) 0; border-bottom:var(--control-border-width) solid var(--line); }
  .fa-table td { display:flex; align-items:center; gap:var(--space-50); padding:0; border:0; font-size:var(--text-sm); }
  .fa-table td:first-child { grid-column:1 / -1; font-weight:var(--weight-semibold); }
  .fa-table td:not(:first-child)::after { content:attr(data-choice); color:var(--ink-2); }
  .fa-panel .tableWrap:has(> .fa-table) { overflow:visible; border:0; }
}

/* ---------------------------------------------------------------------------------- Departments */
/* "Add a department" in its own dialog: the dialog's title names it, and its footer has the button that creates it.
   The form's own button stays in the form, hidden, so Enter in a field still sends it. */
.department-create-dialog .department-create-card #departmentCreateTitle { display:none; }
.department-create-dialog .department-create-card > div:first-child .wf-hint { margin:0 0 var(--space-200); }
.department-create-dialog #departmentCreateSubmit { display:none; }
.department-create-dialog .department-create-form { max-width:none; }
/* The department just created, in the list. */
.department-switch-row.is-new { background:var(--spruce-pale); border-color:var(--spruce); }
.department-sensitive-more { margin:0 0 var(--space-150); }

/* ---------------------------------------------------------------------------------- Tables, one card a row on a phone */
@media (max-width:700px) {
  table.settings-stack, table.settings-stack tbody { display:block; width:100%; }
  table.settings-stack thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  table.settings-stack tr { display:block; margin:0 0 var(--space-150); padding:var(--space-100) var(--space-150); border:var(--control-border-width) solid var(--line); border-radius:var(--radius-lg); background:var(--surface); }
  table.settings-stack tr:last-child { margin-bottom:0; }
  table.settings-stack td { display:grid; grid-template-columns:minmax(6rem, 38%) 1fr; gap:var(--space-150); align-items:start; padding:var(--space-75) 0; border:0; text-align:left; overflow-wrap:anywhere; }
  table.settings-stack td + td { border-top:var(--control-border-width) solid var(--line); }
  table.settings-stack td::before { content:attr(data-label); color:var(--muted); font-size:var(--text-xs); font-weight:var(--weight-semibold); }
  table.settings-stack td:not([data-label])::before, table.settings-stack td[data-label=""]::before { content:none; }
  table.settings-stack td:not([data-label]), table.settings-stack td[data-label=""] { grid-template-columns:1fr; }
  /* A row's own buttons sit together at its foot. */
  table.settings-stack td:is(.api-actions, .backup-actions, .sr-actions, .settings-stack-actions) { display:flex; flex-wrap:wrap; gap:var(--space-100); }
  table.settings-stack td:is(.api-actions, .backup-actions, .sr-actions, .settings-stack-actions)::before { content:none; }
  table.settings-stack td.people-select { display:flex; }
  table.settings-stack td.people-select::before { content:none; }
  .tableWrap:has(> table.settings-stack), .backups-table-wrap:has(> table.settings-stack), .sso-acc-table-wrap:has(> table.settings-stack) { overflow:visible; max-height:none; border:0; background:none; }
  .settings-list-row { padding:var(--space-150); }
  .settings-list-actions { margin-left:0; }
  /* A row's own heading (Usage's month) is the card's title. */
  table.settings-stack tbody th { display:block; padding:0 0 var(--space-75); border:0; text-align:left; font-weight:var(--weight-semibold); }
  /* Usage: the history is a card a month, and the tiles one column. */
  .usage-table.settings-stack { min-width:0; }
  .usage-table.settings-stack td { text-align:left; white-space:normal; }
  .usage-table-wrap:has(> table.settings-stack) { overflow:visible; }
  .usage-tiles { grid-template-columns:minmax(0, 1fr); }
}

/* ---------------------------------------------------------------------------------- Login policy & sessions */
/* Each number as Limits and Files have it (GitHub issue 203, 1e: here they stretched the card's width with the range
   under them): its name and line of help, then its box with its range beside it. A number's box is as wide as its
   numbers (settings-frame.css, the owner's 2026-10-30 request). A switch keeps its row. */
#settingsView #loginPolicySettingsPanel label.login-policy-row { display:grid; grid-template-columns:auto minmax(0, 1fr); grid-template-areas:'text text' 'value range'; align-items:center; gap:var(--space-75) var(--space-150); padding:var(--space-150) 0; }
#settingsView #loginPolicySettingsPanel label.login-policy-row > span { grid-area:text; }
#settingsView #loginPolicySettingsPanel label.login-policy-row > input { grid-area:value; }
#settingsView #loginPolicySettingsPanel label.login-policy-row > input:not([type="number"]) { width:100%; text-align:left; }
#settingsView #loginPolicySettingsPanel label.login-policy-row > em { grid-area:range; color:var(--ink-2); font-size:var(--text-sm); font-style:normal; white-space:nowrap; }
#settingsView #loginPolicySettingsPanel label.login-policy-row.login-policy-switch { grid-template-columns:minmax(0, 1fr) auto auto; grid-template-areas:'text value range'; }
#settingsView #loginPolicySettingsPanel label.login-policy-row.login-policy-choice { grid-template-columns:minmax(0, 1fr); grid-template-areas:'text' 'value'; }
#settingsView #loginPolicySettingsPanel label.login-policy-row.login-policy-choice > select { grid-area:value; width:100%; max-width:24rem; }
#loginPolicySettingsPanel .login-policy-card { max-width:none; }

/* ---------------------------------------------------------------------------------- Backups */
/* The status's words and values in two columns that keep their words together ("Backup disk", not "Backup / disk"),
   one under the other on a phone; the schedule's one line, the rest behind "Learn more" (GitHub issue 203, 1e). */
#backupsSettingsPanel .backups-facts div { display:grid; grid-template-columns:minmax(7.5rem, auto) minmax(0, 1fr); align-items:baseline; }
#backupsSettingsPanel .backups-facts dt { white-space:nowrap; }
#backupsSettingsPanel .backups-facts dd { overflow-wrap:anywhere; }
#backupsSettingsPanel .backup-schedule-more { margin:calc(-1 * var(--space-100)) 0 var(--space-150) calc(2.25rem + var(--space-150)); }
@media (max-width:700px) {
  #backupsSettingsPanel .backups-facts div { grid-template-columns:minmax(0, 1fr); gap:var(--space-25); }
  #backupsSettingsPanel .backups-facts dd { text-align:left; }
}

/* ---------------------------------------------------------------------------------- AI assistant */
/* A switch's one line, the rest behind "Learn more" lined up with its words. While the assistant isn't on, the
   features say they wait for it (GitHub issue 203, 1e), and a switch that is on is drawn on, with "Waiting" beside its
   name (1f: drawn gray it read as neither on nor off; settings-finish.css). */
#settingsView .ai-switch-more { margin:calc(-1 * var(--space-100)) 0 var(--space-150) calc(2.25rem + var(--space-150)); }
.ai-features-card .settings-notice { margin:0 0 var(--space-150); }
#aiModelHint:empty { display:none; }

/* ---------------------------------------------------------------------------------- Account & branding */
/* The one field (the account's name) is a form row of its own at the top, not inside a figure's card; the figures
   under it have no glyphs of their own; the owner's initials are a quiet avatar; and the backups say how they really
   are, in the statuses' own chip, with a way there (GitHub issue 203, 1e). */
#accountSettingsPanel .account-name-card { max-width:980px; margin:0 0 var(--space-200); padding:var(--space-200) var(--space-250); }
#accountSettingsPanel .account-name-card .account-name-field { max-width:28rem; }
#accountSettingsPanel .account-name-shown p { margin:0 0 var(--space-50); color:var(--muted); font-size:var(--text-xs); font-weight:var(--weight-semibold); }
#accountSettingsPanel .account-name-shown h3 { margin:0; font-size:var(--text-xl); }
#accountSettingsPanel .account-summary-card p { font-size:var(--text-xs); font-weight:var(--weight-semibold); letter-spacing:.04em; }
#accountSettingsPanel .account-owner-initials { display:grid; flex:none; place-items:center; width:var(--control-height); height:var(--control-height); border-radius:var(--radius-round); background:var(--surface-2); color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
#accountSettingsPanel .account-backup-card h3 .settings-chip { font-size:var(--text-sm); }
#accountSettingsPanel .account-backup-card .settings-row-action { margin-top:var(--space-150); }
#accountSettingsPanel .account-settings-grid > .account-backup-card { grid-column:auto; }

/* ---------------------------------------------------------------------------------- Modules */
/* A module's name with what it waits for and what waits for it as small chips beside it (GitHub issue 203, 1e). */
.module-switch-name { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50) var(--space-100); }
.module-chip { display:inline-flex; align-items:center; padding:var(--space-25) var(--space-100); border-radius:var(--radius-pill); background:var(--surface-2); color:var(--ink-2); font-size:var(--text-xs); font-weight:var(--weight-semibold); line-height:var(--leading-tight); }
.module-chip.is-warn { background:var(--saffron-pale); color:var(--warn-ink); }
/* Departments: a row's Rename and Delete are the row actions every settings list has; its sensitive-records box sits
   level with its words (GitHub issue 203, 1e). */
.department-switch-row .department-switch-name { row-gap:var(--space-50); }
.department-switch-row :is(.department-rename-open, .department-delete-open) { min-height:var(--control-height-sm); padding:0 var(--space-150); font-size:var(--text-sm); }
.department-switch-row .department-delete-open { color:var(--bad); }
.department-switch-managers.is-none { color:var(--warn-ink); }
.department-sensitive .wf-check { display:flex; align-items:center; gap:var(--space-100); }
.department-sensitive .wf-check input { margin:0; }
/* A department's own modules, under its sensitive-records box (GitHub issue 313, R2; department-module-switches.js):
   one small row each, its state and buttons as the department's own row has them. */
.department-modules { grid-column:1 / -1; display:grid; gap:var(--space-100); padding-top:var(--space-100); border-top:1px solid var(--line); min-width:0; }
.department-modules-heading { margin:0; font-size:var(--text-sm); font-weight:var(--weight-semibold); color:var(--ink-2); }
.department-module-list { list-style:none; margin:0; padding:0; display:grid; gap:var(--space-75); }
.department-module-row { display:grid; grid-template-columns:minmax(0, 1fr) auto auto; gap:var(--space-100) var(--space-150); align-items:center; padding:var(--space-100) var(--space-150); border-radius:var(--radius-md); background:var(--surface-2); min-width:0; }
.department-module-name { display:grid; gap:var(--space-25); min-width:0; }
.department-module-name small { color:var(--muted); font-size:var(--text-sm); overflow-wrap:anywhere; }
.department-module-row .department-row-actions button { min-height:var(--control-height-sm); padding:0 var(--space-150); font-size:var(--text-sm); }
.department-module-roles { grid-column:1 / -1; min-width:0; }
.department-module-roles summary { cursor:pointer; font-size:var(--text-sm); color:var(--ink-2); }
.department-module-roles-body { display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--space-100) var(--space-150); padding-top:var(--space-100); }
.department-module-roles-body .wf-hint { flex-basis:100%; margin:0; }
.department-module-roles-body label { display:grid; gap:var(--space-25); font-size:var(--text-sm); }
/* A department's invoices (GitHub issue 317, V4): each role's six rights, side by side where they fit. */
.department-invoices .department-module-roles-body { align-items:stretch; }
.department-invoices .department-module-roles-body > button { align-self:flex-end; }
.department-invoice-role { flex:1 1 15rem; min-width:0; margin:0; padding:var(--space-75) var(--space-100); border:1px solid var(--line); border-radius:var(--radius-md, 8px); }
.department-invoice-role legend { padding:0 var(--space-50); font-size:var(--text-sm); font-weight:600; }
.department-invoice-role legend small { margin-left:var(--space-50); font-weight:400; color:var(--ink-2); }
.department-module-roles-body .department-invoice-role label.wf-check { display:flex; align-items:center; gap:var(--space-50); padding:var(--space-25) 0; }

.department-module-never { margin:0; }
/* A department's own Admin settings › Modules (GitHub issue 313, R3; department-own-modules.js): the same rows, each
   with who gets the module under it. */
.own-modules-card { display:grid; gap:var(--space-150); }
.own-module-gets { grid-column:1 / -1; list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:var(--space-50) var(--space-200); font-size:var(--text-sm); color:var(--ink-2); min-width:0; }
.own-module-gets li { min-width:0; overflow-wrap:anywhere; }
.own-module-gets b { font-weight:var(--weight-semibold); color:var(--ink); }
@media (max-width: 640px) {
  .department-module-row { grid-template-columns:auto minmax(0, 1fr); }
  .department-module-row > .department-module-name { grid-column:1 / -1; }
  .department-module-row .department-row-actions { justify-content:flex-end; }
}

/* Single sign-on's Microsoft card: "New people" and "Password sign-in" are said as the card's fields are, a label
   over its words, not a small gray label beside them (GitHub issue 203, 1e). */
#settingsView .sso-config-card .sso-details > div { grid-template-columns:1fr; gap:var(--space-50); }
#settingsView .sso-config-card .sso-details dt { color:var(--ink); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
#settingsView .sso-config-card .sso-details dd { color:var(--ink-2); }

/* The person's dialog (Users, Requesters): one gap between its rows, and the Sign-in access box apart from the
   fields above it, as the form's groups are (GitHub issue 203, 1e: it touched Site and Profile department, and the
   Email row had a larger gap under it than the rest). */
.modal .modal-two-col:has(#userEmailInput, #requesterEmailInput) { row-gap:0; }
.modal .modal-two-col + .account-access { margin-top:var(--space-200); }

/* Files' Sizes card ends with what email can carry: in the size of the help above it, one size of help a card
   (GitHub issue 203, 1e). */
#settingsView #fileRulesEmailLimits { font-size:var(--text-xs); }

/* ---------------------------------------------------------------------------------- Location levels (Phase 2d, AP2)
   A location under another is drawn under it, set in by how deep it is (the row's --organization-depth), with its kind
   beside its name. */
.organization-row.is-under { margin-left:calc(var(--organization-depth, 0) * var(--space-200)); }
.organization-row b + .organization-kind, .organization-row .organization-kind { display:inline-flex; align-items:center; margin:0 0 var(--space-50); padding:var(--space-25) var(--space-100); border-radius:var(--radius-pill); background:var(--surface-2); color:var(--ink-2); font-size:var(--text-xs); font-weight:var(--weight-semibold); line-height:var(--leading-tight); }
.organization-row b:has(+ .organization-kind) { display:inline; margin-right:var(--space-75); }
.organization-cost-centers-to-fix { margin:var(--space-150) 0 0; }
.organization-cost-centers-to-fix li { margin:0 0 var(--space-50); }
.organization-profile-address { display:block; white-space:pre-line; }
@media (max-width:700px) {
  .organization-row.is-under { margin-left:calc(var(--organization-depth, 0) * var(--space-100)); }
}

/* ---------------------------------------------------------------------------------- Address and contact (Phase 2d, AP1)
   The Organization card's text fields look as its lists do. */
.organization-settings-card textarea, .organization-settings-card input[type="tel"], .organization-settings-card input[type="email"] { width:100%; margin-top:var(--space-75); padding:var(--space-150); border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--surface); color:var(--ink); font:inherit; font-size:var(--text-md); font-weight:400; }
.organization-settings-card textarea { resize:vertical; line-height:var(--leading-normal); }
.organization-settings-card textarea:focus, .organization-settings-card input[type="tel"]:focus, .organization-settings-card input[type="email"]:focus { border-color:var(--spruce); outline:none; box-shadow:0 0 0 3px var(--spruce-pale); }
.organization-settings-card label + label, .organization-settings-card .wf-hint + label { margin-top:var(--space-150); }
.organization-card-subhead { margin:var(--space-250) 0 var(--space-100); color:var(--ink); font-size:var(--text-md); font-weight:var(--weight-semibold); }
.print-org-details { margin:var(--space-50) 0 0; font-size:var(--text-sm); line-height:var(--leading-normal); }

/* ---------------------------------------------------------------------------------- Opening periods (Phase 2d, AP7)
   A day of business hours can have up to three opening periods, one under the other, each after the one before. */
.bh-periods { display:inline-flex; flex-direction:column; gap:var(--space-75); }
.bh-remove-period { display:inline-flex; align-items:center; justify-content:center; width:var(--space-300); height:var(--space-300); padding:0; border:0; border-radius:var(--radius-pill); background:transparent; color:var(--muted); font-size:var(--text-lg); line-height:1; cursor:pointer; }
.bh-remove-period:hover:not(:disabled) { background:var(--surface-2); color:var(--bad); }
.bh-remove-period:focus-visible { outline:2px solid var(--spruce); outline-offset:var(--space-25); }
.bh-add-period { align-self:center; padding:var(--space-25) var(--space-75); font-size:var(--text-sm); }
@media (max-width:520px) { .bh-periods { flex:1 1 100%; } .bh-periods .bh-times { width:100%; } }
/* Adding a country's holidays: its list and its button side by side (Phase 2d, AP7). */
.holiday-country-add { display:inline-flex; flex-wrap:nowrap; align-items:center; gap:var(--space-75); }
.holiday-country-add .holiday-import-button { white-space:nowrap; }
@media (max-width:700px) { .holiday-country-add { flex-wrap:wrap; } }
.holiday-country-add select { width:auto; min-width:0; max-width:100%; }
.holiday-country-add .custom-select-wrapper { flex:0 0 auto; width:auto; min-width:calc(var(--space-1000) * 2); }
#settingsView #fileRulesDepartmentNote { font-size:var(--text-xs); }

/* Single sign-on › Microsoft › How FeatSuite proves who it is to Microsoft (public/js/app/sso-credential.js; docs/adr/0115):
   the three ways as choices, each with what it means, the one in use marked; then what the picked way needs. */
.sso-credential-card { margin-top:var(--space-200); }
.sso-credential-card .settings-help { margin:0; }
.sso-way-list { display:grid; gap:var(--space-100); margin:var(--space-200) 0 0; padding:0; border:0; min-width:0; }
.sso-way-option { display:flex; align-items:flex-start; gap:var(--space-150); padding:var(--space-150); border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--surface); color:var(--ink); cursor:pointer; }
.sso-way-option.picked { border-color:var(--spruce); box-shadow:0 0 0 1px var(--spruce) inset; }
.sso-way-option input { flex:none; width:16px; height:16px; margin:var(--space-25) 0 0; accent-color:var(--spruce); }
.sso-way-option > span { flex:1; min-width:0; }
.sso-way-option b { font-size:var(--text-md); }
.sso-way-option small.field-note { display:block; margin-top:var(--space-50); color:var(--muted); font-size:var(--text-sm); font-weight:var(--weight-regular); }
.sso-way-option:has(input:disabled) { cursor:default; }
.sso-way-option:has(input:disabled:not(:checked)) :is(b, small) { color:var(--muted); }
.sso-way-in-use { display:inline-block; margin-left:var(--space-100); padding:0 var(--space-100); border-radius:var(--radius-pill); background:var(--spruce-pale); color:var(--spruce-dark); font-size:var(--text-xs); font-weight:700; vertical-align:middle; }
.sso-credential-card .sso-actions { display:flex; margin-top:var(--space-200); }
.sso-credential-card .sso-details code { overflow-wrap:anywhere; }
.sso-credential-card .sso-details a.outline-button { display:inline-flex; align-items:center; min-height:28px; padding:0 var(--space-150); font-size:var(--text-xs); text-decoration:none; }
[data-theme="dark"] .sso-way-in-use { color:var(--ink); }
.sso-credential-card .sso-status-row .sso-status { flex:none; white-space:nowrap; }
.sso-credential-card #ssoUseWayButton { max-width:100%; white-space:normal; }
/* A department's money rules on its card (GitHub issue 466; docs/adr/0223): two parts side by side, one under the
   other on a phone. */
.department-money-body { align-items:stretch; }
.department-money-part { display:grid; align-content:start; gap:var(--space-75); flex:1 1 18rem; min-width:0; margin:0; padding:var(--space-100) var(--space-150); border:1px solid var(--line); border-radius:var(--radius-md, 8px); }
.department-money-part legend { padding:0 var(--space-50); font-size:var(--text-sm); font-weight:600; }
.department-module-roles-body .department-money-part label.wf-check { display:flex; flex-wrap:nowrap; align-items:center; gap:var(--space-50); width:100%; }
.department-module-roles-body .department-money-part label.wf-check input[type="radio"], .department-module-roles-body .department-money-part label.wf-check input[type="checkbox"] { flex:none; }
.department-module-roles-body .department-money-part label:not(.wf-check) { display:grid; gap:var(--space-25); }
.department-money-amount { display:inline-flex; align-items:center; gap:var(--space-50); }
.department-money-part .buy-num { width:7rem !important; max-width:100%; }
.department-money-after { padding-left:var(--space-250); }
.department-money-set-by { margin:0; font-weight:600; color:var(--ink-2); }
.department-money-actions { flex-basis:100%; }
/* Holds data on a department's built-in data types (GitHub issue 466, decision 5). */
/* The list under its hint, at the left (the review of GitHub issue 466, decision 5). */
.department-holds-body { display:grid; justify-items:start; align-items:start; }
.department-holds-list { list-style:none; margin:var(--space-50) 0 var(--space-150); padding:0; display:grid; gap:var(--space-50); }
.department-module-roles-body .department-holds-list label.wf-check { display:flex; align-items:center; gap:var(--space-50); }
.department-holds-list small { color:var(--ink-2); }
/* A reason with each access change (GitHub issue 447, AR13): the box beside saves of roles, Users entries and restricted groups. */
.access-reason-field { display:grid; gap:var(--space-50); margin-top:var(--space-100); }
.access-reason-field small { color:var(--muted); font-weight:400; }
.access-reason-field input { width:100%; min-width:0; }
/* Under a department's modules on Admin settings › Departments (GitHub issue 484, part 4). */
.department-access-reason { margin:var(--space-100) 0; max-width:36rem; }
#rolesSettingsPanel .access-reason-card { margin-bottom:var(--space-150); padding:var(--space-250); }
#settingsView .access-reason-required { align-items:flex-start; padding-inline:0; }
#settingsView .access-reason-required > input[type="checkbox"] { margin-top:var(--space-25); }
/* Usage & availability › FeatSuite availability: "How it's measured" lays out as Backups' facts do, a long answer
   read left to right, and the two cards beside each other as tall as their own content. */
.availability-panel .backups-facts div { display:grid; grid-template-columns:minmax(7.5rem, auto) minmax(0, 1fr); gap:var(--space-150); align-items:baseline; }
.availability-panel .backups-facts dd { margin:0; text-align:left; overflow-wrap:anywhere; }
@media (max-width:640px) { .availability-panel .backups-facts div { grid-template-columns:minmax(0, 1fr); gap:var(--space-25); } }
/* Roles & permissions › Field access on a phone: a field's name, then its three choices on one line (Change, Read
   only, Hidden), one rule under the row, instead of three narrow cells each with its own broken underline. */
@media (max-width:700px) {
  #settingsView #rolesSettingsPanel .fa-table tr { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-75) var(--space-250); padding:var(--space-100) 0; border-bottom:1px solid var(--line); }
  #settingsView #rolesSettingsPanel .fa-table td { display:inline-flex; align-items:center; gap:var(--space-75); width:auto; padding:0; border:0; white-space:nowrap; text-align:left; }
  #settingsView #rolesSettingsPanel .fa-table td:first-child { flex:1 1 100%; font-weight:var(--weight-semibold); }
}
