/* ContactsWorkspace and ContactDrawer layout, using the CaseAid surface tokens. */
#v-contacts:has(.ve-ca-contacts-hero),
#drawer[data-record-type="contact"]:has(.ve-ca-profile-header) {
  --ve-ca-canvas: #eef2f7;
  --ve-ca-surface: #fff;
  --ve-ca-subtle: #f8fafc;
  --ve-ca-sunken: #f5f7fa;
  --ve-ca-ink: #15213a;
  --ve-ca-muted: #657086;
  --ve-ca-line: #d6dee8;
  --ve-ca-line-strong: #cbd4df;
  --ve-ca-blue: #155eef;
  --ve-ca-blue-soft: #eaf1ff;
  --ve-ca-radius: 10px;
  --ve-ca-gutter: 24px;
  --ve-ca-toolbar-height: 40px;
  color: var(--ve-ca-ink);
  font-family: var(--ca-font-sans, "Geist", Arial, sans-serif);
}

#v-contacts:has(.ve-ca-contacts-hero) {
  margin: -22px -26px 0;
  padding-bottom: 24px;
  background: var(--ve-ca-canvas);
}

#v-contacts .ve-ca-contacts-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: var(--ve-ca-gutter);
  border-bottom: 1px solid var(--ve-ca-line);
  background: var(--ve-ca-surface);
}

#v-contacts .ve-ca-contacts-hero .ph-txt { min-width: 0; }
#v-contacts .ve-ca-contacts-hero h1 {
  margin: 4px 0;
  color: var(--ve-ca-ink);
  font-size: 30px;
  letter-spacing: -.035em;
}

#v-contacts .ve-ca-contacts-toolbar {
  position: relative;
  margin: 16px var(--ve-ca-gutter) 0;
  padding: 12px;
  border: 1px solid var(--ve-ca-line);
  border-radius: var(--ve-ca-radius) var(--ve-ca-radius) 0 0;
  background: var(--ve-ca-surface);
  box-shadow: none;
}

.ve-ca-contacts-toolbar > .tb-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  padding: 0;
}
.ve-ca-contacts-toolbar > .tb-row:has(> .fgroup) { grid-template-columns: minmax(220px, 1fr) 220px auto auto; }
.ve-ca-contact-search .f-search { width: 100%; max-width: none; }
.ve-ca-filter-label,
.ve-ca-contacts-toolbar .fgroup > label,
.ve-ca-sort-label {
  display: block;
  margin: 0 0 4px;
  color: var(--ve-ca-muted);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}
.ve-ca-contacts-toolbar .f-search input,
.ve-ca-contacts-toolbar select {
  width: 100%;
  min-height: var(--ve-ca-toolbar-height);
  border-color: var(--ve-ca-line-strong);
  background: var(--ve-ca-surface);
}
.ve-ca-contacts-toolbar .ve-ca-contacts-result-count {
  padding-block: 0 10px;
  color: var(--ve-ca-muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}
.ve-ca-contact-filters > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--ve-ca-toolbar-height);
  padding: 0 10px;
  border: 1px solid var(--ve-ca-line-strong);
  border-radius: var(--cd-radius-xs);
  color: var(--ve-ca-ink);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}
.ve-ca-contact-filters > summary::after { content: '▾'; }
.ve-ca-contact-filters[open] > summary::after { transform: rotate(180deg); }
.ve-ca-contact-filter-options {
  position: absolute;
  z-index: 9;
  right: 12px;
  top: calc(100% - 4px);
  display: grid;
  gap: 10px;
  width: min(420px, calc(100% - 24px));
  padding: 12px;
  border: 1px solid var(--ve-ca-line);
  border-radius: var(--ve-ca-radius);
  background: var(--ve-ca-surface);
  box-shadow: var(--cd-shadow-panel);
}
.ve-ca-contact-filter-options .tb-row { padding: 0; border: 0; }
.ve-ca-sort-label select { margin-top: 4px; padding: 0 10px; border: 1px solid var(--ve-ca-line-strong); border-radius: 6px; color: var(--ve-ca-ink); font: inherit; text-transform: none; }

#v-contacts #ctNote { margin-inline: var(--ve-ca-gutter); }
#v-contacts .ve-ca-contacts-table {
  width: auto;
  margin: 0 var(--ve-ca-gutter);
  overflow: hidden;
  border: 1px solid var(--ve-ca-line);
  border-top: 0;
  border-radius: 0 0 var(--ve-ca-radius) var(--ve-ca-radius);
  box-shadow: none;
  background: var(--ve-ca-surface);
}

.ve-ca-contacts-table > .card-head { display: none; }
#ctTable .tbl-wrap { overflow-x: auto; }
#ctTable .tbl { min-width: 930px; table-layout: fixed; }
#ctTable .tbl thead th {
  padding: 8px 12px;
  background: var(--ve-ca-sunken);
  color: var(--ve-ca-muted);
  font-size: 13px;
  font-weight: 850;
}

#ctTable .tbl .ve-ca-directory-person { width: 22%; }
#ctTable .tbl .ve-ca-directory-contact { width: 22%; }
#ctTable .tbl .ve-ca-directory-matters { width: 13%; text-align: left; }
#ctTable .tbl .ve-ca-directory-channel { width: 16%; }
#ctTable .tbl .ve-ca-directory-activity { width: 13%; }
#ctTable .tbl .ve-ca-directory-open { width: 14%; text-align: left; }
#ctTable .tbl tbody td { height: 82px; padding: 12px; overflow-wrap: anywhere; }
#ctTable .tbl tr:hover td { background: var(--ve-ca-subtle); }
#ctTable .tbl th[hidden] { display: none; }
#ctTable .tbl .t-primary { color: var(--ve-ca-ink); }
#ctTable .tbl .who .avatar { display: none; }
#ctTable .ve-ca-directory-cell { display: grid; gap: 4px; color: var(--ve-ca-ink); }
#ctTable .ve-ca-directory-cell small { color: var(--cd-ink-quiet); font-size: 13px; }
#ctTable .ve-ca-directory-line-email .mono { font-family: inherit; color: var(--ve-ca-muted); }
#ctTable .ve-ca-directory-open .ve-ca-directory-cell { display: flex; align-items: center; gap: 4px; }
#ctTable .ve-ca-directory-open .ve-ca-directory-line { display: flex; }
#ctTable .tbl .ci-call-phone { color: var(--ve-ca-blue); white-space: nowrap; }
#ctTable .tbl .ve-ca-open-profile {
  min-height: var(--ve-ca-toolbar-height);
  margin: 0;
  padding: 0 7px;
  border: 1px solid var(--ve-ca-line);
  border-radius: 6px;
  background: var(--ve-ca-blue-soft);
  color: var(--ve-ca-blue);
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
}

#ctTable .tbl .ve-ca-open-profile:hover { background: var(--ve-ca-sunken); }
#ctTable .tbl .ve-ca-open-profile:focus-visible { outline: 2px solid var(--ve-ca-blue); outline-offset: 2px; }

#drawer[data-record-type="contact"]:has(.ve-ca-profile-header) {
  inset: var(--cd-topbar-h, var(--topbar-h)) 0 0;
  width: 100%;
  max-width: none;
  background: var(--ve-ca-canvas);
}

body:has(#drawer.on[data-record-type="contact"] .ve-ca-profile-header) #scrim { top: var(--cd-topbar-h, var(--topbar-h)); }
#drawer[data-record-type="contact"]:has(.ve-ca-profile-header) .dr-head {
  padding: 0;
  background: var(--ve-ca-surface);
  border-color: var(--ve-ca-line);
}

.ve-ca-profile-header,
.ve-ca-profile-person,
.ve-ca-profile-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.ve-ca-profile-header {
  justify-content: space-between;
  gap: 20px;
  min-height: 98px;
  padding: 16px var(--ve-ca-gutter);
}

.ve-ca-profile-person { gap: 12px; }
.ve-ca-profile-person > div { min-width: 0; }
.ve-ca-profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ve-ca-blue-soft);
  color: var(--ve-ca-blue);
  font-weight: 800;
}

#drawer[data-record-type="contact"]:has(.ve-ca-profile-header) .ve-ca-profile-person h2 {
  font-size: 28px;
  letter-spacing: -.04em;
}

.ve-ca-profile-person .t-id { color: var(--ve-ca-muted); font-size: 13px; }
.ve-ca-profile-person .dr-badges { margin-top: 8px; }
.ve-ca-profile-actions { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ve-ca-profile-actions .ph-actions { margin-top: 0 !important; }
.ve-ca-profile-actions .btn, .ve-ca-profile-actions .dr-close { min-height: var(--ve-ca-toolbar-height); }
.ve-ca-profile-actions .btn-primary { border-color: var(--ve-ca-blue); background: var(--ve-ca-blue); }
.ve-ca-profile-actions .dr-close { width: 40px; flex-basis: 40px; }

#drawer[data-record-type="contact"]:has(.ve-ca-profile-header) .dr-tabs {
  align-items: stretch;
  gap: 5px;
  margin: 0;
  padding: 0 var(--ve-ca-gutter);
  border: solid var(--ve-ca-line);
  border-width: 1px 0 0;
}

#drawer[data-record-type="contact"]:has(.ve-ca-profile-header) .dr-tab {
  min-height: 50px;
  padding: 0 18px;
  margin-bottom: 0;
  border-bottom-width: 3px;
  color: var(--ve-ca-muted);
  font-size: 13px;
}

#drawer[data-record-type="contact"]:has(.ve-ca-profile-header) .dr-tab.on {
  border-bottom-color: var(--ve-ca-blue);
  color: var(--ve-ca-ink);
}

#drawer[data-record-type="contact"]:has(.ve-ca-profile-header) .dr-body {
  display: block;
  padding: 20px var(--ve-ca-gutter) 50px;
}

.ve-ca-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: 16px;
  max-width: 1500px;
  margin-inline: auto;
}

.ve-ca-profile-main, .ve-ca-profile-aside { display: grid; align-content: start; gap: 16px; min-width: 0; }
.dr-body > .ve-ca-path + .ve-contact-inquiry-layout { margin-top: 16px; }
.ve-ca-path {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ve-ca-line);
  border-radius: var(--ve-ca-radius);
  background: var(--ve-ca-surface);
}
.ve-ca-path-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.ve-ca-path-head h3, .ve-ca-path-dialog h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -.02em;
}
.ve-ca-path-picker {
  display: grid;
  gap: 4px;
  width: min(285px, 100%);
  min-width: 0;
  font-size: 12px;
  font-weight: 750;
}
.ve-ca-path select, .ve-ca-path-dialog :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--ve-ca-line, #d6dee8);
  border-radius: 6px;
  background: #fff;
  color: var(--ve-ca-ink, #15213a);
  font: inherit;
}
.ve-ca-path-stages {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 8px;
}
.ve-ca-path-stage {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ve-ca-line);
  border-radius: 8px;
  background: var(--ve-ca-subtle);
  overflow-wrap: anywhere;
}
.ve-ca-path-future {
  border-color: #cad8f4;
  background: #f3f7ff;
}
.ve-ca-path-tag {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--ve-ca-blue-soft);
  color: #1747a5;
  font-size: 11px;
  font-weight: 800;
}
.ve-ca-path-stage h4, .ve-ca-path-next-title { margin: 6px 0; font-size: 14px; font-weight: 750; }
.ve-ca-path-stage .ve-ca-path-next-label { margin: 0; color: #1747a5; font-size: 12px; }
.ve-ca-path-facts {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ve-ca-muted);
  font-size: 13px;
}
.ve-ca-path-muted {
  margin: 0 0 8px;
  color: var(--ve-ca-muted, #526078);
  font-size: 13px;
  line-height: 1.45;
}
.ve-ca-path-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ve-ca-path-actions .btn { min-height: 36px; white-space: normal; }
.ve-ca-path-dialog {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 18px;
  border: 1px solid #d6dee8;
  border-radius: 10px;
  color: #15213a;
  background: #fff;
}
.ve-ca-path-dialog::backdrop { background: rgb(15 23 42 / 45%); }
.ve-ca-path-dialog form { display: grid; gap: 10px; }
.ve-ca-path-field { display: grid; gap: 4px; font-size: 13px; font-weight: 750; }
.ve-ca-path-status { margin: 0; color: #9c2443; font-size: 13px; }
.ve-contact-sms-dialog {
  width: min(28rem, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  box-sizing: border-box;
  margin: auto;
  padding: clamp(16px, 4vw, 24px);
  overflow: auto;
  color: #15213a;
  background: #fff;
  border: 1px solid #d6dee8;
  border-radius: 12px;
  box-shadow: 0 16px 56px #15213a32;
}
.ve-contact-sms-dialog::backdrop { background: rgb(15 23 42 / 45%); }
.ve-contact-sms-dialog form { display: grid; gap: 16px; }
.ve-contact-sms-dialog h2 { margin: 0; font-size: 21px; line-height: 1.25; }
.ve-contact-sms-dialog p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.ve-contact-sms-dialog [hidden], .ve-contact-sms-dialog p:empty { display: none; }
.ve-contact-sms-to { display: flex; gap: 12px; padding: 12px; border-radius: 8px; background: #f2f5f9; }
.ve-contact-sms-to > span, .ve-contact-sms-dialog label { color: #526276; font-size: 13px; font-weight: 650; }
.ve-contact-sms-dialog label { display: block; margin-bottom: 4px; }
.ve-contact-sms-dialog select { width: 100%; min-height: 42px; }
.ve-contact-sms-dialog [data-sms-fees] { padding: 12px; background: #f2f5f9; border-radius: 8px; }
.ve-contact-sms-dialog [data-sms-fees] p { margin: 6px 0 12px; white-space: pre-line; }
.ve-contact-sms-dialog [data-sms-fees] label { display: flex; align-items: baseline; gap: 8px; color: #15213a; }
.ve-contact-sms-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ve-contact-sms-actions .btn { min-height: 40px; white-space: normal; }
.ve-ca-profile-panel {
  padding: 20px;
  border: 1px solid var(--ve-ca-line);
  border-radius: var(--ve-ca-radius);
  background: var(--ve-ca-surface);
}

.ve-ca-profile-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.ve-ca-profile-panel-head h3 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.025em; }
.ve-ca-profile-panel-head .btn { min-height: var(--ve-ca-toolbar-height); }
.ve-ca-profile-panel:has(#editForm) .ve-ca-profile-fields,
.ve-ca-profile-panel:has(#editForm) .ve-ca-profile-panel-head [data-act="edit"],
.ve-ca-profile-panel:has(#editForm) > .muted { display: none; }
#editWrap.ve-ca-inline-open { display: none; }
.ve-ca-profile-panel .pick {
  width: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.ve-ca-profile-panel .pick .pick-head { display: none; }
.ve-ca-profile-panel .pick .edit-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  max-height: none;
  overflow: visible;
  padding: 0;
}
.ve-ca-profile-panel .pick .edit-group { color: var(--ve-ca-muted); }
.ve-ca-profile-panel .pick .edit-foot {
  padding: 12px 0 0;
  border: 0;
  background: transparent;
}
.ve-ca-profile-panel .pick .set-field > :is(input, select) { min-height: var(--ve-ca-toolbar-height); }
.ve-ca-profile-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.ve-ca-profile-field dt {
  margin-bottom: 4px;
  color: var(--ve-ca-muted);
  font-size: 13px;
  font-weight: 700;
}

.ve-ca-profile-field dd {
  display: flex;
  align-items: center;
  min-height: var(--ve-ca-toolbar-height);
  margin: 0;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  border: 1px solid var(--ve-ca-line);
  border-radius: 6px;
  background: var(--ve-ca-subtle);
  color: var(--ve-ca-ink);
  font-size: 14px;
}

.ve-ca-profile-aside > .card,
.ve-ca-profile-work > .card { box-shadow: none; border-color: var(--ve-ca-line); }
.ve-ca-profile-work { display: grid; gap: 16px; margin-top: 16px; }
.ve-ca-profile-work .tbl-wrap { overflow-x: auto; }

#drawer[data-record-type="contact"]:has(.ve-contact-timeline-full) .dr-body {
  overflow-x: clip;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  scrollbar-gutter: stable;
}

.ve-contact-timeline {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: clamp(12px, 2.4vw, 24px);
  border: 1px solid var(--ve-ca-line, var(--line));
  border-radius: 14px;
  background: var(--ve-ca-sunken, #f5f7fa);
  color: var(--ve-ca-ink, var(--ink));
}

.ve-contact-timeline-full {
  width: min(100%, 900px);
  margin-inline: auto;
}

.ve-contact-timeline-head { display: grid; gap: 14px; }
.ve-contact-timeline h3 { margin: 0; font-size: 20px; letter-spacing: -.025em; }

.ve-contact-timeline-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--ve-ca-line, var(--line));
}

.ve-contact-timeline-filters button {
  min-height: 38px;
  padding: 5px 13px;
  border: 1px solid var(--ve-ca-line, var(--line));
  border-radius: 20px;
  background: var(--ve-ca-surface, #fff);
  color: var(--ve-ca-ink, var(--ink));
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ve-contact-timeline-filters button:hover { border-color: var(--ve-ca-blue, #155eef); }
.ve-contact-timeline-filters button[aria-pressed="true"] {
  border-color: #aac3fb;
  background: var(--ve-ca-blue-soft, #eaf1ff);
  color: #1346a3;
}

.ve-contact-timeline :is(button, summary):focus-visible {
  outline: 2px solid var(--ve-ca-blue, #155eef);
  outline-offset: 2px;
}

.ve-contact-timeline-day { min-width: 0; }
.ve-contact-timeline-day h4 {
  margin: 0 0 8px;
  color: var(--ve-ca-muted, #526276);
  font-size: 12px;
  font-weight: 750;
}

.ve-contact-timeline-day ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }

.ve-contact-timeline-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--ve-ca-line, var(--line));
  border-radius: 10px;
  background: var(--ve-ca-surface, #fff);
}

.ve-contact-timeline-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ve-ca-blue-soft, #eaf1ff);
  color: #2453a8;
}

.ve-contact-timeline-card[data-timeline-kind="contract"] .ve-contact-timeline-icon { color: #166047; background: #e6f4ec; }
.ve-contact-timeline-card:is([data-timeline-kind="email_open"], [data-timeline-kind="sms"]) .ve-contact-timeline-icon {
  color: #4f3b96;
  background: #eeeafa;
}

.ve-contact-timeline-copy { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.ve-contact-timeline-card h5 { margin: 1px 0 0; font-size: 14px; line-height: 1.4; }
.ve-contact-timeline-card p { margin: 0; color: var(--ve-ca-muted, #526276); font-size: 13px; line-height: 1.5; }
.ve-contact-timeline-values { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 12px; }
.ve-contact-timeline-values span:not([aria-hidden]) {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ve-ca-sunken, #f5f7fa);
  color: var(--ve-ca-ink, var(--ink));
  font-weight: 650;
}
.ve-contact-timeline-card time {
  color: var(--ve-ca-muted, #526276);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ve-contact-timeline-action { margin-top: 3px; }
.ve-contact-timeline-action .btn { min-height: 32px; max-width: 100%; }
.ve-contact-timeline-transcript {
  margin-top: 4px;
  border: 1px solid var(--ve-ca-line, var(--line));
  border-radius: 8px;
  background: var(--ve-ca-subtle, #f8fafc);
}
.ve-contact-timeline-transcript summary {
  min-height: 34px;
  padding: 7px 10px;
  color: #2453a8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ve-contact-transcript-body {
  max-height: 20rem;
  overflow: auto;
  padding: 0 10px 10px;
  color: var(--ve-ca-ink, var(--ink));
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.ve-contact-transcript-body button { display: block; margin-top: 8px; }

.ve-transcript-intake {
  margin-top: 4px;
  border: 1px solid var(--ve-ca-line, var(--line));
  border-radius: 8px;
  background: var(--ve-ca-subtle, #f8fafc);
}
.ve-transcript-intake summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  color: #2453a8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.ve-transcript-intake summary::-webkit-details-marker { display: none; }
.ve-transcript-intake summary::after { content: '+'; margin-left: auto; }
.ve-transcript-intake[open] summary::after { content: '−'; }
.ve-transcript-intake :is(summary, button, select, input):focus-visible {
  outline: 2px solid var(--ve-ca-blue, #155eef);
  outline-offset: 2px;
}
.ve-transcript-intake-panel,
.ve-transcript-intake-panel form,
.ve-transcript-intake-applied {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.ve-transcript-intake-panel { padding: 0 10px 10px; font-size: 13px; overflow-wrap: anywhere; }
.ve-transcript-intake-panel :is(p, h6) { margin: 0; }
.ve-transcript-intake-panel h6 { font-size: 13px; }
.ve-transcript-intake-panel form > label { display: grid; gap: 3px; font-weight: 650; }
.ve-transcript-intake-panel select {
  width: 100%;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--ve-ca-line, var(--line));
  border-radius: 6px;
  background: var(--ve-ca-surface, #fff);
  color: inherit;
  font: inherit;
}
.ve-transcript-intake-panel button { justify-self: start; }
.ve-transcript-intake-panel ul { margin: 0; padding-left: 20px; }
.ve-transcript-intake-panel [role="alert"] { color: #9b2824; }
.ve-transcript-intake-panel [data-transcript-intake-message]:empty { display: none; }
.ve-transcript-intake-panel fieldset {
  display: grid;
  gap: 8px;
  min-inline-size: 0;
  margin: 0;
  padding: 8px 0 0;
  border: 0;
}
.ve-transcript-intake-panel legend { padding: 0; font-weight: 700; }
.ve-transcript-intake-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--ve-ca-line, var(--line));
  border-radius: 6px;
  background: var(--ve-ca-surface, #fff);
  cursor: pointer;
}
.ve-transcript-intake-choice input { margin-top: 2px; }
.ve-transcript-intake-choice:has(input:disabled) { cursor: default; }
.ve-transcript-intake-quote { display: block; margin-top: 3px; color: var(--ve-ca-muted, #526276); }

.ve-contact-timeline-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 20px 10px;
  color: var(--ve-ca-muted, #526276);
  text-align: center;
}
.ve-contact-timeline-empty p, .ve-contact-timeline-foot p { margin: 0; }
.ve-contact-timeline-foot { display: grid; justify-items: center; gap: 7px; padding-top: 2px; }

@media (max-width: 540px) {
  .ve-contact-timeline { gap: 13px; }
  .ve-contact-timeline-card { grid-template-columns: auto minmax(0, 1fr); gap: 4px 9px; padding: 10px; }
  .ve-contact-timeline-card .ve-contact-timeline-icon { grid-row: span 2; width: 30px; height: 30px; }
  .ve-contact-timeline-card time { grid-column: 2; grid-row: 1; }
  .ve-contact-timeline-card .ve-contact-timeline-copy { grid-column: 2; grid-row: 2; }
}
#drawer[data-record-type="contact"] .ve-ca-profile-aside .dl { grid-template-columns: minmax(90px, 1fr) minmax(0, 1.4fr); }

.ve-contact-inquiry-layout {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 16px;
  align-items: start;
}
.ve-contact-inquiry-context,
.ve-contact-inquiry-layout > [data-selected-inquiry] {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.ve-contact-inquiry-context { order: -1; }
.ve-contact-inquiry-layout :is([data-inquiry-contact], [data-contact-timeline], [data-selected-inquiry]) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ve-contact-inquiry-layout [data-inquiry-contact] .dl {
  grid-template-columns: minmax(72px, .65fr) minmax(0, 1.35fr);
}
.ve-contact-inquiry-layout [data-contact-inquiry] {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ve-ca-accent, #1856bf);
  font: inherit;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}
.ve-contact-inquiry-layout [data-contact-inquiry]:hover { text-decoration: underline; }
.ve-contact-inquiry-layout [data-contact-timeline] [aria-current="true"] {
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ve-contact-inquiry-layout [data-selected-inquiry] .ph-actions { margin-block: 8px; }
.ve-contact-document-preview {
  width: 100%;
  min-height: 450px;
  border: 1px solid var(--ve-ca-line);
  border-radius: 8px;
}
.ve-contact-document-image { max-width: 100%; height: auto; }
.ve-contact-document-text { max-height: 65dvh; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 760px) {
  .ve-contact-inquiry-layout { grid-template-columns: minmax(0, 1fr); }
  .ve-contact-inquiry-context { display: contents; }
  .ve-contact-inquiry-layout [data-inquiry-contact] { order: -1; }
  .ve-contact-inquiry-layout [data-contact-timeline] { order: 1; }
}

@media (max-width: 1180px) {
  .ve-ca-profile-fields,
  .ve-ca-profile-panel .pick .edit-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  #v-contacts:has(.ve-ca-contacts-hero) { margin: -16px -14px 0; --ve-ca-gutter: 16px; }
  .ve-ca-contacts-toolbar > .tb-row,
  .ve-ca-contacts-toolbar > .tb-row:has(> .fgroup) { grid-template-columns: minmax(0, 1fr) auto; }
  .ve-ca-contact-search,
  .ve-ca-contacts-toolbar > .tb-row > .fgroup { grid-column: 1 / -1; }
  #drawer[data-record-type="contact"]:has(.ve-ca-profile-header) { --ve-ca-gutter: 16px; }
  .ve-ca-profile-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .ve-ca-profile-actions { justify-content: flex-start; }
  .ve-ca-profile-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  #v-contacts:has(.ve-ca-contacts-hero),
  #drawer[data-record-type="contact"]:has(.ve-ca-profile-header) { --ve-ca-gutter: 12px; }
  .ve-ca-contacts-toolbar .ve-ca-contacts-result-count { white-space: normal; }
  .ve-ca-profile-fields,
  .ve-ca-profile-panel .pick .edit-body { grid-template-columns: minmax(0, 1fr); }
  .ve-ca-path-stages { grid-template-columns: minmax(0, 1fr); }
  .ve-ca-profile-avatar { display: none; }
  .ve-ca-profile-header { position: relative; }
  .ve-ca-profile-person { padding-right: 48px; }
  .ve-ca-profile-actions #drClose { position: absolute; top: 12px; right: 12px; }
  #drawer[data-record-type="contact"]:has(.ve-ca-profile-header) .dr-tab { padding-inline: 12px; }
}
