/* ===========================================================================
   Contact drawer
   =========================================================================== */

/* The company and contact drawers lead with a rounded square, not a circle —
   a circle is a person, and these two are a record. */
.drawer__mark {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px;
  background: var(--coral); color: var(--on-coral);
  display: grid; place-items: center; font-size: 13px; font-weight: var(--weight-strong);
}

/* Approve and delete sit right-aligned above the emails. */
.drawer__actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px }

.tile__big { font-size: 15px; font-weight: var(--weight-strong); line-height: 1.35 }

/* Where this person ranks against the others at their company. Bars rather
   than a number, because the useful fact is the position, not the integer. */
.rankbars { display: flex; align-items: flex-end; gap: 6px; height: 34px }
.rankbar { width: 12px; border-radius: 4px; background: #DCDCDC }
.rankbar--best { background: var(--teal) }
.rankbar--here { background: var(--ink) }
.rankbars__num { margin-left: 8px; font-size: 15px; font-weight: var(--weight-strong); color: var(--muted) }
.rankbars__num[data-best="true"] { color: var(--text) }

/* Why this pain point fits this person. */
.leverfit {
  display: flex; gap: 10px; background: var(--page);
  border-radius: 16px; padding: 14px 16px; margin-top: 14px;
}
.leverfit .ms { font-size: 17px; color: var(--muted); flex: 0 0 auto }
.leverfit span { font-size: 12.5px; line-height: 1.6; color: var(--muted) }

/* One email of the sequence. */
.step__label { font-size: 11.5px; font-weight: var(--weight-strong); color: var(--muted); margin-bottom: 6px }

/* The conversation, once there is one. */
.thread { display: flex; flex-direction: column; gap: 4px }
/* Messages in a run sit close; a new run, a meeting, the draft and anything
   else in the thread start further down. */
.thread > .msg--first, .thread > .suggest, .thread > .ready__form, .thread > .thread__end { margin-top: 14px }
/* Where the day changes: the day, centred, on its own, as a chat app marks
   it (no rule either side: in the Thread the deal is the one line that runs
   to the edge, so the day never competes with it). */
.thread__day {
  display: flex; justify-content: center; margin: 22px 0 0;
  font-size: 11.5px; font-weight: var(--weight-strong); color: var(--muted); white-space: nowrap;
}
.threadempty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 44px 20px; text-align: center;
}
/* Sub tabs in a drawer (see .tabchips), under the tabs. On the grey (below)
   they head the scrolling body and scroll away with it (drawer-type-scale.css
   sets their edges there). */
.dealsbar, .notesbar {
  flex: 0 0 auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  /* 28px: the tabs' 16px inset plus a tab's own 12px. */
  padding: 6px 28px 8px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.dealsbar::-webkit-scrollbar, .notesbar::-webkit-scrollbar { width: 0; height: 0 }
/* Deals', Signals' and Notes' rows are hidden only until their tab's read
   comes back, so they keep a chip's height while empty: the containers under
   them never move when the chips arrive. */
.dealsbar[hidden], .notesbar[hidden] { display: flex; visibility: hidden }
.dealsbar[hidden]::before, .notesbar[hidden]::before { content: ""; height: var(--subbar-h) }
.dealsbar .chip, .notesbar .chip { flex: 0 0 auto }
@media (max-width: 900px) {
  .dealsbar, .notesbar { padding: 4px 16px 8px 20px }
}
/* Over a tab laid out in containers (Deals), the sub tabs sit in the grey
   with the containers instead: the white header ends at the tabs' hairline,
   the row is page grey with no line of its own, and the chosen one is white
   with the faint edge a container has, rather than a grey wash that would
   vanish on grey. The row takes the containers' own edges: the first chip
   starts at their left edge and New deal ends at their right (16px, and on
   the right the body's scrollbar gutter too). New deal is white, a control
   on the grey. */
.dealsbar, .notesbar { background: var(--page); border-bottom: 0; padding: 14px 27px 8px 16px }
.dealsbar .chip[aria-pressed="true"], .notesbar .chip[aria-pressed="true"],
.dealsbar .chip[aria-pressed="true"]:hover, .notesbar .chip[aria-pressed="true"]:hover {
  background: var(--card); box-shadow: 0 0 0 1px rgba(16, 33, 31, .07), 0 1px 2px rgba(16, 33, 31, .04);
}
.dealsbar .chip:not([aria-pressed="true"]):not(:disabled):hover, .notesbar .chip:not([aria-pressed="true"]):not(:disabled):hover { background: color-mix(in srgb, var(--card) 70%, transparent) }
/* Every control in the row is one height, chips, buttons and search alike,
   so the row is the same on every tab and the first container sits in the
   same place on Deals, Signals, Notes and Contacts. The row scrolls
   sideways, which clips it top and bottom too, so it keeps 8px under the
   controls for the chosen chip's edge, and the body under it gives those 8px
   back (the containers rule at the end). */
/* 32, the sub-tab size (design/corners-and-spacing.md, "Buttons"), 44 on
   touch as every control is; the buttons and search beside the chips take the
   same height and the 32px control corner. */
.dealsbar, .notesbar { --subbar-h: 32px }
@media (pointer: coarse) {
  .dealsbar, .notesbar { --subbar-h: 44px }
}
.dealsbar :is(.chip, .btn, .iconbtn, .ctfind__search, .notesbar__search),
.notesbar :is(.chip, .btn, .iconbtn, .ctfind__search, .notesbar__search) { border-radius: var(--r-btn-sm) }
@media (pointer: coarse) {
  .dealsbar :is(.chip, .btn, .iconbtn, .ctfind__search, .notesbar__search),
  .notesbar :is(.chip, .btn, .iconbtn, .ctfind__search, .notesbar__search) { border-radius: var(--r-btn) }
}
.dealsbar :is(.chip, .btn, .iconbtn, .ctfind__search, .notesbar__search),
.notesbar :is(.chip, .btn, .iconbtn, .ctfind__search, .notesbar__search) { height: var(--subbar-h) }
.dealsbar .iconbtn, .notesbar .iconbtn { width: var(--subbar-h); flex-basis: var(--subbar-h) }
/* At 32 tall the buttons take the sub tabs' tighter sides, 12 / 8, not a
   38px button's 20 / 16 (design/corners-and-spacing.md, "Buttons"). */
.dealsbar .btn, .notesbar .btn { padding: 0 12px }
.dealsbar .btn:has(> :is(.ms, svg, .mark):first-child), .notesbar .btn:has(> :is(.ms, svg, .mark):first-child) { padding-left: 8px }
.dealsbar .btn:has(> :is(.ms, svg, .mark):last-child:not(:first-child)), .notesbar .btn:has(> :is(.ms, svg, .mark):last-child:not(:first-child)) { padding-right: 8px }
/* The buttons take the sidebar's ink, so an action never reads as one more
   tab beside the chips. */
.dealsbar :is(.btn, .iconbtn), .notesbar :is(.btn, .iconbtn) {
  background-color: var(--ink); color: var(--on-ink); border-color: transparent;
}
.dealsbar :is(.btn, .iconbtn) .ms, .notesbar :is(.btn, .iconbtn) .ms { color: inherit }
.dealsbar :is(.btn, .iconbtn):hover:not(:disabled), .notesbar :is(.btn, .iconbtn):hover:not(:disabled) {
  background-color: color-mix(in srgb, var(--ink) 88%, var(--on-ink)); color: var(--on-ink); border-color: transparent;
}
@media (max-width: 900px) {
  .dealsbar, .notesbar { padding: 12px 16px 8px }
}
/* Here the surfaces swap (see .tabchips__n): a plain chip sits on the grey,
   so its counter is white with a container's faint edge, and the chosen
   chip is white, so its counter takes the grey wash. */
.dealsbar .tabchips__n, .notesbar .tabchips__n {
  background: var(--card); box-shadow: 0 0 0 1px rgba(16, 33, 31, .08);
}
.dealsbar .chip[aria-pressed="true"] .tabchips__n, .notesbar .chip[aria-pressed="true"] .tabchips__n {
  color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); box-shadow: none;
}
@media (max-width: 479px) {
  .dealsbar, .notesbar { padding: 12px 12px 8px }
}
.threadempty > .ms { font-size: 30px; color: #C4C4C4 }
.threadempty b { font-size: 14px; font-weight: var(--weight-strong) }
.threadempty p {
  margin: 0; font-size: 12.5px; color: var(--muted);
  max-width: 320px; text-wrap: pretty;
}
