body {
  --rail-width: 56px;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Global navigation rail: light, 56px, 36px items. */
.rail {
  --rail-padding: calc((var(--rail-width) - 36px) / 2);
  position: relative;
  z-index: 12;
  width: var(--rail-width);
  background: var(--rail);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  padding: 10px var(--rail-padding);
  min-height: 0;
  transition: width 150ms ease, box-shadow 150ms ease;
}
.rail[data-expanded] { width: min(220px, 100vw); box-shadow: var(--shadow-pop); }
.brand { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; height: 36px; border-radius: var(--radius-md); }
.brand .brand-mark { width: 28px; height: 28px; justify-self: center; }
.brand .rail-label { padding-inline-start: 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; min-height: 0; margin-top: 16px; padding-block: 4px; overflow: auto; scrollbar-width: none; }
.rail-nav .nav-link { flex: 0 0 36px; }
.rail-nav .nav-link:focus-visible { outline-offset: -2px; }
.nav-link {
  position: relative;
  width: 100%;
  height: 36px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  padding: 0;
  transition: background-color 120ms ease, color 120ms ease;
}
.rail[data-expanded] .nav-link { column-gap: 8px; }
.rail-label { min-width: 0; justify-self: stretch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; font-size: 14px; visibility: hidden; opacity: 0; transition: opacity 120ms ease; }
.rail[data-expanded] .rail-label { visibility: visible; opacity: 1; }
.nav-link:hover { color: var(--ink); background: var(--rail-hover); }
.nav-link[aria-current] { color: var(--ink); background: var(--rail-selection); border-color: transparent; }
.nav-link[aria-current] .rail-label { font-weight: 500; }
.nav-count { position: absolute; inset-inline-end: -3px; top: -3px; min-width: 18px; height: 18px; padding: 0 4px; background: var(--accent); color: #fff; border: 2px solid var(--rail); border-radius: 999px; font-size: 10px; font-weight: 600; line-height: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.rail[data-expanded] .nav-count { inset-inline-end: 6px; top: 50%; transform: translateY(-50%); }
.rail[data-expanded] .nav-link:has(.nav-count:not([hidden])) .rail-label { padding-inline-end: 30px; }
.rail-bottom { display: grid; gap: 4px; margin-top: auto; }
.account { position: relative; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.account summary { list-style: none; border-radius: var(--radius-md); }
.account .avatar { --avatar-size: 28px; --avatar-font: 11px; }
/* Account menu popover (opens to the right of the rail). */
.account-menu { position: absolute; z-index: 5; bottom: 0; inset-inline-start: calc(var(--rail-width) - var(--rail-padding) + 6px); width: 248px; padding: 6px; background: var(--elevated); color: var(--ink); }
.account-menu strong, .account-menu small { display: block; overflow-wrap: anywhere; }
.account-menu strong { padding: 8px 10px 0; font-size: 14px; font-weight: 600; }
.account-menu small { margin: 2px 0 6px; padding: 0 10px 8px; border-bottom: 1px solid var(--line); color: var(--quiet); font-size: 12px; }
.account-menu small:empty { padding-bottom: 6px; }
.account-menu label { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 8px; margin: 0; padding: 3px 4px 3px 10px; color: var(--ink); font-size: 13px; font-weight: 400; }
.desk-ui .account-menu label select { --desk-field-height: 28px; --desk-field-font-size: 12px; --desk-field-padding: 3px 8px; width: 100%; }
.account-menu label:has(+ .button) { margin-bottom: 6px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.account-menu button { width: 100%; }
.account-menu .button { justify-content: flex-start; min-height: 32px; padding-inline: 10px; border-color: transparent; border-radius: var(--radius-sm); background: transparent; font-weight: 400; }
.account-menu .button:hover { background: var(--hover); border-color: transparent; }
.account-menu #sign-out { margin-top: 6px; }
.account-menu #sign-out::before { content: ''; position: absolute; inset: -4px -6px auto; height: 1px; background: var(--line); }
.account-menu #sign-out { position: relative; }
#account-google-connected { margin: 0; padding: 6px 10px; border: 0; }
@media (prefers-reduced-motion: reduce) { .rail, .rail-label, .nav-link { transition: none; } }

.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
/* Workspace header: 48px, title 14px/600, ghost/secondary small actions on the right. */
.workspace-header {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--line);
}
.workspace-location { display: flex; align-items: center; gap: 8px; min-width: 0; }
.workspace-name { color: var(--ink); font-size: 13px; font-weight: 500; }
.developer-workspace-label { padding: 2px 8px; border-radius: 999px; background: var(--warning-soft); color: var(--warning-ink); font-size: 12px; font-weight: 500; white-space: nowrap; }
.workspace-switch { position: relative; max-width: min(240px, 28vw); }
.workspace-switch summary { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px 4px 4px; border-radius: var(--radius-md); list-style: none; background: transparent; }
.workspace-switch summary:hover, .workspace-switch[open] summary { background: var(--hover); }
.workspace-switch summary::-webkit-details-marker, .account summary::-webkit-details-marker { display: none; }
.workspace-switch .workspace-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.down-caret { width: 6px; height: 6px; flex: 0 0 6px; margin: -3px 1px 0; border-bottom: 1.5px solid var(--quiet); border-right: 1.5px solid var(--quiet); transform: rotate(45deg); }
/* Workspace switcher popover. */
.workspace-menu { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; width: 264px; padding: 6px; background: var(--elevated); }
#workspace-options { max-height: 45dvh; overflow: auto; }
#workspace-options::before { content: 'Workspaces' / ''; display: block; padding: 6px 10px 4px; color: var(--quiet); font-size: 12px; font-weight: 500; }
.workspace-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); text-align: left; font-size: 13px; }
.workspace-option:hover { background: var(--hover); }
.workspace-option[aria-current="true"] { background: var(--selected); font-weight: 500; }
.workspace-option span { min-width: 0; overflow-wrap: anywhere; }
.workspace-option small { color: var(--quiet); font-size: 12px; font-weight: 400; }
.workspace-menu .button { justify-content: flex-start; width: 100%; min-height: 32px; padding-inline: 10px; border-color: transparent; border-radius: var(--radius-sm); background: transparent; font-weight: 400; }
.workspace-menu .button:hover { border-color: transparent; background: var(--hover); }
#new-workspace { width: 100%; margin-top: 6px; position: relative; }
#new-workspace::before { content: ''; position: absolute; inset: -4px -6px auto; height: 1px; background: var(--line); }
.path-divider { color: var(--quiet); font-size: 15px; }
.workspace-header h1 { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-button { min-height: 32px; font-size: 13px; }
.header-button .i-external { color: var(--quiet); margin-left: 1px; }
/* Quick actions trigger looks like a compact search field with a shortcut chip. */
.actions-trigger { min-width: 200px; justify-content: flex-start; color: var(--quiet); background: var(--surface); gap: 8px; font-weight: 400; }
.actions-trigger > span:not(.icon) { margin-inline-end: auto; }
.actions-trigger:hover { color: var(--muted); }
.actions-trigger kbd, .actions-footer kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--inset); color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1; white-space: nowrap; }
.connection { display: inline-flex; align-items: center; gap: 6px; padding-inline: 4px; white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--quiet); }
.connection > :first-child { width: 7px; height: 7px; background: var(--warning-ink); border-radius: 50%; box-shadow: 0 0 0 3px var(--warning-soft); }
.connection[data-state="live"] { color: var(--muted); }
.connection[data-state="live"] > :first-child { background: var(--success-ink); box-shadow: 0 0 0 3px var(--success-soft); }

.inbox-grid {
  --queue-width: 170px;
  --default-list-width: 298px;
  --default-details-width: 250px;
  --min-list-width: 195px;
  --max-list-width: 620px;
  --min-thread-width: 250px;
  --min-details-width: 210px;
  --max-details-width: 640px;
  --reserved-details: var(--min-details-width);
  --list-width: clamp(var(--min-list-width), var(--preferred-list-width, var(--default-list-width)),
    min(var(--max-list-width), calc(100% - var(--queue-width) - var(--min-thread-width) - var(--reserved-details))));
  --details-space: calc(100% - var(--queue-width) - var(--list-width) - var(--min-thread-width));
  --details-column: clamp(var(--min-details-width), var(--preferred-details-width, var(--default-details-width)),
    min(var(--max-details-width), var(--details-space)));
  display: grid;
  grid-template-columns: var(--queue-width) var(--list-width) minmax(0, 1fr) var(--details-column);
  flex: 1;
  min-height: 0;
  position: relative;
}
.inbox-grid:has(.details-panel[hidden]) { --reserved-details: 0px; --details-column: 0px; }
.inbox-grid[data-inbox-layout="table"] { --default-list-width: 515px; }
.pane-resizer { position: absolute; z-index: 2; top: 0; bottom: 0; width: 11px; cursor: col-resize; touch-action: none; transform: translateX(-50%); }
.pane-resizer[data-resize-pane="list"] { left: calc(var(--queue-width) + var(--list-width)); }
.pane-resizer[data-resize-pane="details"] { right: var(--details-column); transform: translateX(50%); }
.inbox-grid:has(.details-panel[hidden]) .pane-resizer[data-resize-pane="details"] { display: none; }
.pane-resizer::after { content: ''; position: absolute; inset: 0 auto; left: calc(50% - 1px); width: 2px; }
.pane-resizer:is(:hover, :focus-visible, [data-dragging])::after { background: var(--accent); }
.pane-resizer:focus-visible { outline-offset: -2px; }
.inbox-grid[data-resizing] { cursor: col-resize; user-select: none; }
.inbox-grid[data-resizing] * { cursor: inherit; }
.queue-panel { background: var(--page); border-right: 1px solid var(--line); padding: 18px 9px; min-width: 0; overflow: auto; }
.queue-panel h2 { padding-left: 9px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.queue-list { display: grid; gap: 3px; }
.queue-link { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 36px; padding: 0 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
.queue-link:hover { background: var(--hover); }
.queue-link[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.queue-link .icon { color: var(--quiet); }
.queue-link[aria-pressed="true"] .icon { color: var(--accent); }
.queue-count { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--quiet); font-variant-numeric: tabular-nums; }
.queue-link[aria-pressed="true"] .queue-count { color: var(--accent); }
.at-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: 0 0 auto; color: var(--quiet); font-size: 14px; }
.queue-link[aria-pressed="true"] .at-icon { color: var(--accent); }
.team-queues { margin-top: 15px; padding-top: 11px; border-top: 1px solid var(--line); }
.team-queues h3 { margin: 0 0 6px 7px; color: var(--quiet); font-size: 11px; font-weight: 500; }
.teammate-queue .avatar { --avatar-size: 19px; --avatar-font: 8px; }
.teammate-queue > :nth-child(2) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conversation-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; min-height: 0; background: var(--surface); }
.list-controls { border-bottom: 1px solid var(--line); padding: 13px 13px 9px; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 10px; }
.list-heading h2, .details-header h2 { font-size: 15px; letter-spacing: -.02em; font-weight: 600; }
.list-heading-tools { display: flex; gap: 4px; }
#inbox-layout-toggle { width: 32px; min-height: 30px; }
#inbox-layout-toggle[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.inbox-table-icon { position: relative; width: 14px; height: 12px; border: 1px solid currentColor; border-radius: 2px; }
.inbox-table-icon::before, .inbox-table-icon::after { content: ""; position: absolute; }
.inbox-table-icon::before { top: 3px; left: 0; right: 0; border-top: 1px solid currentColor; }
.inbox-table-icon::after { top: 3px; left: 4px; bottom: 0; border-left: 1px solid currentColor; }
.sort-menu { position: relative; }
.sort-menu summary { list-style: none; min-height: 28px; width: 28px; border-color: transparent; color: var(--muted); }
.sort-menu summary::-webkit-details-marker { display: none; }
.sort-menu[open] summary, .sort-menu[data-sorted] summary { color: var(--accent); background: var(--accent-soft); }
.sort-popover { position: absolute; z-index: 3; right: 0; top: calc(100% + 6px); padding: 6px; width: 184px; background: var(--elevated); }
.sort-popover button { display: block; width: 100%; min-height: 32px; padding: 6px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); text-align: left; font-size: 13px; }
.sort-popover button:hover { background: var(--hover); }
.sort-popover button[aria-pressed="true"] { background: var(--selected); font-weight: 500; }
.snooze-popover { width: 240px; }
.snooze-popover form { margin-block: 5px; padding: 7px; border-block: 1px solid var(--line); }
.snooze-popover label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.snooze-popover form button { margin-top: 4px; }
.snooze-popover input, .inbox-bulk-actions input[type="datetime-local"] {
  width: 100%;
}
.conversation-history summary { color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 500; }
.conversation-history ol { display: grid; gap: 9px; margin: 10px 0 0; padding-left: 16px; font-size: 12px; }
.conversation-history li time { display: block; margin-top: 2px; color: var(--quiet); font-size: 11px; }
.message-reply-action { padding: 0 4px; border: 0; background: none; color: var(--muted); font: inherit; }
.message-reply-action:hover { color: var(--accent); text-decoration: underline; }
.note-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.note-reactions button { display: inline-flex; gap: 3px; align-items: center; min-height: 24px; padding: 1px 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 11px; }
.note-reactions button[aria-pressed="true"], .note-reactions button:hover { background: var(--accent-soft); border-color: var(--accent-line); }
.message-quote, .reply-quote blockquote { display: grid; gap: 3px; padding: 6px 8px; border-inline-start: 2px solid var(--accent-line); color: var(--muted); font-size: 12px; }
.message-quote { margin: 0 0 6px; background: var(--surface); border-radius: 4px; white-space: pre-wrap; }
.reply-quote { display: flex; align-items: start; justify-content: space-between; gap: 7px; margin-block: 4px; padding: 2px 4px; background: var(--page); border-radius: 5px; }
.reply-quote blockquote { flex: 1; min-width: 0; margin: 0; }
.reply-quote blockquote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-field { display: flex; align-items: center; gap: 6px; padding: 0 7px; color: var(--quiet); }
kbd { font: inherit; }
.search-field kbd { flex-shrink: 0; min-width: 19px; text-align: center; padding: 1px 4px 2px; border: 1px solid var(--control-line); border-radius: 4px; background: var(--surface); font-size: 11px; }
.inbox-filters { margin-top: 7px; }
.inbox-filters summary { color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.pinned-inboxes { margin-top: 0; margin-bottom: 9px; }
.pin-mark { min-width: 13px; color: var(--accent); text-align: center; }
#inbox-preferences { margin-block: 10px; padding: 6px; }
#inbox-preferences fieldset { margin: 7px 0 0; padding: 6px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; }
#inbox-preferences legend { font-size: 11px; color: var(--muted); }
#inbox-preferences label { display: flex; align-items: start; gap: 4px; margin-block: 5px; font-size: 11px; }
#inbox-preferences input { flex: 0 0 auto; accent-color: var(--accent); }
#open-messenger-reply-window { max-width: 100%; margin-top: 6px; white-space: normal; }
#messenger-reply-window-form { margin-block: 14px; }
.inbox-team-members { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.inbox-team-members legend { padding-inline: 4px; color: var(--muted); font-size: 12px; }
.inbox-team-members label { display: flex; gap: 6px; }
.inbox-team-members input[type="checkbox"] { width: auto; accent-color: var(--accent); }
#inbox-team-form { margin-top: 13px; }
#inbox-teams-results { margin-bottom: 16px; }
#notification-settings-form fieldset { min-width: 0; margin: 0; }
#notification-settings-form label { display: flex; align-items: center; gap: 8px; }
#notification-settings-form input[type="checkbox"] { flex: none; margin: 0; }
.thread-details .claim-button { margin-top: 5px; }
.inbox-search-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-block: 8px 3px; }
.inbox-search-filters label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.inbox-search-filters :is(input, select) { width: 100%; }
.inbox-search-filters .button { justify-self: start; align-self: end; min-height: 28px; }
.inbox-column-options, .inbox-bulk-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-block: 9px 4px; }
.inbox-column-options { gap: 5px 13px; }
.inbox-column-options label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.inbox-column-options input, .inbox-table input { accent-color: var(--accent); }
.inbox-bulk-actions { padding: 7px; border-radius: 7px; background: var(--inset); }
.inbox-bulk-actions label { display: grid; gap: 4px; font-size: 11px; color: var(--muted); }
.inbox-bulk-actions .inbox-notes-option { display: inline-flex; align-self: center; align-items: center; }
.inbox-bulk-actions select { max-width: min(160px, 100%); }
.inbox-bulk-actions .button { min-height: 28px; padding-inline: 8px; font-size: 12px; }
#inbox-bulk-selection { align-self: center; font-size: 12px; font-weight: 500; }
.inbox-table { width: 100%; border-spacing: 0; border-collapse: separate; text-align: left; font-size: 12px; }
.inbox-table :is(th, td) { padding: 7px 9px; white-space: nowrap; border-bottom: 1px solid var(--soft-line); }
.inbox-table thead th { position: sticky; top: 0; z-index: 1; background: var(--page); color: var(--muted); font-weight: 600; }
.inbox-table tr[data-current="true"] td { background: var(--accent-soft); }
.inbox-table tr:hover td { background: var(--hover); }
.inbox-table .inbox-subject { width: 100%; min-width: 145px; }
.inbox-table .inbox-subject button { display: grid; gap: 3px; width: 100%; padding: 0; background: none; border: 0; color: var(--ink); text-align: left; font: inherit; }
.inbox-table .inbox-subject span { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
/* Segmented filter chips (Open / Waiting / Closed): 28px pills, active = --selected. */
.tabs { display: flex; gap: 4px; margin-top: 10px; }
.tabs button { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.tabs button:hover { background: var(--hover); color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--selected); }
.tabs span { font-size: 12px; font-weight: 400; color: var(--quiet); font-variant-numeric: tabular-nums; }
.tabs button[aria-selected="true"] span { color: var(--muted); }
.tabs span:empty { display: none; }
.conversation-rows { flex: 1; min-height: 0; overflow: auto; }
.conversation-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 10px 12px 10px 10px;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  border-left: 3px solid transparent;
  background: var(--surface);
  text-align: left;
}
.conversation-row:hover { background: var(--hover); }
.conversation-row[aria-current="true"] { background: var(--accent-soft); border-left-color: var(--accent); }
.conversation-row:focus-visible { outline-offset: -3px; }
.conversation-row .avatar { --avatar-size: 32px; --avatar-font: 10px; margin-top: 1px; }
.row-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.row-top time { white-space: nowrap; flex: 0 0 auto; font-size: 10px; color: var(--quiet); }
.viewer-presence { display: inline-flex; flex-shrink: 0; align-items: center; gap: 2px; vertical-align: middle; white-space: nowrap; }
.viewer-presence > span { display: inline-grid; align-content: center; justify-items: center; min-width: 19px; height: 19px;
  padding: 0 2px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 600; }
.inbox-subject:has(.viewer-presence) { position: relative; padding-inline-end: 84px; }
.inbox-subject > .viewer-presence { position: absolute; right: 8px; top: 7px; }
#thread-presence:empty { display: none; }
.row-name, .row-subject, .row-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-name { font-size: 13px; font-weight: 500; }
.conversation-row:has(.row-unread) .row-name { font-weight: 600; }
.row-subject { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-weight: 500; font-size: 12px; color: var(--muted); }
.row-subject span { overflow: hidden; text-overflow: ellipsis; }
.row-unread { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.inbox-subject .row-unread { display: inline-block; }
.row-mention { color: var(--accent); font-weight: 600; }
.row-priority { flex: 0 0 auto; padding: 1px 4px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 10px; }
.row-preview { color: var(--quiet); font-size: 11px; margin-top: 3px; }
.list-empty { color: var(--muted); text-align: center; padding: 32px 12px; font-size: 13px; line-height: 1.5; }
/* A list/table container that only holds the "nothing here" line gets an icon well instead of bare gray text. */
:is(.contacts-results, .conversation-rows, .saved-library-list, .desk-table-wrap) > .list-empty:only-child:not([role="alert"]) { position: relative; display: grid; justify-items: center; gap: 12px; padding: 56px 24px; }
:is(.contacts-results, .conversation-rows, .saved-library-list, .desk-table-wrap) > .list-empty:only-child:not([role="alert"])::before { content: ''; width: 40px; height: 40px; border-radius: 50%; background: var(--hover); }
:is(.contacts-results, .conversation-rows, .saved-library-list, .desk-table-wrap) > .list-empty:only-child:not([role="alert"])::after { content: ''; position: absolute; top: 67px; left: calc(50% - 9px); width: 18px; height: 18px; background: var(--quiet); mask: url('/icons.png') -90px 0 / 324px 18px no-repeat; }

.thread-panel, .thread-content { display: flex; flex-direction: column; min-height: 0; min-width: 0; flex: 1; background: var(--surface); }
.thread-header { min-height: 62px; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.thread-header > .avatar { --avatar-size: 33px; --avatar-font: 11px; }
.thread-title { min-width: 0; flex: 1; }
.thread-title h2 { font-size: 15px; font-weight: 600; letter-spacing: -.014em; }
.thread-title p { color: var(--muted); font-size: 11px; margin-top: 3px; }
.thread-title h2, .thread-title p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-actions { display: flex; align-items: center; gap: 5px; }
.thread-actions .button { min-height: 32px; }
.thread-actions .icon-button { width: 32px; }
.thread-tool { color: var(--muted); }
.thread-tool:is([aria-expanded="true"], [aria-pressed="true"]) { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.resolve-button { color: var(--ink); padding-inline: 8px; gap: 3px; font-size: 12px; }
.timeline { flex: 1; min-height: 0; overflow: auto; padding: 22px 22px 14px; overscroll-behavior: contain; }
.day-divider { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 17px; color: var(--quiet); font-size: 11px; font-weight: 500; text-align: center; }
.day-divider::after, .day-divider::before { content: ''; width: 28px; height: 1px; background: var(--line); }
.message { display: flex; align-items: flex-end; gap: 7px; margin-bottom: 17px; }
.message:last-child { margin-bottom: 0; }
.message.agent { flex-direction: row-reverse; }
.message .avatar { --avatar-size: 24px; --avatar-font: 9px; margin-bottom: 3px; }
.message-content { max-width: min(84%, 480px); min-width: 0; }
.message-byline { display: flex; align-items: baseline; gap: 7px; font-size: 10px; color: var(--quiet); padding: 0 1px; margin-top: 4px; }
.message.agent .message-byline { justify-content: flex-end; }
.message-byline strong { color: var(--muted); font-weight: 600; }
.message-body { padding: 9px 12px; max-width: 100%; border-radius: 9px 9px 9px 3px; background: var(--hover); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.agent .message-body { border-radius: 9px 9px 3px 9px; background: var(--accent-soft); }
.note .message-body { background: var(--note-background); }
.note-label { display: block; margin-bottom: 3px; color: var(--note-ink); font-size: 11px; }
.note-mention { color: var(--note-mention); background: var(--note-highlight); border-radius: 4px; padding: 1px 3px; font-weight: 600; }
.reply-area { padding: 0 16px 15px; }
.composer { position: relative; background: var(--surface); border: 1px solid var(--control-line); border-radius: 10px; box-shadow: 0 2px 7px #19243c0c; padding: 0 9px 8px; }
.composer:focus-within { border-color: var(--focus); }
.composer-header { display: flex; align-items: center; gap: 5px; padding: 6px 0; border-bottom: 1px solid var(--soft-line); }
.compose-mode { padding: 4px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.compose-mode:hover { background: var(--hover); }
.compose-mode[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.composer[data-compose-mode="note"] { border-color: var(--note-line); background: var(--note-composer); }
.composer[data-compose-mode="note"] .compose-mode[aria-pressed="true"] { color: var(--note-ink); background: var(--note-highlight); }
.composer textarea { display: block; width: 100%; min-height: 54px; max-height: 26vh; padding: 7px 3px 5px; border: 0; background: transparent; resize: vertical; outline: none; font-size: 13px; line-height: 1.5; }
.reply-articles { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; max-height: min(180px, 25vh); overflow: auto; }
.reply-article { display: flex; align-items: center; gap: 5px; max-width: 100%; }
.reply-article .article-card { width: auto; }
.reply-article .icon-button { flex-shrink: 0; color: var(--quiet); }
.message-content > .article-card { width: min(340px, 100%); }
.message-content > * + .article-card { margin-top: 5px; }
.mention-options { position: absolute; z-index: 3; left: 8px; bottom: calc(100% + 5px); width: min(280px, calc(100% - 16px)); max-height: 45dvh; overflow: auto; padding: 5px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--surface); box-shadow: 0 7px 18px var(--shadow); }
.mention-options button { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; padding: 5px; border: 0; border-radius: 5px; background: var(--surface); font-size: 12px; text-align: left; }
.mention-options button:hover, .mention-options button[aria-selected="true"] { background: var(--accent-soft); }
.mention-options .avatar { --avatar-size: 25px; --avatar-font: 9px; }
.mention-options button > :last-child { margin-left: auto; color: var(--quiet); font-size: 11px; overflow-wrap: anywhere; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 5px; }
.composer-pins { display: contents; }
.composer-more .sort-popover { inset: auto auto calc(100% + 5px) 0; width: 190px; }
.inbox-grid[data-inbox-layout="table"] .composer-footer { flex-wrap: wrap; }
.inbox-grid[data-inbox-layout="table"] .composer-hint { display: none; }
.composer-footer .button { min-height: 31px; font-size: 12px; gap: 5px; }
.saved-reply-symbol { display: inline-grid; place-items: center; width: 18px; height: 18px; font-size: 18px; font-weight: 500; line-height: 1; }
.composer-footer .saved-picker-trigger { gap: 3px; min-height: 29px; margin-right: auto; padding: 0 5px; border-color: transparent; color: var(--muted); font-size: 11px; }
.saved-picker-trigger:hover { color: var(--accent); }
.composer-hint { color: var(--quiet); font-size: 10px; padding-left: 3px; }
.composer-hint kbd { font-weight: 500; }
.composer-hint > span { color: var(--quiet); margin: 0 3px; }
/* Empty state: centered, 40px icon well (drawn behind a leading .empty-icon), 15px/600 title. */
.empty-state { position: relative; isolation: isolate; display: grid; justify-items: center; align-content: center; gap: 6px; max-width: 420px; margin: auto; padding: 40px 24px; text-align: center; }
.empty-state > .empty-icon { margin: 11px 0 19px; color: var(--muted); }
.empty-state:has(> .empty-icon:first-child)::before { content: ''; position: absolute; z-index: -1; top: 40px; left: calc(50% - 20px); width: 40px; height: 40px; border-radius: 50%; background: var(--hover); }
.empty-state :is(h2, h3) { margin: 0; font-size: 15px; font-weight: 600; }
.empty-state p { max-width: 360px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.empty-icon { color: var(--muted); }

.details-panel { min-width: 0; min-height: 0; overflow: auto; border-left: 1px solid var(--line); background: var(--inset); }
.details-header { position: sticky; top: 0; z-index: 1; min-height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: inherit; border-bottom: 1px solid var(--line); }
.details-header .button { width: 32px; min-height: 32px; }
.contact-card, .thread-details { padding: 15px; }
.contact-card + .contact-card { border-top: 1px solid var(--line); }
.thread-details { border-bottom: 1px solid var(--line); }
.conversation-tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.conversation-tag-list:not(:empty) { margin-bottom: 8px; }
.conversation-tag { min-height: 27px; max-width: 100%; overflow-wrap: anywhere; font-size: 11px; }
.message-tags { margin-top: 3px; font-size: 11px; }
.message-tags summary { color: var(--muted); cursor: pointer; }
.message-tags > label { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.message-tags > label select { max-width: 100%; }
.desk-form .hours-toggle { display: flex; align-items: center; gap: 8px; }
.sla-targets { display: grid; gap: 6px; list-style: none; padding: 0; margin: 10px 0 0; font-size: 11px; }
.sla-targets li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 8px; }
.sla-targets [data-sla-status="breached"] { color: var(--danger-ink); }
.report-sla-targets { margin: 4px 0 0; padding: 0 0 0 15px; }
.report-sla-targets li + li { margin-top: 6px; }
.saved-inbox-folder > summary { padding: 6px 4px; color: var(--muted); cursor: pointer; overflow-wrap: anywhere; }
.saved-inbox-folder > .saved-inbox-view { margin-inline-start: 8px; }
.saved-inbox-view { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px; align-items: center; }
.saved-inbox-view .queue-link { width: 100%; }
.saved-inbox-view .button { min-height: 24px; padding-inline: 5px; font-size: 10px; }
#new-inbox-view { margin-top: 5px; }
.i-settings { mask: none; background: none; }
.i-settings::before { content: '⚙︎'; display: block; text-align: center; font: 21px/18px system-ui; }
#open-workspace-settings { margin-top: 4px; }
/* Settings shell: sub-nav (search + sections) on --subnav, content column with breadcrumb + page header. */
.settings-view { flex: 1; min-height: 0; display: grid; grid-template-columns: clamp(180px, 19vw, 232px) minmax(0, 1fr); overflow: auto; background: var(--page); }
.settings-navigation { min-width: 0; display: grid; align-content: start; gap: 2px; padding: 12px 8px; border-right: 1px solid var(--line); background: var(--subnav); overflow: auto; }
.settings-navigation a { position: relative; display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius-md); font-size: 14px; font-weight: 400; color: var(--ink); }
.settings-navigation a .icon { color: var(--muted); }
.settings-navigation a > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-navigation a:hover { background: var(--hover); color: var(--ink); }
.settings-navigation a[aria-current] { background: var(--selected); color: var(--ink); font-weight: 500; }
.settings-navigation a[aria-current] .icon { color: var(--ink); }
.settings-navigation a:focus-visible { outline-offset: -2px; }
/* "Overview" sits above the category list, separated like a group. */
.settings-navigation a:first-child { margin-bottom: 13px; }
.settings-navigation a:first-child::after { content: ''; position: absolute; inset: auto 8px -7px; height: 1px; background: var(--line); }
.settings-navigation a:nth-child(2)::before { content: 'Categories' / ''; position: absolute; inset: -24px 0 auto 8px; color: var(--quiet); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.settings-navigation a:nth-child(2) { margin-top: 22px; }
.settings-content { width: 100%; min-width: 0; min-height: 0; overflow: auto; padding: 24px 32px 40px; }
.settings-content > * { max-width: 1040px; margin-inline: auto; }
.settings-heading h2 { font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.settings-heading h2:focus { outline: none; }
.settings-heading p { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.5; }
#workspace-settings-search-form { margin-block: 0 12px; }
.settings-search { min-height: 32px; padding-inline: 8px; gap: 6px; background: var(--surface); }
.settings-search input { font-size: 13px; }
.settings-search-status { margin-bottom: 12px; font-size: 13px; color: var(--muted); }
/* Overview cards: icon well + 14px/600 title + 13px muted description. */
.settings-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.settings-card, .settings-list { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.settings-card, .settings-row { display: grid; align-items: center; min-width: 0; text-align: start; }
.settings-card { grid-template-columns: 36px minmax(0, 1fr); align-items: start; align-content: start; gap: 12px; min-height: 84px; padding: 16px; transition: border-color 120ms ease, box-shadow 120ms ease; }
.settings-card:hover { border-color: var(--control-line); box-shadow: var(--shadow-sm); }
.settings-card-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius-md); background: var(--hover); color: var(--muted); }
.settings-card strong, .settings-row strong { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
.settings-card small, .settings-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.settings-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px; border: 0; background: transparent; color: var(--muted); font: inherit; }
.settings-row + .settings-row { border-top: 1px solid var(--soft-line); }
.settings-row:first-child { border-start-start-radius: 11px; border-start-end-radius: 11px; }
.settings-row:last-child { border-end-start-radius: 11px; border-end-end-radius: 11px; }
a.settings-row:hover { background: var(--hover); }
.settings-row select { width: auto; min-width: 140px; }
.settings-card > .i-right, .settings-row > .i-right { color: var(--quiet); }
#settings-preferences { margin-bottom: 16px; }
#workspace-settings-results { display: grid; gap: 24px; }
#workspace-settings-results h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--ink); }
@media (max-width: 890px) { .settings-overview { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .settings-view { display: block; }
  .settings-navigation { display: flex; overflow-x: auto; padding: 7px; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-navigation a { flex: none; padding-inline: 8px; }
  .settings-navigation a:is(:first-child, :nth-child(2)) { margin: 0; }
  .settings-navigation a:is(:first-child, :nth-child(2))::after, .settings-navigation a:nth-child(2)::before { display: none; }
  .settings-content { overflow: visible; }
  .settings-card, .settings-row { padding: 11px; }
}
.contact-card > h3, .thread-details > h3 { margin: 0 0 15px; font-size: 12px; }
.contact-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 10px; }
.contact-section-heading h3 { margin: 0; font-size: 12px; }
.contact-edit-button { min-height: 26px; padding: 0 7px; font-size: 11px; }
.contact-summary { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 15px; }
.contact-summary .avatar { --avatar-size: 36px; --avatar-font: 12px; }
.contact-summary div { min-width: 0; }
.contact-summary strong { font-size: 13px; overflow-wrap: anywhere; }
.contact-summary p { color: var(--muted); font-size: 11px; margin-top: 3px; overflow-wrap: anywhere; }
.contact-fields { display: grid; gap: 13px; margin: 0; }
.contact-fields dt, .detail-label { color: var(--quiet); font-size: 11px; font-weight: 500; }
.contact-fields dd { display: flex; gap: 3px; align-items: center; margin: 5px 0 0; color: var(--muted); font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
.contact-fields dd a { color: var(--accent); overflow-wrap: anywhere; }
.contact-fields dd a:hover { text-decoration: underline; }
.copy-email { color: var(--quiet); display: grid; place-items: center; width: 25px; height: 24px; margin-left: auto; border: 0; padding: 0; border-radius: 5px; background: transparent; }
.copy-email:hover { color: var(--accent); background: var(--accent-soft); }
.contact-more { margin-top: 13px; font-size: 12px; }
.contact-more summary { color: var(--accent); font-weight: 500; }
.contact-field-group { padding-top: 13px; }
.contact-field-group + .contact-field-group { margin-top: 12px; border-top: 1px solid var(--line); }
.contact-field-group h4 { margin: 0 0 9px; font-size: 11px; }
.contact-empty { color: var(--quiet); font-size: 12px; }
.contact-notes { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.contact-notes li { padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.contact-notes strong { display: block; font-size: 11px; }
.contact-notes time { color: var(--quiet); font-size: 10px; }
.contact-notes p { margin: 4px 0 0; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 5px; align-items: center; margin-bottom: 10px; }
.detail-row:last-child { margin-bottom: 0; }
.detail-row select { width: 100%; text-overflow: ellipsis; }
.channel { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 5px; padding-left: 4px; }
.channel .icon { color: var(--accent); }
.mobile-back { display: none; }

.contacts-view { flex: 1; min-height: 0; overflow: auto; background: var(--page); padding: 27px; }
.contacts-controls, .contacts-results { width: min(100%, 980px); }
.contacts-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.contacts-controls h2 { font-size: 16px; }
.contacts-controls .search-field { width: 240px; background: var(--surface); }
.contact-directory-tools { flex-wrap: wrap; }
.contact-directory-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
/* Table base (shared by every .contacts-results list: contacts, companies, events, team, KB…). */
.contacts-results { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.contacts-results table { border-collapse: collapse; width: 100%; font-size: 13px; text-align: left; }
.contacts-results th, .contacts-results td { padding: 10px 16px; border-bottom: 1px solid var(--soft-line); }
.contacts-results th { color: var(--muted); font-weight: 500; font-size: 12px; }
.contacts-results tbody th[scope="row"] { color: var(--ink); font-size: 13px; font-weight: 500; }
.contacts-results tr:last-child td { border-bottom: 0; }
.contact-link { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 0; color: var(--ink); text-align: left; font-size: 14px; font-weight: 500; }
.contact-link:hover { color: var(--accent); }
.event-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.event-filters select { max-width: min(100%, 320px); }
.event-table :is(th, td) { vertical-align: top; overflow-wrap: anywhere; }
.event-table th[scope="row"] { color: var(--ink); font-size: 13px; }
.event-table time { white-space: nowrap; color: var(--muted); }
.event-table tr:last-child th { border-bottom: 0; }
.event-metadata { min-width: 110px; }
.event-metadata summary { color: var(--accent); cursor: pointer; }
.event-metadata dl { display: grid; gap: 7px; margin: 8px 0 0; }
.event-metadata dt { color: var(--muted); font-size: 11px; }
.event-metadata dd { margin: 2px 0 0; max-width: 360px; white-space: pre-wrap; }
#load-older-events { margin-top: 13px; }
.recent-events { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.recent-events li { display: grid; gap: 4px; padding: 7px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.recent-events li:last-child { border-bottom: 0; }
.recent-events strong { font-size: 12px; }
.recent-events span { color: var(--muted); font-size: 11px; }
.profile-events { margin: 12px 0; }
.profile-events .contact-section-heading { justify-content: flex-end; }
.profile-events h3 { display: none; }
.contact-link .avatar { --avatar-size: 32px; --avatar-font: 11px; }

.saved-library { width: min(100%, 920px); }
.saved-library-tools, .saved-library-filters { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.saved-library-tools .search-field { flex: 0 1 310px; min-width: 0; height: 36px; background: var(--surface); }
.saved-library-filters > div { display: flex; align-items: center; gap: 5px; }
.saved-library-filters .compose-mode { padding: 6px 9px; }
.saved-library-count { color: var(--quiet); font-size: 12px; }
.saved-library-list { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.saved-library-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 43px; align-items: center; gap: 11px; width: 100%; padding: 13px; border: 0; border-bottom: 1px solid var(--soft-line); background: var(--surface); text-align: left; }
.saved-library-row:last-child { border-bottom: 0; }
.saved-library-row:hover { background: var(--page); }
.saved-library-row:focus-visible { outline-offset: -2px; }
.saved-row-icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--accent); background: var(--accent-soft); border-radius: 7px; font-size: 19px; }
.saved-row-copy, .saved-option-copy { min-width: 0; }
.saved-row-copy > *, .saved-option-copy > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-row-copy strong, .saved-option-copy strong { font-size: 13px; font-weight: 600; }
.saved-row-copy > span, .saved-option-copy > span { margin-top: 4px; color: var(--quiet); font-size: 12px; }
.saved-row-action { color: var(--muted); text-align: right; font-size: 12px; }
.reply-visibility { padding: 2px 8px; border-radius: 999px; color: var(--muted); background: var(--hover); font-size: 12px; font-weight: 500; white-space: nowrap; }
.reply-visibility[data-visibility="shared"] { color: var(--accent); background: var(--accent-soft); }

.saved-suggestions { position: absolute; z-index: 3; left: 8px; bottom: calc(100% + 5px); width: min(370px, calc(100% - 16px)); overflow: hidden; border: 1px solid var(--control-line); border-radius: 9px; background: var(--surface); box-shadow: 0 7px 22px var(--shadow); }
.saved-suggestions-heading { display: flex; justify-content: space-between; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--soft-line); font-size: 11px; font-weight: 500; }
.saved-suggestions-heading span { color: var(--quiet); font-weight: 400; }
.saved-options { max-height: min(340px, 47dvh); overflow-y: auto; padding: 4px; }
.saved-options:empty { display: none; }
.saved-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 5px; background: var(--surface); text-align: left; }
.saved-option:is(:hover, [aria-selected="true"]) { color: var(--accent-hover); background: var(--accent-soft); }
.saved-picker-search { margin-bottom: 7px; }
.saved-picker-footer { display: flex; justify-content: space-between; gap: 5px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--soft-line); }
.saved-picker-footer .button { min-height: 31px; padding: 0 9px; font-size: 12px; }
.saved-editor-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 170px); gap: 10px; }
.saved-editor :is(textarea, select) { width: 100%; }
.saved-editor textarea { min-height: 115px; max-height: 37dvh; line-height: 1.5; resize: vertical; }
.saved-field-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.saved-field-controls select { width: auto; }
.saved-field-controls p { font-size: 12px; }
.saved-editor-actions, .saved-delete-confirm { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.saved-editor-actions > :last-child { margin-left: auto; }
.saved-delete-confirm { flex-wrap: wrap; }
.saved-delete-confirm > div { display: flex; gap: 6px; }
/* Danger (secondary): red text, soft red hover. Primary danger = .button.primary.danger. */
.danger-button, .button.danger:not(.primary) { color: var(--danger-ink); border-color: var(--control-line); }
.danger-button:hover, .button.danger:not(.primary):hover { color: var(--danger-ink); background: var(--danger-soft); border-color: var(--danger-line); }

/* Quick actions: Intercom-style command palette (search on top, grouped 36px rows, key hints in the footer). */
.actions-dialog { margin: min(14vh, 120px) auto auto; width: min(600px, calc(100% - 28px)); padding: 0; overflow: hidden; border: 1px solid var(--dialog-border); border-radius: var(--radius-lg); color: var(--ink); }
.actions-search { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.actions-search > .icon { color: var(--quiet); }
.desk-ui .actions-search input { flex: 1; min-width: 0; min-height: 50px; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; color: var(--ink); font-size: 15px; }
.actions-search .icon-button { min-height: 28px; width: 28px; border-color: transparent; color: var(--quiet); }
.action-results { padding: 6px; max-height: min(400px, 56dvh); overflow: auto; }
.action-results:empty { display: none; }
.action-item { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--ink); border: 0; border-radius: var(--radius-md); text-align: left; font-size: 14px; }
.action-item .icon { color: var(--muted); }
.action-item:hover { background: var(--hover); }
.action-item[aria-selected="true"] { background: var(--selected); }
.action-item[aria-selected="true"]::after { content: '↵' / ''; margin-inline-start: auto; color: var(--quiet); font-size: 12px; }
.action-item[data-group] { position: relative; margin-top: 30px; }
.action-item[data-group]:first-child { margin-top: 26px; }
.action-item[data-group]::before { content: attr(data-group) / ''; position: absolute; inset: -24px auto auto 10px; color: var(--quiet); font-size: 12px; font-weight: 500; pointer-events: none; }
.actions-dialog .list-empty { padding: 28px 16px; }
.actions-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 16px; border-top: 1px solid var(--line); background: var(--inset); color: var(--quiet); font-size: 12px; }
.actions-footer span { display: inline-flex; align-items: center; gap: 4px; }
/* Modal dialogs: 16px radius, 24px padding, title 16px/600 + ghost close button, right-aligned footer. */
.setup-dialog { width: min(520px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--dialog-border); border-radius: var(--radius-xl); color: var(--ink); }
#messenger-apps-dialog { width:min(660px, calc(100% - 24px)); }
/* Messenger apps catalog/scheduling styles live in ui-channels.css. */
:is(.inbox-scheduling, .inbox-orders) ul { display:grid; list-style:none; gap:8px; padding:0; margin:8px 0; }
:is(.inbox-scheduling, .inbox-orders) li { display:grid; gap:7px; padding:9px; border:1px solid var(--line); border-radius:8px; }
:is(.inbox-scheduling, .inbox-orders) li small { display:block; margin-top:2px; color:var(--muted); overflow-wrap:anywhere; }
:is(.inbox-scheduling, .inbox-orders) li button { justify-self:start; }
#outbound-smart-links-results { display: grid; gap: 7px; margin-top: 10px; }
#outbound-smart-links-results button { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 5px 12px; }
#outbound-smart-links-results button :is(span, small) { color: var(--muted); font-size: 12px; }
#outbound-smart-links-results small { grid-column: 1 / -1; white-space: normal; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin: -4px -8px 12px 0; }
.dialog-heading h2 { min-width: 0; font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -.005em; }
.dialog-heading .icon-button { flex: none; color: var(--muted); }
.setup-dialog p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.setup-dialog :where(h3) { margin: 16px 0 6px; font-size: 14px; font-weight: 600; }
.setup-dialog :where(code) { padding: 1px 4px; border-radius: 4px; background: var(--hover); font-size: .92em; }
.desk-form { display: grid; gap: 12px; }
.setup-dialog .desk-form { margin-top: 16px; }
.workspace-security-dialog { width: min(760px, calc(100% - 32px)); }
.workspace-security-dialog nav { justify-content: flex-start; margin: 12px 0; }
.workspace-security-dialog nav button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-hover); }
.security-check { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.security-check h3 { margin: 0; font-size: 14px; }
.security-check p { margin: 3px 0 0; }
.security-check-status { padding: 5px 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.security-check-status[data-active="true"] { color: var(--success-ink); }
.workspace-security-dialog .desk-form .security-guidance { margin: -5px 0 0; }
.workspace-security-dialog textarea { display: block; width: 100%; }
#teammate-audit-search { justify-content: flex-start; }
.security-audit-table { margin: 12px 0; overflow: auto; }
.security-audit-table table { width: 100%; border-collapse: collapse; text-align: start; font-size: 13px; }
.security-audit-table :is(th, td) { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: start; }
.security-audit-table time { white-space: nowrap; }
.workspace-remove-button { color: var(--danger-ink); }
.security-redaction-rule { display: grid; min-width: 0; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.security-redaction-rule legend { font-size: 13px; font-weight: 500; }
.security-redaction-rule > button { justify-self: start; }
body[data-seat="limited"] :is(.rail [data-view], #open-workspace-settings, #open-actions, .widget-preview, #inbox-view) { display: none; }
.limited-inbox-layout { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(280px, 2fr); gap: 24px; }
.limited-inbox > p { margin: 6px 0 16px; color: var(--muted); }
.limited-inbox > p.form-error { color: var(--danger-ink); }
#limited-inbox-results { display: grid; align-content: start; gap: 6px; }
#limited-inbox-results button { display: grid; justify-content: start; gap: 3px; padding: 9px 12px; text-align: start; }
#limited-inbox-results button[aria-current="true"] { background: var(--accent-soft); }
#limited-inbox-results span, .limited-note > span { color: var(--muted); }
.limited-note > span { margin-inline-start: 7px; font-size: 12px; }
#limited-inbox-thread h3 { margin: 0 0 8px; }
.limited-note { padding: 10px 0; border-bottom: 1px solid var(--line); }
.limited-note p { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
#limited-note-form { margin-top: 14px; }
@media (max-width: 640px) { .limited-inbox-layout { grid-template-columns: minmax(0,1fr); } }
.desk-form label { display: grid; gap: 6px; color: var(--ink); font-size: 13px; font-weight: 500; }
.desk-form label:has(> input:is([type="checkbox"], [type="radio"])) { font-weight: 400; }
/* Messenger Home dialog styles live in ui-channels.css. */
.object-definitions { display: grid; gap: 8px; padding: 0; list-style: none; }
.object-definitions li { display: grid; gap: 3px; }
.object-definitions li span { color: var(--muted); }
.object-field-definition { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-block: 8px 12px; }
.object-field-definition .object-field-required { display: flex; gap: 6px; align-items: center; grid-column: 1 / 3; }
.custom-object-card { padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-block: 8px; overflow-wrap: anywhere; }
.custom-object-card h4, .custom-object-card p { margin: 0 0 5px; }
.custom-object-card p, .custom-object-card dt { color: var(--muted); }
.custom-object-card dl { margin: 0 0 7px; }
.custom-object-card dl div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 6px; }
.custom-object-card dd { margin: 0; }
[data-record-fields] { display: grid; gap: 8px; }
@media (max-width: 520px) {
  .object-field-definition { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .object-field-definition .object-field-required { grid-column: 1; }
}
.desk-form :where(input:not([type="checkbox"], [type="radio"]), label > select, label > textarea) { width: 100%; }
.desk-form .button { justify-self: start; }
.routing-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
.routing-fields { display: grid; gap: 10px; }
#inbox-routing-dialog select { width: 100%; }
#routing-configuration-form { border-top: 1px solid var(--line); padding-top: 14px; }
.desk-form .routing-checkbox { grid-template-columns: auto 1fr; align-items: center; }
#inbox-workload-dialog { width: min(920px, calc(100% - 32px)); }
.workload-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.workload-filters label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.workload-table { overflow-x: auto; margin: 12px 0; }
.workload-table table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 13px; text-align: left; }
.workload-table :is(th, td) { padding: 10px; border-bottom: 1px solid var(--line); }
.workload-table thead th { color: var(--muted); }
.workload-at-capacity { display: block; color: var(--danger-ink); font-size: 12px; }
#workload-settings summary { cursor: pointer; }
#workload-settings-form { max-width: 300px; padding: 10px 0; }
#workspace-owners-dialog { width: min(660px, calc(100% - 32px)); }
#workspace-owners-dialog td:last-child .button + .button { margin-inline-start: 6px; }
.conversation-fields-list { list-style: none; margin: 12px 0; padding: 0; }
.conversation-fields-list li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.conversation-fields-list small { display: block; color: var(--muted); }
.conversation-field-actions, .conversation-fields-list li > span:last-child { display: flex; flex-wrap: wrap; gap: 6px; }
#conversation-field-form :is(select, textarea), #thread-conversation-fields input, #inbox-field-filter-value input { width: 100%; }
.contact-editor { width: min(640px, calc(100% - 32px)); }
.contact-editor :is(textarea, select), #contact-note-form textarea { width: 100%; }
.contact-input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contact-input-grid > label { min-width: 0; overflow-wrap: anywhere; }
.contact-form-section { margin-top: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; }
.contact-form-section summary { font-size: 13px; font-weight: 600; }
.contact-form-section[open] summary { margin-bottom: 10px; }
.contact-form-section #profile-note-list { margin-bottom: 8px; }
.attribute-list ul { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 7px; }
.attribute-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px; }
.attribute-list li + li { border-top: 1px solid var(--line); }
.attribute-list li > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.attribute-list strong, .attribute-list span { display: block; }
.attribute-list strong { font-size: 13px; }
.attribute-list span { margin-top: 3px; color: var(--quiet); font-size: 11px; }
.attribute-row-actions { display: flex; gap: 4px; }
#attribute-form-title { margin: 6px 0 0; font-size: 14px; }
#attributes-error { margin-top: 8px; }
/* Sign-in card (desk, Google verification page, demo OAuth consent). */
.auth-screen { grid-column: 1 / -1; display: grid; place-items: center; min-height: 0; overflow: auto; padding: 24px; background: var(--page); }
.auth-card { display: grid; gap: 16px; width: min(100%, 400px); padding: 32px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-sm); }
.auth-card .brand-mark { width: 36px; height: 36px; margin-bottom: 4px; }
.auth-card h1 { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.auth-card > p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-card .desk-form { gap: 14px; }
.auth-card .desk-form label > :is(input, select) { width: 100%; }
.auth-card .button { width: 100%; min-height: 36px; font-size: 14px; }
.auth-card > a { justify-self: center; color: var(--muted); font-size: 13px; }
.auth-card > a:hover, .auth-card p a { color: var(--accent); text-decoration: underline; }
.auth-card .dialog-actions .button { width: auto; }
.button.google-button { min-height: 36px; gap: 10px; padding-inline: 12px; border-color: var(--control-line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; }
.button.google-button:hover { background: var(--hover); border-color: var(--control-line-hover); }
.google-button img { object-fit: contain; }
.form-error, .setup-dialog .form-error, .auth-card .form-error { color: var(--danger-ink); font-size: 13px; }
.setup-dialog pre { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--inset); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; }
.event-setup-dialog { width: min(620px, calc(100% - 32px)); }
.event-setup-dialog h3 { margin: 14px 0 6px; font-size: 14px; }
.event-key-section { margin-top: 16px; border-top: 1px solid var(--line); }
.event-key-section p { margin: 6px 0 10px; }
.event-key-actions { display: flex; gap: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.notice { position: fixed; z-index: 10; right: 20px; bottom: 20px; max-width: calc(100% - 40px); padding: 10px 16px; border-radius: var(--radius-md); background: var(--primary-fill); color: var(--primary-text); box-shadow: var(--shadow-pop); font-size: 13px; font-weight: 500; pointer-events: none; }

@media (max-width: 1180px) {
  .inbox-grid { --queue-width: 155px; --default-list-width: 268px; }
}
@media (max-width: 1120px) {
  .inbox-grid { --queue-width: 138px; --default-list-width: clamp(215px, 24vw, 268px); --default-details-width: clamp(217px, 23vw, 245px); }
  .queue-panel { padding-inline: 6px; }
  .queue-link { font-size: 11px; padding-inline: 5px; }
  .list-controls { padding-inline: 9px; }
  .thread-header, .timeline, .reply-area { padding-inline: 10px; }
  .details-header { padding-inline: 10px; }
}
@media (max-width: 879px) {
  .workspace-header { padding-inline: 10px; }
  .header-actions { gap: 9px; }
  .inbox-grid { --default-details-width: clamp(210px, 34vw, 250px); --details-space: calc(100% - var(--min-thread-width)); grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  body[data-pane="thread"] .inbox-grid { grid-template-columns: minmax(0, 1fr) var(--details-column); grid-template-rows: minmax(0, 1fr); }
  .pane-resizer:not([data-resize-pane="details"]), body[data-pane="list"] .pane-resizer { display: none; }
  .pane-resizer[data-resize-pane="details"] { width: 16px; }
  .queue-panel { padding: 7px; border-right: 0; border-bottom: 1px solid var(--line); max-height: 30dvh; }
  .queue-panel h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .queue-list { display: flex; flex-wrap: wrap; }
  .queue-link { min-height: 29px; width: auto; }
  .team-queues { margin-top: 4px; padding-top: 4px; }
  .team-queues h3 { margin-bottom: 3px; }
  .conversation-list { border-right: 0; }
  body[data-pane="list"] :is(.thread-panel, .details-panel), body[data-pane="thread"] :is(.queue-panel, .conversation-list) { display: none; }
  .mobile-back { display: inline-flex; }
  .contacts-view { padding: 13px; }
  .contacts-controls .search-field { width: 155px; }
}
@media (max-width: 710px) {
  body { --rail-width: 48px; }
  .actions-trigger > :not(.icon) { display: none; }
}
@media (max-width: 560px) {
  .inbox-grid { --details-column: 0px; }
  .pane-resizer[data-resize-pane="details"] { display: none; }
  .details-panel { position: absolute; z-index: 2; inset: 0 0 0 auto; width: min(268px, 100%); box-shadow: -10px 0 25px var(--shadow); }
}
@media (max-width: 480px) {
  .path-divider, .widget-preview .i-external, .widget-preview > :nth-child(2), .connection { display: none; }
  .header-button { gap: 4px; padding-inline: 7px; }
  .queue-link .icon { display: none; }
  .thread-header { gap: 5px; padding-inline: 6px; }
  .thread-header > .avatar { display: none; }
  .thread-actions { gap: 3px; }
  .resolve-button .icon { display: none; }
  .composer-hint { display: none; }
  .composer-footer { justify-content: flex-end; }
  .saved-library-row { grid-template-columns: 25px minmax(0, 1fr) auto; padding: 10px 7px; gap: 7px; }
  .saved-row-icon { width: 25px; height: 29px; }
  .saved-row-action { display: none; }
  .saved-library-tools .button { font-size: 11px; padding: 0 6px; }
  .saved-editor-fields { grid-template-columns: 1fr; }
  .contact-input-grid { grid-template-columns: 1fr; }
}

/* Secondary-sidebar page (sidebar + content). Item look is finalized in desk-layout.css. */
.people-view { display: grid; grid-template-columns: var(--desk-side-width, 232px) minmax(0, 1fr); flex: 1; min-height: 0; }
.segments-sidebar { overflow: auto; border-right: 1px solid var(--line); background: var(--subnav); padding: 12px 8px; }
.segments-sidebar h2 { margin: 0 8px 12px; font-size: 16px; font-weight: 600; }
#segment-list { display: grid; gap: 2px; }
.segment-link { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 8px; border: 0; border-radius: var(--radius-md); background: none; color: var(--ink); text-align: left; font-size: 14px; font-weight: 400; }
.segment-link span:last-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.segment-link:hover { background: var(--hover); }
.segment-link[aria-pressed="true"] { background: var(--selected); color: var(--ink); font-weight: 500; }
.segment-link .icon { color: var(--muted); }
.segment-link[aria-pressed="true"] .icon { color: var(--ink); }
.people-content { min-width: 0; overflow: auto; padding: 24px 32px; }
.people-toolbar, .people-results-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.people-toolbar { margin-bottom: 16px; }
.people-toolbar h2 { overflow-wrap: anywhere; font-size: 20px; font-weight: 600; }
.people-results-toolbar { margin: 16px 0 10px; }
.people-results-toolbar p { flex: 1; white-space: nowrap; color: var(--muted); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.people-results-toolbar .search-field { width: min(230px, 100%); }
.people-content .contacts-results { width: 100%; }
.people-table th[scope="row"] { color: var(--ink); }
.people-table tr:last-child th { border-bottom: 0; }
.people-table .contact-link span:last-child { min-width: 0; }
.people-row-actions, .segment-actions, .segment-editor-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.people-row-actions { justify-content: flex-start; }
.contact-type { display: inline-block; border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; font-size: 11px; }
.people-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.people-pagination span { margin-right: 6px; }
.people-filters, .nested-filter-group { border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: var(--page); }
.nested-filter-group { margin: 8px 0 8px 14px; background: var(--surface); border-left: 2px solid var(--accent); }
.filter-group-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.segment-actions { margin-top: 9px; }
#contact-search-error { margin-top: 10px; }
.filter-picker { width: min(490px, calc(100% - 28px)); }
#filter-picker-results { margin-top: 10px; max-height: min(440px, 55dvh); overflow: auto; }
#filter-picker-results h3 { padding: 8px 7px 4px; color: var(--muted); font-size: 11px; }
.filter-choice { display: block; width: 100%; text-align: left; border: 0; padding: 6px 8px; border-radius: 5px; background: none; color: var(--ink); overflow-wrap: anywhere; }
.filter-choice:hover { background: var(--accent-soft); }
.segment-editor-actions { margin-top: 5px; }
@media (max-width: 850px) {
  .people-view { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .segments-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; }
  .segments-sidebar h2 { margin-bottom: 4px; }
  #segment-list { display: flex; overflow: auto; }
  .segment-link { flex-shrink: 0; max-width: 190px; }
  .people-content { padding: 12px; }
  .people-content .contacts-results table { min-width: 585px; }
}

.report-menu-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; padding-inline-end: 2px; }
.report-menu-title h2 { margin-bottom: 0; }
.workspace .report-menu-title .button.icon-button { width: 28px; min-height: 28px; font-size: 18px; font-weight: 400; color: var(--muted); }
#report-list h3 { margin: 16px 8px 4px; color: var(--quiet); font-size: 12px; font-weight: 600; }
#report-list > div { display: grid; gap: 2px; }
.report-content { background: var(--page); }
.report-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 7px; margin: 0 0 12px; }
.report-filters label { display: grid; min-width: 110px; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.report-cohort { margin: 0 0 11px; color: var(--muted); font-size: 12px; }
.report-charts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.report-chart { min-width: 0; grid-column: span 2; min-height: 115px; border: 1px solid var(--line); padding: 14px; border-radius: 9px; background: var(--surface); }
.report-chart.report-number { grid-column: span 1; }
.report-chart-heading { display: flex; align-items: first baseline; flex-wrap: wrap; justify-content: space-between; gap: 4px; margin-bottom: 10px; }
.report-chart-heading h3 { font-size: 13px; }
.report-chart-heading span { color: var(--quiet); font-size: 10px; }
.chart-drill-button { border: 0; padding: 3px; background: none; color: var(--accent-hover); text-align: left; border-radius: 4px; }
.chart-drill-button:not(:disabled):hover { background: var(--accent-soft); }
.metric-value .chart-drill-button { font-size: clamp(22px, 2.4vw, 34px); font-weight: 600; letter-spacing: -.035em; }
.report-bars { display: grid; max-height: 280px; overflow: auto; gap: 5px; }
.report-bars .chart-drill-button { display: grid; gap: 4px; grid-template-columns: minmax(0, 1fr) auto; font-size: 11px; }
.report-bars progress { grid-column: span 2; width: 100%; height: 7px; border: 0; border-radius: 3px; accent-color: var(--accent); }
.report-bars progress::-webkit-progress-bar { background: var(--hover); border-radius: 3px; }
.report-bars progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
.report-breakdown { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.report-breakdown th { font-weight: 500; }
.report-breakdown th, .report-breakdown td { padding: 5px; border-bottom: 1px solid var(--soft-line); }
.report-breakdown :is(td, th):last-child { text-align: right; }
.report-editor, .report-drill { width: min(750px, calc(100% - 28px)); }
.report-editor-header, .report-chart-editor { display: grid; align-items: end; gap: 8px; grid-template-columns: minmax(130px, 2fr) minmax(105px, 1fr); }
.report-chart-editor { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; margin-bottom: 5px; }
.report-chart-editor select { width: 100%; }
#report-drill-results small { display: block; margin-top: 3px; color: var(--muted); }
@media (max-width: 850px) {
  #report-list { display: flex; align-items: center; overflow: auto; }
  #report-list > div { display: flex; flex-shrink: 0; }
  #report-list h3 { white-space: nowrap; margin: 0 5px; }
  .report-chart.report-number { grid-column: span 2; }
}
@media (max-width: 555px) {
  .report-chart:not(.report-number) { grid-column: span 4; }
  .report-chart-editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

#knowledge-nav { display: grid; gap: 3px; }
.knowledge-content .contacts-results { max-width: none; }
.kb-table th[scope="row"] { color: var(--ink); overflow-wrap: anywhere; }
.kb-table th small, .kb-share-choice span, .kb-history-entry span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; }
.kb-table tr:last-child th { border-bottom: 0; }
#knowledge-filters { position: relative; flex-wrap: nowrap; }
#knowledge-filters .search-field { flex: 1; width: auto; max-width: 520px; }
.kb-filter-options summary { list-style: none; }
.kb-filter-options summary::-webkit-details-marker { display: none; }
.kb-filter-options[open] summary { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.kb-filter-count { color: var(--accent); font-size: 11px; }
.kb-filter-popover { position: absolute; z-index: 2; inset-inline-end: 0; top: calc(100% + 5px); display: grid; gap: 8px; width: min(250px, 100%); padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 8px 24px var(--shadow); }
.kb-filter-popover label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.kb-filter-popover select { width: 100%; }
#knowledge-view[data-kb-tab="articles"]:not(:has(#kb-editor:not([hidden]))) {
  gap: 8px;
  padding: 8px 9px 0 8px;
  background: var(--page);
}
#knowledge-view:has(> .kb-reader:not([hidden])) {
  grid-template-columns: var(--desk-side-width, 232px) minmax(245px, .73fr) minmax(0, 1fr);
}
#knowledge-view[data-kb-tab="articles"]:not(:has(#kb-editor:not([hidden]))) > :is(.segments-sidebar, .knowledge-content, .kb-reader) {
  min-height: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}
#knowledge-view[data-kb-tab="articles"]:not(:has(#kb-editor:not([hidden]))) > .knowledge-content {
  background: var(--surface);
  padding: 19px clamp(12px, 1.6vw, 26px) 20px;
}
.kb-article-count { margin: 15px 0 7px; color: var(--muted); font-size: 12px; font-weight: 500; }
#knowledge-view[data-kb-tab="articles"] #knowledge-results { border: 0; border-radius: 0; }
.kb-article-row th { padding-block: 10px; }
.kb-article-row .contact-link { width: 100%; color: var(--ink); text-align: left; }
.kb-article-row .contact-link[aria-current="true"] { color: var(--accent); }
.kb-article-row:has([aria-current="true"]) { background: var(--accent-soft); }
.kb-article-row:has([aria-current="true"]):hover { background: var(--accent-soft); }
#knowledge-view:has(> .kb-reader:not([hidden])) .kb-table :is(th, td):not(:first-child) { display: none; }
.kb-reader {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}
.kb-reader:focus-visible { outline-offset: -2px; }
.kb-reader-toolbar, .kb-reader-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px clamp(12px, 1.45vw, 24px); border-bottom: 1px solid var(--line); }
.kb-reader-toolbar { justify-content: space-between; }
.kb-reader-heading, .kb-reader-actions { display: flex; align-items: center; gap: 7px; }
.kb-reader-heading h2 { font-size: 15px; }
.kb-reader-heading .icon { color: var(--accent); }
.kb-reader-actions { flex-wrap: wrap; }
.kb-reader-meta { min-height: 42px; padding-block: 6px; background: var(--inset); color: var(--muted); font-size: 12px; }
.kb-reader-status, .kb-reader-language, #kb-reader-placement { border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; background: var(--surface); }
.kb-reader-status[data-status="published"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.kb-reader-language { display: inline-flex; align-items: center; gap: 5px; }
.kb-reader-scroll { flex: 1; min-height: 0; overflow: auto; }
.kb-reader-document { width: min(100%, 780px); margin-inline: auto; padding: clamp(24px, 3.8vw, 60px) clamp(18px, 3vw, 48px) 54px; }
.kb-reader-document #kb-reader-title { margin: 0 0 10px; font-size: clamp(25px, 2.55vw, 36px); line-height: 1.18; letter-spacing: -.025em; }
.kb-reader-document #kb-reader-body { margin-top: 20px; }
.kb-editor-title { display: flex; align-items: center; gap: 8px; }
.kb-editor-title h2 { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.kb-editor-status, #kb-byline { color: var(--muted); font-size: 12px; }
.kb-editor-status { margin-top: 2px; }
#knowledge-view:has(#kb-editor:not([hidden])) { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
#knowledge-view:has(#kb-editor:not([hidden])) > .segments-sidebar { display: none; }
#knowledge-view:has(#kb-editor:not([hidden])) .knowledge-content { background: var(--page); padding: 0 24px 24px; }
#kb-editor { max-width: 1240px; margin-inline: auto; }
.kb-editor-toolbar { position: sticky; z-index: 4; top: 0; min-height: 62px; margin: 0 0 15px; padding-block: 9px; background: var(--page); }
.kb-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 260px); align-items: start; gap: 18px; }
.kb-write-area, .kb-preview, .kb-article-details { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.kb-article-details { display: grid; gap: 13px; padding: 16px; }
.kb-editor-grid label:not(.kb-checkbox), #kb-group-translations label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.kb-editor-grid :where(input:not([type="checkbox"], [type="radio"]), select, textarea) { width: 100%; }
.kb-format-toolbar { position: sticky; z-index: 3; top: 62px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 7px 10px; border-bottom: 1px solid var(--line); border-radius: 9px 9px 0 0; background: var(--surface); }
.kb-format-toolbar #kb-block-style { width: auto; }
.kb-format-group { display: flex; gap: 2px; border-right: 1px solid var(--line); padding-right: 6px; }
.kb-format-toolbar .button, .kb-table-toolbar .button { min-height: 30px; font-size: 12px; padding: 0 7px; border-color: transparent; }
.kb-format-toolbar .button[aria-pressed="true"], #kb-open-insert[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.kb-format-toolbar .kb-history-tools { margin-left: auto; border: 0; padding: 0; }
.kb-history-tools .button { font-size: 16px; }
.kb-insert-menu { position: fixed; z-index: 10; width: min(320px, calc(100vw - 20px)); padding: 7px; background: var(--surface); border: 1px solid var(--control-line); border-radius: 10px; box-shadow: 0 12px 32px var(--shadow); }
.kb-insert-menu input { font-size: 13px; margin-bottom: 5px; }
#kb-insert-results { max-height: var(--kb-insert-height, min(300px, 47vh)); overflow: auto; color: var(--quiet); font-size: 13px; }
#kb-insert-results button { display: grid; gap: 2px; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; }
#kb-insert-results button:is(:hover,:focus-visible) { background: var(--accent-soft); outline-offset: -2px; }
#kb-insert-results button span { color: var(--muted); font-size: 11px; }
.kb-table-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px 10px; border-bottom: 1px solid var(--line); background: var(--inset); }
.kb-writing-page, .kb-preview { padding: clamp(20px, 4vw, 54px); min-height: min(540px, 64vh); }
.kb-writing-page { padding-inline-start: clamp(36px, 4vw, 54px); }
.kb-writing-body { position: relative; }
.kb-line-insert { position: absolute; z-index: 2; inset-inline-start: -34px; top: var(--kb-caret-offset); transform: translateY(-50%); border: 1px solid var(--accent-line); border-radius: 7px; background: var(--surface); color: var(--accent); width: 26px; height: 26px; line-height: 22px; padding: 0; font-size: 19px; }
.kb-line-insert::after { content: ''; position: absolute; inset-inline-start: 100%; top: calc(50% - .5px); width: 7px; height: 1px; background: var(--accent-line); }
.kb-line-insert:hover, .kb-line-insert[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); }
.kb-writing-page :is(input[name="title"], textarea[name="description"]) { display: block; padding: 0; border: 0; border-radius: 3px; resize: vertical; }
.kb-writing-page input[name="title"] { font-size: clamp(25px, 3.5vw, 39px); line-height: 1.2; font-weight: 600; letter-spacing: -.04em; margin-bottom: 12px; }
.kb-writing-page textarea[name="description"] { min-height: 28px; line-height: 1.55; font-size: 16px; color: var(--muted); margin-bottom: 22px; }
.kb-writing-page :is(input, textarea)::placeholder { color: var(--quiet); }
.kb-rich-body .tiptap { min-height: 260px; overflow-wrap: anywhere; white-space: pre-wrap; outline: none; }
.kb-rich-body .tiptap > :first-child { margin-top: 0; }
.kb-rich-body .tiptap .is-editor-empty:first-child::before,
.kb-rich-body .tiptap :is(summary, aside p:first-child).is-empty::before { content: attr(data-placeholder); float: left; height: 0; color: var(--quiet); pointer-events: none; }
.kb-rich-body .tiptap .ProseMirror-selectednode { outline: 2px solid var(--focus); }
.kb-rich-body .tableWrapper { overflow: auto; }
.kb-rich-body table { width: 100%; table-layout: fixed; }
.kb-rich-body .selectedCell { background: var(--accent-soft); }
.kb-rich-body [data-type="details"] { display: flex; align-items: start; gap: 7px; margin: 1em 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--page); }
.kb-rich-body [data-type="details"] > div { min-width: 0; flex: 1; }
.kb-rich-body [data-type="details"] > button { border: 0; color: var(--muted); background: transparent; }
.kb-rich-body [data-type="details"] > button::before { content: '▸'; }
.kb-rich-body [data-type="details"].is-open > button::before { content: '▾'; }
.kb-rich-body [data-type="detailsContent"] { margin-top: 6px; }
.kb-writing-footer { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding: 7px 12px; color: var(--quiet); font-size: 12px; }
.kb-format-dialog { width: min(450px, calc(100% - 28px)); }
#kb-format-hint { color: var(--muted); font-size: 12px; }
.kb-format-dialog-actions { display: flex; justify-content: flex-end; gap: 7px; }
.kb-media-node { display: flex; align-items: center; gap: 12px; margin: 1em 0; padding: 12px; border: 1px solid var(--accent-line); border-radius: 9px; background: var(--page); }
.kb-media-node .icon { color: var(--accent); }
.kb-media-copy { min-width: 0; display: grid; flex: 1; gap: 2px; white-space: normal; }
.kb-media-copy small { color: var(--muted); font-size: 12px; }
.kb-article-details h3 { font-size: 14px; }
.kb-add-language { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; align-items: end; }
.kb-add-language button { min-height: 34px; font-size: 11px; padding: 0 7px; }
.kb-placements { min-width: 0; margin: 0; padding: 6px 7px; border: 1px solid var(--line); border-radius: 6px; }
.kb-placements legend { color: var(--muted); font-size: 11px; }
.kb-placement + .kb-placement { border-top: 1px solid var(--line); margin-top: 7px; padding: 7px 0 0; }
.kb-placement-options { display: grid; gap: 6px; margin-top: 5px; }
#kb-publication-actions { display: flex; flex-wrap: wrap; gap: 5px; }
#kb-publication-actions .button { min-height: 28px; padding: 0 6px; font-size: 11px; }
.kb-checkbox, #kb-center-form .kb-checkbox { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.kb-checkbox input[type="checkbox"] { width: auto; min-width: 0; }
.kb-preview { display: block; }
.kb-metric-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 9px 0; }
.kb-metric-list > div { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 7px; padding: 9px; }
.kb-metric-list span { color: var(--muted); font-size: 11px; }
.kb-metric-list strong { font-size: 20px; }
.kb-bulk-move { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 12px; padding: 8px 0; }
.kb-bulk-move label { display: grid; gap: 4px; max-width: min(460px, 100%); color: var(--muted); font-size: 12px; }
.kb-bulk-move strong { align-self: center; font-size: 13px; }
.kb-table .kb-select-article { width: 32px; }
.kb-collection-center { margin-bottom: 18px; }
.kb-collection-center h3 { margin: 0 0 6px; font-size: 15px; }
.kb-collection-tree, .kb-collection-articles { list-style: none; margin: 5px 0; padding: 0; }
.kb-collection-tree .kb-collection-tree, .kb-collection-articles { margin-inline-start: 18px; padding-inline-start: 8px; border-inline-start: 1px solid var(--line); }
.kb-collection-node, .kb-collection-article { display: flex; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 7px; padding: 5px 8px; margin: 2px 0; }
.kb-collection-node { justify-content: space-between; background: var(--page); }
.kb-collection-grip { color: var(--muted); cursor: grab; }
.kb-collection-article[draggable] .contact-link { flex: 1; text-align: left; }
.kb-collection-node.drop-target, .kb-collection-article.drop-target { background: var(--accent-soft); border-color: var(--accent); }
#kb-redirect-dialog { width: min(630px, calc(100vw - 28px)); }
#kb-redirect-list { max-height: 245px; overflow: auto; margin-bottom: 12px; }
.kb-redirect-source { overflow-wrap: anywhere; }
#kb-center-footer-fields { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; }
#kb-center-footer-fields legend { font-size: 13px; color: var(--muted); }
.kb-center-footer-row { display: grid; grid-template-columns: minmax(68px, 1fr) minmax(130px, 2fr) auto; gap: 6px; align-items: end; margin-bottom: 6px; }
#kb-center-preview > summary { cursor: pointer; font-size: 13px; font-weight: 500; }
.kb-brand-preview { --preview-accent: #3d49a1; overflow: hidden; border-radius: 9px; border: 1px solid var(--line); margin-top: 8px; }
.kb-brand-preview.theme-slate { --preview-accent: #30465a; }
.kb-brand-preview.theme-teal { --preview-accent: #225e56; }
.kb-brand-preview.theme-rust { --preview-accent: #843c2a; }
.kb-brand-preview header { background: var(--preview-accent); color: #fff; padding: 12px; }
.kb-brand-preview header img { display: block; width: auto; max-width: 120px; max-height: 34px; object-fit: contain; margin-bottom: 6px; }
.kb-brand-preview header h3 { margin: 4px 0 0; }
.kb-brand-preview header p { color: inherit; margin: 4px 0 0; }
.kb-brand-preview footer { display: flex; gap: 10px; flex-wrap: wrap; padding: 7px 12px; font-size: 12px; }
.kb-content-tags { display: grid; gap: 6px; }
.kb-content-tags > .button { justify-self: start; }
#kb-article-tags { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
#kb-article-tags .button { font-size: 11px; min-height: 24px; padding: 2px 6px; overflow-wrap: anywhere; }
.kb-insights { padding: 12px; }
.kb-insights h3 { margin-top: 16px; font-size: 13px; }
.kb-history-entry { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
#kb-history-results, #kb-share-results { margin-top: 9px; max-height: 52dvh; overflow: auto; }
#kb-group-translations label { margin-top: 7px; }
.message-body a { color: var(--accent-hover); text-decoration: underline; }
@media (max-width: 850px) {
  #knowledge-nav { display: flex; overflow: auto; }
  #knowledge-view[data-kb-tab="articles"]:not(:has(#kb-editor:not([hidden]))) > .segments-sidebar { border-bottom: 1px solid var(--line); border-radius: 10px; }
  #knowledge-view:has(> .kb-reader:not([hidden])) { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  #knowledge-view:has(> .kb-reader:not([hidden])) > :is(.segments-sidebar, .knowledge-content) { display: none; }
  #knowledge-view:has(#kb-editor:not([hidden])) .knowledge-content { padding-inline: 12px; }
  .kb-editor-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 550px) {
  #knowledge-view[data-kb-tab="articles"] #knowledge-results table { min-width: 0; }
  #knowledge-view[data-kb-tab="articles"] .kb-table :is(th, td):nth-child(n+4) { display: none; }
  .kb-editor-toolbar, .kb-format-toolbar { position: relative; top: auto; }
  .kb-editor-toolbar { gap: 7px; }
  .kb-format-toolbar .kb-history-tools { margin-left: 0; }
}

#show-companies { width: 100%; margin-top: 13px; }
.company-editor { width: min(620px, calc(100% - 28px)); }
.company-editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.company-contacts { padding-top: 12px; margin-top: 13px; border-top: 1px solid var(--line); }
#company-contact-list { max-height: 150px; overflow: auto; display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 850px) {
  #show-companies { width: auto; margin-top: 5px; }
}
@media (max-width: 400px) {
  .company-editor-fields { grid-template-columns: 1fr; }
}

.report-filters .report-compare { display: flex; align-items: center; min-height: 33px; gap: 4px; margin: 0 4px; }
.report-compare input { min-height: 0; min-width: 0; }
.report-comparison { color: var(--muted); margin-top: 7px; font-size: 11px; }
.report-definition { margin-top: 9px; color: var(--muted); font-size: 11px; }
.report-definition summary { cursor: pointer; }
.report-definition p { margin-top: 6px; line-height: 1.4; }
.report-snapshot-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.report-snapshot-tabs .button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
#report-snapshots-dialog > p { color: var(--muted); margin: 8px 0 13px; }
#report-snapshots-content .desk-form { max-width: 430px; }
.report-snapshot-recipients { border: 1px solid var(--line); border-radius: 7px; max-height: 140px; overflow: auto; }
.report-snapshot-recipients label { display: flex; align-items: center; gap: 5px; margin: 5px; }
.report-snapshot-list { display: grid; padding: 0; margin: 10px 0; list-style: none; }
.report-snapshot-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.report-snapshot-list p, .report-snapshot-view-header p { font-size: 12px; color: var(--muted); margin: 4px 0; }
.report-snapshot-view-header h3 { margin-top: 8px; }
.report-snapshot-charts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); margin-top: 10px; }
@media (min-width: 650px) {
  .report-chart-editor { grid-template-columns: minmax(0, 2fr) repeat(4,minmax(0, 1fr)) auto; }
}

@media (min-width: 851px) {
  #reports-view { grid-template-columns: 220px minmax(0, 1fr); }
}

.i-sequence { mask: none; background: none; position: relative; }
.i-sequence::before { content: ''; position: absolute; inset: 2px 2px 2px 3px; background: currentColor; clip-path: polygon(0 0, 39% 0, 39% 31%, 23% 31%, 23% 49%, 77% 49%, 77% 69%, 100% 69%, 100% 100%, 61% 100%, 61% 69%, 67% 69%, 67% 59%, 13% 59%, 13% 31%, 0 31%); }
.sequence-top-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
/* Status pill (badge primitive). Tones follow data-state. */
.sequence-badge { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 2px 8px; background: var(--hover); font-size: 12px; font-weight: 500; line-height: 16px; color: var(--muted); white-space: nowrap; }
.sequence-badge[data-state="live"] { color: var(--success-ink); background: var(--success-soft); }
.sequence-badge[data-state="paused"] { color: var(--warning-ink); background: var(--warning-soft); }
.sequence-form { min-width: 0; }
.sequence-form label:not(.sequence-stop) { display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
.sequence-form :where(input:not([type="checkbox"], [type="radio"]), textarea, select) { width: 100%; }
.sequence-block { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.sequence-trigger-note { font-size: 11px; color: var(--quiet); line-height: 1.4; }
#sequence-live-wait-form .sequence-trigger-note { margin: 12px 0; }
.sequence-duration { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sequence-stop { display: flex; gap: 6px; align-items: center; margin-top: 14px; color: var(--muted); font-size: 12px; }
.sequence-report-outcomes { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 14px; }
.sequence-report-outcomes span { display: flex; align-items: center; gap: 6px; }
#sequence-report-people h3 { margin: 14px 0 5px; }
#sequence-report-people .sequence-runs li { justify-items: start; }
.sequence-runs .report-filter-preset { grid-template-columns: 1fr auto; align-items: center; }
.saved-prompt-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.saved-prompt-tools input { flex: 1; min-width: 120px; }
#report-save-filter { margin-top: 12px; }
#sequence-report-summary th small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
.sequence-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 10px; }
.sequence-totals div { background: var(--page); border-radius: 6px; padding: 8px; }
.sequence-totals dt, .sequence-runs time { color: var(--quiet); font-size: 11px; }
.sequence-totals dd { margin: 3px 0 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sequence-runs { list-style: none; padding: 0; margin: 0; }
.sequence-runs li { display: grid; gap: 5px; padding: 8px 0; border-top: 1px solid var(--line); }
.sequence-runs strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.sequence-runs span { color: var(--muted); font-size: 11px; }
/* Desk tokens (light). Base tokens live in shared.css; these restate them for the desk and
   add desk-only ones. Keep names stable: area sheets and feature modules read them. */
:root {
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --quiet: #8a8a8a;
  --page: #f7f7f6;
  --surface: #ffffff;
  --inset: #f7f7f6;
  --subnav: #f7f7f6;
  --hover: #f0f0ef;
  --selected: #ebebea;
  --line: #e6e6e4;
  --soft-line: #efefed;
  --control-line: #d9d9d6;
  --control-line-hover: #c4c4c0;
  --accent: #1f5eff;
  --accent-hover: #1747c7;
  --accent-soft: #eef3ff;
  --accent-line: #d4e0ff;
  --focus: #1f5eff;
  --focus-ring: color-mix(in srgb, var(--focus) 22%, transparent);
  --rail: #f2f2f0;
  --mark: #e8eeff;
  --toolbar-background: var(--surface);
  --queue-background: var(--subnav);
  --elevated: #ffffff;
  --primary-fill: #1a1a1a;
  --primary-hover: #333333;
  --primary-text: #ffffff;
  --rail-selection: #e2e2df;
  --rail-selection-line: transparent;
  --rail-hover: #e9e9e6;
  --note-background: #fff7e0;
  --note-composer: #fffbf0;
  --note-line: #f0dca0;
  --note-ink: #7a5512;
  --note-highlight: #f7e5b0;
  --note-mention: #65430d;
  --bubble-customer: #f2f2f0;
  --bubble-agent: #e8efff;
  --success-ink: #137a3f;
  --success-soft: #e7f6ec;
  --warning-ink: #9a5b00;
  --warning-soft: #fff4dc;
  --danger-ink: #c4262e;
  --danger-soft: #fdecec;
  --danger-hover: var(--danger-soft);
  --danger-line: #f1c4c6;
  --paused-ink: var(--warning-ink);
  --shadow: rgb(0 0 0 / .08);
  --dialog-shadow: rgb(0 0 0 / .18);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .05);
  --shadow-pop: 0 8px 28px rgb(0 0 0 / .12), 0 0 0 1px rgb(0 0 0 / .04);
  --shadow-dialog: 0 24px 64px rgb(0 0 0 / .18);
  --dialog-border: transparent;
  --backdrop: rgb(0 0 0 / .32);
}
/* Dark: neutral grays, no tint. */
:root[data-desk-theme="dark"] {
  color-scheme: dark;
  --ink: #ececec;
  --muted: #b4b4b4;
  --quiet: #8c8c8c;
  --page: #141414;
  --surface: #1c1c1c;
  --inset: #181818;
  --subnav: #181818;
  --hover: #262626;
  --selected: #2c2c2c;
  --line: #2e2e2e;
  --soft-line: #262626;
  --control-line: #3a3a3a;
  --control-line-hover: #4a4a4a;
  --accent: #6e95ff;
  --accent-hover: #93b0ff;
  --accent-soft: #1d2740;
  --accent-line: #2c3d66;
  --focus: #6e95ff;
  --rail: #111111;
  --rail-selection: #2c2c2c;
  --rail-hover: #222222;
  --mark: #253250;
  --toolbar-background: var(--surface);
  --queue-background: var(--subnav);
  --elevated: #212121;
  --primary-fill: #ececec;
  --primary-hover: #ffffff;
  --primary-text: #141414;
  --note-background: #3a3020;
  --note-composer: #29251c;
  --note-line: #5d4d33;
  --note-ink: #e8c989;
  --note-highlight: #514121;
  --note-mention: #f2d79c;
  --bubble-customer: #262626;
  --bubble-agent: #1f2a44;
  --success-ink: #6fd39a;
  --success-soft: #16301f;
  --warning-ink: #f2c36b;
  --warning-soft: #3a2c12;
  --danger-ink: #ff8f93;
  --danger-soft: #3d1d1f;
  --danger-line: #6a3438;
  --shadow: rgb(0 0 0 / .45);
  --dialog-shadow: rgb(0 0 0 / .6);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-pop: 0 8px 28px rgb(0 0 0 / .5), 0 0 0 1px rgb(255 255 255 / .06);
  --shadow-dialog: 0 24px 64px rgb(0 0 0 / .6);
  --dialog-border: #2e2e2e;
  --backdrop: rgb(0 0 0 / .55);
}
/* ---- Shell: light rail + 48px header ---- */
.rail { border-right: 1px solid var(--line); }
.rail-nav { gap: 4px; margin-top: 16px; }
.nav-link:hover { color: var(--ink); background: var(--rail-hover); }
.nav-link[aria-current] { color: var(--ink); background: var(--rail-selection); border-color: transparent; }
.workspace-header { background: var(--toolbar-background); flex-basis: 48px; }
.workspace-header h1 { font-size: 14px; font-weight: 600; letter-spacing: 0; }

/* ---- Global primitives (Foundation). Area sheets reuse these; see the spec notes. ---- */
/* Buttons: 32px default, 28px .small; primary = black (--primary-fill). */
.workspace .button, .setup-dialog .button { min-height: 32px; }
.workspace .button.icon-button, .setup-dialog .button.icon-button { width: 32px; min-height: 32px; }
.button { background: var(--surface); }
.button.primary { background: var(--primary-fill); color: var(--primary-text); border-color: var(--primary-fill); }
.button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
:is(.workspace, .setup-dialog, .rail) .button.small, .button.small { min-height: 28px; padding-inline: 10px; font-size: 12px; }
:is(.workspace, .setup-dialog) .button.icon-button.small, .button.icon-button.small { width: 28px; min-height: 28px; }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button.ghost:hover { background: var(--hover); color: var(--ink); }
.button.primary.danger { background: var(--danger-ink); border-color: var(--danger-ink); color: var(--primary-text); }
.button.primary.danger:hover { background: color-mix(in srgb, var(--danger-ink) 86%, var(--ink)); border-color: transparent; }
.button:disabled:hover { background: var(--surface); border-color: var(--control-line); }
.button.primary:disabled:hover { background: var(--primary-fill); border-color: var(--primary-fill); }
/* Dialog chrome shared by modal dialogs and the command palette. */
.actions-dialog, .setup-dialog { background: var(--elevated); box-shadow: var(--shadow-dialog); }
.actions-dialog::backdrop, .setup-dialog::backdrop { background: var(--backdrop); }
.action-item { background: transparent; }
.desk-form label:has(input[type="checkbox"]) input { width: auto; }
/* Badges / pills: .badge + .blue/.green/.yellow/.red (or data-tone). */
.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 20px; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge:is(.blue, [data-tone="blue"]) { background: var(--accent-soft); color: var(--accent); }
.badge:is(.green, [data-tone="green"]) { background: var(--success-soft); color: var(--success-ink); }
.badge:is(.yellow, [data-tone="yellow"]) { background: var(--warning-soft); color: var(--warning-ink); }
.badge:is(.red, [data-tone="red"]) { background: var(--danger-soft); color: var(--danger-ink); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* Cards: .desk-card with optional .desk-card-header (h3 + p + actions) and .desk-card-footer. */
.desk-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.desk-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.desk-card-header h3 { margin: 0; font-size: 15px; font-weight: 600; }
.desk-card-header p { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.desk-card-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin: 20px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); }
/* Page header: .desk-page-header > (div > h2.desk-page-title + p.desk-page-description) + .desk-page-actions. */
.desk-page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 20px; }
.desk-page-header h2, .desk-page-title { font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.desk-page-description { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.desk-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Underline tabs (.desk-tabs) and pill filter chips (.desk-chips). Active: aria-selected/pressed/current. */
.desk-tabs { display: flex; flex-wrap: wrap; gap: 0 20px; border-bottom: 1px solid var(--line); }
.desk-tabs > :is(button, a) { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 2px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.desk-tabs > :is(button, a):hover { color: var(--ink); }
.desk-tabs > :is([aria-selected="true"], [aria-pressed="true"], [aria-current]) { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.desk-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.desk-chips > :is(button, a, label > span) { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.desk-chips > :is(button, a):hover { background: var(--hover); color: var(--ink); }
.desk-chips > :is([aria-selected="true"], [aria-pressed="true"], [aria-current]) { background: var(--selected); color: var(--ink); }
/* Empty states: .desk-empty > .desk-empty-icon + h3 + p + .button.primary. */
.desk-empty { display: grid; justify-items: center; align-content: center; gap: 6px; max-width: 420px; margin: auto; padding: 48px 24px; text-align: center; }
.desk-empty-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 8px; border-radius: 50%; background: var(--hover); color: var(--muted); }
.desk-empty :is(h2, h3) { margin: 0; font-size: 15px; font-weight: 600; }
.desk-empty p { max-width: 360px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.desk-empty .button { margin-top: 10px; }
/* Tables: .desk-table-wrap > table (or table.desk-table); .contacts-results uses the same base. */
.desk-table-wrap { min-width: 0; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
:is(.desk-table-wrap > table, table.desk-table) { width: 100%; border-collapse: collapse; font-size: 13px; text-align: start; }
:is(.desk-table-wrap > table, table.desk-table) thead th { height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--inset); color: var(--muted); font-size: 12px; font-weight: 500; text-align: start; white-space: nowrap; }
:is(.desk-table-wrap > table, table.desk-table) tbody :is(th, td) { height: 48px; padding: 8px 16px; border-bottom: 1px solid var(--soft-line); text-align: start; }
:is(.desk-table-wrap > table, table.desk-table) tbody tr:last-child > * { border-bottom: 0; }
:is(.desk-table-wrap > table, table.desk-table) tbody tr:hover { background: var(--hover); }
:is(.desk-table-wrap > table, table.desk-table) tbody th[scope="row"] { color: var(--ink); font-size: 14px; font-weight: 500; }
/* Menus / popovers: .desk-menu container + .desk-menu-item rows (also applied to existing menus). */
.desk-menu { padding: 6px; border: 1px solid var(--dialog-border); border-radius: var(--radius-lg); background: var(--elevated); box-shadow: var(--shadow-pop); }
.desk-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font-size: 13px; font-weight: 400; text-align: start; }
.desk-menu-item:hover { background: var(--hover); }
.desk-menu-separator { height: 1px; margin: 6px -6px; background: var(--line); }
/* Existing floating panels adopt the popover look. */
.desk-ui :is(.mention-options, .saved-suggestions, .kb-filter-popover, .kb-insert-menu, .contact-popover) { border-color: var(--dialog-border); border-radius: var(--radius-lg); background: var(--elevated); box-shadow: var(--shadow-pop); }
.desk-ui :is(.mention-options button, .saved-option, #kb-insert-results button):is(:hover, [aria-selected="true"]) { background: var(--hover); color: var(--ink); }
[data-desk-theme="dark"] .avatar { background: #33373f; color: #dde2ea; }
[data-desk-theme="dark"] .avatar.tone-1 { background: #463c5a; color: #e6defa; }
[data-desk-theme="dark"] .avatar.tone-2 { background: #5a3d48; color: #fbe3ec; }
[data-desk-theme="dark"] .avatar.tone-3 { background: #34465a; color: #e1edfb; }
[data-desk-theme="dark"] .avatar.tone-4 { background: #5a4033; color: #f7e8df; }
[data-desk-theme="dark"] .avatar.tone-5 { background: #524731; color: #f8ebc9; }
[data-desk-theme="dark"] .avatar.agent-avatar { background: var(--mark); color: var(--accent-hover); }
[data-desk-theme="dark"] .article-prose .callout-warning { background: var(--note-background); }

/* Page pattern shared by Contacts, Reports, Knowledge, Workflows, Team, Events…: 24px (32 wide) padding,
   20px/600 title row with actions on the right. Sidebar + item styles live in desk-layout.css. */
.people-content { padding: 24px 32px 32px; }
.people-toolbar { min-height: 32px; margin-bottom: 16px; }
.people-toolbar h2, .contacts-controls h2 { font-size: 20px; letter-spacing: -.01em; font-weight: 600; }
.segments-sidebar { background: var(--subnav); padding-top: 12px; }
.segments-sidebar h2 { color: var(--ink); font-size: 16px; font-weight: 600; }
#report-list h3 { color: var(--quiet); font-size: 12px; font-weight: 600; }
.segment-link { min-height: 32px; padding-inline: 8px; font-size: 14px; }
.segment-link[aria-pressed="true"] { background: var(--selected); border-color: transparent; }
.contacts-view { background: var(--surface); padding: 24px 32px; }
.contacts-controls, .contacts-results { width: 100%; }
.contacts-controls { margin-bottom: 16px; }
.contacts-results { border-radius: var(--radius-lg); }
.contacts-results :is(th, td) { padding: 8px 16px; }
.contacts-results thead th { height: 40px; padding-block: 0; border-bottom-color: var(--line); background: var(--inset); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.contacts-results tbody :is(th, td) { height: 48px; border-bottom-color: var(--soft-line); }
.contacts-results tbody tr:hover { background: var(--hover); }
#contacts-results { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
#contacts-results .people-table tbody :is(th, td) { height: 48px; }
.people-table .contact-link { font-size: 14px; font-weight: 500; }
.people-table .contact-link .avatar { --avatar-size: 28px; --avatar-font: 11px; }
.contact-type { border: 0; border-radius: 999px; padding: 2px 8px; background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 500; }
.people-results-toolbar p { color: var(--ink); font-size: 13px; }
.event-filters { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.saved-library { max-width: none; }
.saved-library-row { padding-block: 10px; }
.saved-library-row:hover { background: var(--hover); }
.report-filters { background: var(--inset); border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
.report-chart { padding: 13px; }
.kb-preview, .kb-write-area, .kb-article-details { border-radius: 8px; }

.queue-panel { background: var(--queue-background); padding-top: 14px; }
.queue-link { min-height: 34px; }
.list-controls { padding: 11px 11px 8px; background: var(--toolbar-background); }
.conversation-row { padding: 8px 10px 8px 8px; }
.conversation-row .avatar { --avatar-size: 29px; }
.thread-header { background: var(--toolbar-background); }
[data-desk-theme="dark"] .customer .message-body { background: var(--hover); }
[data-desk-theme="dark"] .agent .message-body { background: #283947; }

.people-filters { padding: 0 0 9px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.filter-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }
.filter-chip-row:empty { display: none; }
.filter-chip { display: inline-flex; min-width: 0; max-width: 100%; align-items: stretch; background: var(--inset); border: 1px solid var(--control-line); border-radius: 8px; }
.filter-chip-main { display: inline-flex; align-items: center; gap: 6px; min-width: 0; min-height: 32px; padding: 0 8px; border: 0; border-radius: 7px 0 0 7px; background: transparent; color: var(--ink); font-size: 12px; }
.filter-chip-main .icon { color: var(--accent); transform: scale(.88); }
.filter-chip-main span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.filter-chip-main strong { font-weight: 600; }
.filter-chip-remove, .filter-group-remove { display: inline-grid; place-items: center; min-width: 28px; min-height: 27px; padding: 0; background: none; border: 0; color: var(--quiet); }
.filter-chip-remove { border-left: 1px solid var(--control-line); border-radius: 0 7px 7px 0; }
.filter-chip-remove .icon, .filter-group-remove .icon { transform: scale(.76); }
.filter-chip-main:hover, .filter-chip-remove:hover, .filter-group-remove:hover { background: var(--hover); color: var(--ink); }
.filter-join-label { font-size: 10px; font-weight: 600; color: var(--quiet); }
.nested-filter-group { max-width: 100%; margin: 0; padding: 5px; background: var(--page); border: 1px dashed var(--control-line); border-radius: 8px; }
.nested-filter-group .filter-chip-row { margin-bottom: 1px; }
.filter-group-actions { margin-top: 4px; }
.filter-text-action { border: 0; border-radius: 5px; padding: 5px 7px; min-height: 28px; background: transparent; color: var(--accent); font-size: 12px; font-weight: 600; }
.filter-text-action:hover { background: var(--accent-soft); }
.filter-add-group { color: var(--quiet); }
.segment-actions { margin-top: 7px; }
.contact-popover {
  position: fixed; inset: auto; margin: 0; padding: 9px; width: min(340px, calc(100vw - 20px));
  max-height: calc(100dvh - 20px); overflow: auto; border: 1px solid var(--control-line); border-radius: 9px;
  background: var(--elevated); color: var(--ink); box-shadow: 0 14px 38px var(--shadow);
}
.contact-popover-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; }
.contact-popover-head h2 { font-size: 13px; }
.contact-popover .button { min-height: 28px; font-size: 11px; }
.contact-popover .button.icon-button { width: 28px; }
#filter-picker-results { max-height: min(410px, 55dvh); margin-top: 7px; }
#filter-picker-results h3 { margin: 4px 0 0; padding-block: 4px; }
.filter-choice { font-size: 13px; }
#contact-rule-choices { max-height: min(410px, 52dvh); overflow: auto; }
.filter-operator-group { padding: 3px 0; margin: 0 0 3px; border: 0; min-width: 0; }
.filter-operator-group legend { padding: 0 5px; color: var(--quiet); font-size: 11px; font-weight: 500; }
.operator-choice > label { display: flex; gap: 7px; align-items: center; min-height: 27px; padding: 2px 5px; border-radius: 5px; font-size: 12px; cursor: pointer; }
.operator-choice > label:hover { background: var(--hover); }
.operator-choice input[type="radio"] { accent-color: var(--accent); margin: 0; }
.filter-operand { display: flex; align-items: center; gap: 6px; padding: 2px 6px 7px 24px; color: var(--quiet); font-size: 11px; }
.filter-operand :is(input, select) { width: 100%; }
.filter-operand > span { white-space: nowrap; }
.contact-popover-footer { display: flex; justify-content: flex-end; gap: 6px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 850px) {
  .people-content, .contacts-view { padding: 12px; }
  .segments-sidebar { padding-top: 8px; }
  .rail-nav { margin-top: 14px; }
}

#contact-column-options { max-height: min(410px, 52dvh); overflow: auto; margin-top: 6px; }
#contact-column-options label { display: flex; align-items: center; gap: 7px; min-height: 28px; padding: 2px 6px; color: var(--ink); font-size: 12px; cursor: pointer; border-radius: 5px; }
#contact-column-options label:hover { background: var(--hover); }
#contact-column-options input { accent-color: var(--accent); margin: 0; }
#contacts-results th:first-child { min-width: 140px; }
#contacts-results .people-table :is(th, td) { white-space: nowrap; }
#contacts-results .contact-link { max-width: 235px; }
#contacts-results :is(.contact-link span:last-child, .contact-cell-value) { overflow: hidden; text-overflow: ellipsis; }
#contacts-results .contact-cell-value { display: block; max-width: 280px; }
#contacts-results .contact-chat-button { min-height: 25px; width: 27px; background: transparent; border-color: transparent; }
#contacts-results .contact-chat-button:hover { background: var(--accent-soft); }

.outbound-view { flex: 1; background: var(--page); }
.outbound-view h2 { margin: 0; }
#outbound-library { max-width: 1240px; margin: 0 auto; padding: clamp(12px, 2vw, 28px) clamp(0px, (100vw - 760px) / 40, 14px) 24px; }
.outbound-library-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px 24px; margin-bottom: 24px; }
.outbound-library-header h2 { font-size: clamp(25px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -.04em; font-weight: 600; }
.outbound-library-header p { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.outbound-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#outbound-library .outbound-header-actions .button { min-height: 39px; padding-inline: 13px; }
.outbound-plus { font-size: 19px; line-height: .8; }
.outbound-library-panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 2px 4px color-mix(in srgb, var(--shadow) 35%, transparent); }
.outbound-status-bar, .outbound-library-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-inline: 16px; border-bottom: 1px solid var(--line); }
.outbound-status-bar { min-height: 49px; }
.outbound-statuses { display: flex; flex-wrap: wrap; gap: 0 4px; }
.outbound-statuses button { min-height: 48px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 2px 10px 0; white-space: nowrap; font-size: 13px; font-weight: 500; }
.outbound-statuses button:hover { color: var(--ink); background: var(--inset); }
.outbound-statuses button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.outbound-statuses button:focus-visible { outline-offset: -3px; }
#outbound-result-count { padding-block: 8px; color: var(--quiet); font-size: 12px; font-variant-numeric: tabular-nums; }
.outbound-library-toolbar { padding-block: 12px; }
.outbound-search-actions, .outbound-view-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.outbound-search-actions { flex: 1 1 355px; }
.outbound-search-actions .search-field { flex: 0 1 270px; height: 36px; min-width: min(145px, 100%); padding-inline: 9px; background: var(--surface); border-color: var(--control-line); }
.outbound-search-actions .search-field:focus-within { border-color: var(--focus); }
.outbound-search-actions .search-field input { font-size: 13px; }
#outbound-library .outbound-library-toolbar .button { min-height: 36px; }
#toggle-outbound-filters[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
.outbound-filter-icon { display: inline-block; width: 15px; height: 12px; color: var(--muted); background: linear-gradient(currentColor 0 0) center 1px / 14px 1.5px no-repeat, linear-gradient(currentColor 0 0) center / 10px 1.5px no-repeat, linear-gradient(currentColor 0 0) center 10px / 5px 1.5px no-repeat; }
.outbound-filter-count { min-width: 18px; padding: 2px 4px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 11px; text-align: center; }
.outbound-text-action { padding: 5px; border: 0; border-radius: 5px; background: transparent; color: var(--accent); font-size: 12px; font-weight: 500; }
.outbound-text-action:hover { text-decoration: underline; }
.outbound-view-actions select { max-width: min(190px, 100%); }
.outbound-filter-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--inset); }
.outbound-filter-fields label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.outbound-filter-fields :is(input, select) { width: 100%; }
.outbound-selection { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--accent-line); background: var(--accent-soft); font-size: 13px; }
#outbound-selection-count { margin-inline-end: 6px; font-weight: 500; }
#outbound-library-error { padding: 12px 16px; border-bottom: 1px solid var(--line); }
#outbound-results { overflow-x: auto; border-radius: 0 0 12px 12px; }
#outbound-results:focus-visible { outline-offset: -2px; }
.outbound-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: start; }
.outbound-table :is(th, td) { padding: 10px 14px; border-bottom: 1px solid var(--soft-line); text-align: start; white-space: nowrap; }
.outbound-table thead th { background: var(--inset); color: var(--muted); font-size: 12px; font-weight: 500; }
.outbound-table tbody tr:last-child > * { border-bottom: 0; }
.outbound-table tbody tr:hover, .outbound-table tbody tr:focus-within { background: var(--inset); }
.outbound-table tbody tr:has(input:checked) { background: var(--accent-soft); }
.outbound-table .outbound-row-select { width: 42px; padding-inline: 15px 6px; }
.outbound-row-select input { width: 15px; height: 15px; margin: 0; vertical-align: middle; accent-color: var(--primary-fill); }
.outbound-table .contact-link { min-height: 32px; min-width: 130px; max-width: 240px; border-radius: 5px; white-space: normal; overflow-wrap: anywhere; }
.outbound-table .contact-link:hover { color: var(--accent); text-decoration: underline; }
.outbound-row-icon { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.outbound-table td { max-width: 205px; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.outbound-table td[data-column="sender"] { min-width: 224px; max-width: 255px; }
.outbound-table td[data-column="updated"] { min-width: 116px; }
.outbound-table .sequence-badge { display: inline-flex; gap: 6px; align-items: center; background: var(--surface); white-space: nowrap; }
.outbound-table .sequence-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.outbound-table .sequence-badge[data-state="scheduled"] { color: var(--accent); }
.outbound-empty { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 300px; padding: 28px 18px; text-align: center; }
.outbound-empty-mark { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 8px; border: 1px solid var(--accent-line); border-radius: 21px; background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.outbound-empty-mark .icon { transform: scale(1.45); }
.outbound-empty h3 { margin: 0; font-size: 19px; line-height: 1.3; letter-spacing: -.025em; }
.outbound-empty p { max-width: 34ch; color: var(--muted); font-size: 13px; line-height: 1.55; }
#outbound-library .outbound-empty .button { min-height: 36px; margin-top: 7px; }
@media (max-width: 650px) {
  .outbound-library-header { margin-bottom: 18px; }
  .outbound-status-bar, .outbound-library-toolbar, .outbound-filter-fields { padding-inline: 10px; }
  .outbound-status-bar { gap: 0; padding-block: 3px; }
  .outbound-statuses button { min-height: 38px; padding-inline: 7px; font-size: 12px; }
  #outbound-result-count { padding-inline: 7px; }
  .outbound-search-actions .search-field { flex: 1 1 145px; }
  .outbound-empty { min-height: 265px; }
}
.outbound-back { border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); padding: 6px 9px; white-space: nowrap; font-size: 12px; font-weight: 500; }
.outbound-back:hover { color: var(--ink); background: var(--hover); }
#outbound-view:has(#outbound-editor:not([hidden])) { padding-top: 0; scroll-padding-top: 116px; }
#outbound-editor { min-width: 0; max-width: 1440px; margin-inline: auto; }
.outbound-editor-header { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 13px 0 0; background: var(--page); }
.outbound-editor-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.outbound-title { display: flex; flex: 1 1 285px; align-items: center; gap: 6px; min-width: 0; }
.outbound-title h2 { font-size: 20px; font-weight: 600; letter-spacing: -.025em; overflow-wrap: anywhere; }
.outbound-title .desk-title-field { field-sizing: content; min-width: min(12ch, 100%); width: auto; max-width: 100%; }
.outbound-title .sequence-badge, #back-outbound { flex: 0 0 auto; }
#back-outbound { border-color: transparent; background: transparent; color: var(--muted); }
#back-outbound:hover { background: var(--hover); color: var(--ink); }
#outbound-editor .sequence-top-actions .button { min-height: 36px; }
.outbound-editor-nav { display: flex; flex-wrap: wrap; gap: 2px 17px; min-width: 0; border-bottom: 1px solid var(--line); }
.outbound-editor-nav a { display: inline-flex; align-items: center; min-height: 35px; padding-inline: 2px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.outbound-editor-nav a:hover, .outbound-editor-nav a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }
#outbound-error { margin-bottom: 8px; overflow-wrap: anywhere; }
.sequence-badge[data-state="sending"], .sequence-badge[data-state="sent"] { color: var(--success-ink); background: var(--success-soft); }
.sequence-badge[data-state="completed_with_errors"] { color: var(--warning-ink); background: var(--warning-soft); }
.outbound-editor-form { display: grid; gap: 14px; margin-top: 13px; }
.outbound-stage, .outbound-studio { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.outbound-stage { display: grid; gap: 13px; padding: clamp(14px, 1.7vw, 22px); }
.outbound-stage h3, .outbound-studio h3 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
.outbound-studio { overflow: hidden; }
.outbound-studio-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 49px; padding: 8px 17px; border-bottom: 1px solid var(--line); }
#outbound-preview-format { padding: 5px 9px; border: 1px solid var(--accent-line); border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 500; }
.outbound-studio-layout { display: grid; grid-template-columns: clamp(210px, 21vw, 255px) minmax(0, 1fr); }
.outbound-studio-settings { display: grid; align-content: start; gap: 15px; min-width: 0; padding: 17px; border-inline-end: 1px solid var(--line); }
.outbound-primary-settings { display: grid; gap: 12px; min-width: 0; }
.outbound-studio-settings details > summary { font-size: 12px; }
#outbound-form .outbound-studio-settings input[type="file"] { padding: 5px; overflow: hidden; font-size: 11px; }
.outbound-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.outbound-editor-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 7px; }
.outbound-disclosure { min-width: 0; border-top: 1px solid var(--soft-line); }
.outbound-disclosure summary { padding-top: 9px; color: var(--muted); font-size: 13px; font-weight: 500; }
.outbound-details-content { display: grid; gap: 10px; margin-top: 9px; }
.outbound-details-content > .outbound-details-content { margin-top: 0; }
.outbound-details-content.outbound-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#outbound-form .outbound-check { display: flex; align-items: center; gap: 7px; }
#outbound-form .outbound-check input { margin: 0; accent-color: var(--primary-fill); }
.outbound-recipient-count { display: block; margin-bottom: 4px; font-size: 17px; }
.outbound-audience-sample, .outbound-exclusions { margin-top: 8px; color: var(--muted); font-size: 12px; }
.outbound-sample, .outbound-issues { list-style: none; padding: 0; margin: 8px 0 0; }
.outbound-sample li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
.outbound-sample small { color: var(--quiet); font-size: 11px; white-space: pre-wrap; }
.outbound-canvas { display: flex; flex-direction: column; min-width: 0; background: var(--inset); }
.outbound-canvas-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 54px; padding: 8px 15px; border-bottom: 1px solid var(--line); background: var(--surface); }
.outbound-canvas-modes { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--inset); }
.outbound-canvas-modes button { min-height: 28px; padding: 3px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.outbound-canvas-modes button:hover { color: var(--ink); }
.outbound-canvas-modes [aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.outbound-device { margin-inline-start: auto; }
.outbound-canvas-scene { display: flex; flex: 1; padding: clamp(15px, 3vw, 42px); background: radial-gradient(circle at 88% 88%, var(--accent-soft), transparent 67%), var(--inset); }
.outbound-canvas-window { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, min(395px, 92%)); grid-template-rows: minmax(35px, 1fr) auto auto; gap: 7px 0; width: 100%; min-height: 345px; margin-inline: auto; }
.outbound-message-surface { grid-area: 2 / 2 / 3 / 3; min-width: 0; border: 1px solid var(--accent-line); border-radius: 14px 14px 14px 5px; background: var(--surface); box-shadow: 0 8px 22px var(--shadow); overflow: hidden; }
.outbound-message-surface:focus-within { border-color: var(--focus); }
.outbound-canvas-sender { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 11px 13px; border-bottom: 1px solid var(--soft-line); background: var(--inset); color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.outbound-canvas-sender small { display: block; margin-top: 2px; color: var(--quiet); font-size: 11px; }
.outbound-canvas-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
#outbound-form .outbound-canvas-subject { grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 9px; padding-inline: 13px; border-bottom: 1px solid var(--soft-line); }
#outbound-form .outbound-canvas-subject input, #outbound-form #outbound-write-message textarea { border: 0; border-radius: 0; background: transparent; outline: none; }
#outbound-form .outbound-canvas-subject input { padding-inline: 0; font-size: 13px; }
#outbound-form #outbound-write-message textarea { field-sizing: content; min-height: 108px; max-height: 320px; padding: 12px 14px; color: var(--ink); font-size: 14px; line-height: 1.55; }
#outbound-form #outbound-write-message textarea::placeholder { color: var(--quiet); }
.outbound-message-inserts { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 6px 8px; border-top: 1px solid var(--soft-line); background: var(--inset); }
#outbound-editor .outbound-message-inserts .button { min-height: 32px; padding: 3px 6px; font-size: 12px; font-weight: 500; }
.outbound-canvas-reply { grid-area: 3 / 2 / 4 / 3; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--quiet); background: var(--surface); font-size: 12px; }
.outbound-preview-subject { display: block; padding: 13px 14px 0; font-size: 15px; overflow-wrap: anywhere; }
#outbound-preview-copy { padding: 13px 14px; color: var(--ink); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.outbound-preview-image { display: block; width: min(calc(100% - 28px), 100%); height: auto; max-height: 220px; margin: 11px 14px 0; object-fit: contain; border-radius: 7px; }
#outbound-canvas-action { padding: 3px 14px 12px; }
.outbound-preview-action { display: inline-block; max-width: 100%; padding: 7px 11px; border-radius: 7px; color: var(--primary-text); background: var(--primary-fill); font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
[data-presentation="email"] .outbound-canvas-window { grid-template-rows: auto 1fr; }
[data-presentation="email"] .outbound-message-surface { grid-area: 1 / 1 / 2 / -1; align-self: start; width: min(100%, 615px); margin-inline: auto; border-radius: 10px; }
[data-presentation="banner"] .outbound-canvas-window { grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
[data-presentation="banner"] .outbound-message-surface { grid-area: 1 / 1 / 2 / -1; border: 0; border-radius: 0; background: var(--accent-soft); box-shadow: none; }
#outbound-form [data-presentation="banner"] #outbound-write-message textarea { min-height: 53px; text-align: center; }
[data-presentation="banner"] #outbound-preview-copy { color: var(--accent); text-align: center; font-weight: 500; }
[data-presentation="teaser"] .outbound-message-surface { border-inline-start: 3px solid var(--accent); }
[data-preview-width="mobile"] .outbound-canvas-window { max-width: 345px; grid-template-columns: minmax(0, 1fr); }
[data-preview-width="mobile"] :is(.outbound-message-surface, .outbound-canvas-reply) { grid-column: 1 / -1; }
.outbound-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.outbound-issues { color: var(--muted); font-size: 12px; }
.outbound-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#outbound-confirm-summary { margin: 10px 0 0; overflow-wrap: anywhere; }
.outbound-format-dialog { width: min(750px, calc(100% - 24px)); }
.outbound-format-dialog > p { margin: 8px 0 15px; color: var(--muted); font-size: 13px; }
.outbound-formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.outbound-formats button { display: grid; grid-template-columns: minmax(0, 1fr) 18px; align-items: start; gap: 9px; min-height: 118px; width: 100%; padding: 11px; border: 1px solid var(--control-line); border-radius: 11px; background: var(--surface); text-align: start; }
.outbound-formats button:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.outbound-formats button strong, .outbound-formats button small { display: block; }
.outbound-formats button strong { font-size: 14px; }
.outbound-formats button small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.outbound-formats button .outbound-format-icon { grid-column: 1 / -1; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
@media (max-width: 760px) {
  #outbound-view:has(#outbound-editor:not([hidden])) { scroll-padding-top: 12px; }
  .outbound-editor-header { position: static; }
  .outbound-studio-layout { grid-template-columns: minmax(0, 1fr); }
  .outbound-studio-settings { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .outbound-primary-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .outbound-canvas-window { grid-template-columns: minmax(0, 1fr); }
  .outbound-message-surface, .outbound-canvas-reply { grid-column: 1 / -1; }
  .outbound-formats { grid-template-columns: 1fr; }
  .outbound-formats button { grid-template-columns: 35px minmax(0, 1fr) 18px; align-items: center; min-height: 60px; }
  .outbound-formats button .outbound-format-icon { grid-column: auto; }
}
@media (max-width: 480px) {
  .outbound-field-grid, .outbound-details-content.outbound-field-grid { grid-template-columns: minmax(0, 1fr); }
  .outbound-editor-nav { gap: 0 12px; }
  .outbound-editor-nav a { min-height: 32px; font-size: 12px; }
  .outbound-canvas-window { min-height: 285px; }
  .outbound-canvas-scene { padding: 9px; }
  .outbound-canvas-toolbar { padding-inline: 9px; }
  .outbound-title .desk-title-field { min-width: 0; }
}

#pending-chat-replies li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; }
.pending-reply-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.pending-reply-time { color: var(--muted); font-size: 12px; }
#pending-chat-replies .button { flex-shrink: 0; }

.campaign-library-controls { display:flex; flex-wrap:wrap; align-items:end; gap:8px 14px; margin:10px 0; }
.campaign-library-controls label { display:grid; gap:4px; font-size:12px; color:var(--muted); }
.campaign-library-controls :is(select,input) { min-height:32px; max-width:190px; }
#outbound-library-columns > div { display:flex; flex-wrap:wrap; gap:6px 12px; }
#outbound-library-columns label { display:flex; gap:5px; align-items:center; }
.forward-preview { padding: 9px; border: 1px solid var(--line); border-radius: 7px; }
.forward-preview h3, .forward-preview blockquote { margin: 0; }
.forward-preview blockquote { max-height: 30vh; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.email-side-links { display: grid; gap: 5px; padding: 0; list-style: none; }
.email-side-links button { max-width: 100%; text-align: start; white-space: normal; }
.reply-email-participant { display: flex; align-items: center; gap: 8px; padding: 4px 10px; color: var(--muted); font-size: 13px; }
.reply-email-participant select { max-width: 85%; }

.call-operations-dialog { width: min(860px, calc(100% - 24px)); max-height: calc(100dvh - 30px); }
.call-dashboard-filters, .call-dashboard-queue li, .call-dashboard-queue form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.call-dashboard-filters label, .call-dashboard-queue label { display: grid; gap: 3px; }
.call-dashboard-queue { list-style: none; padding: 0; }
.call-dashboard-queue li { justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.call-dashboard-queue li span { display: block; font-size: 13px; padding-top: 3px; }
.call-dashboard-table { overflow: auto; }
.call-dashboard-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.call-dashboard-table :is(th, td) { padding: 8px; text-align: left; border-bottom: 1px solid var(--line); }
.call-dashboard-tab-editor { margin-top: 14px; }

#call-recording-player { width: min(100%, 420px); }
#call-recordings > label { display: grid; gap: 4px; }
.call-supervision-players { display: grid; gap: 8px; margin-top: 14px; }
.call-supervision-players label { display: grid; gap: 4px; }
.call-supervision-players audio { width: 100%; }

.browser-line-option { display: grid; grid-template-columns: 65px 1fr 1fr 1fr auto; align-items: end; gap: 7px; margin: 0 0 8px; }
.browser-line-option label { display: grid; gap: 4px; min-width: 0; }
.browser-line-option :is(input, select) { width: 100%; }
#browser-line-inbox .queue-link { white-space: normal; text-align: left; }
@media (max-width: 720px) {
  .browser-line-option { grid-template-columns: 65px 1fr; }
}

#relay-voice-preview, .relay-voice-message audio { width: min(100%, 340px); }
#relay-voice-preview { margin-top: 12px; }
.relay-voice-message details { margin-top: 6px; }
.relay-voice-message p { white-space: pre-wrap; }
