/* Harvey, the sales agent (harvey.js). Tokens only — the palette lives in styles.css :root.
   Motion stays under 250 ms; reduced motion turns it off. */

.hv { display: flex; flex-direction: column; gap: 16px; max-width: 1280px; }
.hv-grow { flex: 1; }

.hv-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.hv-head-icon { flex: none; width: 44px; height: 44px; border-radius: var(--r-lg); display: grid; place-items: center; font-size: 22px;
  color: var(--accent); background: var(--accent-fill); box-shadow: inset 0 0 0 1px var(--accent-sep); }
.hv-head-text { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 4px; }
.hv-head-text h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.hv-head-sub { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 4px; }
.hv-head-text p { margin: 0; font-size: 13px; color: var(--text-2); max-width: 720px; line-height: 1.5; }
.hv-head-text p b { color: var(--text); font-weight: 600; }
.hv-head-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-top: 2px; }
.hv-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.hv-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 3px; border-radius: var(--r-md); background: var(--fill); box-shadow: inset 0 0 0 1px var(--sep);
  scrollbar-width: none; }
.hv-tabs::-webkit-scrollbar { display: none; }
.hv-tab { all: unset; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600;
  color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.hv-tab:hover { color: var(--text); background: var(--fill-2); }
.hv-tab[aria-selected="true"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--sep-strong); }
.hv-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hv-tab i { font-size: 14px; }
.hv-tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 10.5px;
  font-variant-numeric: tabular-nums; color: var(--orange); background: color-mix(in srgb, var(--orange) 16%, transparent); }
.hv-tab-badge.is-teal { color: var(--teal); background: color-mix(in srgb, var(--teal) 16%, transparent); }

.hv-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.hv-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--sep); min-width: 0; }
.hv-card h4 { margin: 6px 0 0; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.hv-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.hv-card-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.hv-note { margin: 0; font-size: 12px; }
.hv-card > .ui-btn { align-self: flex-start; }

.hv-pill-neutral { --tone: var(--text-2); }
.hv-pill-teal { --tone: var(--teal); }
.hv-pill-green { --tone: var(--green); }
.hv-pill-orange { --tone: var(--orange); }
.hv-pill-red { --tone: var(--red); }
.hv-pill-yellow { --tone: var(--yellow); }

.hv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hv-list > li + li { border-top: 1px solid var(--sep); }
.hv-compact > li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 12px; }
.hv-compact > li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hv-compact b { font-weight: 600; font-size: 12.5px; overflow-wrap: anywhere; }
.hv-compact span { color: var(--text-3); overflow-wrap: anywhere; }

.hv-todo { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.hv-todo > i { flex: none; font-size: 20px; color: var(--accent); }
.hv-todo.hv-tone-warn > i { color: var(--orange); }
.hv-todo.hv-tone-bad > i { color: var(--red); }
.hv-todo > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.hv-todo b { font-size: 13.5px; font-weight: 600; }
.hv-todo span { color: var(--text-2); line-height: 1.45; }

.hv-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.hv-steps li { position: relative; display: flex; gap: 10px; padding: 12px; border-radius: var(--r-md); background: var(--fill); box-shadow: inset 0 0 0 1px var(--sep); }
.hv-steps li > i { font-size: 18px; color: var(--accent); flex: none; }
.hv-steps li div { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.hv-steps li b { font-size: 13px; }
.hv-steps li span { color: var(--text-2); line-height: 1.45; }
.hv-step-n { position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.hv-legal { display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.5; }
.hv-legal i { color: var(--yellow); font-size: 16px; flex: none; margin-top: 1px; }

.hv-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--orange) 10%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 40%, transparent); font-size: 12.5px; }
.hv-banner.is-bad { background: color-mix(in srgb, var(--red) 9%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 40%, transparent); }
.hv-banner > i { font-size: 20px; color: var(--red); }
.hv-banner > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.hv-banner span { color: var(--text-2); }

/* the decisions desk */
.hv-desk { display: flex; flex-direction: column; gap: 10px; }
.hv-desk-nav { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap; }
.hv-desk-keys { margin-left: auto; font-size: 11.5px; display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.hv-mail { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--fill); box-shadow: inset 0 0 0 1px var(--sep); }
.hv-mail-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; margin: 0; }
.hv-mail-meta dt { font-size: 11px; color: var(--text-3); }
.hv-mail-meta dd { margin: 2px 0 0; font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.hv-mail-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.hv-textarea { height: auto; min-height: 64px; padding: 9px 10px; line-height: 1.55; resize: vertical; font: 13.5px/1.55 var(--font); width: 100%; box-sizing: border-box; }
.hv-mail .hv-textarea { min-height: 220px; }
.hv-mail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hv-warn { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 12.5px; color: var(--orange); line-height: 1.45; }
.hv-warn i { flex: none; margin-top: 2px; }
.hv-ok { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-size: 12.5px; color: var(--green); }
.hv-live { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 12.5px; color: var(--accent-text); }

.hv-fold > summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 2px 0; list-style-position: inside; }
.hv-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
.hv-fold[open] > summary { margin-bottom: 6px; }
.hv-fold + .hv-fold { border-top: 1px solid var(--sep); padding-top: 8px; }

/* replies */
.hv-split { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 14px; align-items: start; }
.hv-conv-list { padding: 6px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); max-height: 640px; overflow: auto; }
.hv-conv-list > li + li { border-top: 0; }
.hv-conv { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; border-radius: var(--r-md); cursor: pointer; font-size: 12px; }
.hv-conv:hover { background: var(--fill); }
.hv-conv.is-on { background: var(--accent-fill); box-shadow: inset 0 0 0 1px var(--accent-sep); }
.hv-conv:focus-visible { outline: 2px solid var(--accent); }
.hv-conv b { font-size: 13px; }
.hv-conv span { color: var(--text-3); }
.hv-conv-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.hv-thread-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hv-msg { max-width: 88%; padding: 10px 12px; border-radius: var(--r-md); background: var(--fill); box-shadow: inset 0 0 0 1px var(--sep); }
.hv-msg.is-us { align-self: flex-end; background: var(--accent-fill); box-shadow: inset 0 0 0 1px var(--accent-sep); }
.hv-msg div { display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; }
.hv-msg time { color: var(--text-3); }
.hv-msg p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* prospects */
.hv-search { width: 240px; max-width: 100%; }
.hv-select { height: 34px; }
.hv-table-wrap { overflow-x: auto; }
.hv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hv-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--sep); white-space: nowrap; }
.hv-table td { padding: 8px; border-bottom: 1px solid var(--sep); vertical-align: top; }
.hv-table td > span { display: block; font-size: 11.5px; margin-top: 2px; }
.hv-table tr:last-child td { border-bottom: 0; }
.hv-num { text-align: right; font-variant-numeric: tabular-nums; }
.hv-row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }

/* find businesses */
.hv-provs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.hv-prov { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--fill); box-shadow: inset 0 0 0 1px var(--sep); cursor: pointer; }
.hv-prov.is-on { background: var(--accent-fill); box-shadow: inset 0 0 0 1px var(--accent-sep); }
.hv-prov.is-off { opacity: .6; cursor: not-allowed; }
.hv-prov input { margin-top: 3px; accent-color: var(--accent); }
.hv-prov div { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.hv-prov b { font-size: 13px; }
.hv-prov span { color: var(--text-2); line-height: 1.4; }
.hv-find-form { display: flex; flex-direction: column; gap: 10px; }
.hv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.hv-chips legend { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.hv-chip { position: relative; cursor: pointer; }
.hv-chip input { position: absolute; opacity: 0; }
.hv-chip span { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: 12px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--sep); color: var(--text-2);
  transition: background-color var(--dur-fast) var(--ease-out); }
.hv-chip input:checked + span { background: var(--accent-fill); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-sep); }
.hv-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.hv-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.hv-row .ui-input { min-width: 220px; }
.hv-estimate { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: var(--r-md); background: var(--fill); font-size: 12.5px; }
.hv-estimate b { font-size: 14px; }
.hv-companies { max-height: 560px; overflow: auto; }
.hv-company > button { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 9px 4px; cursor: pointer; font-size: 12px; }
.hv-company > button:hover b { color: var(--accent-text); }
.hv-company > button:focus-visible { outline: 2px solid var(--accent); border-radius: var(--r-xs); }
.hv-company b { font-size: 13px; }
.hv-company span { color: var(--text-2); }
.hv-company-body { padding: 0 4px 10px; font-size: 12px; }
.hv-company-body ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.hv-company-body p { margin: 6px 0 0; }

/* signals, campaigns, usage */
.hv-signal { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.hv-signal > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.hv-signal b { font-size: 13px; }
.hv-signal span { color: var(--text-2); line-height: 1.4; }
.hv-signal .ui-btn.is-on { color: var(--accent-text); background: var(--accent-fill); }
.hv-seq { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hv-seq li { position: relative; display: flex; gap: 10px; }
.hv-seq .hv-step-n { position: static; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--text-2); }
.hv-seq li div { display: flex; flex-direction: column; gap: 2px; font-size: 12px; min-width: 0; }
.hv-seq b { font-size: 13px; }
.hv-seq p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; color: var(--text-2); overflow-wrap: anywhere; }
.hv-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hv-bars li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 48px; gap: 10px; align-items: center; font-size: 12px; }
.hv-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.hv-log { margin: 0; max-height: 380px; overflow: auto; padding: 10px 12px; border-radius: var(--r-md); background: var(--well, var(--fill)); font: 11.5px/1.55 var(--mono);
  color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* settings */
.hv-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; align-items: start; }
.hv-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.hv-form .ui-field { min-width: 0; }
.hv-form .ui-input, .hv-form select.input { width: 100%; box-sizing: border-box; }
.hv-form .ui-field:has(textarea) { grid-column: 1 / -1; }
.hv-key { display: flex; gap: 4px; }
.hv-key .ui-input { flex: 1; min-width: 0; }
.hv-check { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 12.5px; }
.hv-check input { margin-top: 3px; accent-color: var(--accent); }
.hv-check > span { display: flex; flex-direction: column; gap: 2px; }
.hv-setup { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 12.5px; }
.hv-setup > i { font-size: 18px; color: var(--text-3); flex: none; }
.hv-setup.is-done > i { color: var(--green); }
.hv-setup div { display: flex; flex-direction: column; gap: 2px; }
.hv-setup span { color: var(--text-2); }
.hv-savebar { position: sticky; bottom: 8px; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-lg);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--sep); font-size: 12.5px; }
.hv-savebar span { flex: 1; }
.hv-savebar.is-dirty { box-shadow: inset 0 0 0 1px var(--accent-sep), 0 6px 24px rgb(0 0 0 / .25); }

@media (max-width: 860px) {
  .hv-split { grid-template-columns: 1fr; }
  .hv-settings-grid { grid-template-columns: 1fr; }
  .hv-desk-keys { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hv-tab, .hv-chip span { transition: none; }
}

/* notes on a conversation or a business */
.hv-notes { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--sep); font-size: 12.5px; }
.hv-notes ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hv-notes li { display: flex; gap: 8px; justify-content: space-between; padding: 6px 8px; border-radius: var(--r-sm); background: var(--fill); }
.hv-notes li span { overflow-wrap: anywhere; white-space: pre-wrap; }
.hv-notes time { flex: none; font-size: 11px; }
.hv-notes p { margin: 0; }
.hv-notes .ui-input { flex: 1; min-width: 160px; }
