/* «Контакты»: the cabinet's address book. Loaded after bearmark.css,
   inbox.css and files.css; kit roles only (design/core: BmCard, BmTable
   rows, BmBadge soft, BmEmptyState, BmSegmented chips). One surface with
   hairline rows for the list, a card beside it on a wide screen and in its
   place on a narrow one. */

.contacts-view {
  gap: 16px;
  /* The heading line's tools follow the same widths as the body's. */
  container: contacts / inline-size;
}
.contacts-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}
/* The heading line: the title, then «Ещё» and «+» at its right end; the
   description under both. */
.contacts-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
}
.contacts-head > p {
  grid-column: 1 / -1;
}
.contacts-head-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}
.contacts-head-tools:empty {
  display: none;
}

/* ---- the book's key: not created, locked, recovery ------------------------ */
.contacts-gate.section-card {
  display: grid;
  justify-items: start;
  gap: 10px;
  max-width: 560px;
  padding: 24px;
}
.contacts-gate-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--bm-border);
  border-radius: 50%;
  background: var(--bm-raised);
  color: var(--bm-text-soft);
}
.contacts-gate h3 {
  margin: 0;
  font: 700 16px/1.3 var(--bm-font-display);
}
.contacts-gate .muted {
  margin: 0;
  max-width: 56ch;
}
.contacts-key-form {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 380px;
  margin-top: 6px;
}
.contacts-key-form .button {
  justify-self: start;
}
.contacts-code {
  margin: 4px 0;
  padding: 12px 14px;
  border: 1px solid var(--bm-border-strong);
  border-radius: var(--bm-radius-md);
  background: var(--bm-raised);
  font: 600 15px/1.5 var(--bm-font-mono);
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---- tools: search on its own line, then who and the two filters ---------- */
.contacts-tools {
  display: grid;
  gap: 8px;
}
.contacts-bar {
  display: flex;
  align-items: center;
  min-width: 0;
}
.contacts-bar .search-field {
  flex: 1 1 auto;
  max-width: 640px;
}
.contacts-new {
  flex: none;
}
.contacts-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.contacts-actions .button.contact-tool {
  width: var(--tb-control-h);
  height: var(--tb-control-h);
}
/* A wide row: icon and word; a middle one: the icon alone. */
.button.contacts-wide-tool {
  gap: 6px;
  padding: 0 10px;
  border-color: transparent;
}
@container contacts (max-width: 899.98px) {
  .contacts-tool-text {
    display: none;
  }
  .button.contacts-wide-tool {
    width: var(--tb-control-h);
    padding: 0;
  }
}
/* Wide: one row, chips, the filters, the count at its end. */
.contacts-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.contacts-filter-who {
  display: contents;
}
.contacts-count {
  order: 3;
  margin: 0 2px 0 auto;
  font-size: 13px;
  white-space: nowrap;
}
.contacts-filter-facets {
  display: flex;
  flex: 1 1 360px;
  gap: 8px;
  min-width: 0;
  max-width: 440px;
}
.contacts-filter-facets > .select {
  flex: 1 1 0;
  min-width: 0;
}
.contacts-filter-facets > .select:has(> .select-native[hidden]) {
  display: none;
}
.contacts-filter-facets:not(:has(> .select > .select-native:not([hidden]))) {
  display: none;
}
/* Narrow: the chips with the count beside them; the two filters share the
   next line half and half, each on one line. */
@container contacts (max-width: 699.98px) {
  .contacts-filter {
    display: grid;
  }
  .contacts-filter-who {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }
  .contacts-filter-who .chips {
    flex-wrap: nowrap;
    min-width: 0;
  }
  .contacts-filter-facets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
}
/* Choosing several: «Выбрать все» over the rows' boxes, «Готово» at the end. */
.contacts-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 0 13px;
}
.contacts-pick-head[hidden] {
  display: none;
}
.contacts-pick-head .pick-all {
  min-width: 0;
  font-size: 14px;
}
/* The bulk bar of «Контакты» measures its own column (the list's), not the
   window: beside an open card it is narrow on any screen. Narrow: the count
   with «Снять выбор» and «Готово», then the three actions in equal thirds;
   very narrow: the actions as icons; wide: one row. */
.bulk-bar.contacts-bulk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'sum aside'
    'act act';
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: var(--bm-radius-lg);
}
.contacts-bulk .bulk-summary {
  grid-area: sum;
  gap: 0;
  min-width: 0;
}
.contacts-bulk .bulk-title {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contacts-bulk-away {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contacts-bulk-away[hidden] {
  display: none;
}
.contacts-bulk-aside {
  grid-area: aside;
  display: flex;
  align-items: center;
  gap: 4px;
}
.contacts-bulk .bulk-actions {
  grid-area: act;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.contacts-bulk .bulk-actions .button {
  gap: 6px;
  min-height: var(--tb-control-h);
  padding: 0 8px;
  white-space: nowrap;
}
/* The count is in the bar's title; the button's name says it too. */
.contacts-bulk .bulk-n {
  display: none;
}
@container contacts-side (max-width: 319.98px) {
  .bulk-bar.contacts-bulk {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'sum'
      'aside'
      'act';
  }
  .contacts-bulk-word {
    display: none;
  }
}
@container contacts-side (min-width: 640px) {
  .bulk-bar.contacts-bulk {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: 'sum act aside';
    padding: 10px 12px 10px 18px;
  }
  .contacts-bulk .bulk-actions {
    display: flex;
    flex-wrap: nowrap;
  }
  .contacts-bulk .bulk-actions .button {
    padding: 0 14px;
  }
  .contacts-bulk .bulk-n {
    display: inline;
  }
}
/* The tag dialog: the book's tags to tap, in their colours. */
.contacts-tag-offer-title {
  margin: 4px 0 -4px;
  font-size: 13px;
}
@media (pointer: coarse) {
  .tint-grid.contacts-tag-offer .tag {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
}
.contacts-details {
  border-top: 1px solid var(--bm-border);
  padding-top: 8px;
}
.contacts-details > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 4px 0;
}
.contacts-details .contact-list {
  max-height: 40vh;
  overflow: auto;
}
.contacts-details .contact-item select {
  width: auto;
  flex: none;
  min-height: 32px;
  font-size: 13px;
}
/* A narrow section: «Новый контакт» is a plus; every rare tool is in «Ещё». */
@container contacts (max-width: 699.98px) {
  .contacts-new-text,
  .contacts-wide-tool {
    display: none;
  }
  .contacts-new {
    width: var(--tb-control-h);
    padding: 0;
  }
}
@container contacts (min-width: 700px) {
  .contacts-narrow-item {
    display: none !important;
  }
}

/* ---- a menu under its button (the kit's menu surface) ---------------------- */
.contacts-menu-box {
  position: relative;
  display: inline-flex;
}
.contacts-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: var(--bm-z-dropdown);
  display: flex;
  flex-direction: column;
  min-width: 220px;
  max-width: calc(100vw - 2 * var(--tb-gutter));
  padding: 5px 0;
  border: 1px solid var(--bm-border-strong);
  border-radius: var(--bm-radius-md);
  background: var(--bm-surface);
  box-shadow: var(--bm-shadow-md);
}
.contacts-menu[data-align='start'] {
  right: auto;
  left: 0;
}
.contacts-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--bm-text);
  font: 500 14px/1.3 var(--bm-font-body);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.contacts-menu-item svg {
  color: var(--bm-text-soft);
}
.contacts-menu-item:hover,
.contacts-menu-item:focus-visible {
  background: color-mix(in srgb, var(--bm-text) 8%, var(--bm-surface));
  outline: none;
}
.contacts-menu-item:focus-visible {
  box-shadow: inset 3px 0 0 var(--bm-focus);
}
.contacts-menu-sep {
  height: 1px;
  margin: 5px 0;
  background: var(--bm-border);
}
.contacts-menu-item.danger,
.contacts-menu-item.danger svg {
  color: var(--bm-warn-ink);
}

/* ---- small icon buttons: rows, the card's head, inline forms --------------- */
.button.contact-tool {
  flex: none;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-color: transparent;
  color: var(--bm-text-soft);
}
.button.contact-tool:not(:disabled):hover {
  color: var(--bm-text);
}
.button.contact-tool.primary {
  border-color: var(--bm-brass-deep);
  color: var(--bm-on-accent);
}
.button.contact-tool.danger {
  color: var(--bm-warn-ink);
}
.button.contact-tool.on {
  color: var(--bm-accent-ink);
}
.button.contact-tool.on svg {
  fill: currentColor;
}

/* ---- the list and the card beside it -------------------------------------- */
.contacts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.contacts-side {
  display: grid;
  gap: 8px;
  min-width: 0;
  container: contacts-side / inline-size;
}
.contacts-card.section-card:empty {
  display: none;
}
@container contacts (min-width: 860px) {
  .contacts-layout[data-open='true'] {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  }
}
@container contacts (max-width: 859.98px) {
  .contacts-layout[data-open='true'] .contacts-side {
    display: none;
  }
}
.contacts-list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: clip;
  border: 1px solid var(--bm-border-strong);
  border-radius: var(--bm-radius-lg);
  background: var(--bm-surface);
  transition: opacity var(--bm-dur-base) var(--bm-ease-standard);
}
.contacts-list:empty {
  display: none;
}
.contacts-list[aria-busy='true'] {
  opacity: 0.6;
}
.contact-row + .contact-row {
  border-top: 1px solid var(--bm-border);
}
.contact-row-open {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 6px 12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.contact-row-open:hover {
  background: var(--bm-raised);
}
.contact-row-open[aria-current='true'] {
  background: var(--bm-raised);
  box-shadow: inset 3px 0 0 var(--bm-accent);
}
.contact-row-open:focus-visible,
.contact-row-check:has(> input:focus-visible) {
  outline: 2px solid var(--bm-accent);
  outline-offset: -2px;
}
/* A row while choosing: its box inside the row's own inset, centred on the
   row; the whole row ticks it. */
.contact-row-check {
  grid-template-columns: 20px 32px minmax(0, 1fr);
  gap: 12px;
  color: var(--bm-text);
  font: 400 var(--tb-type-body-size) / 1.4 var(--bm-font-body);
  letter-spacing: 0;
  text-transform: none;
}
.contact-row-check:has(> input:checked) {
  background: color-mix(in srgb, var(--bm-accent) 10%, var(--bm-surface));
}
.contact-row-check > input:focus-visible {
  box-shadow: none;
}
.contact-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--bm-border);
  border-radius: 50%;
  background: var(--bm-raised);
  color: var(--bm-text-soft);
}
.contact-row-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.contact-row-name {
  overflow: hidden;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-row-facts {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contacts-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 32px 20px;
  border: 1px dashed var(--bm-border-strong);
  border-radius: var(--bm-radius-lg);
  text-align: center;
}
.contacts-empty-title {
  margin: 0;
  font: 700 16px/1.3 var(--bm-font-display);
}
.contacts-empty[data-state='waiting'] {
  padding: 20px;
  border-color: transparent;
}
.contacts-empty .muted {
  margin: 0;
  max-width: 52ch;
  font-size: 14px;
}

/* ---- one card: a dense head, then tight sections of one-line rows -------- */
.contacts-card.section-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
  min-width: 0;
  container: contact-card / inline-size;
}
.contact-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}
.contact-head .contact-mark {
  flex: none;
  width: 36px;
  height: 36px;
}
.contact-title {
  flex: 1 1 180px;
  min-width: 0;
}
.contact-title h3 {
  margin: 0;
  font: 600 var(--tb-type-h3-size) / var(--tb-type-h3-line)
    var(--bm-font-display);
  overflow-wrap: anywhere;
}
.contact-title .muted {
  margin: 1px 0 0;
  font-size: 13px;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.contact-actions .button.small {
  gap: 6px;
  padding: 0 12px;
}
.contact-add-open {
  padding: 0 12px 0 10px;
}
@container contact-card (max-width: 559.98px) {
  .contact-actions {
    flex-basis: 100%;
    margin-left: 0;
  }
  .contact-wide-only {
    display: none;
  }
  /* Beside «Написать» the plus says enough; alone it keeps its word. */
  .contact-actions:has(.contact-write) .contact-add-text {
    display: none;
  }
  .contact-actions:has(.contact-write) .contact-add-open {
    width: var(--tb-control-sm);
    padding: 0;
  }
}
@container contact-card (min-width: 560px) {
  .contact-narrow-only {
    display: none;
  }
}
@container contacts (min-width: 860px) {
  .contact-back {
    display: none;
  }
}
.contact-add-slot:empty {
  display: none;
}
.contact-add-slot {
  padding: 8px;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius-md);
  background: var(--bm-raised);
}
.contact-section {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.contact-section h4 {
  margin: 0;
  color: var(--bm-text-soft);
  font: 600 11px/1.3 var(--bm-font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* A row: what it is · the value · its tools at the end. */
.contact-lines {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-line {
  display: grid;
  grid-template-columns: minmax(4.5rem, 7.5rem) minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  min-height: 36px;
  padding: 2px 0;
}
.contact-line + .contact-line {
  border-top: 1px solid var(--bm-border);
}
.contact-line.no-kind {
  grid-template-columns: minmax(0, 1fr) auto;
}
.contact-line.editing {
  display: block;
  padding: 6px 0;
}
.contact-line-kind {
  overflow: hidden;
  color: var(--bm-text-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-line-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
  padding: 4px 0;
}
.contact-line-main .muted {
  font-size: 13px;
}
.contact-line-value {
  min-width: 0;
  font-weight: 500;
  font-size: var(--tb-type-small-size);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.contact-line .link-button {
  min-height: 0;
  padding: 0;
  font-weight: 500;
  text-align: left;
  white-space: normal;
}
.contact-line-tools {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 2px;
}
/* With a mouse the row's tools stay quiet until the row is pointed at. */
@media (hover: hover) and (pointer: fine) {
  .contacts-card .contact-line-tools {
    opacity: 0.5;
    transition: opacity var(--bm-dur-fast) var(--bm-ease-standard);
  }
  .contacts-card .contact-line:hover .contact-line-tools,
  .contacts-card .contact-line:focus-within .contact-line-tools {
    opacity: 1;
  }
}
@container contact-card (max-width: 479.98px) {
  .contact-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .contact-line-kind {
    grid-row: 1;
    padding-top: 4px;
    font-size: 12px;
  }
  .contact-line-kind + .contact-line-main {
    grid-row: 2;
    padding-top: 0;
  }
  .contact-line-tools {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}
.contact-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.contact-badges .tag.reach-unknown,
.contact-badges .tag.reach-absent {
  color: var(--bm-text-soft);
}
.contact-note {
  margin: 0;
  font-size: var(--tb-type-small-size);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.contact-route {
  display: grid;
  gap: 2px;
  padding: 6px 12px;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius-md);
  background: var(--bm-raised);
}
.contact-route p {
  margin: 0;
}
.contact-route-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  padding: 3px 0;
  font-size: 14px;
}
.contact-route-title {
  font-weight: 600;
}
.contact-route[data-state='resolved'] {
  border-color: var(--bm-border-strong);
}
.contact-route .small-print {
  font-size: 13px;
}
.contact-route-options {
  font-size: 14px;
}
.contact-route-options .button.small {
  min-height: 28px;
  padding: 0 10px;
}
/* A small form in place of a row: a caption, fields that wrap, then the
   delete, ✓ and ×. */
.contact-inline-fields {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.contact-inline-cell {
  flex: 1 1 130px;
  min-width: 0;
}
.contact-inline-cell.wide {
  flex: 2 1 200px;
}
.contact-inline input,
.contact-inline .select-trigger {
  min-height: var(--tb-control-sm);
}
.contact-inline textarea {
  min-height: 64px;
}
.contact-inline-actions {
  display: flex;
  gap: 4px;
}
.contact-inline .button.contact-tool {
  width: var(--tb-control-sm);
  height: var(--tb-control-sm);
  min-height: var(--tb-control-sm);
}
.contact-inline .button.contact-tool:not(.primary):not(.danger) {
  border-color: var(--bm-control-border);
}
.contact-inline .button.contact-tool.danger {
  margin-right: 6px;
  border-color: color-mix(in srgb, var(--bm-warn-ink) 45%, transparent);
}
.contacts-dialog-sub {
  margin: 6px 0 0;
  font: 600 11px/1.3 var(--bm-font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bm-text-soft);
}

/* Bin and duplicates (dialogs): a value, a word, an action at the end. */
.contact-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.contact-item + .contact-item {
  border-top: 1px solid var(--bm-border);
}
.contact-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-width: 0;
}
.contact-item-value {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---- a phone: the list comes first ----------------------------------------- */
@media (max-width: 620px), (max-height: 500px) and (pointer: coarse) {
  /* On a phone the screen belongs to names: the section's description is
     left to a wide screen. */
  .contacts-view > .view-head p {
    display: none;
  }
  /* An open card is the screen: search and actions wait behind «назад». */
  .contacts-body:has(.contacts-layout[data-open='true']) .contacts-tools {
    display: none;
  }
  .contacts-card.section-card {
    padding: 10px 12px 14px;
  }
  .contacts-menu-item {
    min-height: 46px;
    font-size: 15px;
  }
}
/* A finger needs 40px: row tools, chips in rows, crosses in forms. */
@media (max-width: 620px), (pointer: coarse) {
  .button.contact-tool {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }
  .contact-route-options .button.small {
    min-height: 40px;
  }
  .contact-line .link-button {
    min-height: 40px;
  }
}

/* A phone or an address in a card is a link: a tap calls, writes or opens
   the map. */
.contact-map svg {
  margin-right: 4px;
  color: var(--bm-text-soft);
  vertical-align: -1px;
}
a.contact-line-value {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--bm-border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ---- history: who changed what ---------------------------------------------- */
.change-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.change-entry {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bm-border);
}
.change-entry:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.change-head,
.change-card {
  margin: 0;
}
.change-card .link-button {
  font-weight: 600;
}
.change-lines {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* ---- busy, refusals, captions ---------------------------------------------- */
/* A write under way: its control waits, the card's other tools rest. */
.contacts-card[aria-busy='true'] .contact-tool,
.contacts-card[aria-busy='true'] .contact-add-open {
  cursor: progress;
}
.button[aria-busy='true'] {
  opacity: 0.55;
  cursor: progress;
}
.contact-inline {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.contact-inline-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
}
.contact-inline-caption {
  margin: 0;
  color: var(--bm-text-soft);
  font: 600 11px/1.3 var(--bm-font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.contact-inline-label {
  display: block;
  margin: 0 0 3px;
  color: var(--bm-text-soft);
  font-size: 12px;
}
.contact-inline-cell {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.contact-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tb-control-sm);
  white-space: nowrap;
}
.contact-inline-out:empty {
  display: none;
}
.contact-inline-out {
  display: grid;
  gap: 6px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.contact-inline-out[data-tone='warn'] > span {
  color: var(--bm-warn-ink);
  font-weight: 500;
}
.contact-inline-offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
}
.contact-inline-offer > span {
  color: var(--bm-text);
  font-weight: 400;
}
/* Long values (a mail address, a link) wrap instead of widening the page. */
.contact-route-way,
.contact-route-options .contact-line-value,
.contact-line-value,
.contact-title .muted {
  min-width: 0;
  overflow-wrap: anywhere;
}
.contact-route-head > * {
  min-width: 0;
}
.contact-route-quiet {
  margin: 0;
  padding: 4px 0;
  font-size: 13px;
}
.contact-prefs .contact-line-value {
  font-weight: 500;
  font-size: var(--tb-type-small-size);
}
.contact-line-note {
  font-size: 12px;
}
.contacts-plain-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}
.contact-line .tag {
  max-width: 100%;
}
/* A tag wears a colour of its own (contacts.js tintOf): a light wash and a
   matching ink from the tags' own palette, never a status hue. */
[data-tint] {
  --tint: var(--tb-tag-1);
}
.tag.tinted {
  --tag-edge: color-mix(in srgb, var(--tint) var(--tb-tag-edge), transparent);
  border-color: var(--tag-edge);
  background: color-mix(
    in srgb,
    var(--tint) var(--tb-tag-wash),
    var(--bm-surface)
  );
  color: color-mix(in srgb, var(--tint) var(--tb-tag-ink), var(--bm-text));
}
[data-tint='2'] {
  --tint: var(--tb-tag-2);
}
[data-tint='3'] {
  --tint: var(--tb-tag-3);
}
[data-tint='4'] {
  --tint: var(--tb-tag-4);
}
[data-tint='5'] {
  --tint: var(--tb-tag-5);
}
[data-tint='6'] {
  --tint: var(--tb-tag-6);
}
[data-tint='7'] {
  --tint: var(--tb-tag-7);
}
[data-tint='8'] {
  --tint: var(--tb-tag-8);
}
[data-tint='9'] {
  --tint: var(--tb-tag-9);
}
[data-tint='10'] {
  --tint: var(--tb-tag-10);
}
[data-tint='11'] {
  --tint: var(--tb-tag-11);
}
[data-tint='12'] {
  --tint: var(--tb-tag-12);
}
/* A tag on a card is pressed to choose its colour; the choices are the tag
   itself in each colour. */
button.tag {
  cursor: pointer;
  appearance: none;
}
.tint-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tint-grid .tag {
  padding: 2px 11px;
}
.tint-grid .tag[aria-pressed='true'] {
  box-shadow: 0 0 0 2px var(--bm-focus);
}
@media (pointer: coarse) {
  .tint-grid .tag {
    min-height: 36px;
  }
}
/* Under a finger the tag on a card answers 10px beyond its edge on every
   side (41px tall) and looks the same: the extra is a clear border, and the
   edge it had is drawn inside. */
@media (pointer: coarse) {
  button.tag:not(.tint-grid .tag) {
    max-width: calc(100% + 20px);
    margin: -10px;
    padding: 1px 10px;
    border: 10px solid transparent;
    background-clip: padding-box;
    box-shadow: inset 0 0 0 1px var(--tag-edge, var(--bm-border-strong));
    outline-offset: -10px;
  }
}
/* The same colour as a dot before a tag in the filter and in its list. */
.select-option[data-tint]::before,
.select-value[data-tint]::before {
  content: '';
  flex: 0 0 auto;
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--tint, var(--tb-tag-1));
}
.select-option[data-tint]::before {
  margin-right: 0;
}
.select-option[data-tint] .select-option-text {
  flex: 1 1 auto;
}
/* A finger reaches a phone or an address: the link is a full row high. */
@media (max-width: 620px), (pointer: coarse) {
  .contact-line-value,
  .contact-line-main .contact-note {
    font-size: var(--tb-type-body-size);
  }
  a.contact-line-value {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
  .contact-inline-row {
    flex-wrap: wrap;
  }
  .contact-inline-actions {
    margin-left: auto;
  }
}
.contact-note.clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.contact-line .contact-note-more {
  min-height: 0;
  font-size: 13px;
}
.contact-line-main .contact-note {
  flex-basis: 100%;
}
