/* BPAU CRM. Every shared piece, once.

   This is the vocabulary every screen is built from. A screen's own
   stylesheet lays these pieces out and adds only what no other screen
   needs, in classes that start with the screen's name. The guide,
   app/static/js/crm/README.md, lists every class here with one line.

   Order: the page, type, icons, buttons, fields, marks, tabs, lists,
   panels, history, things that float, charts. Each piece carries its own
   phone rules, under the one break at 820 px. */

/* ============ The page ============ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 13px/20px var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
ul, ol, dl, dd { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
img { display: block; max-width: 100%; }
/* What the clock and battery sit on when the CRM is opened from a phone's
   Home Screen: the page runs up under them, so this charcoal band keeps
   it clear and matches the tab bar along the bottom. It stays over a
   dialog too. It has no height anywhere else (--safe-t). */
.safe-top { position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-safe); height: var(--safe-t); background: var(--ink); pointer-events: none; }
svg { display: block; }
button { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; }
button:disabled { cursor: default; }
input, select, textarea { margin: 0; font: inherit; color: inherit; }
/* A display rule on an element beats the hidden attribute unless this says so. */
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* One or the other, never both. */
@media (min-width: 821px) { .only-phone { display: none !important; } }
@media (max-width: 820px) { .only-desk { display: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ============ Type ============ */

/* Every phone, time, count and amount */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; word-spacing: -0.22em; }
/* Small spaced capitals: a column head, a figure's label */
.caps { font: 600 11px/16px var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey); }
.muted { color: var(--grey); }
/* A page's or a pane's title, and the larger one for a lead's next step */
.title { font: 800 20px/24px var(--head); letter-spacing: -0.025em; }
.title-lg { font: 800 28px/32px var(--head); letter-spacing: -0.035em; }
/* A big numeral, with its label in .caps above it */
.figure { display: block; font: 800 32px/36px var(--head); letter-spacing: -0.04em; }
.figure-sm { font-size: 24px; line-height: 28px; letter-spacing: -0.03em; }
.figure-lg { font-size: 40px; line-height: 40px; }
/* Icon and words, or mark and words, on one line */
.inline { display: inline-flex; align-items: center; gap: 6px; min-width: 0; vertical-align: middle; }

/* A section's label: small spaced capitals with the short red rule in front,
   as on the website. .n is a count beside it, .sub a quieter few words. */
.rule-label { display: flex; align-items: center; gap: 10px; font: 600 11px/16px var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.rule-label::before { content: ""; width: 16px; height: 2px; background: var(--red); flex: none; }
.rule-label .n { font: 500 12px/16px var(--mono); letter-spacing: 0; color: var(--grey); }
.rule-label .sub { color: var(--grey); font-weight: 500; letter-spacing: 0.06em; }

/* ============ Icons ============ */

.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* A company's logo beside its name (CRM.parts.logo), in its own colours.
   A wide mark is held to the room of a square one, never squeezed. The
   website's house is wide by its nature and keeps its width. A heading
   that is one company wears its logo where the red rule would be. */
.logo { display: inline-block; height: 14px; width: auto; max-width: 20px; object-fit: contain; flex: none; vertical-align: middle; }
.logo-website { max-width: none; }
.rule-logo::before { display: none; }
/* Each in the same room, so the names line up down a page of them */
.rule-logo .logo { width: 20px; height: 16px; }

/* ============ Buttons ============ */

/* Plain is the default. Squared, like the website. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line-firm); border-radius: var(--r-sm); background: #fff; color: var(--ink); font: 600 13px/1 var(--ui); letter-spacing: 0; word-spacing: normal; white-space: nowrap; flex: none; }
.btn .ic { width: 14px; height: 14px; }
.btn > span { display: inline-flex; align-items: center; gap: 8px; }
.btn .mono { font-weight: 500; }
.btn:hover { border-color: var(--mute); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-sm { height: 28px; padding: 0 10px; }
.btn-lg { height: 40px; padding: 0 14px; font-size: 14px; gap: 12px; }
/* The ONE main action on a screen */
.btn-main { background: var(--red); border-color: var(--red); color: #fff; }
.btn-main:hover { background: var(--red-lift); border-color: var(--red-lift); }
/* A firm second action that is not the main one: Send, Save */
.btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ink:hover { background: #2A3038; border-color: #2A3038; }
/* No box until it is pointed at */
.btn-quiet { border-color: transparent; background: none; color: var(--slate); }
.btn-quiet:hover { border-color: transparent; background: var(--wash); color: var(--ink); }
/* An icon and nothing else. Give it an aria-label. */
.btn-icon { width: 32px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-icon .ic { width: 16px; height: 16px; }
/* On the charcoal band */
.btn-on-dark { background: transparent; border-color: rgba(255, 255, 255, .24); color: #fff; }
.btn-on-dark:hover { border-color: rgba(255, 255, 255, .5); }
.btn-on-dark:focus-visible { outline-color: #fff; }
/* The words at the left and the key cap at the right */
.btn-spread { justify-content: space-between; }

/* A key cap */
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid var(--line-firm); border-radius: var(--r-sm); background: #fff; color: var(--grey); font: 400 11px/1 var(--mono); }
.btn-main kbd { background: transparent; border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn-ink kbd, .btn-on-dark kbd { background: transparent; border-color: rgba(255, 255, 255, .24); color: rgba(255, 255, 255, .7); }

/* A small action set in a line of text: Take it, Edit */
.link { font: 600 12px/18px var(--ui); color: var(--ink); border-bottom: 1px solid var(--line-firm); white-space: nowrap; }
.link:hover { border-bottom-color: var(--ink); }
/* A link that leaves the app, with the small arrow that says so. CRM.parts.directions draws it. */
.link-out { display: inline-flex; align-items: center; gap: 4px; }
.link-out .ic { width: 10px; height: 10px; stroke-width: 2.2; color: var(--slate); }
/* A phone number that rings when tapped */
.tel { border-bottom: 1px dashed var(--mute); line-height: 18px; }

/* ============ Fields ============ */

.field { display: block; min-width: 0; }
.field + .field { margin-top: 12px; }
.field-label { display: block; margin-bottom: 4px; font: 500 12px/16px var(--ui); color: var(--slate); }
.field-error { display: block; margin-top: 4px; font: 400 12px/16px var(--ui); color: var(--red-ink); }
/* Two fields side by side, stacked on a phone */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row > .field { margin-top: 0; }
.field-row + .field, .field + .field-row, .field-row + .field-row { margin-top: 12px; }

.input, .select, .textarea { display: block; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-firm); border-radius: var(--r); background: #fff; color: var(--ink); font: 400 13px/20px var(--ui); -webkit-appearance: none; appearance: none; }
.input::placeholder, .textarea::placeholder { color: var(--mute); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--mute); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); outline: 1px solid var(--ink); outline-offset: 0; }
.input.is-bad, .select.is-bad, .textarea.is-bad { border-color: var(--red-ink); }
/* A phone or an amount in a field */
.input.mono { font-family: var(--mono); letter-spacing: -0.01em; word-spacing: -0.22em; }
.input[readonly] { cursor: pointer; }
.textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
.select { padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2368737B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 14px; }

/* A tick box with its words */
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; border: 1px solid var(--line-firm); border-radius: var(--r-sm); background: #fff; -webkit-appearance: none; appearance: none; flex: none; cursor: pointer; }
.check input:checked { border-color: var(--ink); background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* The search box: an icon, the input, and a key cap when there is a key */
.search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); color: var(--grey); }
.search:focus-within { border-color: var(--ink); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0; background: none; color: var(--ink); font: 400 13px/20px var(--ui); -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--mute); }
.search input::-webkit-search-cancel-button { display: none; }

/* A filter in a page head: its name in grey, what is picked in ink, and
   a chevron. It opens a menu. */
.pick { display: inline-flex; align-items: center; gap: 6px; height: 28px; color: var(--grey); font-size: 13px; white-space: nowrap; }
.pick b { font-weight: 500; color: var(--ink); }
.pick .ic { width: 12px; height: 12px; color: var(--mute); }
.pick:hover .ic { color: var(--ink); }

/* ============ Marks ============ */

/* Waiting. Plain under 15 minutes, amber from 15, a red tint with red text
   from 45. CRM.fmt.waiting decides which. */
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--r-sm); font: 500 12px/1 var(--mono); letter-spacing: -0.01em; word-spacing: -0.22em; white-space: nowrap; color: var(--slate); background: var(--wash); flex: none; vertical-align: middle; }
.chip-amber { background: var(--amber-tint); color: var(--amber-ink); }
.chip-late { background: var(--red-tint); color: var(--red-ink); }
/* On a selected row the plain chip would vanish into the row */
.row.is-sel .chip:not(.chip-amber):not(.chip-late) { background: #fff; }

/* A tag: a stage, or Agency. -ink is Ours, -line is the outlined one. */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border: 1px solid var(--line-firm); border-radius: var(--r-sm); font: 600 11px/1 var(--ui); letter-spacing: 0.02em; color: var(--slate); white-space: nowrap; background: #fff; flex: none; vertical-align: middle; }
.tag .ic { width: 11px; height: 11px; }
.tag-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.tag-line { border-color: var(--ink); color: var(--ink); }
.tag-sm { height: 18px; padding: 0 5px; }
/* Who brought a lead in (CRM.parts.broughtBy): LocaliQ's own logo and
   name, the dark Gianni tag with its G, and Unknown, dashed. */
.tag-by .logo { height: 12px; max-width: 12px; }
.tag-by-g { display: inline-grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; background: #fff; color: var(--ink); font: 700 8px/1 var(--ui); font-style: normal; flex: none; }
.tag-by-g::before { content: "G"; }
.tag-by-unknown { border-style: dashed; color: var(--grey); }
/* In a row on a phone, the mark alone. The name is still read out. */
@media (max-width: 820px) {
  .tag-sm.tag-by-localiq, .tag-sm.tag-by-gianni { position: relative; padding: 0 4px; }
  .tag-sm.tag-by-localiq .tag-by-word, .tag-sm.tag-by-gianni .tag-by-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* Their text is waiting on us: "Replied 29 min ago" */
.tag-replied { border-color: transparent; background: var(--amber-tint); color: var(--amber-ink); }
/* What Ava is doing with a lead, in three weights and no more: amber for
   the one that needs a person, the outlined tag with a small dot while
   she is in the conversation, and a soft grey one when nothing is asked
   of anybody. CRM.parts.ava picks. */
.tag-needs { border-color: transparent; background: var(--amber-tint); color: var(--amber-ink); }
.tag-needs .ic { stroke-width: 2.2; }
.tag-live { color: var(--ink); }
.tag-live::before { content: ""; width: 5px; height: 5px; margin-right: 1px; border-radius: 50%; background: var(--ink); }
.tag-soft { border-color: transparent; background: var(--wash); color: var(--grey); font-weight: 500; }
.row.is-sel .tag-soft { background: #fff; }

/* A person, as a square with their initial. -none is nobody. */
.av { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: var(--r-sm); background: #E3E6EA; color: var(--slate); font: 600 11px/1 var(--ui); font-style: normal; flex: none; vertical-align: middle; }
.av-none { background: none; border: 1px dashed #B4BAC1; }
.av-lg { width: 28px; height: 28px; background: var(--ink); color: #fff; font-size: 12px; }
/* Ava, the AI that texts new enquiries. A person is a grey square with an
   initial. She is the one mark in ink, with her letter in the mono face
   the app keeps for what a machine wrote. -sm is the one beside a name. */
.ava-mark { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: var(--r-sm); background: var(--ink); color: #fff; font: 500 12px/1 var(--mono); font-style: normal; flex: none; vertical-align: middle; }
.ava-mark-sm { width: 16px; height: 16px; font-size: 10px; }
/* Why she handed a lead to a person, as a few quiet words after her tag
   in a row. They are cut short and never wrap the row. */
.ava-why { min-width: 0; font-size: 12px; line-height: 20px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* In the Ava filter's menu, each choice carries the mark its tag has */
.ava-key { width: 8px; height: 8px; border-radius: 2px; flex: none; margin: 0 1px; }
.ava-key-needs { background: var(--amber-tint); box-shadow: inset 0 0 0 1px var(--amber-ink); }
.ava-key-live { background: var(--ink); border-radius: 50%; }
.ava-key-soft { background: var(--line-firm); }

/* How far along four steps: class s1 to s4 fills that many */
.steps { display: inline-flex; gap: 2px; flex: none; }
.steps b { width: 5px; height: 10px; border-radius: 1px; background: #DADDE2; }
.steps.s1 b:nth-child(-n+1), .steps.s2 b:nth-child(-n+2), .steps.s3 b:nth-child(-n+3), .steps.s4 b:nth-child(-n+4) { background: var(--ink); }
/* How far somebody got with their welcome link: the steps and the word.
   CRM.parts.link draws it. A text that failed is the word alone in the red
   tint with red text, as waiting too long is, and one on its way is grey.
   -word is the word, which a list with no room for it may hide, and -more
   is the few quiet words that may follow. */
.linked { display: inline-flex; align-items: center; gap: 8px; flex: none; font: 500 13px/20px var(--ui); color: var(--ink); white-space: nowrap; }
.linked-quiet { font-weight: 400; color: var(--grey); }
.linked-failed { height: 20px; padding: 0 6px; border-radius: var(--r-sm); background: var(--red-tint); color: var(--red-ink); font: 600 12px/20px var(--ui); }
.linked-more { min-width: 0; font-size: 12px; line-height: 20px; color: var(--grey); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linked-more .mono { color: inherit; }
/* Tries so far: a filled dot for each one made */
.pips { display: inline-flex; gap: 3px; margin-right: 4px; flex: none; }
.pips b { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--slate); }
.pips b.on { background: var(--slate); }

/* The sample mark. One design, at the right of the head of any panel whose
   engine is not built. Only CRM.sample.mark() draws it. */
.sample-mark { display: inline-flex; align-items: center; gap: 6px; font: 400 11px/16px var(--mono); word-spacing: -0.22em; color: var(--mute); white-space: nowrap; flex: none; }
.sample-mark svg { width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 1; }

/* ============ Tabs ============ */

/* Tabs with a line under the one that is on: a screen's tabs, the composer's */
.tabs { display: flex; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > * { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 2px; margin: 0 16px -1px 0; font: 500 13px/1 var(--ui); color: var(--grey); border-bottom: 2px solid transparent; white-space: nowrap; flex: none; }
.tabs > *:hover { color: var(--ink); }
.tabs > * .ic { width: 13px; height: 13px; }
.tabs > .is-on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
/* Small pills beside a label: All, Texts, Calls, Notes */
.pills { display: flex; gap: 4px; }
.pills > * { height: 24px; padding: 0 8px; border-radius: var(--r-sm); font: 500 12px/24px var(--ui); color: var(--grey); white-space: nowrap; }
.pills > *:hover { color: var(--ink); }
.pills > .is-on { background: var(--wash); color: var(--ink); }

/* ============ Lists ============ */

/* A list of leads. The screen sets the columns once, on .rows, as --cols.
   Each cell is a direct child of .row, in column order. */
.rows { --cols: minmax(0, 1fr); min-width: 0; }
.rows-head, .row { display: grid; grid-template-columns: var(--cols); column-gap: 12px; align-items: center; padding: 0 16px 0 var(--gutter); }
.rows-head { height: 32px; border-bottom: 1px solid var(--line); font: 600 11px/16px var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey); white-space: nowrap; }
/* A group inside a list: its name, its count in .n, a note at the right in .r */
.group { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 16px 0 var(--gutter); background: var(--wash); border-bottom: 1px solid var(--line); font: 600 13px/1 var(--ui); }
.group .ic { width: 12px; height: 12px; color: var(--grey); margin-left: -18px; margin-right: -2px; }
.group .n { font: 400 12px/1 var(--mono); color: var(--grey); }
.group .r { margin-left: auto; font: 400 12px/1 var(--ui); color: var(--grey); }
.group.is-shut .ic { transform: rotate(-90deg); }
/* One lead, one line */
.row { position: relative; width: 100%; height: var(--row-h); border-bottom: 1px solid var(--line-soft); }
.row > * { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 821px) { .row > .inline { display: flex; } }
a.row:hover, button.row:hover, .row[tabindex]:hover { background: var(--wash); }
.row:focus-visible { outline-offset: -2px; }
.row.is-sel, a.row.is-sel:hover, .row.is-sel[tabindex]:hover { background: var(--sel); }
.row.is-sel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--ink); }
/* The customer cell: the name, then where they are */
.who b { font: 600 13px/20px var(--ui); margin-right: 8px; }
.who i { font-style: normal; font-size: 12px; color: var(--grey); }
/* Show more, and the foot with the key hints */
.rows-more { display: flex; align-items: center; width: 100%; height: 32px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line-soft); color: var(--grey); font-size: 12px; }
.rows-more:hover { color: var(--ink); }
.rows-more .ic { width: 12px; height: 12px; margin-right: 6px; }
.rows-foot { display: flex; align-items: center; gap: 16px; height: 44px; padding: 0 var(--gutter); color: var(--grey); font-size: 12px; }
.rows-foot span { display: inline-flex; align-items: center; gap: 5px; }
.rows-foot .sp { flex: 1; }

/* A list of leads as CRM.leadRows draws it, which wears .rows-leads. The
   column heads stay under the page head while the list scrolls, over the
   rows and over the phone numbers, which are lifted above their rows. */
.rows-leads .rows-head { position: sticky; top: var(--below-head); z-index: 2; background: var(--page); }
.rows-leads .row:hover { background: var(--wash); }
.rows-leads .row.is-sel, .rows-leads .row.is-sel:hover { background: var(--sel); }
.rows-leads .row { scroll-margin: calc(var(--below-head) + 40px) 0 52px; }
/* The name is the link that opens the lead, stretched over the whole row,
   so the row is one target. The phone number sits above it and is a link
   of its own. */
.row-open::after { content: ""; position: absolute; inset: 0; }
.row-open:focus-visible { outline: none; }
.row-open:focus-visible::after { outline: 2px solid var(--ink); outline-offset: -2px; }
.row-tel { position: relative; z-index: 1; }
.row-tel:hover { box-shadow: 0 1px 0 var(--mute); }
.rows-leads .row .row-src, .rows-leads .row .row-own { color: var(--slate); }
.rows-leads .row .row-own { font-size: 12px; }
.row-phone { color: var(--ink); }
/* The welcome link in a row: the mark, then the quiet words, which give
   way first where the column is narrow. */
@media (min-width: 821px) { .row > .row-link { display: flex; align-items: center; gap: 8px; } }
/* A date in a row: the day in words, the time in the mono face. A follow
   up whose time has passed wears the late tint, as a late wait does. */
.row-due { font: 400 12px/20px var(--ui); color: var(--slate); white-space: nowrap; }
.row-due .mono { color: var(--ink); }
.row-due-late { display: inline-block; padding: 0 6px; border-radius: var(--r-sm); background: var(--red-tint); color: var(--red-ink); }
.row-due-late .mono { color: inherit; }
/* The x at the end of a row, which discards the lead after asking why
   (CRM.leadRows.discard). A list whose rows have one wears .rows-x and
   keeps the room for it at the right of every row, so no screen's columns
   change for it. It sits above the row's own link, as the number does,
   and is grey until it is pointed at. */
.rows-x .rows-head, .rows-x .row { padding-right: 48px; }
.row > .row-x { position: absolute; top: 0; bottom: 0; right: 12px; z-index: 1; display: flex; align-items: center; overflow: visible; }
.row-discard { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--r); color: var(--mute); }
.row-discard .ic { width: 14px; height: 14px; }
.row-discard:hover, .row-discard:focus-visible { background: var(--red-tint); color: var(--red-ink); }
/* Show more says how far through the group the list is, at the right. */
.rows-more-of { margin-left: auto; padding-left: 12px; color: var(--mute); white-space: nowrap; }
@media (min-width: 821px) {
  /* The name never gives way. Where they are gives way first, and the tag
     for enquiries that joined is always whole. */
  .rows-leads .who { display: flex; align-items: baseline; gap: 8px; }
  .rows-leads .who > a { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .rows-leads .who > a b { margin-right: 0; }
  /* The shrink is this lopsided on purpose. Shared any more evenly, the
     name loses a fraction of a pixel and shows an ellipsis for it. */
  .rows-leads .who > i { flex: 0 1000000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .rows-leads .who > .tag { align-self: center; }
  /* Why Ava handed over follows her tag and gives way before the name
     does. Where it is said, where they are gives way whole. */
  .rows-leads .who > .ava-why { flex: 0 1000000 auto; align-self: center; margin-left: -2px; }
  .rows-leads .who:has(> .ava-why) > i { display: none; }
}

/* The filters on a list of leads (CRM.leadFilters). In a page head each is
   a plain word that opens its menu, in ink once it is in use. Under the
   head one line says which are in use: a chip for each with its own x,
   then Clear filters, and at the right how many leads are left. */
.filter-pick { color: var(--slate); }
.filter-pick.is-on { color: var(--ink); font-weight: 600; }
.filter-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-height: 40px; padding: 6px var(--gutter); background: var(--wash); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--slate); }
.filter-line .caps { margin-right: 4px; }
.filter-line .sp { flex: 1; }
.filter-line .link { margin-left: 6px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 24px; padding: 0 2px 0 8px; border: 1px solid var(--line-firm); border-radius: var(--r-sm); background: #fff; font: 400 12px/1 var(--ui); color: var(--slate); white-space: nowrap; }
.filter-chip b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.filter-chip button { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 2px; color: var(--grey); flex: none; }
.filter-chip button:hover { background: var(--wash); color: var(--ink); }
.filter-chip button .ic { width: 11px; height: 11px; stroke-width: 2.4; }
.filter-count { color: var(--grey); white-space: nowrap; }

/* A table of figures: a campaign and its counts, a person and their devices */
.table { width: 100%; border-collapse: collapse; }
.table th { height: 32px; padding: 0 12px 0 0; border-bottom: 1px solid var(--line); font: 600 11px/16px var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey); text-align: left; white-space: nowrap; }
.table td { height: var(--row-h); padding: 0 12px 0 0; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .num { text-align: right; }
.table td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ============ Panels ============ */

/* A page of panels: a wide column and a 408 px one. .panel-l is a panel in
   the wide column, .panel-wide runs across both. */
.panels { display: grid; grid-template-columns: minmax(0, 1fr) 408px; }
.panel { min-width: 0; padding: 20px var(--gutter) 24px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.panel-l { border-right: 1px solid var(--line); }
.panel-wide { grid-column: 1 / -1; }
.panel-wash { background: var(--wash); }
/* A panel's head: its .rule-label at the left, the sample mark or one
   small action at the right */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 20px; margin-bottom: 12px; }
/* Sections stacked in a column with a line between each */
.sections > * + * { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.sections .panel-head { margin-bottom: 8px; }

/* A list of facts: the name of each in grey, what it is beside it. Set
   --kv on it to change the width of the names. */
.kv { display: grid; grid-template-columns: var(--kv, 112px) minmax(0, 1fr); column-gap: 12px; }
.kv dt, .kv dd { margin: 0; padding: 4px 0; font: 400 13px/20px var(--ui); }
.kv dt { color: var(--grey); font-size: 12px; }
.kv dd { display: flex; align-items: center; column-gap: 6px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.kv dd .link { margin-left: auto; }

/* A person's own words. The line breaks they typed are kept here, by the
   stylesheet, never by turning them into markup. */
.quote { font: 400 13px/20px var(--ui); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.quote-rule { padding-left: 12px; border-left: 2px solid var(--ink); }
.quote-by { margin-top: 8px; font-size: 12px; line-height: 16px; color: var(--grey); }

/* One number worth saying out loud, at the foot of a panel */
.fact { display: flex; align-items: baseline; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.fact b { font: 800 24px/28px var(--head); letter-spacing: -0.035em; white-space: nowrap; }
.fact span { color: var(--slate); }
.panel:has(> .fact) > :not(.fact):not(.panel-head) { margin-bottom: 16px; }

/* A cabin in brief: its picture, its name, its facts, its from price */
.cabin-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; }
.cabin-row img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-sm); background: var(--wash); }
.cabin-row b { display: block; font: 700 14px/20px var(--head); letter-spacing: -0.01em; }
.cabin-row span { display: block; font-size: 12px; line-height: 16px; color: var(--grey); }
.cabin-row .from { color: var(--slate); margin-top: 2px; }
.cabin-row .from .mono { display: inline; color: var(--ink); font-weight: 500; }

/* A quiet strip that says one thing and offers one small button */
.strip { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; background: var(--wash); border-radius: var(--r-sm); font-size: 12px; color: var(--slate); }
.strip .ic { width: 13px; height: 13px; }
.strip .btn { margin-left: auto; height: 24px; padding: 0 8px; font-size: 12px; }

/* A boxed line that says what is on show is a rehearsal: what is not
   connected yet, and that nothing here is real or sent */
.rehearsal { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px dashed var(--line-firm); border-radius: var(--r); color: var(--slate); }
.rehearsal .ic { flex: none; width: 14px; height: 14px; margin-top: 3px; color: var(--grey); }
.rehearsal b { font-weight: 600; color: var(--ink); }

/* Something is wrong and a person should know: across the top of the page */
.banner { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px var(--gutter); background: var(--red-tint); color: var(--red-ink); border-bottom: 1px solid #F6CFCF; font-size: 13px; }
.banner .ic { width: 15px; height: 15px; }
.banner .link { margin-left: auto; color: var(--red-ink); border-bottom-color: currentColor; }
.banner-amber { background: var(--amber-tint); color: var(--amber-ink); border-bottom-color: #EBDDB8; }
.banner-amber .link { color: var(--amber-ink); }

/* Nothing to show: a short title and one plain line, and a button if
   there is something to do about it */
.empty { display: flex; flex-direction: column; align-items: flex-start; padding: 40px var(--gutter) 48px; }
.empty b { font: 800 20px/24px var(--head); letter-spacing: -0.025em; }
.empty p { margin-top: 4px; max-width: 46ch; color: var(--grey); }
.empty .btn { margin-top: 16px; }
.empty-sm { padding: 16px 0 8px; }
.empty-sm b { font: 600 13px/20px var(--ui); letter-spacing: 0; }
.empty-sm p { margin-top: 0; }

/* Waiting for the server: the word, and a short rule that travels */
.loading { display: flex; align-items: center; gap: 10px; padding: 24px var(--gutter); font: 600 11px/16px var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.loading::before { content: ""; width: 16px; height: 2px; background: var(--ink); animation: loading-rule 1.1s ease-in-out infinite alternate; transform-origin: left center; }
@keyframes loading-rule { from { transform: scaleX(.25); opacity: .35; } to { transform: scaleX(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation: none; } }

/* ============ History ============ */

/* A day's name with a line running out from it */
.day-rule { display: flex; align-items: center; gap: 12px; margin: 4px 0; font: 400 12px/16px var(--ui); color: var(--grey); }
.day-rule::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

/* One thing that happened: a mark on the line, what it was, and one quiet
   line that says who and when */
.ev { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; align-items: start; padding: 6px 0; }
.ev-mark { position: relative; display: flex; justify-content: center; align-self: stretch; padding-top: 3px; color: var(--slate); }
.ev-mark::before { content: ""; position: absolute; left: 50%; top: -6px; bottom: -6px; width: 1px; background: var(--line); }
.ev-mark .ic { position: relative; width: 14px; height: 14px; background: #fff; outline: 3px solid #fff; }
.ev:first-child .ev-mark::before { top: 8px; }
.ev:last-child .ev-mark::before { bottom: auto; height: 14px; }
.ev:only-child .ev-mark::before { display: none; }
/* The small ring for a line the system wrote */
.ev-dot { position: relative; width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: #fff; border: 1.5px solid var(--mute); outline: 3px solid #fff; }
.ev-body { min-width: 0; }
/* What happened, in bold, and its meta line. The words wrap by themselves.
   The meta line sits beside their first line, at the right, wherever there
   is room for it and a fair run of words. Where there is not, it goes
   directly under them, at the left, with no gap: it is never left adrift
   on a line of its own. */
.ev-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 16px; }
.ev-what { flex: 1 1 14em; min-width: 0; font: 600 13px/20px var(--ui); overflow-wrap: anywhere; text-wrap: pretty; }
.ev-meta { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; max-width: 100%; min-width: 0; font: 400 12px/20px var(--ui); color: var(--grey); }
.ev-meta span { min-width: 0; overflow-wrap: anywhere; }
.ev-meta .is-waiting { color: var(--amber-ink); }
.ev-time { font-size: 12px; line-height: 20px; color: var(--grey); white-space: nowrap; }
/* A line the system wrote */
.ev-quiet { font-weight: 400; color: var(--slate); }
.ev-body > .quote { margin-top: 4px; }

/* A text message. -in is theirs, -out is ours, -open is theirs and still
   waiting for an answer. */
.bubble { margin-top: 2px; padding: 8px 12px; border-radius: var(--r-sm); font: 400 13px/20px var(--ui); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-in { background: #fff; border: 1px solid var(--line-firm); color: var(--ink); }
.bubble-out { background: var(--wash); color: var(--slate); }
.bubble-open { border-color: var(--ink); }

/* The box a person writes in: a strip if there is one, .tabs, the box,
   and a foot with the button */
.composer { border: 1px solid var(--line-firm); border-radius: var(--r); background: #fff; }
.composer:focus-within { border-color: var(--slate); }
.composer > .strip { padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; font-size: 13px; }
.composer > .strip .ic { width: 14px; height: 14px; }
.composer > .strip .btn { height: 28px; padding: 0 10px; font-size: 13px; }
.composer > .tabs { padding: 0 12px; border-bottom-color: var(--line-soft); }
.composer-box { display: block; width: 100%; min-height: 64px; padding: 12px; border: 0; outline: 0; resize: none; background: none; font: 400 13px/20px var(--ui); color: var(--ink); }
.composer-box::placeholder { color: var(--mute); }
.composer-foot { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; color: var(--grey); font-size: 12px; }
.composer-foot .sp { flex: 1; }
/* The field buttons under a box a text is written in: "Insert", then a
   small button for each field. CRM.replies.buttons draws them */
.insert-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.insert-row .caps { margin-right: 4px; }
.btn.insert { height: 24px; padding: 0 8px; font-size: 12px; font-weight: 500; color: var(--slate); }
.btn.insert:disabled { color: var(--mute); background: var(--wash); border-color: var(--line); }
/* How long a text is: "132 characters, 1 text", and before it, when a
   character from outside the plain alphabet made it more, which one.
   CRM.replies.counter draws it */
.text-count { display: inline-flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 12px; color: var(--grey); white-space: nowrap; }
.text-count .mono { font-size: 11px; color: var(--mute); }
.text-count-why { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--amber-ink); }
.text-count-why b { font-weight: 600; }

/* ============ Things that float ============ */

/* What CRM.ui draws. These are the only shadows in the app. */
.scrim { position: fixed; inset: 0; z-index: var(--z-scrim); display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(16, 20, 25, .42); }
.dialog { display: flex; flex-direction: column; width: 100%; max-width: 440px; max-height: calc(100vh - 48px); background: #fff; border-radius: var(--r); box-shadow: var(--float); }
.dialog-wide { max-width: 640px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); flex: none; }
.dialog-head h2 { font: 800 16px/20px var(--head); letter-spacing: -0.02em; }
.dialog-body { padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dialog-body > p { color: var(--slate); }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); flex: none; }
.dialog-foot .sp { flex: 1; }
.dialog-error { margin-right: auto; color: var(--red-ink); font-size: 12px; line-height: 16px; }

/* A menu under the thing that opened it */
.menu-scrim { position: fixed; inset: 0; z-index: var(--z-pop); }
.menu { position: fixed; z-index: var(--z-pop); min-width: 184px; max-width: 320px; max-height: min(420px, calc(100vh - 16px)); overflow-y: auto; padding: 4px; background: #fff; border: 1px solid var(--line-firm); border-radius: var(--r); box-shadow: var(--float); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 0 8px; border-radius: var(--r-sm); font: 500 13px/20px var(--ui); color: var(--ink); white-space: nowrap; }
.menu-item:hover, .menu-item:focus-visible { background: var(--wash); outline: none; }
.menu-item .ic { width: 14px; height: 14px; color: var(--slate); }
.menu-item .note { margin-left: auto; padding-left: 16px; font: 400 12px/1 var(--mono); color: var(--grey); }
.menu-item .tick { margin-left: auto; color: var(--ink); }
.menu-item .note + .tick { margin-left: 8px; }
.menu-item.is-quiet { color: var(--grey); }
.menu-label { padding: 8px 8px 4px; font: 600 11px/16px var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey); }
.menu-rule { height: 1px; margin: 4px 0; background: var(--line); }
/* A panel put up the way a menu is, holding more than items: a search
   box, rows of two lines, a foot. CRM.ui.popover draws it, and what is
   inside it is the screen's own */
.popover { display: flex; flex-direction: column; width: 380px; max-width: calc(100vw - 16px); padding: 0; overflow: hidden; }

/* One line that says what just happened, then leaves */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: var(--z-toast); display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px); transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 480px; padding: 10px 14px; border-radius: var(--r); background: var(--ink); color: #fff; font: 500 13px/20px var(--ui); box-shadow: var(--float); pointer-events: auto; }
.toast .ic { width: 15px; height: 15px; color: rgba(255, 255, 255, .7); }
.toast .sample-mark { color: rgba(255, 255, 255, .6); }
.toast-err .ic { color: var(--red-lift); }
/* The one small button on a toast: Undo */
.toast-act { margin: -4px -6px -4px 4px; padding: 4px 8px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); font: 600 13px/20px var(--ui); color: #fff; }
.toast-act:hover { background: rgba(255, 255, 255, .12); }
/* Under the page head, for a screen whose foot is a box somebody writes
   in. CRM.ui.toastsAt puts it on. */
.toasts.toasts-top { top: calc(var(--below-head) + 8px); bottom: auto; }

/* The date picker: a month, and the times beside it when a time is asked for */
.datepicker { position: fixed; z-index: var(--z-pop); display: flex; padding: 12px; background: #fff; border: 1px solid var(--line-firm); border-radius: var(--r); box-shadow: var(--float); }
.dp-cal { width: 252px; }
.dp-head { display: flex; align-items: center; gap: 4px; height: 32px; margin-bottom: 4px; }
.dp-head b { flex: 1; padding-left: 8px; font: 800 14px/20px var(--head); letter-spacing: -0.02em; }
.dp-dow, .dp-days { display: grid; grid-template-columns: repeat(7, 36px); }
.dp-dow span { height: 24px; font: 600 11px/24px var(--ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); text-align: center; }
.dp-day { width: 36px; height: 36px; border-radius: var(--r-sm); font: 400 13px/36px var(--mono); text-align: center; color: var(--ink); }
.dp-day:hover { background: var(--wash); }
.dp-day.is-out { color: var(--mute); }
.dp-day.is-today { box-shadow: inset 0 0 0 1px var(--line-firm); }
.dp-day.is-on, .dp-day.is-on:hover { background: var(--ink); color: #fff; box-shadow: none; }
/* A day that cannot be picked. It is still pressed, to be told why. */
.dp-day.is-off, .dp-day.is-off:hover { color: #C9CED4; background: none; text-decoration: line-through; text-decoration-color: #DDE0E4; cursor: default; }
.dp-times { display: flex; flex-direction: column; width: 96px; max-height: 284px; margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); overflow-y: auto; }
.dp-time { flex: none; height: 32px; padding: 0 8px; border-radius: var(--r-sm); font: 400 13px/32px var(--mono); word-spacing: -0.22em; color: var(--ink); white-space: nowrap; }
.dp-time:hover { background: var(--wash); }
.dp-time.is-on, .dp-time.is-on:hover { background: var(--ink); color: #fff; }
.dp-time:disabled { color: #C9CED4; background: none; }
.dp-why { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: 12px; line-height: 16px; color: var(--grey); min-height: 25px; }
.dp-none { padding: 8px 0; font-size: 12px; line-height: 16px; color: var(--grey); }

/* ============ Address search ============ */

/* CRM.addr draws every one of these. The box: a search icon, the input,
   and the x that clears an address once there is one. */
.addr-box { position: relative; display: block; }
.addr-box > .ic { position: absolute; left: 11px; top: 50%; margin-top: -7px; width: 14px; height: 14px; color: var(--grey); pointer-events: none; }
.addr-box .input { padding-left: 33px; padding-right: 34px; }
.addr-x { position: absolute; right: 6px; top: 50%; margin-top: -12px; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--r-sm); color: var(--mute); }
.addr-x:hover { background: var(--wash); color: var(--ink); }
.addr-x .ic { width: 13px; height: 13px; }
/* Under the box: the suburb, the state and the postcode as small facts,
   or one quiet line, and at the right the way to the plain boxes. */
.addr-under { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 20px; row-gap: 2px; margin-top: 8px; font: 400 12px/18px var(--ui); color: var(--grey); }
.addr-facts { display: flex; flex-wrap: wrap; column-gap: 20px; }
.addr-facts span { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.addr-facts b { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.addr-facts b.mono { font-weight: 400; }
.addr-under .link { margin-left: auto; font-weight: 500; color: var(--slate); }
/* The holder a form gives a lead's whole address (CRM.addr.lead), spaced
   as a field is from the fields round it. */
.field + .addr, .field-row + .addr, .addr + .field, .addr + .field-row { margin-top: 12px; }
/* The plain boxes: the street, then the parts side by side */
.addr-parts { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .7fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.addr-parts.addr-parts-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.addr-parts > .field { margin-top: 0; }
/* The suggestions, floating under the box they belong to */
.addr-list { position: fixed; z-index: var(--z-pop); display: flex; flex-direction: column; padding: 4px 4px 0; background: #fff; border: 1px solid var(--line-firm); border-radius: var(--r); box-shadow: var(--float); }
.addr-rows { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.addr-row { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; min-height: 44px; padding: 5px 10px; border-radius: var(--r-sm); cursor: pointer; }
.addr-row .ic { width: 14px; height: 14px; color: var(--mute); }
.addr-row b { display: block; font: 600 13px/18px var(--ui); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-row i { display: block; font: 400 12px/16px var(--ui); color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-row:hover { background: var(--wash); }
.addr-row.is-sel { background: var(--sel); }
.addr-row.is-sel::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; border-radius: 1px; background: var(--ink); }
.addr-row.is-sel .ic { color: var(--ink); }
.addr-row kbd { visibility: hidden; }
.addr-row.is-sel kbd { visibility: visible; }
.addr-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; min-height: 32px; margin: 4px -4px 0; padding: 0 14px; border-top: 1px solid var(--line-soft); background: var(--wash); border-radius: 0 0 3px 3px; font: 400 11px/16px var(--ui); color: var(--grey); }
.addr-keys { display: inline-flex; align-items: center; gap: 5px; }
.addr-keys kbd + span { margin-right: 8px; }
.addr-keys span:last-child { margin-right: 0; }

/* ============ Charts ============ */

/* What CRM.charts draws. Each chart is one SVG on one scale, or a list of
   bars on one scale. */
svg.chart { width: 100%; height: auto; overflow: visible; }
.c-fig { font: 800 26px/1 var(--head); letter-spacing: -0.035em; fill: var(--ink); }
.c-unit { font: 700 13px/1 var(--head); fill: var(--ink); }
.c-cap { font: 600 11px/1 var(--ui); letter-spacing: 0.1em; fill: var(--grey); }
.c-lab { font: 400 12px/1 var(--ui); fill: var(--grey); }
.c-lab-ink { font: 500 12px/1 var(--ui); fill: var(--ink); }
.c-num { font: 400 12px/1 var(--mono); fill: var(--slate); }
.c-num-ink { font: 500 12px/1 var(--mono); fill: var(--ink); word-spacing: -0.22em; }
.c-tick { font: 400 11px/1 var(--mono); fill: var(--mute); word-spacing: -0.22em; }

/* The flow, enquiry to won, as ribbons. Drawn for charcoal, and for a
   light page when its SVG carries .flow-light. */
svg.flow { width: 100%; height: auto; overflow: visible; }
.fl-name { font: 500 11px/1 var(--mono); letter-spacing: 0.09em; word-spacing: -0.2em; fill: rgba(255, 255, 255, .55); }
.fl-name.is-won { fill: var(--red-lift); }
.fl-n { font: 500 24px/1 var(--mono); letter-spacing: -0.03em; fill: #fff; }
.fl-c { font: 400 13px/1 var(--mono); fill: rgba(255, 255, 255, .6); }
.fl-out { font: 400 12px/1 var(--mono); fill: rgba(255, 255, 255, .66); }
.fl-key { font: 500 11px/1 var(--mono); letter-spacing: 0.09em; word-spacing: -0.2em; fill: rgba(255, 255, 255, .4); }
.flow-light .fl-name { fill: var(--grey); }
.flow-light .fl-name.is-won { fill: var(--red-ink); }
.flow-light .fl-n { fill: var(--ink); }
.flow-light .fl-c, .flow-light .fl-out { fill: var(--grey); }
.flow-light .fl-key { fill: var(--mute); }
/* A step nobody has reached, and a join nobody fell away at: the nothing
   steps back, as a figure that is zero does in Home's ledger */
.fl-n.is-zero, .fl-out.is-zero { fill: rgba(255, 255, 255, .34); }
.flow-light .fl-n.is-zero, .flow-light .fl-out.is-zero { fill: var(--mute); }

/* The same flow on a phone: a bar for each step, and what went on between */
.funnel { color: #fff; }
.funnel .fn-top { display: flex; align-items: baseline; justify-content: space-between; }
.funnel .fn-name { font: 500 11px/20px var(--mono); letter-spacing: 0.09em; word-spacing: -0.2em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.funnel .fn-n { font: 500 18px/20px var(--mono); letter-spacing: -0.03em; }
.funnel .fn-bar { height: 16px; margin-top: 4px; }
.funnel .fn-bar i { display: block; height: 100%; min-width: 3px; background: rgba(255, 255, 255, .3); }
.funnel .fn-join { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 12px; min-height: 32px; padding: 8px 0 0 10px; border-left: 1px solid rgba(255, 255, 255, .22); font: 400 12px/16px var(--ui); color: rgba(255, 255, 255, .5); }
.funnel .fn-join b { font: 500 12px/16px var(--mono); color: #fff; margin-right: 2px; }
.funnel .fn-join .mono { color: rgba(255, 255, 255, .75); }
.funnel .is-won .fn-name { color: var(--red-lift); }
.funnel .is-won .fn-bar i { background: var(--red); }
.funnel-light { color: var(--ink); }
.funnel-light .fn-name { color: var(--grey); }
.funnel-light .fn-bar i { background: var(--bar); }
.funnel-light .fn-join { border-left-color: var(--line-firm); color: var(--grey); }
.funnel-light .fn-join b, .funnel-light .fn-join .mono { color: var(--ink); }
.funnel-light .is-won .fn-name { color: var(--red-ink); }
/* A step nobody has reached: its name and a muted 0, and no bar */
.funnel .is-zero .fn-n { color: rgba(255, 255, 255, .34); }
.funnel-light .is-zero .fn-n { color: var(--mute); }
.funnel .is-zero + li { margin-top: 12px; }

/* Bars on one scale: a name, its bar, its count, its share. A row that is
   a link is the whole row, on the row's own columns. */
.bars li { display: grid; grid-template-columns: 104px minmax(0, 1fr) 32px 44px; column-gap: 12px; align-items: center; height: 26px; }
.bars li > a { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: center; height: 100%; }
.bars li > span:first-child, .bars li > a > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .bar { height: 10px; }
.bars .bar i { display: block; height: 100%; min-width: 2px; background: var(--slate); border-radius: 1px; }
.bars li:first-child .bar i { background: var(--ink); }
.bars li:first-child > span:first-child, .bars li:first-child > a > span:first-child { font-weight: 600; }
.bars .n { text-align: right; font: 500 12px/1 var(--mono); }
.bars .p { text-align: right; font: 400 12px/1 var(--mono); color: var(--mute); }
.bars .is-quiet { color: var(--grey); }
.bars .is-quiet .bar i { background: var(--bar); }
.bars .is-quiet > span:first-child { font-weight: 400; }

/* A source and what share of it went on: the whole as a grey bar, the
   part that went on in ink inside it, the share as a figure */
.rates li { padding: 9px 0 12px; border-top: 1px solid var(--line-soft); }
.rates li:first-child { border-top-color: var(--line); }
.rates .rate-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rates .rate-top b { font: 600 13px/20px var(--ui); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rates .rate { margin-left: auto; padding-left: 8px; font: 800 18px/20px var(--head); letter-spacing: -0.03em; }
.rates .rate-line { display: grid; grid-template-columns: minmax(0, 1fr) 116px; align-items: center; margin-top: 5px; }
.rates .rate-track { display: block; height: 12px; }
.rates .rate-bar { display: block; height: 100%; min-width: 4px; background: var(--bar-track); border-radius: 1px; }
.rates .rate-bar u { display: block; height: 100%; min-width: 2px; background: var(--ink); border-radius: 1px; }
.rates .rate-nums { padding-left: 12px; font: 400 12px/16px var(--ui); color: var(--grey); white-space: nowrap; }
.rates .rate-nums .mono { color: var(--ink); font-weight: 500; }

/* What each colour in a chart stands for */
.chart-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font-size: 12px; line-height: 16px; color: var(--slate); }
.chart-key span { display: inline-flex; align-items: center; gap: 6px; }
.chart-key i { width: 8px; height: 8px; }
.chart-key .is-hollow { background: var(--page); box-shadow: inset 0 0 0 1px var(--bar-mid); }

/* ============ A phone ============ */

@media (max-width: 820px) {
  body { font-size: 14px; line-height: 20px; }

  /* Every touch target is 44 px, and nothing typed into is under 16 px,
     or an iPhone zooms the page */
  .btn { height: 44px; padding: 0 14px; font-size: 14px; }
  .btn .ic { width: 16px; height: 16px; }
  .btn-lg { height: 48px; font-size: 15px; }
  .btn-icon, .btn-icon.btn-sm { width: 44px; padding: 0; }
  .btn-icon .ic { width: 20px; height: 20px; }
  .btn kbd, .rows-foot { display: none; }
  .input, .select { height: 44px; font-size: 16px; }
  .textarea { font-size: 16px; line-height: 22px; }
  .field-row { grid-template-columns: 1fr; }
  .field-label { font-size: 13px; }
  .check { min-height: 44px; font-size: 14px; }
  .check input { width: 20px; height: 20px; }
  .search { height: 44px; }
  .search input { font-size: 16px; }
  .pick { height: 44px; font-size: 14px; }
  .link, .tel { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; border-bottom: 0; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-firm); font-size: 13px; }
  .tel { font-size: inherit; text-decoration-style: dashed; text-underline-offset: 5px; text-decoration-color: var(--mute); }
  .tabs > * { height: 44px; font-size: 14px; }
  .pills > * { height: 32px; line-height: 32px; padding: 0 10px; font-size: 13px; }

  /* A row becomes a card of two lines. Only four cells show: .row-main
     and .row-side on the first line, .row-sub and .row-tag on the second. */
  .rows-head { display: none; }
  .group { height: 44px; padding: 0 16px; border-top: 1px solid var(--line); font-size: 14px; }
  .group .ic { margin: 0; }
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main side" "sub tag"; column-gap: 12px; row-gap: 2px; height: auto; min-height: 64px; padding: 11px 16px; align-content: center; }
  .row > * { display: none; }
  .row > .row-main { display: block; grid-area: main; }
  .row > .row-side { display: flex; align-items: center; gap: 4px; grid-area: side; justify-self: end; font-size: 13px; color: var(--slate); }
  .row > .row-sub { display: block; grid-area: sub; font-size: 13px; line-height: 18px; color: var(--grey); }
  .row > .row-tag { display: flex; align-items: center; gap: 6px; grid-area: tag; justify-self: end; font-size: 12px; color: var(--grey); }
  .who b { font-size: 15px; margin-right: 0; }
  .who i { display: none; }
  /* A card's first line has no room for why Ava handed over, after her
     tag. It is the card's second line, in amber. */
  .who > .ava-why { display: none; }
  /* Nor for two tags. Replied is the one somebody has to act on, so the
     quiet tag that follows it gives way. */
  .who > .tag-replied + .tag-soft { display: none; }
  .row > .row-sub-why { color: var(--amber-ink); }
  .rows-more { height: 44px; padding: 0 16px; font-size: 13px; }
  .rows-more-of { font-size: 12px; }
  .rows-leads .who .tag { margin-left: 8px; vertical-align: 2px; }
  .rows-leads .row:hover { background: none; }
  /* The x on a card: at the right, as tall as a finger. */
  .rows-x .row { padding-right: 52px; }
  .row > .row-x { right: 4px; }
  .row-discard { width: 44px; height: 44px; }
  .row-discard .ic { width: 16px; height: 16px; }
  /* The filters in use wrap onto as many lines as they need. */
  .filter-line { min-height: 48px; padding-top: 8px; padding-bottom: 8px; }
  .filter-line .caps, .filter-line .sp, .filter-count { display: none; }
  .filter-chip { height: 32px; padding-left: 10px; font-size: 13px; }
  .filter-chip button { width: 30px; height: 30px; }
  .rows-leads .row.is-sel:hover { background: var(--sel); }
  .table td { height: 44px; }

  .panels { display: block; }
  .panel { border-right: 0; }
  .panel-head { flex-wrap: wrap; row-gap: 4px; }
  .kv { grid-template-columns: var(--kv-phone, 124px) minmax(0, 1fr); }
  .kv dt, .kv dd { padding: 6px 0; font-size: 14px; }
  .kv dt { font-size: 13px; }
  .fact { flex-wrap: wrap; row-gap: 0; }
  .cabin-row b { font-size: 15px; }
  .cabin-row span { font-size: 13px; line-height: 18px; }
  .strip { font-size: 13px; }
  .strip .btn, .composer > .strip .btn { height: 44px; padding: 0 12px; font-size: 14px; }
  .quote, .bubble { font-size: 14px; }
  .ev { grid-template-columns: 16px minmax(0, 1fr); column-gap: 10px; }
  /* Always under the words on a phone, where there is no room beside them */
  .ev-what { flex-basis: 100%; font-size: 14px; }
  .ev-meta, .ev-time { font-size: 13px; }
  .composer-box { font-size: 16px; line-height: 22px; }

  /* Dialogs, menus and the date picker rise from the bottom edge */
  .scrim { align-items: flex-end; padding: 0; }
  .dialog, .dialog-wide { max-width: none; max-height: calc(100vh - 44px - var(--safe-t)); max-height: calc(100dvh - 44px - var(--safe-t)); border-radius: 10px 10px 0 0; padding-bottom: var(--safe-b); }
  .dialog-foot { padding: 12px 16px; }
  .dialog-foot .btn { flex: 1; }
  .dialog-foot .sp { display: none; }
  .dialog-body { padding: 16px; }
  .dialog-head { padding: 0 4px 0 16px; }
  .dialog-error { flex-basis: 100%; }
  .dialog-foot:has(.dialog-error) { flex-wrap: wrap; }
  /* A sheet asked to be the whole screen: CRM.ui.sheet({ full: true }) */
  .sheet-full { height: 100vh; height: 100dvh; max-height: none; padding-top: var(--safe-t); border-radius: 0; }
  .sheet-full .dialog-body { flex: 1 1 auto; min-height: 0; }
  .menu-scrim { background: rgba(16, 20, 25, .42); }
  .menu { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0; max-width: none; max-height: 70vh; padding: 8px 8px calc(8px + var(--safe-b)); border: 0; border-radius: 10px 10px 0 0; }
  .menu-item { min-height: 48px; padding: 0 12px; font-size: 15px; }
  .menu-item .ic { width: 18px; height: 18px; }
  .menu-label { padding: 12px 12px 4px; }
  .popover { width: auto; max-width: none; padding: 0 0 var(--safe-b); }
  /* Address search. The x is a finger's size, the rows are taller, and
     nobody on a phone has arrow keys to be told about. */
  .addr-box .input { padding-right: 46px; }
  .addr-x { right: 4px; width: 36px; height: 36px; margin-top: -18px; }
  .addr-x .ic { width: 15px; height: 15px; }
  .addr-under { display: block; font-size: 13px; line-height: 20px; }
  .addr-facts { column-gap: 16px; }
  .addr-under .link { display: inline-block; min-height: 0; margin: 8px 0 2px; line-height: 20px; }
  .addr-parts, .addr-parts.addr-parts-two { grid-template-columns: minmax(0, 1fr); }
  .addr-row { min-height: 52px; }
  .addr-row b { font-size: 15px; line-height: 20px; }
  .addr-row i { font-size: 13px; line-height: 18px; }
  .addr-row kbd, .addr-keys { display: none; }
  .addr-foot { min-height: 36px; font-size: 12px; }
  /* While the list is open in a dialog the box rides to the top of it, as
     it does when the keyboard comes up, and this is the room to ride into. */
  .dialog-body.addr-room { padding-bottom: 72vh; }
  .btn.insert { height: 36px; padding: 0 12px; font-size: 14px; }
  .text-count { font-size: 13px; }
  .toasts { bottom: calc(var(--tabbar-h) + var(--tabbar-b) + 12px); }
  .datepicker { left: 0 !important; right: 0; top: auto !important; bottom: 0; flex-direction: column; align-items: center; padding: 16px 16px calc(16px + var(--safe-b)); border: 0; border-radius: 10px 10px 0 0; }
  .dp-cal { width: 308px; max-width: 100%; }
  .dp-dow, .dp-days { grid-template-columns: repeat(7, 1fr); }
  .dp-day { width: 100%; height: 44px; line-height: 44px; font-size: 15px; }
  .dp-times { flex-direction: row; flex-wrap: wrap; gap: 4px; width: 308px; max-width: 100%; max-height: 148px; margin: 12px 0 0; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .dp-time { height: 44px; line-height: 44px; padding: 0 10px; font-size: 14px; }

  .bars li { grid-template-columns: 104px minmax(0, 1fr) 28px 36px; height: 32px; font-size: 14px; }
  .rates .rate-top b { font-size: 14px; }
  .rates .rate-line { grid-template-columns: minmax(0, 1fr) 128px; }
  .rates .rate-nums { font-size: 13px; }
}
