/* The workspace's Admin settings pages (GitHub issue 203, part 1d, stage 2; docs/adr/0078; the owner's AH7 and AH10;
   public/js/app/settings-workspace.js): one sentence of help with "Learn more" for the rest, a list's add box and its
   items' own controls, and tables as stacked rows on a phone. Sizes are the tokens' (tokens.css); colors the page's own,
   so light and dark both follow them. */

/* One sentence of help under the page's title, the rest behind "Learn more". */
#settingsView .catalog-heading .settings-help-line { margin:0; }
.settings-learn-more { margin:var(--space-75) 0 0; color:var(--muted); 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-size:var(--text-sm); 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:'▾'; font-size:var(--text-xs); transition:transform .15s ease; }
.settings-learn-more[open] > summary::after { transform:rotate(180deg); }
.settings-learn-more > summary:focus-visible { outline:2px solid var(--spruce); outline-offset:2px; border-radius:var(--radius-sm); }
.settings-learn-more-body { max-width:70ch; margin-top:var(--space-75); }
.settings-learn-more-body p { margin:0 0 var(--space-75); }
.settings-learn-more-body p:last-child { margin-bottom:0; }

/* A link to another settings page, inside a page or a dialog ("Required in a state? State rules"). */
.settings-see-also { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50) var(--space-100); margin:var(--space-100) 0 0; color:var(--ink-2); font-size:var(--text-sm); line-height:var(--leading-normal); }
.settings-see-also a, .settings-see-also button.nt-link { color:var(--spruce-dark); font-weight:var(--weight-semibold); }

/* Email: a check box's help under its label (Reply identity), and the email logo's empty place in both themes. */
.email-identity-card .sso-check-option small.field-note { display:block; margin-top:var(--space-25); font-weight:var(--weight-regular); }
.email-logo-box:not(:has(img)) { background:var(--surface-2); }
.email-logo-box:not(:has(img)) span { color:var(--muted); }

/* A list's rows: Edit and Delete as the shared outline buttons, Delete in red. */
.notification-rule-actions { white-space:nowrap; }
.notification-rule-actions .outline-button + .outline-button { margin-left:var(--space-75); }
#settingsView .outline-button.is-danger { color:var(--bad); border-color:color-mix(in srgb, var(--bad) 40%, var(--line)); }

/* Built-in emails: a filter over the long list, a count that keeps to one line, and the dialog's buttons in view. */
.built-in-emails-panel .bie-count { white-space:nowrap; }
.bie-filter { display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--space-100) var(--space-200); margin:0 0 var(--space-200); }
.bie-filter .bie-find { flex:1 1 18rem; min-width:0; }
.bie-filter .bie-find input { width:100%; }
.bie-filter .bie-only { display:flex; flex-direction:column; gap:var(--space-50); color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
.bie-filter-count { flex:1 1 100%; color:var(--muted); font-size:var(--text-sm); }
.bie-filter-count:empty { display:none; }
.built-in-email-group[hidden], .built-in-email-list > li[hidden] { display:none !important; }
.built-in-email-modal .bie-actions { position:sticky; bottom:calc(-1 * var(--space-300)); z-index:1; margin-bottom:calc(-1 * var(--space-150)); padding:var(--space-150) 0; border-top:var(--control-border-width) solid var(--line); background:var(--surface); }

/* A workflow open in the builder: the way back, its name and its switch, under the page's title. */
.wd-builder-head { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-100) var(--space-200); margin:0 0 var(--space-100); }
.wd-builder-head h3 { flex:1 1 auto; min-width:0; margin:0; font-size:var(--text-lg); }

/* A filter box over a long list of check boxes (State rules' fields). */
.settings-list-filter { width:100%; margin:0 0 var(--space-100); }
.settings-list-group-title { margin:var(--space-150) 0 var(--space-50); color:var(--muted); font-size:var(--text-2xs); font-weight:var(--weight-bold); letter-spacing:.04em; text-transform:uppercase; }
.settings-list-group-title:first-child { margin-top:0; }
.settings-list-empty { margin:var(--space-100) 0; color:var(--muted); font-size:var(--text-sm); }

/* Tables become stacked rows on a phone: each cell on its own line, with its column's name. */
@media (max-width:700px) {
  #settingsView .settings-frame-panel table.settings-stack-table, #settingsView .settings-frame-panel table.settings-stack-table tbody,
  #settingsView .settings-frame-panel table.settings-stack-table tr, #settingsView .settings-frame-panel table.settings-stack-table td { display:block; width:100%; }
  #settingsView .settings-frame-panel table.settings-stack-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  #settingsView .settings-frame-panel table.settings-stack-table tr { padding:var(--space-100) 0; border-bottom:var(--control-border-width) solid var(--line); }
  #settingsView .settings-frame-panel table.settings-stack-table td { padding:var(--space-50) 0; border:0; text-align:left; }
  #settingsView .settings-frame-panel table.settings-stack-table td[data-label]:not(:empty)::before { content:attr(data-label); display:block; margin-bottom:var(--space-25); color:var(--muted); font-size:var(--text-2xs); font-weight:var(--weight-bold); letter-spacing:.04em; text-transform:uppercase; }
  #settingsView .settings-frame-panel .backups-table-wrap { overflow-x:visible; }
}

/* Automations: when each kind of rule runs, once above the list (GitHub issue 203, 1e: it was repeated under every
   rule); a rule's row is its name, when, then, runs, its switch and its two actions. */
.automation-when-more { margin:0 0 var(--space-150); }
.automation-when-list { display:grid; gap:var(--space-75); margin:0; }
.automation-when-list dt { color:var(--ink); font-weight:var(--weight-semibold); }
.automation-when-list dd { margin:0 0 var(--space-75); }
.automation-table td.settings-stack-actions { white-space:nowrap; text-align:right; }
.automation-table td.settings-stack-actions .settings-row-action + .settings-row-action { margin-left:var(--space-50); }
.automation-table td, .automation-table th { vertical-align:middle; }
.automation-table td.automation-rule-name { width:100%; }
.automation-table .automation-rule-line { display:block; margin-top:var(--space-25); color:var(--ink-2); font-size:var(--text-sm); line-height:var(--leading-normal); }
.automation-table .automation-rule-line > span { display:inline-block; min-width:2.75rem; color:var(--muted); font-size:var(--text-xs); font-weight:var(--weight-semibold); letter-spacing:.04em; text-transform:uppercase; }
/* Automations and Workflows: one ordered list for each kind of rule, numbered, with a handle to drag a row and Move up
   and Move down (GitHub issue 288; docs/adr/0143). */
.automation-order-hint { margin:0 0 var(--space-100); }
.automation-table tr.automation-group-head th { padding-top:var(--space-150); color:var(--ink); font-size:var(--text-md); font-weight:var(--weight-semibold); text-align:left; }
.automation-table tr.automation-group-head th small, .wd-order-head small { margin-left:var(--space-50); color:var(--muted); font-size:var(--text-xs); font-weight:var(--weight-regular); }
.automation-rule-place { display:inline-flex; align-items:center; gap:var(--space-50); margin-right:var(--space-50); }
.automation-rule-number { color:var(--muted); font-variant-numeric:tabular-nums; }
.automation-table td.settings-stack-actions .automation-move { margin:0 var(--space-75) 0 0; vertical-align:middle; }
.automation-table tr[draggable="true"] .wd-handle, .wd-list li[draggable="true"] .wd-handle { cursor:grab; }
.automation-table tr.is-dragging, .wd-list li.is-dragging { opacity:.45; }
.automation-table tr.is-drop-target td, .wd-list li.is-drop-target { box-shadow:inset 0 3px 0 var(--spruce); }
.wd-order-head { margin:var(--space-150) 0 var(--space-50); font-size:var(--text-md); }
.wd-order-head:first-of-type { margin-top:0; }
.rule-impact-urgency { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50); min-width:0; }
.rule-impact-urgency label { display:grid; flex:1 1 8rem; gap:var(--space-25); min-width:0; margin:0; color:var(--muted); font-size:var(--text-xs); }
.rule-impact-urgency select { min-width:0; }
.rule-impact-urgency small { flex:1 1 100%; }
.rule-stop-field .wf-hint { margin:var(--space-25) 0 0; }
/* Custom states: each list wide enough for its rows (a state, its color, Edit and Delete). */
#customStatesSettingsPanel .custom-states-grid { grid-template-columns:repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
@media (max-width:700px) {
  #settingsView .settings-frame-panel table.settings-stack-table td.automation-rule-name[data-label]:not(:empty)::before,
  #settingsView .settings-frame-panel table.settings-stack-table td.settings-stack-actions[data-label]:not(:empty)::before { content:none; }
  .automation-table td.settings-stack-actions { text-align:left; }
  /* A rule on a phone: its name and lines, then its runs, its switch and its actions on one line. */
  #settingsView .settings-frame-panel table.automation-table.settings-stack-table tr { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50) var(--space-200); }
  #settingsView .settings-frame-panel table.automation-table.settings-stack-table td { width:auto; }
  #settingsView .settings-frame-panel table.automation-table.settings-stack-table td.automation-rule-name { flex:1 1 100%; }
  #settingsView .settings-frame-panel table.automation-table.settings-stack-table td.settings-stack-actions { margin-left:auto; }
  #settingsView .settings-frame-panel table.automation-table.settings-stack-table td[data-label]:not(:empty)::before { display:inline-block; margin:0 var(--space-75) 0 0; }
  /* A list's heading on a phone: the whole line, wrapped (GitHub issue 288). */
  #settingsView .settings-frame-panel table.automation-table.settings-stack-table tr.automation-group-head th { flex:1 1 100%; min-width:0; white-space:normal; overflow-wrap:anywhere; }
}

/* Custom states: the states first, then what they mean, a row a meaning (its name and one line, and the state that has
   it), with what each one does said once under them (GitHub issue 203, 1e). */
#customStatesSettingsPanel .state-meanings { display:grid; grid-template-columns:minmax(0, 1fr); gap:0; }
#settingsView #customStatesSettingsPanel label.state-meaning { display:grid; grid-template-columns:minmax(0, 1fr) minmax(10rem, 15rem); align-items:center; gap:var(--space-100) var(--space-200); padding:var(--space-100) 0; border:0; border-bottom:var(--control-border-width) solid var(--line); border-radius:0; background:none; }
#customStatesSettingsPanel .state-meaning:last-child { border-bottom:0; }
#customStatesSettingsPanel .state-meaning span { gap:var(--space-25); }
#customStatesSettingsPanel .state-meaning small { font-size:var(--text-xs); }
#customStatesSettingsPanel .state-meaning > :is(select, .custom-select-wrapper) { width:100%; }
#customStatesSettingsPanel .state-meaning-more { display:grid; gap:var(--space-50); margin:var(--space-100) 0 0; }
#customStatesSettingsPanel .state-meaning-more dt { color:var(--ink); font-weight:var(--weight-semibold); }
#customStatesSettingsPanel .state-meaning-more dd { margin:0 0 var(--space-75); }
/* A state's own meaning, in the workspace's words (docs/adr/0136): a row after the five, its name and words, and Edit. */
#settingsView #customStatesSettingsPanel .state-meaning-own { display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:center; gap:var(--space-100) var(--space-200); padding:var(--space-100) 0; border:0; border-bottom:var(--control-border-width) solid var(--line); border-radius:0; background:none; }
#customStatesSettingsPanel .state-meaning-own small { overflow-wrap:anywhere; }
/* The New state and Edit state dialog: what it means, and its meaning, with the move the meaning makes said under it. */
.custom-state-modal textarea { display:block; width:100%; min-height:4.5rem; margin-top:var(--space-75); padding:var(--space-150); border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface); color:var(--ink); font:inherit; font-weight:var(--weight-regular, 400); resize:vertical; }
.custom-state-modal .custom-state-optional { color:var(--muted); font-weight:var(--weight-regular, 400); }
.custom-state-modal .wf-hint { margin-top:var(--space-75); }
.custom-state-modal label > .custom-select-wrapper, .custom-state-modal label > select { margin-top:var(--space-75); }
.custom-state-modal .custom-state-meaning-move { padding:var(--space-100) var(--space-150); border-left:3px solid var(--spruce); background:var(--surface-2); color:var(--ink); }
@media (max-width:700px) {
  #settingsView #customStatesSettingsPanel label.state-meaning { grid-template-columns:minmax(0, 1fr); }
}

/* Email: the test right under the mailbox and the sender's name, the link address after it, and each switch one line
   with the rest behind "Learn more" under it, lined up with its words (GitHub issue 203, 1e). The New emails list
   lines up with the card's other fields. */
#emailSettingsPanel .email-test-row { margin:var(--space-150) 0 var(--space-50); }
#emailSettingsPanel .email-test-row + .wf-hint { margin:0 0 var(--space-150); }
#emailSettingsPanel .email-delivery-link { grid-template-columns:minmax(0, 1fr); margin:0 0 var(--space-150); }
#emailSettingsPanel .email-switch-more { margin:calc(-1 * var(--space-100)) 0 var(--space-150) calc(2.25rem + var(--space-150)); }
#emailSettingsPanel .email-new-tickets { margin-left:0; }
#emailSettingsPanel .email-new-tickets + .email-switch-more { margin-left:0; }
#emailSettingsPanel .email-delivery-intro { margin-bottom:0; }

/* SLA policies: the escalation card's header on a phone, one thing under another at the card's width (GitHub issue
   203, 1e: its line was squeezed into a 130 px column beside the count and the button). */
@media (max-width:700px) {
  #slaSettingsPanel .sla-policy-register > .panel-heading { flex-direction:column; align-items:stretch; gap:var(--space-150); }
  #slaSettingsPanel .sla-policy-register > .panel-heading > .sla-policy-actions { justify-content:space-between; }
}

/* State rules: a group's heading spans the list of fields, so its first field sits under it and not beside it; a
   rule's row reads level with its Edit (GitHub issue 203, 1e). */
.state-rule-modal .state-rule-fields > :is(.settings-list-group-title, .settings-list-empty) { grid-column:1 / -1; margin:var(--space-100) 0 0; }
.state-rule-modal .state-rule-fields > .settings-list-group-title:first-child { margin-top:0; }
.state-rules-table td { vertical-align:middle; }

/* Custom fields: what kind of field it is goes under its name, so the table fits its card at desktop width (GitHub
   issue 203, 1e: with a Type column of its own, Edit and Delete were cut off at 1280 px). */
.custom-fields-table td.custom-field-name small.custom-field-kind { color:var(--ink-2); }
.custom-fields-table thead th { white-space:normal; }
.custom-fields-table .custom-field-order button { margin-right:var(--space-25); }

/* Custom fields on a phone: a field's name and what it is, then where it applies and whether it is required on a line
   each, its order and its actions together on the last (it was a card of twelve labelled lines). */
@media (max-width:700px) {
  #settingsView .settings-frame-panel table.custom-fields-table.settings-stack-table:not(.state-rules-table) tr { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50) var(--space-150); }
  #settingsView .settings-frame-panel table.custom-fields-table.settings-stack-table:not(.state-rules-table) td { width:auto; }
  #settingsView .settings-frame-panel table.custom-fields-table.settings-stack-table:not(.state-rules-table) td.custom-field-name { flex:1 1 100%; order:-1; }
  #settingsView .settings-frame-panel table.custom-fields-table.settings-stack-table:not(.state-rules-table) td:not(.custom-field-order, .custom-field-name, .custom-field-actions) { flex:1 1 100%; }
  #settingsView .settings-frame-panel table.custom-fields-table.settings-stack-table:not(.state-rules-table) td[data-label]:not(:empty)::before { display:inline-block; min-width:6.5rem; margin:0 var(--space-75) 0 0; }
  #settingsView .settings-frame-panel table.custom-fields-table.settings-stack-table:not(.state-rules-table) td:is(.custom-field-name, .custom-field-order, .custom-field-actions)[data-label]:not(:empty)::before { content:none; }
  #settingsView .settings-frame-panel table.custom-fields-table.settings-stack-table:not(.state-rules-table) td.custom-field-order { order:1; }
  #settingsView .settings-frame-panel table.custom-fields-table.settings-stack-table:not(.state-rules-table) td.custom-field-actions { order:2; margin-left:auto; }
}

/* Built-in emails: each row says it opens (GitHub issue 203, 1e: a bordered row with no sign of it), with a chevron
   at its end, as a list of pages does. */
.built-in-email-head, .built-in-email-row { grid-template-columns:minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, 1.1fr) 92px var(--space-200); }
.built-in-email-head::after { content:''; }
.built-in-email-row::after { content:'›'; align-self:center; justify-self:end; color:var(--muted); font-size:var(--text-xl); line-height:1; }
.built-in-email-row:hover::after, .built-in-email-row:focus-visible::after { color:var(--spruce-dark); }
@media (max-width:1000px) {
  .built-in-email-row { grid-template-columns:minmax(0, 1fr) auto var(--space-200); }
  .built-in-email-row .bie-when, .built-in-email-row .bie-to { grid-column:1 / 3; }
  .built-in-email-row::after { grid-column:3; grid-row:1 / span 3; }
}

/* Changes: each kind of change's approvers as chips, with a way to take each off, and everyone who could approve it
   behind "Choose approvers", in a list tall enough to read whole names (GitHub issue 203, 1e). */
.change-approver-chips { display:flex; flex-wrap:wrap; gap:var(--space-75); margin:0; padding:0; list-style:none; }
.change-approver-chips li { display:inline-flex; align-items:center; gap:var(--space-50); min-height:var(--control-height-sm); padding:0 var(--space-50) 0 var(--space-150); border:var(--control-border-width) solid var(--line); border-radius:var(--radius-pill); background:var(--surface-2); color:var(--ink); font-size:var(--text-sm); }
.change-approver-chips li.is-stuck { border-color:var(--saffron); background:var(--saffron-pale); color:var(--warn-ink); }
.change-approver-chips li.change-approver-none { padding-right:var(--space-150); border-style:dashed; background:none; color:var(--muted); }
.change-approver-chips button { display:grid; place-items:center; width:var(--space-300); height:var(--space-300); padding:0; border:0; border-radius:var(--radius-round); background:none; color:var(--ink-2); font-size:var(--text-lg); line-height:1; cursor:pointer; }
.change-approver-chips button:hover { background:var(--hover-bg); color:var(--ink); }
.change-approver-add { margin-top:var(--space-100); }
.change-approver-add > summary { color:var(--spruce-dark); font-size:var(--text-sm); font-weight:var(--weight-semibold); cursor:pointer; }
.change-approver-add > input[type="search"] { width:100%; margin:var(--space-100) 0; }
.change-approver-add > div { display:grid; max-height:18rem; overflow-y:auto; border:var(--control-border-width) solid var(--line); border-radius:var(--radius-md); }
.change-approver-add label { display:flex; align-items:center; gap:var(--space-100); padding:var(--space-75) var(--space-150); border-bottom:var(--control-border-width) solid var(--line); cursor:pointer; }
.change-approver-add label:last-child { border-bottom:0; }
.change-approver-add label span { display:flex; flex-direction:column; min-width:0; }
.change-approver-add label small { color:var(--muted); font-size:var(--text-xs); }

/* Import data: its two first fields level with each other (the list of systems sat lower than the name beside it, its
   label stretched to the other's height), and the steps drawn as steps, not tabs (GitHub issue 203, 1e). */
.data-import-grid { align-items:start; }
#settingsView .cmdb-steps li { border:0; border-bottom:var(--space-50) solid var(--line); border-radius:0; background:none; color:var(--muted); }
#settingsView .cmdb-steps li.active { border-bottom-color:var(--spruce); color:var(--ink); font-weight:var(--weight-semibold); }
#settingsView .cmdb-steps li.done { border-bottom-color:var(--spruce-pale); color:var(--ink-2); }
#settingsView .cmdb-steps li.done::before { content:'✓ ' counter(step) '. '; }

/* Admin settings › AI triage rules (GitHub issue 264; docs/adr/0127): one column, the steps in order, and each rule a
   card that unfolds. At a phone's width every part of a rule stacks. Colors are the page's own, in both themes. */
.triage-rules-grid { grid-template-columns:minmax(0, 1fr); max-width:1000px; }
.triage-steps { display:grid; gap:var(--space-150); margin:0; padding-left:var(--space-250); color:var(--ink-2); }
.triage-steps > li > b { display:block; color:var(--ink); font-size:var(--text-md); }
.triage-steps > li > small { color:var(--muted); font-size:var(--text-sm); }
.triage-rule-list { display:grid; gap:var(--space-100); }
.triage-rule { min-width:0; border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface); }
.triage-rule.is-off .triage-rule-title b { color:var(--muted); }
.triage-rule > summary { display:flex; align-items:flex-start; gap:var(--space-100); padding:var(--space-100) var(--space-150); cursor:pointer; list-style:none; }
.triage-rule > summary::-webkit-details-marker { display:none; }
.triage-rule > summary:focus-visible { outline:2px solid var(--spruce); outline-offset:2px; border-radius:var(--radius-md); }
.triage-rule-place { flex:none; display:inline-grid; place-items:center; width:24px; height:24px; border-radius:50%; background:var(--surface-2); color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
.triage-rule-title { display:grid; gap:var(--space-25); min-width:0; }
.triage-rule-title b { color:var(--ink); overflow-wrap:anywhere; }
.triage-rule-title small { color:var(--muted); font-size:var(--text-sm); overflow-wrap:anywhere; }
.triage-rule-body { display:grid; gap:var(--space-150); padding:var(--space-150); border-top:1px solid var(--line); }
.triage-rule-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:var(--space-150); align-items:start; }
.triage-many { display:grid; gap:var(--space-50); max-height:180px; overflow:auto; padding:var(--space-100) var(--space-150); border:1px solid var(--control-border); border-radius:var(--radius-lg); background:var(--surface); font-weight:var(--weight-regular); }
.triage-many .wf-check { margin:0; color:var(--ink); overflow-wrap:anywhere; }
.triage-rule-part { display:grid; gap:var(--space-100); min-width:0; margin:0; padding:var(--space-150); border:1px solid var(--line); border-radius:var(--radius-md); }
.triage-rule-part legend { padding:0 var(--space-50); color:var(--ink-2); font-weight:var(--weight-semibold); }
.triage-rule-part .wf-hint { margin:0; }
.triage-rule-checks { display:flex; flex-wrap:wrap; gap:var(--space-75) var(--space-200); }
.triage-rule-actions { display:flex; flex-wrap:wrap; gap:var(--space-75); }
.triage-rules-panel .ai-field textarea { width:100%; box-sizing:border-box; padding:var(--space-100) var(--space-150); border:1px solid var(--control-border); border-radius:var(--radius-lg); background:var(--surface); color:var(--ink); font:400 var(--text-md) var(--font-ui); }
.triage-rules-panel .ai-field textarea { resize:vertical; min-height:56px; }
.triage-rules-panel .ai-field select:disabled, .triage-rules-panel .ai-field textarea:disabled { color:var(--muted); }
@media (max-width:640px) {
  .triage-rule-grid { grid-template-columns:minmax(0, 1fr); }
  .triage-rule .rule-row-edit { grid-template-columns:minmax(0, 1fr) 26px; }
  .triage-rule .rule-row-edit > :not(button) { grid-column:1; }
  .triage-rule-body, .triage-rule-part { padding:var(--space-100); }
}
/* Try it, and How the rules did (GitHub issue 264, stage 3; docs/adr/0189): a sample's result step by step, a replay's
   tickets one per line with a chip per field, and each rule's kept/changed counts and patterns. Also Team
   performance › AI triage. */
.triage-try-form { display:grid; gap:var(--space-150); min-width:0; }
.triage-try-form .ai-field input, .triage-review-tab .ai-field textarea, .triage-review-tab .ai-field select { width:100%; box-sizing:border-box; }
.triage-review-tab .ai-field textarea { padding:var(--space-100) var(--space-150); border:1px solid var(--control-border); border-radius:var(--radius-lg); background:var(--surface); color:var(--ink); font:400 var(--text-md) var(--font-ui); resize:vertical; }
.triage-try-result { display:grid; gap:var(--space-150); padding:var(--space-150); border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface); }
.triage-try-sets, .triage-try-summary, .triage-patterns { display:grid; gap:var(--space-50); margin:0; padding-left:var(--space-250); color:var(--ink-2); overflow-wrap:anywhere; }
.triage-try-sets small, .triage-try-note { color:var(--muted); font-size:var(--text-sm); }
.triage-try-note { display:block; }
.triage-try-subhead { margin:0; color:var(--ink); font-size:var(--text-md); }
.triage-replay-list, .triage-report-list, .triage-review-list { display:grid; gap:var(--space-100); margin:0; padding:0; list-style:none; }
.triage-replay-list > li, .triage-report-row, .triage-review-item { display:grid; gap:var(--space-75); min-width:0; padding:var(--space-100) var(--space-150); border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface); }
.triage-replay-list small, .triage-review-item small { color:var(--muted); font-size:var(--text-sm); overflow-wrap:anywhere; }
.triage-review-item p { margin:0; color:var(--ink-2); overflow-wrap:anywhere; }
.triage-replay-head, .triage-report-head { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:var(--space-50) var(--space-150); min-width:0; overflow-wrap:anywhere; }
.triage-replay-head { justify-content:flex-start; }
.triage-chips, .triage-report-counts { display:flex; flex-wrap:wrap; gap:var(--space-50); }
.triage-chip { display:inline-flex; flex-wrap:wrap; align-items:baseline; gap:var(--space-50); max-width:100%; padding:var(--space-25) var(--space-100); border-radius:var(--radius-md); border:1px solid var(--line); background:var(--surface-2); color:var(--ink-2); font-size:var(--text-sm); overflow-wrap:anywhere; }
.triage-chip small { color:var(--muted); }
.triage-chip.is-kept { background:var(--good-soft); border-color:var(--good); color:var(--ink); }
.triage-chip.is-changed { background:var(--bad-soft); border-color:var(--bad); color:var(--ink); }
/* Built-in emails on a phone: Original or Changed under the email's name, so the name has the row's width. */
@media (max-width:640px) {
  .built-in-email-row .bie-state { grid-column:1 / 3; grid-row:auto; justify-self:start; }
}
