/* Business Development: the Sales and Clients lists, Sales Analytics and a
   company's own page. Colors, type and spacing come from styles.css. */

.biz-heading {
  margin-bottom: var(--space-5);
}

.biz-heading-sub {
  margin: var(--space-2) 0 0;
  color: var(--color-ink-muted);
  font-size: var(--text-md);
}

.biz-views {
  width: fit-content;
  margin-bottom: var(--space-5);
}

.biz-message {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-bad-soft);
  color: var(--color-bad);
  font-size: var(--text-sm);
}

.biz-message.is-info {
  background: var(--color-sunken);
  color: var(--color-ink-muted);
}

.biz-message[hidden],
.biz-delete[hidden],
.biz-open[hidden] {
  display: none;
}

.biz-delete {
  color: var(--color-bad);
}

.biz-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin-bottom: var(--space-2);
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.biz-crumbs a {
  color: var(--color-accent-text);
  text-decoration: none;
}

.biz-crumbs a:hover {
  text-decoration: underline;
}

.biz-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-3);
}

/* Cards */
.biz-card {
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-rest);
}

.biz-card + .biz-card,
.biz-stats + .biz-card,
.biz-card + .biz-grid {
  margin-top: var(--space-4);
}

.biz-card-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.biz-card-note {
  margin: 2px 0 var(--space-4);
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.biz-empty {
  margin: 0;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-sunken);
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

/* Search and filters: soft blue, as fields you can change */
.biz-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.biz-tools .biz-add-top {
  align-self: center;
  margin: 0 0 0 auto;
}

.biz-field {
  display: flex;
  min-height: 34px;
  border-radius: var(--radius-sm);
  background: var(--color-editable);
  transition: background-color var(--motion);
}

.biz-field:hover {
  background: var(--color-editable-hover);
}

.biz-field:focus-within {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.biz-field input,
.biz-field select {
  width: 100%;
  min-width: 0;
  padding: 0 var(--space-3);
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: var(--text-sm);
}

.biz-field:first-child {
  width: 280px;
  max-width: 100%;
}

.biz-field select {
  cursor: pointer;
}

/* The lists */
.biz-table-wrap {
  overflow-x: auto;
}

/* Sales column headings kept in view under the app's header while the
   table scrolls past (js/business.js draws a copy of them) */
.biz-float-head {
  position: sticky;
  z-index: 6;
  height: 0;
}

.biz-float-head:not(.is-on) {
  visibility: hidden;
}

.biz-float-inner {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: 0 6px 10px -8px rgba(0, 0, 0, 0.25);
}

.biz-sales.is-float th {
  position: static;
}

.biz-sales.is-float th.is-sticky,
.biz-sales.is-float th.biz-row-action {
  position: sticky;
}

.biz-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.biz-table th {
  padding: 0 var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--color-line-strong);
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.biz-table td {
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--color-line);
  vertical-align: top;
}

.biz-table td > span {
  display: block;
}

.biz-name {
  min-width: 170px;
}

.biz-link {
  display: block;
  color: var(--color-ink);
  font-weight: 600;
  text-decoration: none;
}

.biz-link:hover {
  color: var(--color-accent-text);
}

.biz-site {
  display: block;
  overflow: hidden;
  max-width: 220px;
  color: var(--color-accent-text);
  font-size: var(--text-xs);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.biz-site:hover {
  text-decoration: underline;
}

.biz-strong {
  font-weight: 500;
}

.biz-sub,
.biz-muted {
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
}

.biz-nowrap {
  white-space: nowrap;
}

.biz-next {
  max-width: 240px;
  color: var(--color-ink-muted);
}

.biz-next > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Progress: six dots joined by lines, the furthest stage named */
.biz-progress {
  display: flex !important;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.biz-dots {
  display: flex;
  align-items: center;
}

.biz-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-control);
}

.biz-dot.is-done {
  background: var(--color-accent);
}

.biz-dot.is-deal {
  background: var(--color-good);
}

.biz-dot-line {
  width: 8px;
  height: 2px;
  background: var(--color-control);
}

.biz-dot-line.is-done {
  background: var(--color-accent);
}

.biz-progress-text {
  display: flex;
  flex-direction: column;
}

.biz-progress-stage {
  font-weight: 500;
}

.biz-client-tag {
  display: inline-block !important;
  margin-top: 4px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-good-soft);
  color: var(--color-good);
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
}

/* Analytics */
.biz-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}

.biz-stats .stat {
  border: 1px solid var(--color-card-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-rest);
}

.biz-stats .stat + .stat {
  margin-top: 0;
}

.biz-stats .stat-value {
  font-size: 24px;
}

.biz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: start;
}

.biz-grid .biz-card + .biz-card {
  margin-top: 0;
}

.biz-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.biz-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 130px) minmax(0, 1fr) 32px minmax(0, 110px);
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.biz-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.biz-bar-track {
  height: 16px;
}

/* 4px rounded at the end, square at the start */
.biz-bar-fill {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--color-accent);
}

.biz-bar-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.biz-bar-note {
  overflow: hidden;
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.biz-legend {
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.biz-key {
  width: 14px;
  height: 10px;
  border-radius: 2px 2px 0 0;
}

.biz-activity svg {
  display: block;
  width: 100%;
  height: auto;
}

.biz-activity .biz-gridline {
  stroke: var(--color-line);
}

.biz-activity .biz-baseline {
  stroke: var(--color-line-strong);
}

.biz-axis {
  fill: var(--color-ink-muted);
  font-size: 12px;
}

.biz-speed,
.biz-quiet {
  margin: 0;
  padding: 0;
  list-style: none;
}

.biz-speed-row,
.biz-quiet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
}

.biz-speed-row + .biz-speed-row,
.biz-quiet-row + .biz-quiet-row {
  border-top: 1px solid var(--color-line);
}

.biz-speed-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.biz-quiet-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.biz-quiet-text .biz-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.biz-quiet-days {
  flex: none;
  padding: 1px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-warn-soft);
  color: var(--color-warn);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* ---- A company's page ---- */
.biz-company {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.biz-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.biz-fields.is-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.biz-field-wrap.is-wide {
  grid-column: 1 / -1;
}

.biz-field-wrap .plan-field-note:empty {
  display: none;
}

.biz-field-wrap .plan-field-note.is-problem {
  color: var(--color-bad);
}

.biz-field-wrap .plan-field-box:has(textarea) {
  align-items: stretch;
}

.biz-textarea {
  height: auto;
  padding: var(--space-2);
  line-height: 1.45;
  resize: vertical;
}

select.plan-input {
  cursor: pointer;
}

.biz-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-right: 2px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-accent-text);
  cursor: pointer;
}

.biz-icon:hover {
  background: var(--color-editable-hover);
}

.biz-icon.is-danger {
  color: var(--color-ink-muted);
}

.biz-icon.is-danger:hover {
  background: var(--color-bad-soft);
  color: var(--color-bad);
}

.biz-icon svg,
.biz-add svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.biz-add {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}

.biz-add:hover {
  background: var(--color-accent-soft);
}

/* Sales progress: a checklist with a date beside each ticked step */
.biz-stages {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.biz-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  min-height: 48px;
  padding: var(--space-2) 0;
}

.biz-stage + .biz-stage {
  border-top: 1px solid var(--color-line);
}

.biz-stage-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.biz-stage-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.biz-stage-name {
  font-weight: 500;
}

.biz-stage:not(.is-done) .biz-stage-name {
  color: var(--color-ink-muted);
}

.biz-stage.is-deal.is-done .biz-stage-name {
  color: var(--color-good);
  font-weight: 600;
}

.biz-stage-date {
  width: 190px;
}

/* Contacts: a soft gray panel each, its status as a colored dot */
.biz-contacts {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.biz-contact {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-4);
  border-left: 3px solid var(--color-line-strong);
  border-radius: var(--radius-md);
  background: var(--color-sunken);
}

.biz-contact.is-current {
  border-left-color: var(--color-good);
}

.biz-contact.is-no-response {
  border-left-color: var(--color-warn);
}

.biz-contact .plan-field-box {
  background: var(--color-surface);
}

.biz-contact-fields {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
  min-width: 0;
}

.biz-contact-remove {
  margin-top: 20px;
}

.biz-state-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: var(--space-3);
  border-radius: 50%;
  background: var(--color-ink-muted);
}

.is-current .biz-state-dot {
  background: var(--color-good);
}

.is-no-response .biz-state-dot {
  background: var(--color-warn);
}

/* Work together: dated entries, newest first */
.biz-work {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.biz-work-entry {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
}

.biz-work-text {
  align-items: stretch;
}

@media (max-width: 900px) {
  .biz-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .biz-stats .stat:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .biz-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .biz-contact-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .biz-card {
    padding: var(--space-4);
  }

  .biz-fields,
  .biz-fields.is-two,
  .biz-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .biz-field:first-child {
    width: 100%;
  }

  .biz-contact-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .biz-work-entry {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .biz-work-text {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .biz-bar-row {
    grid-template-columns: minmax(0, 90px) minmax(0, 1fr) 28px;
  }

  .biz-bar-note {
    grid-column: 2 / -1;
  }
}

/* The funnel takes the whole row, so its notes have room */
.biz-grid .biz-card.is-wide {
  grid-column: 1 / -1;
}

.biz-card-title + .biz-bars,
.biz-card-title + .biz-empty {
  margin-top: var(--space-3);
}

.biz-card.is-wide .biz-bar-row {
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr) 32px minmax(0, 220px);
}

@media (max-width: 760px) {
  /* Each step's date always goes under its name, lined up with it */
  .biz-stage {
    flex-direction: column;
    align-items: flex-start;
  }

  .biz-stage-date {
    width: calc(100% - 30px);
    margin-left: 30px;
  }
}

/* ---- Sales: a table filled in row by row ---- */
.biz-sales {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

.biz-sales th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0 var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--color-line-strong);
  background: var(--color-surface);
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: left;
  vertical-align: bottom;
  white-space: nowrap;
}

.biz-sales td {
  padding: 3px 2px;
  border-bottom: 1px solid var(--color-line);
  vertical-align: top;
}

/* The company's name stays in view while the table scrolls sideways */
.biz-sales .is-sticky {
  position: sticky;
  left: 28px;
  z-index: 2;
  background: var(--color-surface);
}

.biz-sales th.is-sticky {
  z-index: 3;
}

.biz-sales .biz-row-action {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 28px;
  min-width: 28px;
  padding: 9px 4px 0;
  background: var(--color-surface);
}

.biz-sales tr:hover .plan-remove-row,
.biz-sales tr:focus-within .plan-remove-row {
  opacity: 1;
}

.biz-input {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 6px var(--space-2);
  border: 0;
  border-radius: 6px;
  outline: none;
  background: var(--color-editable);
  color: var(--color-ink);
  font: inherit;
  line-height: 1.4;
  transition: background-color var(--motion);
}

/* A one-line field never changes size with its text, so typing in it
   doesn't make the browser lay out the long table around it again */
input.biz-input {
  contain: strict;
}

.biz-input:hover {
  background: var(--color-editable-hover);
}

.biz-input:focus {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.biz-input::placeholder {
  color: var(--color-ink-muted);
  opacity: 0.7;
}

textarea.biz-input {
  overflow: hidden;
  resize: none;
}

select.biz-input {
  cursor: pointer;
}

.biz-cell {
  width: 140px;
  min-width: 140px;
}

.biz-sales .is-sticky.biz-cell {
  width: 190px;
  min-width: 190px;
}

.biz-sales .is-sticky .biz-input {
  font-weight: 600;
}

.biz-cell.is-notes {
  width: 220px;
  min-width: 220px;
}

.biz-cell.is-contacts {
  width: 230px;
  min-width: 230px;
  padding: 6px var(--space-2);
}

.biz-cell.is-handler {
  width: 170px;
  min-width: 170px;
}

.biz-contact-summary {
  display: flex;
  flex-direction: column;
}

/* Sales progress: a bar of six parts, the stage names slanted above them */
.biz-progress-head {
  width: 330px;
  min-width: 330px;
  height: 104px;
  padding: 0 var(--space-3) var(--space-2) !important;
}

.biz-stage-labels {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  height: 92px;
}

.biz-stage-label {
  align-self: end;
  justify-self: center;
  width: 0;
  overflow: visible;
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transform: rotate(-38deg);
  transform-origin: left bottom;
}

.biz-stage-label.is-deal {
  color: var(--color-good);
}

.biz-progress-cell {
  width: 330px;
  min-width: 330px;
  padding: 3px var(--space-3) !important;
  vertical-align: top !important;
}

.biz-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  height: 32px;
  padding: 7px 0;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.biz-track:focus-visible {
  box-shadow: 0 0 0 2px var(--color-accent);
}

.biz-track-part {
  background: var(--color-editable);
  transition: background-color 0.12s ease;
}

.biz-track-part:first-child {
  border-radius: 9px 0 0 9px;
}

.biz-track-part:last-child {
  border-radius: 0 9px 9px 0;
}

.biz-track:hover .biz-track-part:not(.is-on) {
  background: var(--color-editable-hover);
}

.biz-track-part.is-on {
  background: var(--color-accent);
}

.biz-track-part.is-deal.is-on {
  background: var(--color-good);
}

.biz-track.is-dragging {
  cursor: ew-resize;
}

.biz-row-open {
  width: 36px;
  padding-top: 4px !important;
}

.biz-open-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--color-accent-text);
}

/* A one-line field grown over the cells beside it while you type in it,
   so a long text shows whole (js/business.js sets its width) */
/* (the frozen name cell is already a frame for it, being sticky) */
.biz-cell.is-widened:not(.is-sticky) {
  position: relative;
}

.biz-sales .biz-cell.is-widened .biz-input {
  height: 32px;
}

.biz-sales .biz-input.is-wide {
  position: absolute;
  top: 3px;
  left: 2px;
  z-index: 4;
  background: var(--color-editable-hover);
  box-shadow: inset 0 0 0 2px var(--color-accent), 0 6px 16px rgba(0, 0, 0, 0.14);
}

.biz-sales .is-sticky.is-widened {
  z-index: 5;
}

/* Fields with suggestions (industry, country, purpose) show no dropdown
   arrow; the suggestions still come up while typing */
.biz-sales input.biz-input[list]::-webkit-calendar-picker-indicator {
  display: none !important;
}

/* Under a company's name: it is already in Sales */
.biz-dupe {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 1px 5px;
  max-width: 186px;
  margin: 4px 2px 0;
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-warn-soft);
  color: var(--color-warn);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.3;
}

/* While the name field is widened over the row, the warning keeps its place under it */
.biz-cell.is-widened .biz-dupe {
  margin-top: 36px;
}

.biz-dupe[hidden] {
  display: none;
}

.biz-dupe-icon {
  display: inline-flex;
  padding-top: 1px;
}

.biz-dupe-icon svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.biz-dupe-go {
  grid-column: 2;
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* The website with a button beside it that opens it */
.biz-cell.has-site {
  position: relative;
}

.biz-cell.has-site .biz-input {
  padding-right: 32px;
}

.biz-site-open {
  position: absolute;
  top: 6px;
  right: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--color-accent-text);
}

.biz-site-open:hover {
  background: var(--color-surface);
}

.biz-site-open[hidden] {
  display: none;
}

.biz-site-open svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.biz-open-row:hover {
  background: var(--color-accent-soft);
}

.biz-open-row svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.biz-empty[hidden] {
  display: none;
}

.biz-card .plan-add-row {
  margin-top: var(--space-3);
}

/* A wider page: the Sales table has many columns */
.biz-page {
  max-width: 1480px;
}

/* The slanted names reach over the next column's heading: headings other
   than the frozen ones have no background, so the names show across them,
   and the frozen columns cover them when the table scrolls sideways. */
.biz-sales th:not(.is-sticky):not(.biz-row-action) {
  position: static;
  background: transparent;
}

.biz-sales th.biz-progress-head {
  position: relative;
  z-index: 1;
}

/* The current contact, one click from writing or calling */
.biz-contact-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.biz-current {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}

.biz-current-name {
  font-weight: 600;
}

.biz-current-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  color: var(--color-accent-text);
  font-size: var(--text-xs);
  text-decoration: none;
}

.biz-current-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.biz-current-link:hover span {
  text-decoration: underline;
}

.biz-current-link svg {
  flex: none;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.biz-contacts-button {
  padding: 2px var(--space-2);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-sunken);
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
}

.biz-contacts-button:hover {
  background: var(--color-accent-soft);
}

/* The contacts popup: wider than other dialogs, scrolling inside */
.biz-contacts-dialog {
  width: min(880px, calc(100vw - 2 * var(--space-4)));
  max-height: calc(100vh - 2 * var(--space-6));
  overflow-y: auto;
}

.biz-contacts-dialog .biz-contact-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.biz-dialog-link {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  text-decoration: none;
}

@media (max-width: 760px) {
  .biz-contacts-dialog .biz-contact-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* How a contact is reached: one action beside them. LinkedIn opens the
   profile in a new tab; email and phone are copied. */
.biz-contact-side {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.biz-contact-side .biz-contact-remove {
  margin-top: 20px;
}

.biz-current-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-width: 0;
}

.biz-reach {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-control);
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--motion);
}

.biz-reach:hover {
  background: var(--color-line-strong);
}

.biz-reach svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.biz-reach.is-done {
  background: var(--color-good-soft);
  color: var(--color-good);
}

/* A contact shown in the row who isn't the current one says how it stands */
.biz-current-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
}

.biz-current-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-line-strong);
}

.biz-current-state.is-no-response::before {
  background: var(--color-warn);
}

/* Under the Sales table while more rows are left to draw */
.biz-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-4) 0 var(--space-2);
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.biz-more.is-above {
  padding: var(--space-2) 0 var(--space-4);
}

.biz-more[hidden] {
  display: none;
}

/* The funnel filter above the Sales table: each step with how many
   companies are at it now */
.biz-funnel {
  flex-wrap: wrap;
  width: fit-content;
  margin-bottom: var(--space-3);
  overflow: visible;
}

.biz-funnel-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
}

.biz-funnel-count {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: center;
}

.biz-funnel-step[aria-current="true"] .biz-funnel-count {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

/* The side rail: search companies or people, and go to the top or bottom,
   fixed at the right edge so it is always at hand. The search field opens
   from its button to the left, over the table, and stays open until closed. */
.biz-rail {
  position: fixed;
  top: 50%;
  right: var(--space-4);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  transform: translateY(-50%);
}

.biz-rail[hidden] {
  display: none;
}

.biz-rail-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-card-border);
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: var(--shadow-raised);
  color: var(--color-accent-text);
  cursor: pointer;
  transition: background-color var(--motion), color var(--motion);
}

.biz-rail-button:hover {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.biz-rail-button svg,
.biz-rail-search-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.biz-rail-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 200px;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-pill);
  background: var(--color-editable);
  box-shadow: var(--shadow-raised);
  color: var(--color-ink-muted);
}

.biz-rail-search:focus-within {
  box-shadow: var(--shadow-raised), inset 0 0 0 2px var(--color-accent);
}

.biz-rail-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: var(--text-sm);
}

.biz-rail-search-icon {
  display: flex;
  flex: none;
}

.biz-rail .biz-rail-search {
  position: absolute;
  top: 0;
  right: 48px;
  visibility: hidden;
  opacity: 0;
  /* Hidden only once it has faded out; shown at once, so it takes focus */
  transition: opacity var(--motion), visibility 0s linear 0.2s;
}

.biz-rail.is-open .biz-rail-search {
  visibility: visible;
  opacity: 1;
  transition: opacity var(--motion), visibility 0s;
}

.biz-rail.is-open .biz-rail-toggle {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

@media (max-width: 760px) {
  .biz-rail {
    top: auto;
    right: var(--space-3);
    bottom: var(--space-4);
    transform: none;
  }

  .biz-rail-search {
    width: min(240px, calc(100vw - 80px));
  }
}

/* What the search found: only the cells it was found in turn yellow */
.biz-sales tr.is-match .biz-input.is-hit {
  background: var(--color-found-strong);
  box-shadow: inset 0 0 0 1px var(--color-found-edge);
}

.biz-sales tr.is-match td.is-hit .biz-current,
.biz-sales tr.is-match td.is-hit select {
  border-radius: var(--radius-sm);
  background: var(--color-found-strong);
  box-shadow: 0 0 0 4px var(--color-found-strong);
}

/* After a search is turned off, the company found keeps its yellow for a
   moment, then fades back to soft blue */
.biz-sales .biz-input.is-landed {
  background: var(--color-found-strong);
  box-shadow: inset 0 0 0 1px var(--color-found-edge);
}

.biz-sales .biz-input.is-fading {
  transition: background-color 0.6s ease, box-shadow 0.6s ease;
}

@media (prefers-reduced-motion: reduce) {
  .biz-sales .biz-input.is-fading {
    transition: none;
  }
}

/* The search button shows a dot while a search is on */
.biz-rail.has-query .biz-rail-toggle {
  position: relative;
}

.biz-rail.has-query .biz-rail-toggle::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--color-surface);
  border-radius: 50%;
  background: var(--color-found-edge);
}
