/* Team, teammates, workspace, inbox and security settings pages and dialogs.
   Intercom-style area overrides. Loaded after every other desk stylesheet. */

/* ───────────── Team page (#team-view): page header, tabs, teammates + team inbox tables ───────────── */
#team-view.team-page { background: var(--page); }
#team-view > .team-page-header { margin-bottom: 16px; }
#team-view > .team-page-header .icon { color: var(--muted); }
#team-view > .team-tabs { margin-bottom: 20px; }
#team-view .team-tab-count { color: var(--quiet); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
#team-view .team-tab-count:empty { display: none; }
#team-view .team-panel-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 32px; margin-bottom: 12px; }
#team-view .team-panel-count { margin: 0; color: var(--muted); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
#team-view .team-panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
#team-view .team-panel-actions .button.ghost { gap: 6px; padding-inline: 10px; }
#team-view .team-panel-actions .button.ghost .icon { color: var(--quiet); }
#team-view .team-panel-actions .button.ghost:hover .icon { color: var(--ink); }
#team-view .team-panel-actions #new-inbox-team { margin-inline-start: 8px; }
#team-view :is(#inbox-teams-results, #team-results) { margin-bottom: 0; }
#team-view .contacts-results table { min-width: 560px; }
#team-view .contacts-results tbody td { height: 56px; vertical-align: middle; }
#team-view .contacts-results :is(th, td):last-child.team-row-actions,
#team-view .contacts-results thead th:last-child:has(.visually-hidden) { width: 1%; text-align: end; white-space: nowrap; }
#team-view .team-member-link, #team-view .team-inbox-link { gap: 12px; min-width: 0; text-align: start; }
#team-view .team-member-link .avatar { --avatar-size: 32px; --avatar-font: 12px; }
#team-view .team-cell-text { display: grid; min-width: 0; line-height: 1.3; }
#team-view .team-cell-text strong { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
#team-view .team-cell-text small { color: var(--muted); font-size: 13px; font-weight: 400; }
#team-view :is(.team-member-link, .team-inbox-link):hover strong { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
#team-view .team-you { color: var(--quiet); font-weight: 400; }
#team-view .team-inbox-icon { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--hover); color: var(--muted); }
#team-view .team-inbox-members { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--muted); font-size: 13px; }
#team-view .team-inbox-members > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.team-avatar-stack { display: inline-flex; flex: none; align-items: center; padding-inline-start: 6px; }
.team-avatar-stack .avatar { --avatar-size: 26px; --avatar-font: 10px; margin-inline-start: -6px; box-shadow: 0 0 0 2px var(--surface); }
.team-avatar-stack .team-avatar-more { background: var(--hover); color: var(--muted); }
#team-view #inbox-teams-results:has(> .team-empty) { display: grid; min-height: 280px; }
@media (max-width: 760px) {
  #team-view .team-panel-toolbar { align-items: flex-start; }
  #team-view .team-panel-actions #new-inbox-team { margin-inline-start: 0; }
}

/* ───────────── Shared settings building blocks (used by every dialog in this area) ─────────────
   .settings-section          a titled group (header + body + optional footer)
   .settings-cards dialogs    inside the Settings page each .settings-section becomes its own card;
                              as a modal the sections are separated by hairlines. */
.setup-dialog .settings-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; margin: 0; }
.setup-dialog .settings-section + .settings-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.setup-dialog .settings-section > .desk-form { margin-top: 0; }
.setup-dialog .settings-section > label + .desk-field-hint { margin: -8px 0 0; }
.settings-section-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; min-width: 0; }
.settings-section-header > div:first-child { min-width: 0; flex: 1 1 260px; }
.setup-dialog .settings-section-header h3 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.35; }
.setup-dialog .settings-section-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.settings-section-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.settings-section-footer, .settings-form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.settings-form-actions { grid-column: 1 / -1; }
.settings-section-footer > p { margin: 0 auto 0 0; color: var(--muted); font-size: 13px; }
.setup-dialog .settings-status:empty { display: none; }
.setup-dialog .settings-status { margin: 0; color: var(--muted); font-size: 13px; }
.settings-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.settings-form-grid > :is(.settings-span, fieldset, p) { grid-column: 1 / -1; }
.setup-dialog .settings-inline-empty { margin: 0; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--radius-md); background: var(--inset); color: var(--muted); font-size: 13px; }
.settings-numeric, .desk-table-wrap > table :is(thead, tbody) :is(th, td).settings-numeric { text-align: end; font-variant-numeric: tabular-nums; }
.settings-row-actions, .desk-table-wrap > table tbody td.settings-row-actions { width: 1%; text-align: end; white-space: nowrap; }
.settings-link-button { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; text-align: start; cursor: pointer; }
.settings-link-button:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
/* Facts list: label over value, laid out in a row. */
.settings-facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0; }
.settings-facts > div { display: grid; gap: 2px; min-width: 0; }
.settings-facts dt { color: var(--muted); font-size: 12px; font-weight: 500; }
.settings-facts dd { margin: 0; color: var(--ink); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Disclosure ("Edit subscription record"): quiet bordered expander. */
.settings-disclosure { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.settings-disclosure > summary { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; color: var(--ink); font-size: 13px; font-weight: 500; list-style: none; cursor: pointer; border-radius: var(--radius-md); }
.settings-disclosure > summary::-webkit-details-marker { display: none; }
.settings-disclosure > summary::before { content: ''; width: 6px; height: 6px; margin-inline-end: 2px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform 120ms ease; }
.settings-disclosure[open] > summary::before { transform: rotate(45deg); }
.settings-disclosure > summary:hover { background: var(--hover); }
.settings-disclosure[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.setup-dialog .settings-disclosure > .desk-form { margin: 0; padding: 16px; }
/* Switch-styled checkbox: <input type="checkbox" class="settings-switch"> */
input[type="checkbox"].settings-switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 32px; height: 18px; min-height: 0; margin: 0; padding: 0;
  border: 0; border-radius: 999px; background: var(--control-line); cursor: pointer; transition: background-color 120ms ease;
}
input[type="checkbox"].settings-switch::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform 120ms ease;
}
.desk-form label > input[type="checkbox"].settings-switch, .setup-dialog .desk-form label > input[type="checkbox"].settings-switch { width: 32px; margin: 0; }
input[type="checkbox"].settings-switch:checked { background: var(--accent); }
input[type="checkbox"].settings-switch:checked::before { transform: translateX(14px); }
input[type="checkbox"].settings-switch:disabled { opacity: .5; cursor: default; }
input[type="checkbox"].settings-switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Toggle rows: label text (+ hint) on the left, switch on the right. */
.setup-dialog .desk-form .settings-toggle-list > label.settings-toggle-row, .settings-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 10px 0;
  border-top: 1px solid var(--soft-line); font-weight: 400;
}
.settings-toggle-row:first-of-type { border-top: 0; }
.settings-toggle-row > span { display: grid; gap: 2px; min-width: 0; color: var(--ink); font-size: 14px; }
.settings-toggle-row > span small { color: var(--muted); font-size: 13px; }
.settings-toggle-list { display: grid; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
/* Copyable read-only values (SAML/SCIM/TOTP). */
.settings-copy-field { display: grid; gap: 6px; min-width: 0; }
.settings-copy-field > span:first-child { color: var(--ink); font-size: 13px; font-weight: 500; }
.settings-copy-row { display: flex; gap: 8px; min-width: 0; }
.setup-dialog .settings-copy-row input { flex: 1; min-width: 0; background: var(--inset); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.settings-copy-row .button { flex: none; }

/* Settings page (inline editor) — dialogs marked .settings-cards render as a stack of cards. */
#workspace-settings-editor > dialog.settings-cards[open] { display: grid; gap: 16px; padding: 0; border: 0; border-radius: 0; background: transparent; }
#workspace-settings-editor > dialog.settings-cards:not(#workspace-security-dialog)[open] { max-width: 880px; }
#workspace-settings-editor > dialog.settings-cards > .desk-form:not(#workspace-billing-form) { max-width: none; margin: 0; }
#workspace-settings-editor > dialog.settings-cards > .settings-section { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
#workspace-settings-editor > dialog.settings-cards > .settings-section + .settings-section { margin-top: 0; padding-top: 20px; }
#workspace-settings-editor > dialog.settings-cards .settings-section > .settings-section-footer,
#workspace-settings-editor > dialog.settings-cards .settings-section > .totp-form:last-child > .settings-section-footer { margin: 6px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); }
#workspace-settings-editor > dialog.settings-cards > :is(p, .form-error) { margin: 0; }

/* ───────────── Billing and usage ───────────── */
.billing-plan { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--inset); }
.billing-plan-icon { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.billing-plan .settings-facts dd { font-size: 15px; }
.billing-plan .settings-facts > div:first-child dd { font-size: 16px; font-weight: 600; }
.setup-dialog .billing-usage-period { margin: 0; color: var(--muted); font-size: 13px; }
.billing-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0; }
.billing-meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.billing-meter dt { color: var(--muted); font-size: 13px; font-weight: 500; }
.billing-meter dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; }
.billing-meter dd strong { color: var(--ink); font-size: 20px; font-weight: 600; }
.billing-meter dd span { color: var(--quiet); font-size: 12px; }
.billing-meter :is(.billing-meter-bar, .billing-meter-note) { grid-column: 1 / -1; text-align: start; }
.billing-meter-note { color: var(--quiet); font-size: 12px; }
.billing-meter progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--hover); appearance: none; -webkit-appearance: none; overflow: hidden; }
.billing-meter progress::-webkit-progress-bar { border-radius: 999px; background: var(--hover); }
.billing-meter progress::-webkit-progress-value { border-radius: 999px; background: var(--accent); }
.billing-meter progress::-moz-progress-bar { border-radius: 999px; background: var(--accent); }
.billing-meter[data-state="warn"] progress::-webkit-progress-value { background: var(--warning-ink); }
.billing-meter[data-state="warn"] progress::-moz-progress-bar { background: var(--warning-ink); }
.billing-meter[data-state="over"] progress::-webkit-progress-value { background: var(--danger-ink); }
.billing-meter[data-state="over"] progress::-moz-progress-bar { background: var(--danger-ink); }
.setup-dialog .billing-alert-form { grid-template-columns: minmax(140px, 200px) minmax(180px, 260px) auto; align-items: end; justify-content: start; margin: 0; }
.setup-dialog .billing-alert-form .button { align-self: end; }
[data-billing-alerts]:empty { display: none; }
[data-billing-alerts] h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.billing-alert-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.billing-alert-list li { display: flex; align-items: center; gap: 8px; }
.billing-invoice-table thead th:last-child { width: 1%; }
.billing-invoice-detail { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--inset); }
.billing-invoice-detail:focus { outline: none; }
.billing-invoice-detail:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.billing-invoice-detail header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.billing-invoice-detail h4 { margin: 0; font-size: 14px; font-weight: 600; }
@media (max-width: 720px) {
  .settings-form-grid, .setup-dialog .billing-alert-form { grid-template-columns: minmax(0, 1fr); }
}

/* ───────────── Workspace security (health check, access controls, redaction, audiences, attachments, audit) ───────────── */
.workspace-security-dialog .workspace-security-tabs { flex-wrap: nowrap; gap: 0 18px; margin: 4px 0 20px; overflow-x: auto; scrollbar-width: none; }
.workspace-security-dialog .workspace-security-tabs > button { flex: none; white-space: nowrap; }
.workspace-security-dialog .workspace-security-tabs > button[aria-pressed="true"] { background: none; color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
#workspace-settings-editor > dialog.settings-cards > div > .settings-section { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
#workspace-settings-editor > dialog.settings-cards > div > .settings-section > .settings-section-footer { margin: 6px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); }
#workspace-settings-editor > #workspace-security-dialog .workspace-security-tabs { margin: 0; }
.setup-dialog .settings-loading { margin: 0; padding: 32px 0; color: var(--muted); font-size: 13px; text-align: center; }
.workspace-security-dialog .desk-form .security-guidance, .setup-dialog .settings-section .security-guidance { margin: -6px 0 0; color: var(--quiet); font-size: 12px; line-height: 1.5; }
.workspace-security-dialog .security-narrow-field { max-width: 320px; }
.setup-dialog .settings-subheading { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.setup-dialog .settings-subheading h4 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; }
/* Health check: checklist with status icons. */
.security-review .settings-section-header { align-items: center; }
.security-review-progress { flex: 0 0 160px; height: 6px; border: 0; border-radius: 999px; background: var(--hover); appearance: none; -webkit-appearance: none; overflow: hidden; }
.security-review-progress::-webkit-progress-bar { border-radius: 999px; background: var(--hover); }
.security-review-progress::-webkit-progress-value { border-radius: 999px; background: var(--success-ink); }
.security-review-progress::-moz-progress-bar { border-radius: 999px; background: var(--success-ink); }
.security-checklist { display: grid; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); list-style: none; overflow: hidden; }
.security-checklist .security-check { grid-template-columns: 24px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--soft-line); background: var(--surface); }
.security-checklist .security-check:last-child { border-bottom: 0; }
.security-checklist .security-check:hover { background: var(--hover); }
.security-check h4 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 500; }
.setup-dialog .security-check p { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.security-check-icon { position: relative; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--warning-soft); color: var(--warning-ink); }
.security-check-icon::before { content: '!'; font-size: 13px; font-weight: 600; line-height: 1; }
.security-check[data-active="true"] .security-check-icon { background: var(--success-soft); color: var(--success-ink); }
.security-check[data-active="true"] .security-check-icon::before { content: ''; width: 9px; height: 5px; margin-top: -2px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.security-checklist .security-check-status { padding: 2px 8px; }
.security-checklist .security-check-status[data-active="true"] { color: var(--success-ink); }
/* Redaction rules. */
.workspace-security-dialog .security-redaction-rule { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--inset); }
.workspace-security-dialog .security-redaction-rule legend { padding-inline: 6px; color: var(--ink); font-size: 13px; font-weight: 600; }
.security-redaction-rule-footer { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 12px; }
.setup-dialog .desk-form .security-redaction-rule-footer > label.security-inline-switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.workspace-security-dialog .security-redaction-rule > button { justify-self: auto; }
/* File type pickers. */
.security-type-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.security-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.setup-dialog .desk-form .security-type-grid > label.security-type-option { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); font-weight: 400; cursor: pointer; }
.setup-dialog .desk-form .security-type-grid > label.security-type-option:hover { background: var(--hover); }
.setup-dialog .desk-form .security-type-grid > label.security-type-option:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.setup-dialog .desk-form .security-type-grid > label.security-type-option > input { margin: 0; }
/* Activity log. */
.security-audit-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.security-audit-search .search-field { flex: 0 1 360px; min-height: 32px; background: var(--surface); }
.workspace-security-dialog .security-audit-table { margin: 0; }
.workspace-security-dialog .security-audit-table table thead th { vertical-align: middle; white-space: nowrap; }
.workspace-security-dialog .security-audit-table tbody td { height: auto; padding-block: 12px; vertical-align: top; color: var(--ink); }
.workspace-security-dialog .security-audit-table time { color: var(--muted); font-variant-numeric: tabular-nums; }
.security-audit-actor { font-weight: 500; white-space: nowrap; }
.security-audit-detail { color: var(--muted); min-width: 200px; }
.security-audit-more { display: flex; justify-content: center; }
.security-audit-empty { padding-block: 32px; }
@media (max-width: 720px) {
  .workspace-security-dialog .security-redaction-rule { grid-template-columns: minmax(0, 1fr); }
  .security-checklist .security-check { grid-template-columns: 24px minmax(0, 1fr); }
  .security-checklist .security-check > :is(.security-check-status, .button) { grid-column: 2; justify-self: start; }
}

/* ───────────── SAML / SCIM / two-factor / Google / deployment ───────────── */
.settings-step { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; margin-inline-end: 8px; border-radius: 50%; background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1; vertical-align: 1px; font-variant-numeric: tabular-nums; }
.setup-dialog .settings-status-line { margin: 0; color: var(--muted); font-size: 13px; }
.setup-dialog .settings-status-line:empty { display: none; }
.setup-dialog .settings-copy-field > label { display: flex; align-items: center; color: var(--ink); font-size: 13px; font-weight: 500; }
.setup-dialog .settings-copy-field > .desk-field-hint { margin: -2px 0 2px; }
.settings-copy-list { display: grid; gap: 14px; }
.setup-dialog .settings-copy-row .button { gap: 6px; }
.setup-dialog .settings-copy-row .button .icon { color: var(--muted); }
.settings-secret .settings-copy-row input { border-color: var(--warning-ink); background: var(--warning-soft); }
.setup-dialog .settings-mono, .setup-dialog textarea.settings-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.settings-status-banner { display: flex; align-items: center; gap: 10px; min-width: 0; }
.settings-status-banner:has(> .badge[hidden]) > p:empty { display: none; }
.setup-dialog .settings-status-banner > p { margin: 0; color: var(--muted); font-size: 13px; }
#workspace-settings-editor > dialog.settings-cards > .settings-status-banner { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.saml-actions { justify-content: flex-start; }
.saml-actions .icon { color: var(--muted); }
.saml-actions #workspace-saml-enforce { margin-inline-start: auto; }
#workspace-settings-editor > dialog.settings-cards .settings-section > .saml-actions { margin: 0; padding: 0; border: 0; }
.setup-dialog .saml-binding { margin: 4px 0 0; padding-top: 16px; border-top: 1px solid var(--line); gap: 12px; }
.setup-dialog .saml-binding .desk-field-hint { margin: -6px 0 0; }
.saml-binding .settings-form-actions { justify-content: flex-end; }
/* SCIM group mappings as rows. */
.scim-groups { display: grid; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.scim-groups:has(> .settings-inline-empty) { border: 0; border-radius: 0; }
.setup-dialog .scim-groups > form.scim-group-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0; padding: 12px 16px; border: 0; border-top: 1px solid var(--soft-line); }
.setup-dialog .scim-groups > form.scim-group-row:first-child { border-top: 0; }
.setup-dialog .scim-groups > form.scim-group-row > label { display: flex; flex: 1 1 320px; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; }
.setup-dialog .scim-groups > form.scim-group-row > label > select { width: min(260px, 100%); }
/* Two-factor + Google + deployment headers with an icon tile. */
.totp-heading { display: flex; align-items: flex-start; gap: 12px; }
.totp-icon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--hover); color: var(--muted); }
.google-icon { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.setup-dialog .totp-form { gap: 16px; margin: 0; }
.totp-step { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--inset); }
.totp-step.totp-confirm { padding: 0; border: 0; background: none; max-width: 380px; }
.totp-step .settings-copy-row input { letter-spacing: .08em; font-size: 14px; }
.totp-recovery { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--warning-ink); border-radius: var(--radius-lg); background: var(--warning-soft); }
.totp-recovery h4 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; }
.setup-dialog .totp-recovery p { margin: 0; color: var(--ink); }
.setup-dialog .totp-recovery pre { max-width: 440px; margin: 0; padding: 12px 16px; columns: 2; column-gap: 32px; border-color: var(--line); background: var(--surface); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 2; letter-spacing: .04em; white-space: pre; }
.settings-narrow-form { max-width: 380px; }
.setup-dialog .settings-narrow-form .google-button { justify-self: start; }
.deployment-summary .settings-section-header p { color: var(--ink); font-size: 14px; }

/* ───────────── Inbox settings: undo send, SLA, notifications, conversation fields, routing, workload, team drawer ───────────── */
.setup-dialog .settings-narrow-field { max-width: 360px; }
.settings-input-suffix { display: flex; align-items: center; min-width: 0; max-width: 220px; border: 1px solid var(--control-line); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.settings-input-suffix:hover { border-color: var(--control-line-hover, var(--control-line)); }
.settings-input-suffix:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring, transparent); }
.setup-dialog .settings-input-suffix input, .settings-input-suffix input { flex: 1; min-width: 0; width: auto; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-variant-numeric: tabular-nums; }
.settings-input-suffix input:focus, .settings-input-suffix input:focus-visible { outline: none; box-shadow: none; }
.settings-input-suffix > span { flex: none; padding: 0 12px; color: var(--muted); font-size: 13px; font-weight: 400; }
.setup-dialog .settings-callout { margin: 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--warning-soft); color: var(--warning-ink); font-size: 13px; }
/* SLA policies. */
.sla-policies-table tbody tr[aria-current="true"] { background: var(--selected); }
.sla-clock-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.sla-target-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.setup-dialog .desk-form .sla-target-list > label.sla-target-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--soft-line); font-weight: 400; }
.setup-dialog .desk-form .sla-target-list > label.sla-target-row:first-child { border-top: 0; }
.sla-target-text { display: grid; gap: 2px; min-width: 0; }
.sla-target-text strong { color: var(--ink); font-size: 14px; font-weight: 500; }
.sla-target-text small { color: var(--muted); font-size: 13px; }
.sla-target-row .settings-input-suffix { flex: 0 0 160px; }
/* Notifications: activity × channel matrix. */
.notification-matrix-head { display: flex; justify-content: space-between; padding: 10px 0 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 500; }
.notification-matrix .settings-toggle-row:first-of-type { border-top: 0; }
#notification-settings-dialog .notification-permission .settings-section-header { align-items: center; }
/* Conversation fields: list rendered as a table. */
.setup-dialog .conversation-fields-list { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.setup-dialog .conversation-fields-list li { min-height: 52px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--soft-line); background: var(--surface); }
.setup-dialog .conversation-fields-list li:last-child { border-bottom: 0; }
.setup-dialog .conversation-fields-list li:hover { background: var(--hover); }
.conversation-field-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.conversation-field-main strong { color: var(--ink); font-size: 14px; font-weight: 500; margin-inline-end: 4px; }
.setup-dialog .conversation-field-main small { display: inline; color: var(--quiet); font-size: 12px; }
.conversation-fields-list li[data-archived="true"] strong { color: var(--muted); }
.conversation-fields-list .badge[data-field-type="select"] { background: var(--accent-soft); color: var(--accent); }
.setup-dialog .conversation-fields-list li.conversation-fields-empty { justify-content: center; min-height: 72px; color: var(--muted); font-size: 13px; background: var(--inset); }
.setup-dialog .conversation-field-actions { gap: 8px; }
/* Routing. */
#workspace-settings-editor #inbox-routing-dialog > #routing-configuration-form.settings-section { margin: 0; padding: 20px; border-top: 1px solid var(--line); }
.setup-dialog .routing-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.setup-dialog .routing-fields > :is(.routing-checkbox, p) { grid-column: 1 / -1; }
.setup-dialog .routing-fields > p { margin: 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--inset); color: var(--muted); font-size: 13px; }
/* Workload dashboard: metric cards + tables. */
#inbox-workload-dialog { width: min(1040px, calc(100% - 32px)); }
.workload-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
#inbox-workload-dialog .workload-filters { margin: 0; gap: 12px; }
#inbox-workload-dialog .workload-filters label { gap: 8px; color: var(--muted); font-weight: 500; }
#inbox-workload-dialog .workload-filters select { min-width: 160px; min-height: 32px; font-size: 13px; }
.workload-settings-menu { position: relative; }
.workload-settings-menu > summary { gap: 6px; list-style: none; cursor: pointer; }
.workload-settings-menu > summary::-webkit-details-marker { display: none; }
.workload-settings-menu > summary .icon { color: var(--muted); }
.workload-settings-menu[open] > summary { background: var(--selected); }
.workload-settings-menu > #workload-settings-form { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: 300px; max-width: none; margin: 0; padding: 16px; border: 1px solid var(--dialog-border, var(--line)); border-radius: var(--radius-lg); background: var(--elevated); box-shadow: var(--shadow-pop); }
.workload-settings-menu #workload-settings-form .button.primary { justify-self: end; }
.workload-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.workload-metric { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.workload-metric dt { color: var(--muted); font-size: 13px; font-weight: 500; }
.workload-metric dd { margin: 0; color: var(--ink); font-size: 22px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.workload-metric[data-tone="warn"] dd { color: var(--warning-ink); }
#inbox-workload-dialog .workload-table { margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
#inbox-workload-dialog .workload-table table { font-variant-numeric: tabular-nums; }
#inbox-workload-dialog .workload-table thead th { height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--inset); color: var(--muted); font-size: 12px; font-weight: 500; }
#inbox-workload-dialog .workload-table tbody :is(th, td) { height: 48px; padding: 8px 14px; border-bottom: 1px solid var(--soft-line); }
#inbox-workload-dialog .workload-table tbody tr:last-child > * { border-bottom: 0; }
#inbox-workload-dialog .workload-table tbody tr:hover { background: var(--hover); }
#inbox-workload-dialog .workload-table tbody th { font-weight: 500; text-align: start; }
#inbox-workload-dialog .workload-at-capacity { display: inline-flex; margin-inline-start: 6px; padding: 1px 6px; border-radius: 999px; background: var(--danger-soft); font-size: 11px; font-weight: 500; }
.workload-reason { color: var(--muted); font-size: 12px; }
#workspace-settings-editor > #inbox-workload-dialog[open] { padding: 0; border: 0; background: transparent; }
@media (max-width: 860px) { .workload-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Team inbox drawer: member picker with avatars. */
#inbox-team-dialog .inbox-team-members { gap: 0; padding: 4px 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
#inbox-team-dialog .inbox-team-members legend { float: left; width: 100%; margin-bottom: 6px; padding: 8px 14px 2px; color: var(--ink); font-size: 13px; font-weight: 500; }
#inbox-team-dialog .desk-form .inbox-team-members > label { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-top: 1px solid var(--soft-line); font-size: 14px; font-weight: 400; cursor: pointer; }
#inbox-team-dialog .desk-form .inbox-team-members > label:hover { background: var(--hover); }
#inbox-team-dialog .inbox-team-members > label > input { margin: 0; }
#inbox-team-dialog .inbox-team-members .avatar { --avatar-size: 28px; --avatar-font: 11px; }
#inbox-team-dialog .inbox-team-hint { margin: -6px 0 0; }

/* ───────────── Workspace: owners, create, invite, delete, teammate access ───────────── */
#workspace-owners-dialog { width: min(720px, calc(100% - 32px)); }
.workspace-owners-table table tbody th[scope="row"] { font-size: 14px; font-weight: 500; }
.workspace-owners-table td.settings-row-actions .button + .button { margin-inline-start: 6px; }
.setup-dialog .settings-callout-info { background: var(--accent-soft); color: var(--ink); }
/* Invite (modal). */
#invite-dialog { width: min(560px, calc(100% - 32px)); }
.setup-dialog .invite-intro { margin: 0 0 4px; }
#invite-dialog .settings-form-grid { gap: 14px 16px; }
#invite-dialog .desk-field-hint { margin: -6px 0 0; }
.invite-result { gap: 16px; }
.invite-success { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--success-soft); }
.invite-success strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.setup-dialog .invite-success p { margin: 2px 0 0; color: var(--ink); }
.invite-success .invite-success-icon { flex: none; background: var(--surface); color: var(--success-ink); }
.invite-success .invite-success-icon::before { content: ''; width: 9px; height: 5px; margin-top: -2px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
/* Destructive flows. */
.settings-danger-icon { position: relative; display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--danger-soft); color: var(--danger-ink); }
.settings-danger-icon::before { content: '!'; font-size: 16px; font-weight: 600; line-height: 1; }
#workspace-settings-editor > dialog.settings-cards > .settings-section.settings-danger { border-color: var(--danger-line, var(--danger-ink)); }
.setup-dialog .settings-danger h3 { color: var(--danger-ink); }
.setup-dialog .settings-danger strong { color: var(--ink); }
.setup-dialog .settings-danger .desk-form { margin: 0; }
.setup-dialog .settings-danger .desk-field-hint { margin: -6px 0 0; }
#workspace-settings-editor > dialog.settings-cards .settings-danger .desk-form > .settings-section-footer { margin: 6px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); }
dialog#workspace-removal-dialog:modal { width: min(560px, calc(100% - 32px)); }
.teammate-access-dialog { width: min(560px, calc(100% - 32px)); }
.setup-dialog .teammate-access-person { margin: 0 0 4px; color: var(--ink); font-size: 14px; font-weight: 500; }
.setup-dialog .teammate-access-scope { grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-top: 8px; }
.settings-danger-zone { display: grid; margin-top: 20px; border: 1px solid var(--danger-line, var(--line)); border-radius: var(--radius-lg); overflow: hidden; }
.setup-dialog .settings-danger-zone h3 { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--danger-line, var(--line)); background: var(--danger-soft); color: var(--danger-ink); font-size: 13px; font-weight: 600; }
.settings-danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; }
.settings-danger-row + .settings-danger-row { border-top: 1px solid var(--soft-line); }
.settings-danger-row strong { color: var(--ink); font-size: 14px; font-weight: 500; }
.setup-dialog .settings-danger-row p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.settings-danger-row .button { flex: none; }
.teammate-access-dialog > #teammate-access-error:not([hidden]) { margin: 12px 0 0; }

/* ───────────── Office hours page ───────────── */
#office-hours-view .office-hours-content { max-width: 1180px; }
#office-hours-view #office-hours-form { gap: 16px; padding-bottom: 0; }
#office-hours-view .office-hours-scope { grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); align-items: center; }
#office-hours-view .office-hours-scope > .office-hours-enable { padding: 0 0 0 24px; border-inline-start: 1px solid var(--line); }
#office-hours-view .desk-form .hours-toggle { gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; }
#office-hours-view .office-hours-enable .desk-field-hint { margin: 4px 0 0 42px; }
#office-hours-view .office-hours-card-heading { margin-bottom: 14px; }
#office-hours-view .office-hours-details { gap: 12px 16px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
#office-hours-view .office-hours-day { grid-template-columns: minmax(130px, 1fr) minmax(108px, 136px) 20px minmax(108px, 136px); gap: 8px; min-height: 48px; padding-block: 8px; border-top-color: var(--soft-line); }
#office-hours-view .office-hours-day:not(.office-hours-columns):hover { background: linear-gradient(var(--hover), var(--hover)) padding-box; }
#office-hours-view .office-hours-columns { min-height: 0; padding-block: 0 8px; color: var(--muted); }
#office-hours-view .office-hours-day label { font-size: 14px; font-weight: 500; }
#office-hours-view .office-hours-day input[type="time"] { width: 100%; min-height: 32px; font-variant-numeric: tabular-nums; }
#office-hours-view .office-hours-to { color: var(--quiet); font-size: 12px; text-align: center; }
#office-hours-view .office-hours-day:has(input[type="time"][hidden]) .office-hours-to { display: none; }
#office-hours-view .office-hours-closed { grid-column: span 3; color: var(--quiet); }
#office-hours-view .office-hours-day:has(.settings-switch:not(:checked)) label { color: var(--muted); }
#office-hours-view .office-hours-summary { padding: 12px 14px; border-radius: var(--radius-md); }
#office-hours-view .office-hours-preview { border-color: var(--line); border-radius: var(--radius-md); }
#office-hours-view .office-hours-preview h4 { color: var(--muted); font-size: 12px; font-weight: 500; }
#office-hours-view .office-hours-preview-bubble { border: 0; border-radius: 12px 12px 12px 4px; background: var(--bubble-customer); color: var(--ink); }
/* Sticky save bar at the bottom of the page. */
#office-hours-view .office-hours-actions { position: sticky; z-index: 4; bottom: 0; margin-inline: calc(-1 * var(--desk-space)); padding: 12px var(--desk-space); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(6px); }
@media (max-width: 860px) {
  #office-hours-view .office-hours-scope { grid-template-columns: minmax(0, 1fr); }
  #office-hours-view .office-hours-scope > .office-hours-enable { padding: 12px 0 0; border-inline-start: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  #office-hours-view .office-hours-day { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #office-hours-view .office-hours-to { display: none; }
}
