/* Canonical shared components and admin UI. */

.topbar-actions { min-width: 0; display: flex; align-items: center; gap: 6px; }
.compact-search { flex: 0 1 360px; }

/* Dialogs */
.compose-dialog,
.profile-dialog {
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
}
.compose-dialog { width: min(680px, calc(100vw - 24px)); }
.profile-dialog { width: min(700px, calc(100vw - 24px)); }
.compose-dialog::backdrop,
.profile-dialog::backdrop { background: rgba(8, 15, 26, .56); }
.compose-dialog form,
.profile-dialog form { display: grid; gap: 0; }
.compose-dialog header,
.profile-dialog header,
.profile-dialog footer { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.profile-dialog footer { border-top: 1px solid var(--line); border-bottom: 0; }
.compose-dialog form > label { min-height: 38px; display: grid; grid-template-columns: 64px minmax(0,1fr); align-items: center; gap: 6px; padding: 0 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.compose-dialog form > label input { border: 0; background: transparent; box-shadow: none; }
.compose-dialog textarea { min-height: 240px; padding: 10px 12px; border: 0; border-radius: 0; background: var(--surface); box-shadow: none; resize: vertical; }
.compose-address-row { min-height: 38px; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 5px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.compose-extra-row { grid-template-columns: 44px minmax(0,1fr); }
.compose-recipient-actions { display: flex; gap: 2px; }
.compose-footer { min-height: 44px; display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-top: 1px solid var(--line); }
.compose-footer select { width: 150px; }
.compose-footer .selected-files { flex: 1 1 auto; }

.profile-form-grid { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 16px; padding: 16px; }
.profile-avatar-column { display: grid; justify-items: center; align-content: start; gap: 8px; }
.profile-avatar-preview { width: 92px; height: 92px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 22px; font-weight: 900; }
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-fields { display: grid; gap: 10px; }
.profile-fields > label { display: grid; gap: 4px; color: var(--text-2); font-size: 11.5px; font-weight: 750; }
.signature-field { display: grid; gap: 6px; }
.field-title { color: var(--text-2); font-size: 11.5px; font-weight: 800; }
.signature-toolbar { display: flex; align-items: center; gap: 6px; }
.signature-editor { min-height: 130px; max-height: 360px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); outline: none; }
.signature-editor:focus,
.signature-admin-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent); }
.signature-editor img,
.signature-admin-editor img { max-width: 100%; height: auto; }

/* Contact review */
.contact-review-list { overflow: hidden; }
.contact-review-tools { display: grid; grid-template-columns: minmax(0,1fr) 108px; gap: 6px; padding: 7px 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.contact-review-tools .searchbox { width: 100%; max-width: none; min-width: 0; }
.contact-review-tools .searchbox input { width: 100%; min-width: 0; }
.contact-review-tools select { min-width: 0; height: 30px; font-size: 10.5px; }
.contact-review-detail { overflow-y: auto; overflow-x: hidden; }
.contact-review-mobile-back { display: none; }
.contact-review-row {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) 54px;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.contact-review-row:hover { background: var(--surface-2); }
.contact-review-row.active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.contact-review-avatar { width: 30px; height: 30px; font-size: 10px; }
.contact-review-row-main { min-width: 0; display: grid; gap: 1px; }
.contact-review-row-main strong,
.contact-review-row-main small,
.contact-review-row-main em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-review-row-main strong { font-size: 12px; }
.contact-review-row-main small { color: var(--muted); font-size: 10.5px; }
.contact-review-row-main em { color: var(--text-2); font-size: 10.5px; font-style: normal; }
.contact-review-row-meta { display: grid; justify-items: end; gap: 3px; }
.contact-review-row-meta b { min-width: 19px; height: 18px; display: grid; place-items: center; padding: 0 5px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 10px; }
.contact-review-row-meta small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.contact-review-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.contact-review-head > div { min-width: 0; display: flex; align-items: center; gap: 9px; }
.contact-review-detail-avatar { width: 36px; height: 36px; font-size: 11px; }
.contact-review-head h2 { margin: 0 0 1px; font-size: 14px; }
.contact-review-head p { margin: 0; color: var(--muted); font-size: 11px; }
.contact-review-requests { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 10.5px; font-weight: 750; }
.contact-review-workspace { max-width: 980px; display: grid; grid-template-columns: minmax(240px, .72fr) minmax(420px, 1.28fr); gap: 12px; align-items: start; padding: 14px; }
.contact-review-evidence, .contact-create-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-card); }
.contact-review-evidence { padding: 11px; }
.contact-review-evidence > header { margin-bottom: 9px; }
.contact-review-evidence > header b { font-size: 11px; }
.contact-evidence-grid { display: grid; gap: 7px; }
.contact-evidence-grid > span { display: grid; gap: 2px; padding: 7px 8px; border-radius: 7px; background: var(--surface-2); }
.contact-evidence-grid small, .contact-evidence-subjects > small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.contact-evidence-grid b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.contact-evidence-subjects { margin-top: 10px; }
.contact-evidence-subjects ul { margin: 6px 0 0; padding-left: 16px; color: var(--text-2); font-size: 10.5px; line-height: 1.45; }
.contact-create-card { overflow: hidden; }
.contact-create-head { min-height: 48px; display: flex; align-items: center; padding: 0 11px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.contact-create-head > div { min-width: 0; display: grid; gap: 1px; }
.contact-create-head b { font-size: 11.5px; }
.contact-create-head span { color: var(--muted); font-size: 9.5px; }
.contact-review-form { padding: 0; }
.contact-review-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; padding: 11px; }
.contact-review-form-grid label { min-width: 0; display: grid; gap: 3px; color: var(--text-2); font-size: 11px; font-weight: 750; }
.contact-review-form-grid label.wide { grid-column: 1 / -1; }
.contact-review-form-grid input { height: 30px; font-size: 11px; }
.contact-review-form-grid textarea { min-height: 70px; font-size: 11px; }
.contact-more-fields { margin: 0 11px; border-top: 1px solid var(--line); }
.contact-more-fields > summary { min-height: 38px; display: flex; align-items: center; color: var(--text-2); font-size: 10.5px; font-weight: 760; cursor: pointer; }
.contact-more-fields > .contact-review-form-grid { padding: 0 0 11px; }
.contact-review-actions { display: flex; justify-content: flex-end; gap: 7px; padding: 10px 11px 11px; border-top: 1px solid var(--line); }
.contact-review-empty { min-height: 120px; display: grid; place-items: center; padding: 16px; color: var(--muted); font-size: 11.5px; text-align: center; }
.contact-review-empty.large { min-height: 260px; }

/* Admin */
.admin-view-v3 { padding: 0; }
.admin-shell-v3 { min-height: calc(100vh - var(--topbar-h) - 18px); display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 14px; overflow: hidden; }
.admin-sidebar-v3 { min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 10px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); }
.admin-nav-group { display: grid; gap: 3px; }
.admin-nav-group > span { padding: 0 9px 4px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.admin-nav-item { width: 100%; min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 9px; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 11px; font-weight: 730; text-align: left; }
.admin-nav-item:hover { background: var(--surface-3); color: var(--text); }
.admin-nav-item.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.nav-svg { width: 17px; height: 17px; flex: 0 0 auto; display: grid; place-items: center; }
.nav-svg svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-content-v3 { min-width: 0; min-height: 0; overflow-y: auto; padding: 0 2px 30px; }
.admin-title-row-v3 { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; }
.admin-title-row-v3 h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.admin-title-actions-v3 { display: flex; gap: 7px; }
.admin-title-actions-v3 .button { min-height: 32px; }
.admin-panel-v3 { min-width: 0; }
.admin-master-detail { height: calc(100vh - var(--topbar-h) - 76px); max-height: 820px; min-height: 480px; display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); }
.admin-list-pane { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); border-right: 1px solid var(--line); background: var(--surface-2); overflow: hidden; }
.admin-list-tools { display: grid; grid-template-columns: minmax(0,1fr) 104px; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.user-list-tools { grid-template-columns: minmax(0,1fr) 118px 104px; }
.signatures-master-detail .admin-list-tools { grid-template-columns: 1fr; }
.admin-list-tools input, .admin-list-tools select { height: 32px; font-size: 10.5px; }
.admin-entity-list { min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; }
.admin-entity-row { width: 100%; min-height: 54px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto 14px; align-items: center; gap: 8px; padding: 7px 9px; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); text-align: left; }
.admin-entity-row:hover { background: var(--surface-3); }
.admin-entity-row.selected { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.admin-entity-avatar { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 8.5px; font-weight: 900; }
.admin-entity-avatar.large { width: 38px; height: 38px; }
.admin-entity-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.admin-entity-copy { min-width: 0; display: grid; gap: 2px; }
.admin-entity-copy b, .admin-entity-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-entity-copy b { font-size: 11px; }
.admin-entity-copy small { color: var(--muted); font-size: 10.5px; }
.admin-source-pill { padding: 2px 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 800; }
.admin-source-pill.staff { background: var(--success-soft); color: var(--success); }
.admin-row-chevron { color: var(--muted); font-size: 18px; }
.admin-list-empty, .admin-empty-inspector { color: var(--muted); font-size: 10.5px; }
.admin-list-empty { padding: 18px 12px; text-align: center; }
.admin-inspector-pane { min-width: 0; overflow-y: auto; background: var(--surface-inset); }
.admin-empty-inspector { min-height: 100%; display: grid; place-content: center; gap: 3px; text-align: center; }
.admin-empty-inspector b { color: var(--text-2); font-size: 12px; }
.admin-inspector-card { min-height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr) auto; background: var(--surface); }
.admin-inspector-head { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.admin-inspector-head > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.admin-inspector-head > div > span:last-child { min-width: 0; display: grid; gap: 2px; }
.admin-inspector-head b { font-size: 12px; }
.admin-inspector-head small { color: var(--muted); font-size: 10px; }
.admin-inspector-body { min-height: 0; display: grid; align-content: start; gap: 14px; padding: 14px; overflow-y: auto; }
.admin-inspector-actions { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
.identity-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.identity-grid > span { min-width: 0; display: grid; gap: 3px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.identity-grid small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.identity-grid b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.admin-form-grid label, .setting-group-grid label, .admin-dialog-body > label { min-width: 0; display: grid; gap: 4px; color: var(--text-2); font-size: 10px; font-weight: 740; }
.admin-form-grid .wide { grid-column: 1/-1; }
.admin-subsection { display: grid; gap: 7px; }
.admin-subsection > header b { font-size: 10.5px; }
.admin-advanced { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.admin-advanced > summary { min-height: 38px; display: flex; align-items: center; padding: 0 10px; cursor: pointer; list-style: none; color: var(--text-2); font-size: 10.5px; font-weight: 760; }
.admin-advanced > summary::-webkit-details-marker { display: none; }
.admin-advanced > summary::after { content: '›'; margin-left: auto; color: var(--muted); font-size: 16px; transform: rotate(90deg); transition: transform .14s ease; }
.admin-advanced[open] > summary::after { transform: rotate(-90deg); }
.admin-advanced-body { display: grid; gap: 8px; padding: 9px 10px 10px; border-top: 1px solid var(--line); }
.admin-advanced-body label { display: grid; gap: 4px; color: var(--text-2); font-size: 10px; font-weight: 740; }
.role-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.role-choice-grid label { min-height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 10.5px; }
.role-checks { display: flex; flex-wrap: wrap; gap: 7px 12px; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.role-checks legend { color: var(--muted); font-size: 9.5px; font-weight: 780; }
.role-checks label { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; }
.status-pill { display: inline-flex; justify-self: start; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 820; text-transform: capitalize; }
.status-pill.active { background: var(--success-soft); color: var(--success); }
.status-pill.inactive { background: var(--danger-soft); color: var(--danger); }
.ghost-danger { background: transparent; }
.workspace-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px color-mix(in srgb,var(--muted) 10%,transparent); }
.workspace-dot.online { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb,var(--success) 13%,transparent); }
.workspace-access-box { border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.workspace-access-box > summary { min-height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; cursor: pointer; list-style: none; font-size: 10.5px; font-weight: 760; }
.workspace-access-box > summary::-webkit-details-marker { display: none; }
.workspace-access-box > summary em { color: var(--muted); font-style: normal; }
.workspace-access-mode { display: grid; grid-template-columns: minmax(0,1fr) 180px; align-items: center; gap: 10px; padding: 8px; border-top: 1px solid var(--line); font-size: 10px; font-weight: 700; color: var(--text-2); }
.workspace-access-mode select { height: 30px; }
.workspace-access-custom[hidden] { display: none; }
.workspace-access-tools { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; padding: 7px; border-top: 1px solid var(--line); }
.workspace-access-tools input { height: 30px; font-size: 10px; }
.workspace-access-tools > span { display: flex; gap: 3px; }
.workspace-access-tools button { min-width: 38px; height: 30px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 9.5px; font-weight: 760; }
.workspace-access-tools button:hover { color: var(--text); }
.workspace-access-list, .workspace-user-checks { max-height: 220px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; padding: 7px; overflow-y: auto; border-top: 1px solid var(--line); }
.workspace-access-tools + .workspace-access-list { border-top: 0; }
.workspace-access-list label, .workspace-user-checks label { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; font-size: 10px; }
.workspace-access-list label:hover { background: var(--surface-3); }
.signature-inspector-body { display: grid; align-content: start; gap: 10px; }
.signature-admin-editor { min-height: 220px; max-height: 460px; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-inset); outline: none; font-size: 11px; line-height: 1.5; }
.signature-admin-editor:empty::before { content: attr(data-empty-placeholder); color: var(--muted); pointer-events: none; }
.signature-admin-editor.drag-over { border-color: var(--accent); background: color-mix(in srgb,var(--accent-soft) 28%,var(--surface-inset)); }
.admin-surface-v3 { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-card); }
.admin-surface-v3 > header { min-height: 28px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.admin-surface-v3 > header b { font-size: 11.5px; }
.admin-settings-grid-v3 { display: grid; gap: 10px; }
.admin-settings-grid-v3.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.admin-settings-grid-v3 .admin-wide { grid-column: 1/-1; }
.setting-group-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.setting-group-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.admin-save-row { display: flex; justify-content: flex-end; margin-top: 10px; }
.admin-danger-compact { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-color: color-mix(in srgb,var(--danger) 23%,var(--line)); }
.admin-danger-compact > div { display: grid; gap: 2px; }
.admin-danger-compact span { color: var(--muted); font-size: 10px; }
.dictionary-shell { max-width: 920px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-card); }
.dictionary-head { min-height: 46px; display: flex; align-items: stretch; justify-content: space-between; gap: 10px; padding-right: 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.dictionary-tabs { min-height: 45px; display: flex; align-items: end; gap: 4px; padding: 0 10px; }
.dictionary-save-button { align-self: center; min-width: 74px; }
.dictionary-tabs button { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 780; }
.dictionary-tabs button.on { border-bottom-color: var(--accent); color: var(--text); }
.dictionary-tabs span { min-width: 20px; padding: 1px 5px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 9px; }
.dictionary-panel { height: min(640px,calc(100vh - 205px)); display: grid; grid-template-rows: auto minmax(0,1fr); padding: 10px; border: 0; border-radius: 0; box-shadow: none; }
.dictionary-toolbar { display: grid; gap: 7px; margin-bottom: 8px; }
.dictionary-add { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
.dictionary-item-list { min-height: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-inset); }
.dictionary-item { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.dictionary-item:last-child { border-bottom: 0; }
.dictionary-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.dictionary-item > span.editing { overflow: visible; white-space: normal; padding: 4px 6px; border: 1px solid var(--accent); border-radius: 6px; background: var(--surface); outline: none; }
.dictionary-item > div { flex: 0 0 auto; display: flex; gap: 3px; opacity: 0; }
.dictionary-item:hover > div { opacity: 1; }
.icon-text-button { padding: 3px 5px; border-radius: 5px; background: transparent; color: var(--muted); font-size: 9px; }
.icon-text-button:hover { background: var(--surface-3); color: var(--text); }
.danger-text { color: var(--danger); }
.settings-chip-list { min-height: 64px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-inset); }
.settings-chip { display: inline-flex; align-items: center; gap: 2px; min-height: 27px; padding: 2px 4px 2px 8px; border-radius: 999px; background: var(--surface-3); font-size: 9.5px; }
.settings-chip-text[contenteditable="true"] { min-width: 70px; outline: none; }
.mini-icon { width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); line-height: 1; }
.mini-icon svg { width: 12px; height: 12px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chip-add-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; margin-top: 8px; }
.role-editor { min-height: 510px; display: grid; grid-template-columns: 280px minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-card); }
.role-editor-list { min-width: 0; display: grid; align-content: start; border-right: 1px solid var(--line); background: var(--surface-2); }
.role-editor-role { min-height: 66px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); text-align: left; }
.role-editor-role:hover { background: var(--surface-3); }
.role-editor-role.selected { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.role-editor-role span { min-width: 0; display: grid; gap: 2px; }
.role-editor-role b { font-size: 11px; }
.role-editor-role small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9.5px; }
.role-editor-role em { min-width: 24px; padding: 2px 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 9px; font-style: normal; text-align: center; }
.role-editor-detail { min-width: 0; display: grid; grid-template-rows: auto minmax(0,1fr); }
.role-editor-head { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.role-editor-head h3 { margin: 0 0 3px; font-size: 14px; }
.role-editor-head p { margin: 0; color: var(--muted); font-size: 10px; }
.role-editor-head > span { padding: 3px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 9.5px; }
.permission-groups { min-height: 0; display: grid; align-content: start; gap: 10px; padding: 12px 14px; overflow-y: auto; }
.permission-group { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.permission-group > header { min-height: 36px; display: flex; align-items: center; padding: 0 10px; border-bottom: 1px solid var(--line); }
.permission-group > header b { font-size: 10.5px; }
.permission-toggle { min-height: 46px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.permission-toggle:last-child { border-bottom: 0; }
.permission-toggle:hover { background: var(--surface-3); }
.permission-toggle span { min-width: 0; display: grid; gap: 1px; }
.permission-toggle b { font-size: 10.5px; }
.permission-toggle small { color: var(--muted); font-size: 9px; }
.permission-toggle input { width: 17px; height: 17px; }
.integration-grid-v3 { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 9px; }
.integration-grid-v3 > div, .admin-info-list > div { min-height: 68px; display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-card); }
.integration-grid-v3 b, .admin-info-list b { display: block; font-size: 11px; }
.integration-grid-v3 span, .admin-info-list span, .integration-grid-v3 small, .admin-info-list small { color: var(--muted); font-size: 9.5px; }
.integration-grid-v3 em, .admin-info-list em { color: var(--text-2); font-size: 9.5px; font-style: normal; }
.integration-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.integration-dot.ok { background: var(--success); }
.integration-dot.bad { background: var(--danger); }
.admin-dialog-v3 { width: min(560px,calc(100vw - 28px)); padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px #0008; }
.admin-dialog-v3::backdrop { background: #020817a8; backdrop-filter: blur(2px); }
.admin-dialog-form > header, .admin-dialog-form > footer { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; }
.admin-dialog-form > header { border-bottom: 1px solid var(--line); }
.admin-dialog-form > footer { border-top: 1px solid var(--line); }
.admin-dialog-body { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 12px; }
.admin-dialog-body fieldset { grid-column: 1/-1; }
.admin-dialog-body .workspace-user-checks { grid-column: 1/-1; }

/* Audit */
.admin-audit-list { display: grid; gap: 10px; }
.audit-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.audit-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.audit-tabs button { min-height: 31px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 780; }
.audit-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.audit-tabs span { min-width: 19px; padding: 1px 5px; border-radius: 999px; background: var(--surface-3); font-size: 9px; text-align: center; }
.audit-summary-card { min-height: 82px; display: grid; align-content: center; gap: 2px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-card); }
.audit-summary-card small, .audit-summary-card span { color: var(--muted); font-size: 10px; }
.audit-summary-card b { font-size: 20px; letter-spacing: -.02em; }
.audit-section { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-card); }
.audit-section > header { min-height: 42px; display: flex; align-items: center; padding: 0 11px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 11px; }
.audit-issue-list, .audit-event-list { display: grid; }
.audit-issue-card { border-bottom: 1px solid var(--line); background: var(--surface); }
.audit-issue-card:last-child { border-bottom: 0; }
.audit-issue-card > summary { min-height: 58px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto 125px; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; list-style: none; }
.audit-issue-card > summary::-webkit-details-marker { display: none; }
.audit-issue-card[open] > summary { background: var(--surface-2); }
.audit-badge { display: inline-flex; padding: 3px 6px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: 9px; font-weight: 850; }
.audit-issue-copy { min-width: 0; }
.audit-issue-copy b, .audit-issue-copy small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-issue-copy b { font-size: 11px; }
.audit-issue-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.audit-issue-count { color: var(--warning); font-size: 10px; font-weight: 800; }
.audit-issue-card time { color: var(--muted); font-size: 9.5px; text-align: right; }
.audit-issue-body { display: grid; gap: 9px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--surface-inset); }
.audit-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.audit-meta-grid > span { display: grid; gap: 2px; }
.audit-meta-grid small { color: var(--muted); font-size: 9.5px; }
.audit-meta-grid b { font-size: 10.5px; }
.audit-thread-chips b { display: block; margin-bottom: 4px; font-size: 10px; }
.audit-thread-chips > div { display: flex; flex-wrap: wrap; gap: 4px; }
.audit-thread-chips span, .audit-thread-chips em { padding: 2px 5px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); font-size: 9.5px; font-style: normal; }
.audit-hint { color: var(--text-2); font-size: 10.5px; }
.audit-event-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.audit-event-row:last-child { border-bottom: 0; }
.audit-event-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-3); color: var(--text-2); font-size: 9px; font-weight: 900; }
.audit-event-main header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.audit-event-main header div { min-width: 0; }
.audit-event-main header b, .audit-event-main header span { display: block; }
.audit-event-main header b { font-size: 10.5px; }
.audit-event-main header span, .audit-event-main time { color: var(--muted); font-size: 9.5px; }
.audit-event-main dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin: 7px 0 0; }
.audit-event-main dl div { min-width: 0; display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 4px; }
.audit-event-main dt, .audit-event-main dd { margin: 0; font-size: 9.5px; }
.audit-event-main dt { color: var(--muted); }
.audit-event-main dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-muted { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
@media (max-width: 1120px) {
  .admin-shell-v3 { grid-template-columns: 1fr; }
  .admin-sidebar-v3 { flex-direction: row; overflow-x: auto; }
  .admin-nav-group { display: flex; gap: 3px; }
  .admin-nav-group > span { display: none; }
  .admin-nav-item { width: auto; flex: 0 0 auto; }
  .admin-master-detail { height: auto; min-height: 620px; grid-template-columns: 280px minmax(0,1fr); }
  .contact-review-body { grid-template-columns: 1fr; }
  .kpi-settings-groups { grid-template-columns: 1fr; }
  .kpi-settings-groups .setting-group-card:last-child { grid-column: auto; }
}
@media (max-width: 760px) {
  .profile-form-grid, .contact-review-form-grid, .setting-group-grid, .setting-group-grid.three, .admin-settings-grid-v3.two, .admin-form-grid, .identity-grid, .admin-dialog-body { grid-template-columns: 1fr; }
  .contact-review-workspace, .role-editor { grid-template-columns: 1fr; }
  .contact-review-head { align-items: flex-start; flex-wrap: wrap; padding: 8px; }
  .contact-review-mobile-back { min-height: 30px; display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--text-2); }
  .contact-review-mobile-back b { font-size: 10.5px; }
  .contact-review-head > div { flex: 1 1 calc(100% - 95px); }
  .contact-review-requests { margin-left: auto; }
  .contact-review-workspace { max-width: none; padding: 8px; gap: 8px; }
  .role-editor-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-master-detail { grid-template-columns: 1fr; }
  .user-list-tools { grid-template-columns: 1fr 1fr; }
  .user-list-tools input { grid-column: 1 / -1; }
  .admin-list-pane { max-height: 280px; border-right: 0; border-bottom: 1px solid var(--line); }
  .workspace-access-list, .workspace-user-checks, .role-choice-grid { grid-template-columns: 1fr; }
  .audit-summary-grid { grid-template-columns: 1fr; }
  .audit-issue-card > summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .audit-issue-card time { display: none; }
}

/* Contacts workspace */
.contacts-workspace { min-width: 0; min-height: 0; height: calc(100vh - var(--topbar-h) - 20px); display: flex; flex-direction: column; gap: 8px; }
.contacts-tabs { flex: 0 0 auto; min-height: 38px; display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-card); }
.contacts-tabs button { min-height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 11px; font-weight: 760; }
.contacts-tabs button:hover { background: var(--surface-2); color: var(--text); }
.contacts-tabs button.active { background: var(--accent-soft); color: var(--accent); }
.contacts-tabs button em { min-width: 16px; min-height: 16px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 9px; font-style: normal; }
.contacts-tabs button em:empty { display: none; }
.contacts-panel { min-width: 0; min-height: 0; flex: 1 1 auto; }
.contacts-people-layout, .contacts-lists-layout { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(320px, 370px) minmax(0, 1fr); gap: 8px; }
.contacts-people-card, .contacts-lists-card, .contacts-person-detail, .contacts-list-detail { min-height: 0; overflow: hidden; }
.contacts-people-card, .contacts-lists-card { display: flex; flex-direction: column; }
.contacts-filter-bar { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 5px; padding: 7px 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.contacts-filter-bar .searchbox { grid-column: 1 / -1; width: 100%; max-width: none; min-width: 0; }
.contacts-filter-bar .searchbox input { min-width: 0; width: 100%; }
.contacts-filter-combo { position: relative; min-width: 0; height: 30px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-inset); transition: border-color .12s ease, box-shadow .12s ease; }
.contacts-filter-combo:focus-within, .contacts-filter-combo.open { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent); }
.contacts-filter-combo > input { width: 100%; min-width: 0; height: 28px; padding: 0 48px 0 8px; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: var(--text); font-size: 10.5px; }
.contacts-filter-combo > input:focus { outline: 0; box-shadow: none; }
.contacts-filter-combo > input::-webkit-search-cancel-button { display: none; }
.contacts-filter-clear, .contacts-filter-toggle { position: absolute; top: 2px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border-radius: 5px; background: transparent; color: var(--muted); }
.contacts-filter-clear[hidden] { display: none; }
.contacts-filter-clear { right: 25px; }
.contacts-filter-toggle { right: 2px; }
.contacts-filter-clear:hover, .contacts-filter-toggle:hover { background: var(--surface-3); color: var(--text); }
.contacts-filter-clear svg, .contacts-filter-toggle svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.contacts-filter-combo.open .contacts-filter-toggle svg { transform: rotate(180deg); }
.contacts-filter-menu { position: absolute; z-index: 45; top: calc(100% + 4px); left: 0; right: 0; max-height: min(360px, 48vh); overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-popover); }
.contacts-filter-option { width: 100%; min-height: 29px; display: flex; align-items: center; padding: 5px 7px; border-radius: 5px; background: transparent; color: var(--text-2); font-size: 10.5px; line-height: 1.25; text-align: left; overflow-wrap: anywhere; }
.contacts-filter-option:hover, .contacts-filter-option:focus { background: var(--surface-2); color: var(--text); outline: 0; }
.contacts-filter-option.active { background: var(--accent-soft); color: var(--accent); font-weight: 760; }
.contacts-filter-no-results { min-height: 34px; display: grid; place-items: center; padding: 6px; color: var(--muted); font-size: 10px; }
.contacts-selected-count { color: var(--accent); font-size: 10px; font-weight: 760; }
.contacts-people-rows, .contacts-list-rows { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.contacts-person-row { min-height: 58px; display: grid; grid-template-columns: 22px 30px minmax(0,1fr); align-items: center; gap: 7px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.contacts-person-row:hover { background: var(--surface-2); }
.contacts-person-row.active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.contacts-person-row.selected { background: color-mix(in srgb, var(--accent-soft) 58%, var(--surface)); }
.contacts-select { display: grid; place-items: center; }
.contacts-select input { width: 14px; height: 14px; }
.contacts-avatar { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 850; }
.contacts-person-open { min-width: 0; display: grid; gap: 1px; padding: 0; background: transparent; color: var(--text); text-align: left; }
.contacts-person-open b, .contacts-person-open span, .contacts-person-open small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contacts-person-open b { font-size: 11.5px; }
.contacts-person-open span { color: var(--text-2); font-size: 10.5px; }
.contacts-person-open small { color: var(--muted); font-size: 9.5px; }
.contacts-person-detail, .contacts-list-detail { overflow-y: auto; padding: 12px; }
.contacts-detail-head, .contacts-list-head, .contacts-bulk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.contacts-detail-head > div, .contacts-list-head > div, .contacts-bulk-head > div { min-width: 0; flex: 1 1 auto; }
.contacts-detail-head .contacts-avatar { width: 40px; height: 40px; font-size: 11px; }
.contacts-detail-head h2, .contacts-list-head h2, .contacts-bulk-head h2 { margin: 0; font-size: 14px; }
.contacts-detail-head span, .contacts-list-head span, .contacts-bulk-head span { color: var(--muted); font-size: 10.5px; }
.contacts-profile-layout { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 8px; padding-top: 10px; align-items: start; }
.contacts-profile-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.contacts-profile-card h3 { margin: 0; padding: 7px 9px; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.contacts-profile-row { min-width: 0; display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 8px; align-items: baseline; padding: 6px 9px; border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent); }
.contacts-profile-row:last-child { border-bottom: 0; }
.contacts-profile-row span { color: var(--muted); font-size: 9.5px; }
.contacts-profile-row b, .contacts-profile-row a { min-width: 0; overflow-wrap: anywhere; color: var(--text); font-size: 10.8px; font-weight: 720; }
.contacts-profile-row a { color: var(--accent); text-decoration: none; }
.contacts-notes { margin-top: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 10.5px; white-space: pre-wrap; }
.contacts-bulk-body { display: grid; gap: 10px; padding-top: 10px; }
.contacts-bulk-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contacts-add-list-inline { min-width: 0; display: flex; align-items: center; gap: 5px; margin-left: auto; }
.contacts-add-list-inline select { min-width: 180px; max-width: 320px; height: 30px; }
.contacts-bulk-list { display: grid; grid-template-columns: repeat(2, minmax(220px,1fr)); gap: 5px; }
.contacts-bulk-list.compact-list { max-height: 170px; overflow-y: auto; padding-right: 2px; }
.contacts-bulk-person { min-width: 0; display: grid; grid-template-columns: 30px minmax(0,1fr) 26px; align-items: center; gap: 7px; min-height: 44px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.contacts-bulk-person > span { min-width: 0; display: grid; gap: 1px; }
.contacts-bulk-person b, .contacts-bulk-person small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contacts-bulk-person b { font-size: 10.5px; }
.contacts-bulk-person small { color: var(--muted); font-size: 9.5px; }
.contacts-bulk-overflow { padding: 7px 9px; color: var(--muted); font-size: 10px; }
.contacts-inline-remove { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border-radius: 5px; background: transparent; color: var(--muted); }
.contacts-inline-remove:hover { background: var(--surface-3); color: var(--text); }
.contacts-inline-remove svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.contacts-inline-mailing { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.contacts-inline-mailing-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contacts-inline-mailing-head b { font-size: 11.5px; }
.contacts-inline-mailing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.contacts-inline-mailing label, .contacts-inline-mailing-grid label { display: grid; gap: 3px; color: var(--text-2); font-size: 10.5px; font-weight: 740; }
.contacts-inline-mailing textarea { min-height: 150px; resize: vertical; }
.contacts-inline-mailing-actions { display: flex; justify-content: flex-end; }
.contacts-empty { min-height: 110px; display: grid; place-items: center; padding: 14px; color: var(--muted); font-size: 11px; text-align: center; }
.contacts-empty.detail { min-height: 240px; }
.contacts-create-list { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.contacts-create-list input { height: 31px; }
.contacts-list-row { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 9px; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); text-align: left; }
.contacts-list-row:hover { background: var(--surface-2); }
.contacts-list-row.active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.contacts-list-row span { min-width: 0; display: grid; gap: 1px; }
.contacts-list-row b { font-size: 11.5px; }
.contacts-list-row small { color: var(--muted); font-size: 9.5px; }
.contacts-list-row i { color: var(--muted); font-style: normal; }
.contacts-list-head .row-actions { flex: 0 0 auto; display: flex; gap: 5px; }
.contacts-member-list { display: grid; gap: 2px; margin-top: 10px; }
.contacts-member-row { min-height: 44px; display: grid; grid-template-columns: 30px minmax(0,1fr) 28px; align-items: center; gap: 7px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; }
.contacts-member-row > span { min-width: 0; display: grid; gap: 1px; }
.contacts-member-row b, .contacts-member-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contacts-member-row b { font-size: 10.5px; }
.contacts-member-row small, .contacts-muted { color: var(--muted); font-size: 9.5px; }
.contacts-mailings-layout { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 8px; }
.contacts-mailing-compose, .contacts-mailing-history-card { min-height: 0; overflow: hidden; }
.contacts-mailing-form { display: grid; gap: 8px; padding: 11px; }
.contacts-mailing-form > label, .contacts-mailing-grid label { display: grid; gap: 3px; color: var(--text-2); font-size: 10.5px; font-weight: 740; }
.contacts-mailing-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
.contacts-mailing-form textarea { min-height: 220px; resize: vertical; }
.contacts-mailing-actions { display: flex; justify-content: flex-end; }
.contacts-mailing-history-card { display: flex; flex-direction: column; }
.contacts-mailing-history { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.contacts-mailing-row { width: 100%; min-height: 58px; display: grid; gap: 1px; padding: 8px 9px; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); text-align: left; }
.contacts-mailing-row:hover { background: var(--surface-2); }
.contacts-mailing-row b { font-size: 11px; }
.contacts-mailing-row span { color: var(--text-2); font-size: 10px; }
.contacts-mailing-row small { color: var(--muted); font-size: 9px; }

/* Dashboard hotel integration */
.hotel-picker { position: relative; display: grid; gap: 5px; }
.hotel-picker-selected { min-height: 28px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.hotel-picker-empty { color: var(--muted); font-size: 10px; font-weight: 500; }
.hotel-chip { max-width: 100%; min-height: 26px; display: inline-flex; align-items: center; gap: 2px; padding: 0 3px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.hotel-chip.mapped { border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); background: var(--accent-soft); }
.hotel-chip-name, .hotel-chip > span { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; background: transparent; color: inherit; font-size: 10px; font-weight: 720; }
.hotel-chip-dashboard, .hotel-chip-remove { width: 20px; height: 20px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.hotel-chip-dashboard:hover, .hotel-chip-remove:hover { background: var(--surface-3); color: var(--text); }
.hotel-chip-dashboard svg, .hotel-chip-remove svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hotel-picker-search-wrap { position: relative; }
.hotel-picker-search-wrap > input { width: 100%; height: 30px; }
.hotel-picker-results { position: absolute; z-index: 90; top: calc(100% + 4px); left: 0; right: 0; max-height: 240px; overflow-y: auto; padding: 4px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-pop); }
.hotel-picker-option { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 7px; border-radius: 6px; background: transparent; color: var(--text); text-align: left; }
.hotel-picker-option:hover { background: var(--surface-2); }
.hotel-picker-option span { min-width: 0; display: grid; gap: 1px; }
.hotel-picker-option b, .hotel-picker-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hotel-picker-option b { font-size: 10.5px; }
.hotel-picker-option small { color: var(--muted); font-size: 9px; }
.hotel-picker-option i { color: var(--accent); font-size: 16px; font-style: normal; }
.hotel-picker-no-results { padding: 9px; color: var(--muted); font-size: 10px; text-align: center; }
.hotel-summary-values { display: flex; flex-wrap: wrap; gap: 4px; }
.hotel-summary-link, .hotel-summary-text { min-width: 0; display: inline-flex; align-items: center; gap: 2px; }
.hotel-summary-link { padding: 2px 5px; border-radius: 5px; background: var(--accent-soft); }
.hotel-summary-link button { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; background: transparent; color: var(--accent); font-size: 10.5px; font-weight: 760; text-align: left; }
.hotel-summary-link a { width: 17px; height: 17px; display: inline-grid; place-items: center; color: var(--muted); }
.hotel-summary-link a:hover { color: var(--text); }
.hotel-summary-link a svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hotel-summary-text { color: var(--text); font-size: 10.5px; font-weight: 720; }
.request-empty-value { color: var(--warn); }

/* Tracker integration */
.tracker-integration-row { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 5px 6px; border-radius: 7px; background: var(--surface-2); }
.tracker-integration-row .linked-record-icon { flex: 0 0 auto; }
.tracker-issue-link { min-width: 0; flex: 1 1 auto; display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--text); }
.tracker-issue-link > span, .tracker-empty-copy { min-width: 0; display: grid; gap: 1px; }
.tracker-issue-link b, .tracker-empty-copy b { font-size: 10.5px; }
.tracker-issue-link small, .tracker-empty-copy small { color: var(--muted); font-size: 9px; }
.tracker-issue-link i { color: var(--muted); font-style: normal; }
.tracker-actions { margin-left: auto; display: flex; gap: 4px; }
.tracker-unlink { color: var(--danger); }

/* Integration dialogs */
.integration-dialog { width: min(760px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 28px)); padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px #0008; }
.integration-dialog::backdrop { background: #020817a8; backdrop-filter: blur(2px); }
.integration-dialog-shell { position: relative; min-height: 0; max-height: min(760px, calc(100vh - 28px)); display: flex; flex-direction: column; }
.integration-dialog-shell > header { min-height: 48px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 11px; border-bottom: 1px solid var(--line); }
.integration-dialog-shell > header > div { min-width: 0; display: grid; gap: 1px; }
.integration-dialog-shell > header b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.integration-dialog-shell > header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9.5px; }
.integration-dialog-body { min-height: 120px; min-width: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 11px; }
.integration-loading, .integration-error { min-height: 120px; display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; }
.integration-error { color: var(--danger); }
.hotel-context-overview { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hotel-context-counts { min-width: 0; display: flex; gap: 6px; }
.hotel-context-counts > span { min-width: 90px; display: grid; gap: 1px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.hotel-context-counts b { font-size: 15px; line-height: 1; }
.hotel-context-counts small { color: var(--muted); font-size: 9.5px; }
.hotel-context-primary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 10px; align-items: start; }
.hotel-context-section { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.hotel-context-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hotel-context-section-head h3 { margin: 0; color: var(--text-2); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.hotel-context-section-head span { min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 9px; font-weight: 800; }
.hotel-context-items { display: grid; gap: 5px; }
.hotel-context-item { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.hotel-context-item-row { min-height: 40px; display: flex; align-items: center; padding: 6px 8px; }
.hotel-context-item-copy { min-width: 0; display: grid; gap: 2px; }
.hotel-context-title-line { min-width: 0; display: flex; align-items: flex-start; gap: 4px; }
.hotel-context-title-line b { min-width: 0; }
.hotel-context-item b { overflow-wrap: anywhere; font-size: 10.5px; }
.hotel-context-item small { color: var(--muted); font-size: 9px; }
.hotel-context-description-button { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; margin-top: -3px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); }
.hotel-context-description-button:hover, .hotel-context-description-button[aria-expanded="true"] { border-color: var(--line); background: var(--surface-3); color: var(--accent); }
.hotel-context-description-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.hotel-description-popover[hidden] { display: none; }
.hotel-description-popover { position: absolute; z-index: 12; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-1, var(--surface)); box-shadow: 0 16px 48px #0008; }
.hotel-description-popover > header { min-height: 42px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px 7px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.hotel-description-popover > header > div { min-width: 0; display: grid; gap: 1px; }
.hotel-description-popover > header b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.hotel-description-popover > header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.hotel-description-close { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.hotel-description-close:hover { background: var(--surface-3); color: var(--text); }
.hotel-description-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.hotel-description-text { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 11px 11px; color: var(--text-2); font-size: 10px; line-height: 1.5; white-space: pre-wrap; }
.hotel-context-empty { min-height: 46px; display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.hotel-context-secondary { margin-top: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.hotel-context-secondary > summary { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 9px; cursor: pointer; list-style: none; color: var(--text-2); font-size: 10.5px; font-weight: 780; }
.hotel-context-secondary > summary::-webkit-details-marker { display: none; }
.hotel-context-secondary > summary em { min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 9px; font-style: normal; }
.hotel-context-facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; padding: 0 8px 8px; }
.hotel-context-facts > div { min-width: 0; display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 7px; padding: 5px 7px; border-radius: 5px; background: var(--surface); }
.hotel-context-facts span { color: var(--muted); font-size: 9px; }
.hotel-context-facts b { min-width: 0; overflow-wrap: anywhere; font-size: 9.8px; }
.hotel-context-contact-list { display: grid; gap: 4px; padding: 0 8px 8px; }
.hotel-context-contact-list > div { min-width: 0; display: grid; gap: 1px; padding: 6px 7px; border-radius: 6px; background: var(--surface); }
.hotel-context-contact-list b { font-size: 10px; }
.hotel-context-contact-list small { color: var(--muted); font-size: 9px; }
.tracker-integration-form { display: grid; gap: 9px; }
.tracker-integration-form > label, .tracker-form-grid label { min-width: 0; display: grid; gap: 3px; color: var(--text-2); font-size: 10.5px; font-weight: 740; }
.tracker-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.tracker-integration-form textarea { resize: vertical; }
.integration-form-actions { display: flex; justify-content: flex-end; gap: 6px; padding-top: 2px; }

@media (max-width: 980px) {
  .contacts-workspace { height: auto; min-height: 0; }
  .contacts-people-layout, .contacts-lists-layout, .contacts-mailings-layout { grid-template-columns: 1fr; height: auto; }
  .contacts-people-rows, .contacts-list-rows, .contacts-mailing-history { max-height: 420px; }
  .contacts-filter-bar, .contacts-mailing-grid { grid-template-columns: 1fr; }
  .hotel-context-primary, .hotel-context-facts, .tracker-form-grid { grid-template-columns: 1fr; }
  .contacts-profile-layout, .contacts-bulk-list, .contacts-inline-mailing-grid { grid-template-columns: 1fr; }
}



/* SAMO B2B admin integration */
.samo-admin-card { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px 14px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-card); }
.samo-admin-card > header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.samo-admin-card > header > div { display: flex; align-items: center; gap: 8px; }
.samo-admin-card > header b { font-size: 12px; }
.integration-state { padding: 2px 6px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.integration-state.ok { background: var(--success-soft); color: var(--success); }
.integration-state.bad { background: var(--danger-soft); color: var(--danger); }
.samo-admin-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.samo-admin-fields label { display: grid; gap: 3px; color: var(--text-2); font-size: 10px; font-weight: 780; }
.samo-admin-fields input { height: 34px; background: var(--surface-inset); }
.samo-admin-actions { display: flex; gap: 6px; justify-content: flex-end; }
.samo-api-card { align-items: center; }
.samo-api-card > .muted-note { grid-column: 1 / -1; margin: -2px 0 0; max-width: 760px; }
.samo-api-fields { min-width: 420px; }
.samo-profile-tabs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.samo-profile-tabs > button { min-width: 118px; max-width: 220px; display: grid; gap: 2px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text-2); text-align: left; }
.samo-profile-tabs > button:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--surface-3); }
.samo-profile-tabs > button.on { border-color: color-mix(in srgb, var(--accent) 62%, var(--line)); background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent); }
.samo-profile-tabs b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.samo-profile-tabs small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.samo-profile-fields { align-items: end; }
.samo-admin-fields label.samo-default-profile { min-height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-inset); cursor: pointer; }
.samo-default-profile input { width: 15px; height: 15px; min-height: 0; margin: 0; }
@media (max-width: 720px) { .samo-admin-card { grid-template-columns: 1fr; } .samo-api-fields { min-width: 0; } .samo-admin-fields { grid-template-columns: 1fr; } .samo-admin-actions { justify-content: stretch; } .samo-admin-actions .button { flex: 1; } .samo-profile-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; } .samo-profile-tabs > button { flex: 0 0 150px; } }

/* CRM labels and mail feed */
.crm-tag-editor { display: grid; gap: 7px; min-width: 0; }
.crm-tag-list { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.crm-tag {
  max-width: 100%; min-height: 22px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 999px; background: color-mix(in srgb, var(--accent-soft) 58%, var(--surface));
  color: var(--text-2); font-size: 10px; font-weight: 720;
}
.crm-tag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-tag button { width: 15px; height: 15px; display: grid; place-items: center; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); line-height: 1; }
.crm-tag button:hover { background: var(--surface-3); color: var(--danger); }
.crm-tag button .ui-close-icon { width: 9px; height: 9px; }
.crm-tag.more { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.crm-tags-empty { color: var(--muted); font-size: 10px; }
.crm-tag-add { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px; }
.crm-tag-add input { height: 30px; font-size: 11px; }
.crm-tag-add .mini-button { min-height: 30px; }
.crm-tag-editor.compact .crm-tag-add { max-width: 360px; }

.feed-view { min-height: 0; }
.feed-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.feed-help { color: var(--muted); font-size: 10.5px; }
.feed-table-head, .feed-row {
  display: grid;
  grid-template-columns: 118px minmax(150px, .9fr) minmax(260px, 2fr) minmax(150px, 1fr) minmax(145px, .8fr) 86px;
  gap: 10px; align-items: center;
}
.feed-table-head { min-height: 34px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 9.5px; font-weight: 780; text-transform: uppercase; letter-spacing: .025em; }
.feed-rows { min-height: 0; flex: 1 1 auto; overflow: auto; }
.feed-row { width: 100%; min-height: 62px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; }
.feed-row:hover { background: color-mix(in srgb, var(--surface-2) 72%, var(--accent-soft) 28%); }
.feed-row-time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.feed-row-sender, .feed-row-message, .feed-row-owner { min-width: 0; display: grid; gap: 2px; }
.feed-row-sender b, .feed-row-message b, .feed-row-owner b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.feed-row-sender small, .feed-row-message small, .feed-row-owner small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.feed-row-labels { min-width: 0; display: flex; flex-wrap: wrap; gap: 3px; }
.feed-row-labels .crm-tag { max-width: 120px; }
.feed-row-signals { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.feed-alert { min-height: 20px; display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 800; }
.feed-alert.warning { background: var(--warning-soft); color: var(--warning); }
.feed-alert.danger { background: var(--danger-soft); color: var(--danger); }
.feed-empty { padding: 40px; color: var(--muted); text-align: center; }

@media (max-width: 1180px) {
  .feed-table-head, .feed-row { grid-template-columns: 96px minmax(130px,.8fr) minmax(230px,2fr) minmax(130px,.9fr) 120px 64px; gap: 7px; }
}
@media (max-width: 860px) {
  .feed-table-head { display: none; }
  .feed-row { grid-template-columns: 88px minmax(120px,.8fr) minmax(220px,2fr) 110px 54px; }
  .feed-row-labels { display: none; }
}
@media (max-width: 700px) {
  .feed-rows { padding: 6px; }
  .feed-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    gap: 5px 10px;
    min-height: 0;
    margin-bottom: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
  }
  .feed-row:last-child { margin-bottom: 0; }
  .feed-row-sender { grid-column: 1; grid-row: 1; }
  .feed-row-time { grid-column: 2; grid-row: 1; justify-self: end; }
  .feed-row-message { grid-column: 1 / -1; grid-row: 2; }
  .feed-row-owner { grid-column: 1; grid-row: 3; }
  .feed-row-signals { grid-column: 2; grid-row: 3; align-self: end; justify-content: flex-end; }
  .feed-row-sender b, .feed-row-message b, .feed-row-owner b { font-size: 12px; }
  .feed-row-sender small, .feed-row-message small, .feed-row-owner small, .feed-row-time { font-size: 10.5px; }
}

/* Coverage / duty planning */
.coverage-admin-grid { display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.35fr); gap:14px; align-items:start; }
.coverage-admin-card > header > div { display:grid; gap:3px; }
.coverage-admin-card > header span { color:var(--text-3); font-size:10.5px; line-height:1.35; font-weight:560; }
.coverage-form { display:grid; gap:12px; }
.coverage-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.coverage-form-grid label { display:grid; gap:5px; color:var(--text-2); font-size:10px; font-weight:700; }
.coverage-form input,.coverage-form select { min-width:0; width:100%; }
.coverage-form-footer { display:flex; align-items:center; gap:9px; }
.coverage-form-footer > input { flex:1 1 auto; }
.coverage-note { flex:1 1 auto; color:var(--text-3); font-size:10.5px; line-height:1.35; }
.coverage-team-block,.coverage-mapping-block { display:grid; gap:8px; padding-top:10px; border-top:1px solid var(--line-soft); }
.coverage-block-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.coverage-block-head > div { display:grid; gap:2px; }
.coverage-block-head b { font-size:11px; }
.coverage-block-head span { color:var(--text-3); font-size:10px; }
.coverage-team { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.coverage-team-person { min-width:0; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:7px; min-height:38px; padding:7px 9px; border:1px solid var(--line); border-radius:9px; background:var(--surface-2); cursor:pointer; }
.coverage-team-person:hover { border-color:var(--line-strong); background:var(--surface-3); }
.coverage-team-person.selected { border-color:color-mix(in srgb,var(--accent) 42%,var(--line)); background:var(--accent-soft); }
.coverage-team-person input { width:14px; height:14px; margin:0; }
.coverage-team-person span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10.5px; font-weight:720; color:var(--text); }
.coverage-team-person em { font-size:9.5px; font-style:normal; color:var(--text-3); white-space:nowrap; }
.coverage-mapping { display:grid; gap:5px; max-height:330px; overflow:auto; padding-right:2px; }
.coverage-map-row { display:grid; grid-template-columns:minmax(0,1fr) 22px minmax(150px,.8fr); align-items:center; gap:7px; min-height:42px; padding:6px 8px; border:1px solid var(--line); border-radius:9px; background:var(--surface-2); }
.coverage-map-row > div { min-width:0; display:grid; gap:2px; }
.coverage-map-row b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10.5px; }
.coverage-map-row span { color:var(--text-3); font-size:9.5px; }
.coverage-map-arrow { text-align:center; color:var(--text-3); font-weight:800; }
.coverage-map-row select { min-width:0; }
.coverage-rule-list { display:grid; gap:6px; margin-top:12px; padding-top:10px; border-top:1px solid var(--line-soft); }
.coverage-rule { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:9px; align-items:start; padding:9px 10px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); }
.coverage-rule-main { min-width:0; display:grid; gap:3px; }
.coverage-rule-main > div:first-child { display:flex; flex-wrap:wrap; gap:5px 8px; align-items:center; }
.coverage-rule-main b { font-size:10.8px; }
.coverage-rule-main span,.coverage-rule-main small { color:var(--text-3); font-size:9.8px; line-height:1.35; }
.coverage-rule-map { display:flex; flex-wrap:wrap; gap:4px 8px; margin-top:3px; }
.coverage-rule-map span { display:inline-flex; gap:4px; }
.coverage-rule-map b { color:var(--text-2); font-size:9.8px; }
.coverage-state { display:inline-flex; align-items:center; min-height:22px; padding:0 7px; border-radius:999px; border:1px solid var(--line); color:var(--text-2); background:var(--surface-3); font-size:9px; font-weight:800; white-space:nowrap; }
.coverage-state.ok { color:var(--success); background:color-mix(in srgb,var(--success) 12%,transparent); border-color:color-mix(in srgb,var(--success) 30%,var(--line)); }
.coverage-state.bad { color:var(--danger); background:color-mix(in srgb,var(--danger) 10%,transparent); border-color:color-mix(in srgb,var(--danger) 30%,var(--line)); }
.coverage-state.muted { opacity:.72; }
.coverage-empty { padding:12px; border:1px dashed var(--line); border-radius:9px; color:var(--text-3); background:var(--surface-2); font-size:10.5px; line-height:1.4; text-align:center; }

@media (max-width:1100px) {
  .coverage-admin-grid { grid-template-columns:1fr; }
}
@media (max-width:720px) {
  .coverage-form-grid,.coverage-team { grid-template-columns:1fr; }
  .coverage-form-footer,.coverage-block-head { align-items:stretch; flex-direction:column; }
  .coverage-map-row { grid-template-columns:minmax(0,1fr); gap:5px; }
  .coverage-map-arrow { display:none; }
  .coverage-rule { grid-template-columns:minmax(0,1fr) auto; }
  .coverage-rule > .mini-icon { grid-column:2; grid-row:1; }
  .coverage-state { grid-column:2; grid-row:2; }
}

/* SAMO room catalog sync */
.integration-state.neutral { background: var(--surface-inset); color: var(--muted); }
.samo-catalog-card { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding-top: 11px; border-top: 1px solid var(--line); }
.samo-catalog-copy { min-width: 0; display: grid; gap: 3px; }
.samo-catalog-copy > div { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.samo-catalog-copy b { font-size: 11px; }
.samo-catalog-copy strong { font-size: 12px; color: var(--text); font-weight: 760; }
.samo-catalog-copy span, .samo-catalog-copy small { color: var(--text-2); font-size: 10px; }
.samo-catalog-copy small { color: var(--muted); }
.samo-catalog-copy em { margin-top: 2px; color: var(--danger); font-size: 10px; font-style: normal; overflow-wrap: anywhere; }
.samo-catalog-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 720px) { .samo-catalog-card { grid-template-columns: 1fr; } .samo-catalog-actions { justify-content: stretch; } .samo-catalog-actions .button { flex: 1; } }

/* Team chat */
.chat-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 74;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-pop);
}
.chat-fab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-fab em { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; border: 2px solid var(--bg); font-size: 9px; font-style: normal; font-weight: 900; }
.chat-panel {
  position: fixed;
  z-index: 1220;
  right: 18px;
  bottom: 72px;
  width: min(440px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 92px));
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}
.chat-panel[hidden] { display: none; }
.chat-panel-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 11px 10px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg,color-mix(in srgb,var(--accent-soft) 34%,var(--surface)),var(--surface)); }
.chat-panel-head > div { min-width: 0; display: grid; gap: 2px; }
.chat-panel-head b { font-size: 13px; }
.chat-panel-head span { color: var(--muted); font-size: 9.5px; }
.chat-panel-head span::before { content: ''; width: 6px; height: 6px; display: inline-block; margin-right: 5px; border-radius: 50%; background: var(--success); vertical-align: 1px; }
.chat-messages { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 11px 16px; background: color-mix(in srgb,var(--surface-inset) 55%,var(--surface)); }
.chat-message { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 8px; align-items: start; }
.chat-message.own { grid-template-columns: minmax(0,1fr) 32px; }
.chat-message.own .chat-avatar { grid-column: 2; }
.chat-message.own .chat-message-body { grid-column: 1; grid-row: 1; justify-self: end; background: color-mix(in srgb,var(--accent-soft) 65%,var(--surface)); border-color: color-mix(in srgb,var(--accent) 18%,var(--line)); }
.chat-message.mentioned .chat-message-body { box-shadow: inset 3px 0 0 var(--warning); }
.chat-avatar { width: 32px; height: 32px; }
.chat-message-body { width: fit-content; max-width: 100%; min-width: 150px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 2px 8px rgba(5,10,22,.03); }
.chat-message-body header { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-message-body header b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.chat-message-body header em { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 5px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 8px; font-style: normal; font-weight: 800; }
.chat-message-body header time { margin-left: auto; flex: 0 0 auto; color: var(--muted); font-size: 8px; }
.chat-message-body p { margin: 5px 0 0; color: var(--text-2); font-size: 10.8px; line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 680px) { .chat-panel { right: 8px; bottom: 62px; width: calc(100vw - 16px); height: min(640px, calc(100vh - 74px)); } .chat-fab { right: 10px; bottom: 10px; } }

/* Dashboard resort information inside CRM hotel context */
.hotel-resort-info { display: grid; gap: 8px; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.hotel-resort-info > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hotel-resort-info > header > div { min-width: 0; display: grid; gap: 1px; }
.hotel-resort-info > header b { font-size: 11px; }
.hotel-resort-info > header span { color: var(--muted); font-size: 9px; }
.hotel-resort-info > header em { color: var(--muted); font-size: 9px; font-style: normal; white-space: nowrap; }
.hotel-resort-sections { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; align-items: start; }
.hotel-resort-section { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.hotel-resort-section > summary { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; cursor: pointer; list-style: none; color: var(--text-2); font-size: 10px; font-weight: 780; }
.hotel-resort-section > summary::-webkit-details-marker { display: none; }
.hotel-resort-section > summary em { min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 8.5px; font-style: normal; }
.hotel-resort-section-body { display: grid; gap: 1px; padding: 0 6px 6px; }
.hotel-resort-section-body > p { margin: 0 0 4px; padding: 6px 7px; border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 9px; line-height: 1.4; }
.hotel-resort-row { min-width: 0; display: grid; grid-template-columns: minmax(90px, .42fr) minmax(0,1fr); gap: 8px; padding: 6px 7px; border-radius: 6px; background: var(--surface); }
.hotel-resort-row > span { color: var(--muted); font-size: 9px; }
.hotel-resort-row > div { min-width: 0; display: grid; gap: 4px; }
.hotel-resort-value { min-width: 0; display: grid; gap: 2px; }
.hotel-resort-value > b { overflow-wrap: anywhere; font-size: 9.6px; }
.hotel-resort-value > small { display: flex; flex-wrap: wrap; gap: 5px; color: var(--muted); font-size: 8.6px; }
.hotel-resort-value a { color: var(--accent); text-decoration: none; }
@media (max-width: 900px) { .hotel-resort-sections { grid-template-columns: 1fr; } }

/* Shared signature templates */
.signature-mode-tabs { display: inline-flex; align-items: center; gap: 3px; margin-bottom: 10px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.signature-mode-tabs button { min-height: 32px; padding: 0 13px; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; }
.signature-mode-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.signature-mode-pane[hidden] { display: none; }
.signatures-panel { min-height: 0; }
.signature-person-card { min-height: 100%; }
.signature-token-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.signature-token-toolbar > span { margin-right: 3px; color: var(--muted); font-size: 8.7px; font-weight: 780; text-transform: uppercase; letter-spacing: .045em; }
.signature-token-chip { min-height: 27px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid color-mix(in srgb,var(--accent) 24%,var(--line)); border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 800; }
.signature-token-chip > span { font-size: 11px; line-height: 1; }
.signature-token-chip:hover { border-color: color-mix(in srgb,var(--accent) 48%,var(--line)); transform: translateY(-1px); }
.signature-variable-chip { display: inline-flex; align-items: center; min-height: 22px; margin: 0 2px; padding: 1px 7px; border: 1px solid color-mix(in srgb,var(--accent) 28%,var(--line)); border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 820; vertical-align: 1px; user-select: all; }
.signature-composer-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(300px,.85fr); gap: 10px; align-items: start; }
.signature-composer-grid > div { min-width: 0; display: grid; gap: 6px; }
.signature-resolve-hint { color: var(--muted); font-size: 9px; line-height: 1.4; }
.signature-preview-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); }
.signature-preview-card > header { padding: 10px 11px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.signature-preview-card > header > div { display: grid; gap: 2px; }
.signature-preview-card > header b { font-size: 10.5px; }
.signature-preview-card > header span { color: var(--muted); font-size: 8.7px; }
.signature-preview-content { min-height: 220px; max-height: 390px; overflow: auto; padding: 14px; background: #fff; color: #17191d; font-size: 11px; line-height: 1.5; }
.signature-preview-content img { max-width: 100%; height: auto; }
.signature-preview-empty { color: #7d838d; font-size: 10px; }
.signature-preview-card > footer { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.signature-preview-card > footer > span { min-width: 0; display: grid; gap: 1px; padding: 7px 9px; background: var(--surface-2); }
.signature-preview-card > footer small { color: var(--muted); font-size: 7.8px; text-transform: uppercase; letter-spacing: .04em; }
.signature-preview-card > footer b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 700; }
.signature-bulk-workspace { min-height: 0; }
.signature-bulk-compose { min-width: 0; display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); }
.signature-bulk-compose > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.signature-bulk-compose > header > div { display: grid; gap: 2px; }
.signature-bulk-compose > header b { font-size: 12px; }
.signature-bulk-compose > header span { color: var(--muted); font-size: 9px; }
.signature-bulk-editor { min-height: 220px; max-height: 420px; }
.signature-bulk-targets { display: grid; gap: 7px; padding-top: 2px; }
.signature-bulk-targets > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.signature-bulk-targets > header > div:first-child { min-width: 0; display: grid; gap: 1px; }
.signature-bulk-targets > header b { font-size: 10px; }
.signature-bulk-targets > header span { color: var(--muted); font-size: 8.6px; }
.signature-bulk-targets > header > div:last-child { display: flex; gap: 5px; }
.signature-bulk-targets > div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; max-height: 190px; overflow-y: auto; padding: 2px; }
.signature-bulk-targets label { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: pointer; }
.signature-bulk-targets label:has(input:checked) { border-color: color-mix(in srgb,var(--accent) 36%,var(--line)); background: var(--accent-soft); }
.signature-bulk-targets label > span { min-width: 0; display: flex; align-items: center; gap: 6px; }
.signature-bulk-targets label b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9.4px; }
.signature-bulk-targets .admin-entity-avatar { width: 24px; height: 24px; flex: 0 0 auto; font-size: 8px; }
.signature-bulk-compose > footer { display: grid; grid-template-columns: minmax(220px,300px) 1fr auto auto; align-items: end; gap: 7px; padding-top: 3px; }
.signature-bulk-compose > footer label { display: grid; gap: 3px; color: var(--muted); font-size: 8.5px; }
.signature-bulk-compose > footer select { height: 33px; }
@media (max-width: 1050px) { .signature-composer-grid { grid-template-columns: 1fr; } .signature-preview-content { min-height: 160px; } .signature-bulk-targets > div { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 700px) { .signature-bulk-targets > div { grid-template-columns: 1fr; } .signature-bulk-compose > footer { grid-template-columns: 1fr 1fr; } .signature-bulk-compose > footer > span { display: none; } }

/* Expanded Contacts filtering */
.contacts-more-filters { grid-column: 1 / -1; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-inset); }
.contacts-more-filters > summary { min-height: 31px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; cursor: pointer; list-style: none; color: var(--text-2); font-size: 10px; font-weight: 760; }
.contacts-more-filters > summary::-webkit-details-marker { display: none; }
.contacts-more-filters > summary::after { content: '›'; margin-left: auto; color: var(--muted); font-size: 15px; transition: transform .14s ease; }
.contacts-more-filters[open] > summary::after { transform: rotate(90deg); }
.contacts-more-filters > summary em { order: 2; min-width: 18px; height: 18px; display: none; place-items: center; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 8px; font-style: normal; }
.contacts-more-filters > summary em:not(:empty) { display: grid; }
.contacts-more-filter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; padding: 0 7px 7px; }
.contacts-more-filter-grid label { min-width: 0; display: grid; gap: 3px; color: var(--muted); font-size: 8.8px; font-weight: 700; }
.contacts-more-filter-grid .contacts-filter-combo { width: 100%; min-width: 0; background: var(--surface); }
.contacts-more-filter-grid .contacts-filter-combo > input { font-size: 9.8px; }
.contacts-clear-extra { margin: 0 7px 7px; width: calc(100% - 14px); }


/* Notification center — shared Staff / Tracker / CRM inbox */
.notification-bell { position: relative; width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); }
.notification-bell:hover, .notification-bell[aria-expanded="true"] { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.notification-bell svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-bell em { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); border-radius: 999px; background: var(--danger); color: #fff; font-size: 8px; font-style: normal; font-weight: 900; }
.notification-center { position: fixed; z-index: 1250; right: 18px; top: calc(var(--topbar-h) + 10px); width: min(440px, calc(100vw - 24px)); max-height: min(680px, calc(100vh - var(--topbar-h) - 28px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-popover); }
.notification-center[hidden] { display: none; }
.notification-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb,var(--surface-raised) 92%,transparent); }
.notification-title-row { min-width: 0; display: flex; align-items: center; gap: 10px; }
.notification-title-row strong { display: block; font-size: 13px; }
.notification-subtitle { margin-top: 2px; color: var(--muted); font-size: 10px; }
.notification-actions { display: flex; align-items: center; gap: 6px; }
.notification-actions .mini-button { min-height: 31px; display: inline-flex; align-items: center; gap: 6px; border-radius: 9px; }
.notification-actions svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-list { min-height: 0; max-height: 596px; overflow-y: auto; padding: 8px; }
.notification-empty { padding: 34px 14px; color: var(--muted); font-size: 10.5px; text-align: center; }
.notification-row { position: relative; border-radius: 13px; }
.notification-row + .notification-row { margin-top: 3px; }
.notification-item { width: 100%; display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 9px; align-items: start; padding: 10px 42px 10px 10px; border: 0; border-radius: 13px; background: transparent; color: var(--text); text-align: left; }
.notification-item:hover { background: var(--surface-2); }
.notification-item.unread { background: color-mix(in srgb,var(--accent-soft) 62%,var(--surface)); }
.notification-kind { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--accent); }
.notification-kind svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-row.warning .notification-kind { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb,var(--warning) 18%,var(--line)); }
.notification-row.danger .notification-kind { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb,var(--danger) 18%,var(--line)); }
.notification-copy { min-width: 0; display: grid; gap: 3px; }
.notification-copy h4 { margin: 0; overflow-wrap: anywhere; font-size: 11px; line-height: 1.25; }
.notification-copy p { margin: 0; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 9.6px; line-height: 1.35; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notification-copy time { color: var(--muted); font-size: 8.6px; }
.notification-dismiss { position: absolute; z-index: 2; top: 8px; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); opacity: .45; }
.notification-row:hover .notification-dismiss, .notification-dismiss:focus-visible { opacity: 1; }
.notification-dismiss:hover { border-color: var(--line); background: var(--surface-3); color: var(--text); }
.notification-dismiss svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (max-width: 700px) { .notification-center { left: 8px; right: 8px; top: calc(var(--topbar-h) + 6px); width: auto; } .notification-head { padding: 12px; } .notification-actions span { display: none; } .notification-dismiss { opacity: .75; } }

/* Chat staff identity + optimistic messages */
.chat-person-link { position: relative; width: 30px; height: 30px; display: block; border-radius: 50%; text-decoration: none; }
.chat-person-link .chat-avatar { width: 100%; height: 100%; }
.chat-person-card { position: absolute; z-index: 8; left: 36px; top: -4px; width: 210px; display: none; gap: 2px; padding: 8px 9px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-popover); color: var(--text); }
.chat-message.own .chat-person-card { left: auto; right: 36px; }
.chat-person-link:hover .chat-person-card, .chat-person-link:focus-visible .chat-person-card { display: grid; }
.chat-person-card b { font-size: 10px; }
.chat-person-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8.8px; }
.chat-message.sending { opacity: .72; }
.chat-message.sending .chat-message-body::after { content: 'Sending…'; display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.chat-thread-ref em { color: var(--text-2); font-size: 8.7px; font-style: normal; line-height: 1.35; }
.chat-thread-ref .chat-ref-meta { display: flex; flex-wrap: wrap; gap: 4px 7px; margin-top: 2px; color: var(--muted); font-size: 8.2px; }

/* Team chat layout: keep media inside the panel and make the composer/pickers stable. */
.chat-panel { display: flex; flex-direction: column; }
.chat-panel-head { flex: 0 0 auto; }
.chat-messages { flex: 1 1 auto; width: 100%; min-width: 0; }
.chat-message { width: 100%; min-width: 0; }
.chat-person-link { flex: 0 0 auto; overflow: visible; }
.chat-avatar { display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 10px; font-weight: 800; }
.chat-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.chat-message-body { min-width: 0; overflow: hidden; }
.chat-thread-refs { min-width: 0; display: grid; gap: 6px; margin-top: 7px; }
.chat-thread-ref { width: 100%; min-width: 0; display: grid; gap: 2px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); text-align: left; overflow: hidden; }
.chat-thread-ref > span { color: var(--accent); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.chat-thread-ref > b, .chat-thread-ref > small, .chat-thread-ref > em { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chat-thread-ref > b { white-space: nowrap; font-size: 9.6px; }
.chat-thread-ref > small { white-space: nowrap; color: var(--muted); font-size: 8.4px; }
.chat-thread-ref > em { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chat-attachments { flex: 0 0 auto; max-height: 84px; display: flex; flex-wrap: wrap; gap: 5px; overflow: auto; padding: 7px 10px; border-top: 1px solid var(--line); background: var(--surface-2); }
.chat-attachment-chip { max-width: 100%; min-height: 26px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 8.8px; }
.chat-attachment-chip > span { width: 14px; height: 14px; display: grid; place-items: center; }
.chat-attachment-chip svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.chat-composer { position: relative; flex: 0 0 auto; display: grid; gap: 7px; padding: 9px 10px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-composer textarea { min-height: 72px; max-height: 150px; resize: vertical; }
.chat-composer > footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-composer-tools { min-width: 0; display: flex; align-items: center; gap: 5px; }
.chat-composer-tools svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.chat-picker { position: absolute; z-index: 5; left: 10px; right: 10px; bottom: 112px; max-height: min(360px, calc(100% - 120px)); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-popover); }
.chat-picker > header { display: grid; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.chat-picker > header b { font-size: 10px; }
.chat-picker > header input { height: 30px; }
.chat-picker > div { max-height: 280px; overflow-y: auto; padding: 5px; }
.chat-picker > div > button { width: 100%; min-width: 0; display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 7px; align-items: center; padding: 6px; border-radius: 8px; background: transparent; color: var(--text); text-align: left; }
.chat-picker > div > button:hover { background: var(--surface-2); }
.chat-picker > div > button > span:last-child { min-width: 0; display: grid; gap: 1px; }
.chat-picker > div > button b, .chat-picker > div > button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-picker-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 9px; font-weight: 800; }
.chat-empty { margin: auto; color: var(--muted); font-size: 10px; }
@media (max-width: 680px) {
  .chat-picker { left: 8px; right: 8px; }
  .chat-composer textarea { min-height: 64px; }
}
.chat-message.own .chat-person-link { grid-column: 2; grid-row: 1; justify-self: end; }
.chat-messages { overflow-x: hidden; overscroll-behavior: contain; }


/* Compact request picker for Team chat. */
.chat-thread-picker { max-height: min(310px, calc(100% - 150px)); }
.chat-thread-picker > .chat-thread-picker-list { max-height: 230px; padding: 5px; scrollbar-gutter: stable; }
.chat-thread-picker .chat-thread-picker-row {
  grid-template-columns: 30px minmax(0,1fr);
  gap: 9px;
  min-height: 54px;
  padding: 7px 8px;
  border: 1px solid transparent;
}
.chat-thread-picker .chat-thread-picker-row + .chat-thread-picker-row { margin-top: 2px; }
.chat-thread-picker .chat-thread-picker-row:hover { border-color: var(--line); background: var(--surface-2); }
.chat-thread-picker .chat-thread-picker-row.selected { border-color: color-mix(in srgb,var(--accent) 35%,var(--line)); background: var(--accent-soft); }
.chat-thread-picker-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--accent);
}
.chat-thread-picker-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-thread-picker-copy { min-width: 0; display: grid; gap: 2px; }
.chat-thread-picker-title { min-width: 0; display: flex; align-items: center; gap: 6px; }
.chat-thread-picker-title > b { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9.7px; }
.chat-thread-picker-title > em { flex: 0 0 auto; max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 5px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 7.6px; font-style: normal; font-weight: 800; }
.chat-thread-picker-copy > small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 8.5px; }
.chat-thread-picker-copy > small.secondary { color: var(--muted); font-size: 8px; }
.chat-picker-empty { margin: 0; padding: 22px 10px; color: var(--muted); font-size: 9px; text-align: center; }
@media (max-width: 680px) {
  .chat-thread-picker { max-height: min(290px, calc(100% - 145px)); }
  .chat-thread-picker > .chat-thread-picker-list { max-height: 212px; }
}

/* Mail feed conversation reader — shared Gmail-like mailbox */
.feed-card.reading {
  border-color: transparent;
  background: var(--surface-inset);
  box-shadow: none;
}
.feed-card.reading > .card-head,
.feed-card.reading .feed-table-head { display: none; }
.feed-card.reading .feed-rows { overflow: hidden; background: var(--surface-inset); }
.feed-reader { height: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--surface-inset); }
.feed-reader-toolbar {
  position: relative; z-index: 8; flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb,var(--surface) 92%,transparent);
  backdrop-filter: blur(12px);
}
.feed-toolbar-spacer { flex: 1 1 auto; }
.feed-back-button,
.feed-label-button {
  min-width: 34px; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 9px; border: 1px solid transparent; border-radius: 999px;
  background: transparent; color: var(--text-2); cursor: pointer; user-select: none;
  font-size: 10px; font-weight: 760;
}
.feed-back-button:hover,
.feed-label-button:hover,
.feed-label-menu[open] .feed-label-button { background: var(--surface-3); color: var(--text); }
.feed-back-button svg,
.feed-label-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feed-label-menu { position: relative; }
.feed-label-menu > summary { list-style: none; }
.feed-label-menu > summary::-webkit-details-marker { display: none; }
.feed-label-button em {
  min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px;
  border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 8px; font-style: normal;
}
.feed-label-popover {
  position: absolute; z-index: 20; top: calc(100% + 7px); right: 0; width: min(340px, calc(100vw - 30px));
  padding: 10px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  box-shadow: var(--shadow-popover);
}
.feed-label-editor { display: grid; gap: 9px; }
.feed-label-editor .crm-tag-list { max-height: 150px; overflow: auto; padding: 1px; }
.feed-label-editor .crm-tag-add { grid-template-columns: minmax(0,1fr) auto; }
.feed-load-error { display: grid; justify-items: center; gap: 7px; }
.feed-load-error b { color: var(--text); }
.feed-load-error span { color: var(--muted); }
.feed-reader-conversation {
  min-height: 0; flex: 1 1 auto; overflow: auto; padding: 20px 22px 44px;
  background: var(--surface-inset); scrollbar-gutter: stable;
}
.feed-reader-thread { width: min(100%, 1240px); margin: 0 auto; }
.feed-thread-head { padding: 2px 8px 18px 52px; }
.feed-thread-subject-line { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.feed-thread-subject-line h1 {
  margin: 0; min-width: 0; color: var(--text); font-size: clamp(18px,1.35vw,22px); line-height: 1.28; font-weight: 690;
}
.feed-reader-inline-labels { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.feed-reader-inline-labels .crm-tag { max-width: 180px; min-height: 20px; padding: 1px 7px; font-size: 8.8px; }
.feed-thread-meta { margin-top: 7px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; color: var(--muted); font-size: 9.7px; }
.feed-thread-meta > span { min-width: 0; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-thread-meta > span + span::before { content: '·'; margin-right: 9px; color: color-mix(in srgb,var(--muted) 62%,transparent); }
.feed-thread-meta .feed-reader-status { color: var(--text-2); font-weight: 720; }
.feed-thread-messages { display: grid; gap: 9px; }
.feed-message-wrap { width: 100%; min-width: 0; margin: 0; }
.feed-message-wrap .message {
  width: 100%; max-width: none; margin: 0;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(4,10,22,.035);
  overflow: hidden;
}
.feed-message-wrap.out .message { background: color-mix(in srgb,var(--accent-soft) 10%,var(--surface)); border-color: color-mix(in srgb,var(--accent) 16%,var(--line)); }
.feed-message-wrap .message-meta-panel { padding: 11px 14px 9px; border-bottom: 0; background: transparent; }
.feed-message-wrap.out .message-meta-panel { background: transparent; }
.feed-message-wrap .message-head-main { gap: 9px; }
.feed-message-wrap .message-avatar { width: 31px; height: 31px; }
.feed-message-wrap .message-sender-copy { min-width: 0; display: flex; align-items: baseline; gap: 5px; }
.feed-message-wrap .message-head-main b { min-width: 0; font-size: 11.5px; font-weight: 760; }
.feed-message-wrap .feed-sender-email { min-width: 0; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9.2px; }
.feed-message-wrap .message-date { font-size: 9.5px; }
.feed-message-wrap .message-subject { margin: 2px 0 0 40px; color: var(--text-2); font-size: 10px; font-weight: 680; }
.feed-message-wrap .message-recipients { margin: 2px 0 0 40px; display: flex; flex-wrap: wrap; gap: 3px 8px; font-size: 9.2px; }
.feed-message-wrap .message-content { padding: 9px 15px 17px 54px; font-size: 12.5px; line-height: 1.58; }
.feed-message-wrap .attachment-list { margin: 0 15px 15px 54px; }
.feed-message-wrap .quoted-message { margin-left: 0; }
.feed-reader-conversation .email-frame { max-width: 100%; border-color: color-mix(in srgb,var(--line) 52%,transparent); border-radius: 8px; }

@media (max-width: 900px) {
  .feed-reader-conversation { padding-inline: 12px; }
  .feed-thread-head { padding-left: 8px; }
}
@media (max-width: 700px) {
  .feed-card.reading { border: 0; }
  .feed-reader-toolbar { min-height: 46px; padding: 5px 7px; }
  .feed-label-button > span { display: none; }
  .feed-label-popover { position: fixed; left: 8px; right: 8px; top: calc(var(--topbar-h) + 52px); width: auto; }
  .feed-reader-conversation { padding: 12px 6px 22px; }
  .feed-thread-head { padding: 0 6px 13px; }
  .feed-thread-subject-line h1 { font-size: 16px; }
  .feed-thread-meta > span:nth-child(2), .feed-thread-meta > span:nth-child(3) { display: none; }
  .feed-thread-messages { gap: 7px; }
  .feed-message-wrap .message { border-radius: 10px; }
  .feed-message-wrap .message-meta-panel { padding: 9px 9px 7px; }
  .feed-message-wrap .message-content { padding: 8px 10px 13px; }
  .feed-message-wrap .message-subject, .feed-message-wrap .message-recipients { margin-left: 38px; }
  .feed-message-wrap .attachment-list { margin: 0 10px 12px; }
}

