/* ============================================================
   DEAL HOME — lead detail surface (loads first when a deal
   is picked, before any tool is opened)
   ============================================================ */

.tp-home { padding: 20px 24px 60px; display: flex; flex-direction: column; gap: 16px; }

/* shared card chrome reused across the home surface */
.dh-card {
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.dh-card__hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -2px 0 12px;
}
.dh-card__hd-r { display: flex; align-items: center; gap: 8px; color: var(--fg3); }
.dh-card__actions { display: flex; gap: 6px; margin-top: 12px; }
.dh-link {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg3); background: transparent; border: 0; cursor: pointer;
}
.dh-link:hover { color: var(--fg1); }

/* ── lead detail header — extends .tp-head ── */
.tp-head--home { background: var(--bg-elevated); }
.tp-head__pri {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em;
  padding: 2px 6px; border-radius: var(--radius);
}
.tp-head__pri--hot  { background: rgba(237,8,0,0.12);  color: var(--red); }
.tp-head__pri--warm { background: rgba(217,138,42,0.14); color: #8c5b1a; }
.tp-head__pri--cold { background: rgba(26,26,26,0.06); color: var(--fg3); }

/* ── stage stepper row ── */
.dh-stepwrap {
  display: flex; flex-direction: column; gap: 14px;
  padding: 14px 18px;
}
.dh-stepwrap__hd {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.dh-stepwrap__wait {
  display: inline-flex; align-items: baseline; gap: 8px;
}

.dh-step {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
}
.dh-step__item {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding-right: 6px;
  min-width: 0;
}
.dh-step__dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: var(--radius);
  background: var(--bg-recessed);
  border: 1px solid var(--stroke);
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.04em;
  color: var(--fg3);
  position: relative; z-index: 2;
}
.dh-step__label {
  font-family: var(--font-head);
  font-size: 11px; font-weight: 500;
  color: var(--fg2);
  letter-spacing: -0.005em;
  line-height: 1.25;
  text-wrap: pretty;
}
.dh-step__bar {
  position: absolute; top: 13px; left: 26px; right: 0;
  height: 2px;
  background: var(--stroke);
  z-index: 1;
}
.dh-step__item--done .dh-step__dot {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.dh-step__item--done .dh-step__bar { background: var(--ink); opacity: 0.45; }
.dh-step__item--done .dh-step__label { color: var(--fg2); }
.dh-step__item--current .dh-step__dot {
  background: var(--red); color: #fff; border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(237,8,0,0.10);
}
.dh-step__item--current .dh-step__label { color: var(--fg1); font-weight: 600; }
.dh-step__item--future .dh-step__label { color: var(--fg3); }

/* ── waiting badge ── */
.dh-wait {
  display: inline-flex; align-items: baseline; gap: 2px;
  font-family: var(--font-head); font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.dh-wait__n { font-size: 22px; }
.dh-wait__unit { font-size: 12px; color: var(--fg3); font-weight: 500; }
.dh-wait--hot  { color: var(--red); }
.dh-wait--warm { color: #8c5b1a; }
.dh-wait--ok   { color: var(--fg1); }
.dh-wait__since {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg3);
}

/* ── next-step callout (the "what now" answer) ── */
.dh-next {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.dh-next::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--red);
}
.dh-next__l { padding-left: 6px; min-width: 0; }
.dh-next__line {
  font-family: var(--font-head); font-weight: 600;
  font-size: 18px; letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 6px 0 6px;
  text-wrap: pretty;
  color: var(--fg1);
}
.dh-next__sub { font-size: 12px; color: var(--fg3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dh-next__sub strong { color: var(--fg1); font-weight: 600; }
.dh-next__r { flex-shrink: 0; }
.dh-next__r .btn { display: inline-flex; align-items: center; }

/* ── initial site screening ── */
.dh-site-screening {
  display: grid;
  gap: 14px;
}
.dh-site-screening h2 {
  margin: 3px 0 0;
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: 0;
}
.dh-screening-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  padding: 4px 8px;
  color: var(--fg3);
  background: rgba(26, 26, 26, 0.06);
  white-space: nowrap;
}
.dh-screening-status--complete {
  color: #1f6f43;
  background: rgba(46, 125, 80, 0.12);
}
.dh-screening-status--in_progress {
  color: #8c5b1a;
  background: rgba(217, 138, 42, 0.14);
}
.dh-screening-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.dh-screening-progress .mono {
  color: var(--fg3);
  font-size: 10px;
}
.dh-screening-progress span:last-child {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.08);
}
.dh-screening-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
}
.dh-screening-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.dh-screening-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--bg-primary);
}
.dh-screening-field label,
.dh-screening-misc {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.dh-screening-field span,
.dh-screening-misc span {
  color: var(--fg3);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dh-screening-field select,
.dh-screening-field input,
.dh-screening-misc textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--fg1);
  font: inherit;
  font-size: 12px;
  padding: 8px 9px;
}
.dh-screening-field select:focus,
.dh-screening-field input:focus,
.dh-screening-misc textarea:focus {
  outline: 2px solid rgba(237, 8, 0, 0.14);
  border-color: rgba(237, 8, 0, 0.34);
}
.dh-screening-misc {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--bg-primary);
}
.dh-screening-misc textarea {
  resize: vertical;
}
.dh-screening-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dh-screening-message {
  margin: -2px 0 0;
  color: #1f6f43;
  font-size: 12px;
}
.dh-screening-message.is-error {
  color: var(--red);
}

/* ── two-column grid ── */
.dh-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.dh-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dh-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 96px; }

/* ── deal communications ── */
.dh-home-tabs {
  display: inline-flex; align-self: flex-start; gap: 4px; padding: 4px;
  border: 1px solid var(--stroke); border-radius: var(--radius);
  background: var(--bg-elevated);
}
.dh-home-tabs button {
  border: 0; background: transparent; color: var(--fg2); cursor: pointer;
  padding: 7px 12px; border-radius: calc(var(--radius) - 2px);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
}
.dh-home-tabs button.is-on { background: var(--ink); color: #fff; }
.comm-panel { display: flex; flex-direction: column; gap: 14px; }
.comm-panel__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--stroke); padding-bottom: 16px;
}
.comm-panel__head h2,
.comm-settings__head h2 {
  margin: 3px 0 0; font-family: var(--font-head); font-size: 22px; letter-spacing: 0;
}
.comm-panel__head p {
  margin: 7px 0 0; max-width: 560px; color: var(--fg2); font-size: 13px; line-height: 1.45;
}
.comm-panel__stats {
  display: grid; grid-template-columns: repeat(2, minmax(88px, 1fr)); gap: 8px; min-width: 260px;
}
.comm-panel__stats span {
  border: 1px solid var(--stroke); border-radius: var(--radius); padding: 9px 10px;
  background: var(--bg-primary); color: var(--fg3); font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
}
.comm-panel__stats strong {
  display: block; color: var(--fg1); font-family: var(--font-head); font-size: 18px; letter-spacing: 0;
}
.comm-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 12px; border: 1px solid var(--stroke); border-radius: var(--radius);
  background: var(--bg-recessed);
}
.comm-toolbar > div:first-child {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; min-width: 0;
}
.comm-toolbar strong { font-family: var(--font-head); font-size: 15px; }
.comm-toolbar span { color: var(--fg3); font-size: 12px; overflow-wrap: anywhere; }
.comm-toolbar__right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.comm-view-toggle {
  display: inline-flex; gap: 4px; padding: 4px;
  border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--bg-primary);
}
.comm-view-toggle button {
  border: 0; background: transparent; color: var(--fg2); cursor: pointer;
  border-radius: calc(var(--radius) - 2px); padding: 6px 9px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
}
.comm-view-toggle button.is-on { background: var(--ink); color: #fff; }
.comm-filter { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.comm-filter button {
  border: 1px solid var(--stroke); background: var(--bg-primary); color: var(--fg2);
  border-radius: var(--radius); padding: 6px 9px; cursor: pointer;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
}
.comm-filter button.is-on { border-color: var(--ink); color: var(--fg1); box-shadow: inset 0 0 0 1px var(--ink); }
.comm-workspace {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px;
  align-items: start;
}
.comm-timeline-shell,
.comm-composer {
  min-width: 0; border: 1px solid var(--stroke); border-radius: var(--radius);
  background: var(--bg-primary);
}
.comm-timeline-shell { display: flex; flex-direction: column; }
.comm-composer {
  position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; padding: 14px;
}
.comm-section-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 14px 12px; border-bottom: 1px solid var(--stroke);
}
.comm-composer > .comm-section-head { padding: 0 0 12px; }
.comm-section-head h3 {
  margin: 3px 0 0; font-family: var(--font-head); font-size: 17px; letter-spacing: 0;
}
.comm-section-head > span {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3);
}
.comm-action-tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px;
  border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--bg-recessed);
}
.comm-action-tabs button {
  border: 0; border-radius: calc(var(--radius) - 2px); background: transparent; color: var(--fg2);
  padding: 8px 6px; cursor: pointer; font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
}
.comm-action-tabs button.is-on { background: var(--ink); color: #fff; }
.comm-action {
  display: flex; flex-direction: column; gap: 10px;
}
.comm-action header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comm-action strong { font-family: var(--font-head); font-size: 14px; }
.comm-action textarea,
.comm-action input,
.comm-action select,
.comm-field input,
.comm-field textarea,
.comm-field select,
.comm-inline-input {
  width: 100%; border: 1px solid var(--stroke); border-radius: var(--radius);
  background: var(--bg-primary); color: var(--fg1); padding: 9px 10px;
  font: inherit; font-size: 13px; line-height: 1.4;
}
.comm-action textarea,
.comm-field textarea { resize: vertical; }
.comm-action textarea:focus,
.comm-action input:focus,
.comm-action select:focus,
.comm-field input:focus,
.comm-field textarea:focus,
.comm-field select:focus,
.comm-inline-input:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px rgba(26,26,26,0.08);
}
.comm-email-row,
.comm-editor__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 0.55fr); gap: 10px;
}
.comm-email-row label,
.comm-field { display: flex; flex-direction: column; gap: 5px; }
.comm-email-row span,
.comm-field span {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3);
}
.comm-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg2); }
.comm-check input { width: auto; accent-color: var(--red); }
.comm-email-actions,
.comm-editor__actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.comm-home {
  display: grid; grid-template-columns: minmax(420px, 1fr) minmax(280px, 0.48fr); gap: 0;
  padding: 0; overflow: hidden;
}
.comm-home--side {
  display: block; padding: 14px; overflow: visible;
}
.comm-home__left { padding: 16px; border-right: 1px solid var(--stroke); }
.comm-home--side .comm-home__left { padding: 0; border-right: 0; }
.comm-home__head,
.comm-home__recent header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px;
}
.comm-home__head h2 {
  margin: 3px 0 0; font-family: var(--font-head); font-size: 18px; letter-spacing: 0;
}
.comm-home__actions {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.comm-home--side .comm-home__actions { grid-template-columns: minmax(0, 1fr); }
.comm-home__actions button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  min-width: 0; border: 1px solid var(--stroke); border-radius: var(--radius);
  background: var(--bg-primary); color: var(--fg1); padding: 10px 12px;
  text-align: left; cursor: pointer;
}
.comm-home__actions button.is-on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.comm-home__actions strong { font-family: var(--font-head); font-size: 13px; letter-spacing: 0; }
.comm-home__actions span {
  color: var(--fg3); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
}
.comm-home__form {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--stroke);
}
.comm-home--side .comm-email-row { grid-template-columns: minmax(0, 1fr); }
.comm-home--side .comm-email-actions { flex-direction: column; align-items: stretch; }
.comm-home--side .comm-email-actions .btn { width: 100%; justify-content: center; }
.comm-home__recent { padding: 16px; background: var(--bg-recessed); }
.comm-home__recent button {
  width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; align-items: baseline;
  padding: 9px 0; border: 0; border-top: 1px dashed var(--stroke); background: transparent;
  text-align: left; cursor: pointer; color: var(--fg1);
}
.comm-home__recent button:first-of-type { border-top: 0; }
.comm-home__recent strong,
.comm-home__recent small { display: block; overflow-wrap: anywhere; }
.comm-home__recent strong { font-size: 12.5px; font-weight: 600; }
.comm-home__recent small {
  margin-top: 2px; color: var(--fg3); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
}
.comm-home__dot { width: 7px; height: 7px; background: var(--fg3); margin-top: 5px; }
.comm-home__dot--email { background: #1f6f8b; }
.comm-home__dot--meeting { background: #6d5cae; }
.comm-home__dot--meta { background: #4466b0; }
.comm-home__dot--phone { background: #5f7c37; }
.comm-home__dot--note { background: #8b6f1f; }
.comm-timeline { display: flex; flex-direction: column; gap: 0; }
.comm-item {
  padding: 14px 16px; border-top: 1px solid var(--stroke);
  background: var(--bg-primary); border-left: 4px solid transparent;
}
.comm-item:first-child { border-top: 0; }
.comm-item--email { border-left-color: #1f6f8b; }
.comm-item--meeting { border-left-color: #6d5cae; }
.comm-item--phone { border-left-color: #5f7c37; }
.comm-item--note { border-left-color: #8b6f1f; }
.comm-item--system,
.comm-item--meta { border-left-color: var(--fg3); }
.comm-chat-card {
  border-top: 1px solid var(--stroke);
  border-left: 4px solid #4466b0;
  background: var(--bg-primary);
}
.comm-chat-card:first-child { border-top: 0; }
.comm-chat-card__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px 10px;
}
.comm-chat-card__head h3 {
  margin: 3px 0 0; font-family: var(--font-head); font-size: 15px; letter-spacing: 0;
}
.comm-chat-card__head > span {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3);
}
.comm-chat-viewport {
  max-height: 430px; overflow: auto; padding: 12px 16px 16px;
  background:
    linear-gradient(var(--bg-recessed), var(--bg-recessed)) padding-box,
    linear-gradient(to bottom, transparent, rgba(0,0,0,0.04)) border-box;
  border-top: 1px solid var(--stroke);
  overscroll-behavior: contain;
}
.comm-chat-row {
  display: flex; margin: 0 0 9px;
}
.comm-chat-row--inbound { justify-content: flex-start; }
.comm-chat-row--outbound { justify-content: flex-end; }
.comm-chat-bubble {
  max-width: min(72%, 620px); padding: 9px 11px 10px;
  border: 1px solid var(--stroke); border-radius: 8px;
  background: var(--bg-primary); box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.comm-chat-row--outbound .comm-chat-bubble {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.comm-chat-row--inbound .comm-chat-bubble {
  border-top-left-radius: 3px;
}
.comm-chat-row--outbound .comm-chat-bubble {
  border-top-right-radius: 3px;
}
.comm-chat-bubble__meta {
  display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg3);
}
.comm-chat-row--outbound .comm-chat-bubble__meta { color: rgba(255,255,255,0.62); }
.comm-chat-bubble p {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 13px; line-height: 1.45; color: inherit;
}
.comm-email-thread-card {
  border-top: 1px solid var(--stroke);
  border-left: 4px solid #1f6f8b;
  background: var(--bg-primary);
}
.comm-email-thread-card:first-child { border-top: 0; }
.comm-email-thread-card__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px 10px;
}
.comm-email-thread-card__head h3 {
  margin: 3px 0 0; font-family: var(--font-head); font-size: 15px; letter-spacing: 0;
  overflow-wrap: anywhere;
}
.comm-email-thread-card__head > span {
  flex: 0 0 auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg3);
}
.comm-email-thread-viewport {
  max-height: 500px; overflow: auto; padding: 12px 16px 16px;
  background: var(--bg-recessed); border-top: 1px solid var(--stroke);
  overscroll-behavior: contain;
}
.comm-email-rowlog {
  display: flex; margin: 0 0 10px;
}
.comm-email-rowlog--inbound { justify-content: flex-start; }
.comm-email-rowlog--outbound { justify-content: flex-end; }
.comm-email-message {
  width: min(78%, 660px); padding: 11px 12px 12px;
  border: 1px solid var(--stroke); border-radius: 8px;
  background: var(--bg-primary); box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.comm-email-rowlog--inbound .comm-email-message { border-top-left-radius: 3px; }
.comm-email-rowlog--outbound .comm-email-message {
  border-top-right-radius: 3px; background: #eef6f8; border-color: #cfe5eb;
}
.comm-email-message__meta {
  display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg3);
}
.comm-email-message__addresses {
  display: grid; gap: 3px; margin-bottom: 9px; color: var(--fg3); font-size: 12px;
}
.comm-email-message__addresses div {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: baseline;
}
.comm-email-message__addresses span {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
}
.comm-email-message__addresses strong {
  color: var(--fg2); font-weight: 500; overflow-wrap: anywhere;
}
.comm-email-message p {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--fg2); font-size: 13px; line-height: 1.5;
}
.comm-item__meta {
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono); font-size: 10px; color: var(--fg3); letter-spacing: 0.06em; text-transform: uppercase;
}
.comm-item h3 { margin: 7px 0 4px; font-family: var(--font-head); font-size: 15px; letter-spacing: 0; }
.comm-item p { margin: 0; color: var(--fg2); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.comm-item__recipient { margin-bottom: 6px; color: var(--fg3); font-size: 12px; overflow-wrap: anywhere; }
.comm-empty,
.comm-error {
  border: 1px dashed var(--stroke); border-radius: var(--radius); padding: 14px;
  color: var(--fg3); background: var(--bg-recessed); font-size: 13px;
}
.comm-error { border-style: solid; color: var(--red); background: rgba(237,8,0,0.05); }

/* ── settings email templates ── */
.comm-settings {
  display: grid; grid-template-columns: minmax(280px, 0.75fr) minmax(460px, 1.25fr);
  gap: 16px; align-items: start;
}
.comm-settings__rail,
.comm-editor {
  border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--bg-primary); padding: 14px;
}
.comm-settings__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.comm-template-list { display: flex; flex-direction: column; gap: 8px; }
.comm-template-row {
  width: 100%; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--bg-primary);
  padding: 10px; text-align: left; cursor: pointer; color: var(--fg1);
}
.comm-template-row.is-on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.comm-template-row strong,
.comm-template-row small { display: block; overflow-wrap: anywhere; }
.comm-template-row strong { font-family: var(--font-head); font-size: 13px; }
.comm-template-row small { color: var(--fg3); margin-top: 2px; font-size: 12px; }
.comm-template-row em {
  flex: 0 0 auto; font-style: normal; font-family: var(--font-mono); font-size: 9px;
  color: var(--fg3); letter-spacing: 0.08em; text-transform: uppercase;
}
.comm-editor { display: flex; flex-direction: column; gap: 12px; }
.comm-merge { display: flex; flex-wrap: wrap; gap: 6px; }
.comm-merge button {
  border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--bg-recessed);
  color: var(--fg2); padding: 5px 7px; cursor: pointer; font-family: var(--font-mono); font-size: 10px;
}
.stg-account__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px;
}
.stg-account__grid > div,
.stg-account__grid > label,
.stg-ms__panel,
.stg-ms-account,
.stg-user-row {
  border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--bg-primary);
}
.stg-account__grid > div,
.stg-account__grid > label { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.stg-account__grid strong { font-family: var(--font-head); overflow-wrap: anywhere; }
.stg-ms { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.stg-ms__panel { padding: 14px; }
.stg-ms__panel p { margin: 4px 0 0; color: var(--fg3); font-size: 13px; line-height: 1.5; }
.stg-ms__status {
  flex: 0 0 auto; border: 1px solid var(--stroke); border-radius: var(--radius);
  padding: 6px 9px; color: var(--fg3); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
}
.stg-ms__status.is-on { border-color: #5f7c37; color: #5f7c37; background: rgba(95,124,55,0.08); }
.stg-ms__connect { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.stg-ms__seg { display: inline-flex; align-self: flex-start; gap: 4px; padding: 4px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--bg-recessed); }
.stg-ms__seg button,
.stg-ms-account__flags button {
  border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--fg2);
  padding: 6px 8px; cursor: pointer; font-size: 12px;
}
.stg-ms__seg button.is-on,
.stg-ms-account__flags button.is-on { background: var(--ink); color: #fff; }
.stg-ms__accounts { display: flex; flex-direction: column; gap: 8px; }
.stg-ms-account {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px;
}
.stg-ms-account strong,
.stg-ms-account span,
.stg-ms-account small { display: block; overflow-wrap: anywhere; }
.stg-ms-account strong { font-family: var(--font-head); font-size: 13px; }
.stg-ms-account span { margin-top: 2px; color: var(--fg2); font-size: 12px; }
.stg-ms-account small { margin-top: 4px; color: var(--fg3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.stg-ms-account__flags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.stg-users { display: grid; gap: 10px; margin-top: 14px; }
.stg-user-row { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 12px; padding: 12px; }
.stg-user-row__meta strong,
.stg-user-row__meta span,
.stg-user-row__meta small { display: block; overflow-wrap: anywhere; }
.stg-user-row__meta strong { font-family: var(--font-head); font-size: 13px; }
.stg-user-row__meta span { color: var(--fg2); font-size: 12px; margin-top: 2px; }
.stg-user-row__meta small { color: var(--fg3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
.stg-user-row__flags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.stg-user-row__flags button {
  border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--bg-recessed);
  color: var(--fg2); padding: 6px 8px; cursor: pointer; font-size: 12px;
}
.stg-user-row__flags button.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.stg-user-row__flags button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── tool launcher grid ── */
.dh-launchers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.dh-launch {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 14px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s var(--ease-out), border-color 0.12s var(--ease-out), transform 0.06s var(--ease-out);
  min-height: 148px;
  color: inherit;
}
.dh-launch:hover { background: var(--bg-elevated); border-color: var(--stroke-firm); }
.dh-launch:active { transform: translateY(1px); }
.dh-launch.is-disabled {
  cursor: not-allowed;
  background: transparent;
  border-style: dashed;
  opacity: 0.55;
}
.dh-launch.is-disabled:hover { background: transparent; border-color: var(--stroke); }
.dh-launch.is-suggested {
  border-color: var(--red);
  background: rgba(237,8,0,0.03);
  box-shadow: inset 0 0 0 1px var(--red);
}
.dh-launch.is-suggested:hover { background: rgba(237,8,0,0.06); }

.dh-launch__top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.dh-launch__glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius);
  background: var(--bg-recessed);
  color: var(--fg2);
}
.is-suggested .dh-launch__glyph { background: var(--red); color: #fff; }
.dh-launch__suggest {
  font-size: 9px;
  background: var(--red); color: #fff;
  padding: 2px 6px; border-radius: var(--radius);
  letter-spacing: 0.1em;
}
.dh-launch__label {
  font-family: var(--font-head); font-weight: 600;
  font-size: 15px; letter-spacing: -0.01em;
}
.dh-launch__blurb {
  font-size: 11px; color: var(--fg3);
  line-height: 1.4;
  text-wrap: pretty;
}
.dh-launch__status {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.04em;
  padding: 4px 6px;
  border-radius: var(--radius);
  background: rgba(26,26,26,0.04);
  color: var(--fg2);
}
.dh-launch__status--live { background: rgba(26,26,26,0.05); color: var(--fg2); }
.dh-launch__status--muted { background: transparent; color: var(--fg3); font-style: italic; padding-left: 0; }

.dh-launch__cta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg2);
}
.is-suggested .dh-launch__cta { color: var(--red); }
.dh-launch.is-disabled .dh-launch__cta { color: var(--fg3); }

/* ── activity timeline ── */
.dh-activity {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
}
.dh-activity-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
}
.dh-activity-filter button {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--fg2);
  cursor: pointer;
  padding: 5px 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dh-activity-filter button.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.dh-activity li {
  display: grid;
  grid-template-columns: 14px 110px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--stroke);
  position: relative;
}
.dh-activity li:first-child { border-top: 0; }
.dh-activity__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--stroke-firm);
  margin-top: 6px;
  display: inline-block;
}
.dh-activity li.is-fresh .dh-activity__dot { background: var(--red); box-shadow: 0 0 0 3px rgba(237,8,0,0.12); }
.dh-activity__when { color: var(--fg3); padding-top: 2px; }
.dh-activity__what { font-size: 13px; color: var(--fg1); line-height: 1.5; text-wrap: pretty; }
.dh-activity__empty {
  display: block; padding: 18px 0;
  color: var(--fg3); font-size: 13px; text-align: center;
}

/* ── side cards ── */
.dh-dl {
  display: grid; grid-template-columns: 78px 1fr;
  gap: 6px 12px; margin: 0; font-size: 12px;
}
.dh-dl dt {
  color: var(--fg3); font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  padding-top: 3px;
}
.dh-dl dd { margin: 0; color: var(--fg1); font-size: 13px; }
.dh-dl dd.mono { font-family: var(--font-mono); font-size: 12px; }

.dh-contact { margin-bottom: 12px; }
.dh-contact__name {
  font-family: var(--font-head); font-weight: 600;
  font-size: 17px; letter-spacing: -0.01em;
}
.dh-contact__type {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg3); margin-top: 2px;
}

/* ── score card ── */
.dh-score__pill {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 2px 8px; border-radius: var(--radius);
}
.dh-score__pill--qualified  { background: rgba(46,125,80,0.14); color: #1f5e3a; }
.dh-score__pill--borderline { background: rgba(217,138,42,0.16); color: #8c5b1a; }
.dh-score__pill--early      { background: rgba(26,26,26,0.06); color: var(--fg3); }

.dh-score { display: flex; flex-direction: column; gap: 8px; }
.dh-score__num {
  display: flex; align-items: baseline; gap: 4px;
  font-family: var(--font-head); font-weight: 600;
  letter-spacing: -0.03em;
}
.dh-score__n { font-size: 36px; line-height: 1; color: var(--fg1); }
.dh-score__d { font-size: 14px; color: var(--fg3); font-weight: 500; }
.dh-score__bar {
  height: 6px; background: var(--bg-recessed);
  border-radius: var(--radius); overflow: hidden;
}
.dh-score__fill { height: 100%; transition: width 0.4s var(--ease-out); }
.dh-score__fill--qualified  { background: #2e7d50; }
.dh-score__fill--borderline { background: #d9882a; }
.dh-score__fill--early      { background: var(--fg3); }
.dh-score__sub { color: var(--fg3); }

.dh-disc {
  margin: 10px 0 0;
  font-size: 10px; line-height: 1.5;
  color: var(--fg3);
}

/* ── responsive ── */
@media (max-width: 1280px) {
  .dh-grid { grid-template-columns: 1fr; }
  .comm-workspace,
  .comm-home,
  .comm-settings { grid-template-columns: minmax(0, 1fr); }
  .comm-home__left { border-right: 0; border-bottom: 1px solid var(--stroke); }
  .comm-composer { position: static; }
  .dh-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .dh-side > .dh-card { flex: 1 1 240px; }
  .dh-launchers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .dh-step { grid-template-columns: repeat(6, minmax(56px, 1fr)); overflow-x: auto; }
  .dh-screening-fields,
  .dh-screening-field { grid-template-columns: minmax(0, 1fr); }
  .comm-panel__head { flex-direction: column; align-items: stretch; }
  .comm-panel__stats { min-width: 0; }
  .comm-toolbar { flex-direction: column; align-items: stretch; }
  .comm-toolbar__right { justify-content: flex-start; }
  .comm-home__actions { grid-template-columns: minmax(0, 1fr); }
  .comm-filter { justify-content: flex-start; }
  .dh-activity-filter { justify-content: flex-start; }
  .comm-email-row,
  .comm-editor__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  html,
  body,
  #root,
  .shell,
  .chrome,
  .shell__body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .chrome.chrome--top {
    overflow: visible;
    z-index: 80;
  }

  .shell {
    min-height: 100vh;
    height: auto;
  }

  .login-route {
    min-height: 100vh;
    height: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .login-route__brand,
  .login-route__panel {
    min-height: 0;
    padding: 28px 20px;
    border-left: 0;
    border-right: 0;
  }

  .login-route__copy h1 {
    font-size: 34px;
  }

  .chrome {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
  }

  .chrome--top {
    width: calc(100% - 12px);
    margin: 4px 6px 0;
    padding: 5px 6px;
    border-radius: 6px;
  }

  .chrome--top::before,
  .chrome--top::after {
    display: none;
  }

  .chrome__brand {
    flex: 0 0 auto;
  }

  .chrome--top .chrome__brand-text {
    display: none;
  }

  .chrome--top .bonsai-wordmark {
    --bonsai-wordmark-height: 15px !important;
  }

  .chrome__workdesk-wrap {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .chrome__workdesk-trigger {
    width: 100%;
    min-width: 0;
    height: 30px;
  }

  .chrome__workdesk-menu {
    left: 0;
    right: auto;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .chrome__tabs {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 2px;
  }

  .chrome__tab {
    flex: 0 0 auto;
    height: 28px;
    padding: 0 7px;
    font-size: 11px;
  }

  .chrome__tab.is-on::after {
    bottom: -3px;
  }

  .chrome__r {
    gap: 6px;
    margin-left: 0;
  }

  .chrome__btn,
  .chrome__avatar {
    width: 28px;
    height: 28px;
  }

  .chrome__user-meta {
    display: none;
  }

  .shell__body {
    display: block;
    height: auto;
    min-height: 0;
    padding: 8px;
  }

  .queue-rail,
  .queue-rail--mini,
  .rail-toggle {
    display: none !important;
  }

  .tool-pane {
    width: 100%;
    max-width: calc(100vw - 16px);
    min-height: 0;
    overflow: visible;
  }

  .tp-head,
  .tp-head--home {
    position: relative;
    top: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }

  .tp-head__title {
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .tp-head__l,
  .tp-head__meta,
  .dh-next__title,
  .dh-contact__name {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .tp-head__r {
    flex-wrap: wrap;
  }

  .tp,
  .tp-estimate2,
  .dh-wrap {
    padding: 16px;
  }

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

  .dh-launchers,
  .ep2-config__grid,
  .ep2-totalsbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .dh-side,
  .ep2-side {
    position: static;
    flex-direction: column;
  }

  .dh-stepwrap,
  .dh-next,
  .dh-card,
  .ep2-vers,
  .ep2-config,
  .ep2-route,
  .ep2-sidecard {
    min-width: 0;
  }

  .dh-step {
    grid-template-columns: repeat(6, minmax(88px, 1fr));
  }

  .ep2-vers__hd,
  .ep2-config__hd {
    flex-direction: column;
    align-items: stretch;
  }

  .ep2-vers__actions,
  .ep2-config__price {
    align-self: stretch;
    text-align: left;
  }

  .ep2-vers__item {
    grid-template-columns: 32px 72px minmax(0, 1fr);
    gap: 8px;
  }

  .ep2-vers__tot,
  .ep2-vers__live {
    grid-column: 3;
    justify-self: start;
    position: static;
  }

  .ep2-route__head,
  .ep2-cat__head,
  .ep2-cat__tools {
    flex-wrap: wrap;
  }
}

/* ── Banzai (dark) overrides ── */
[data-mode="banzai"] .dh-card,
[data-mode="banzai"] .dh-next,
[data-mode="banzai"] .tp-head--home {
  background: var(--bg-elevated);
  border-color: rgba(255,255,255,0.10);
}
[data-mode="banzai"] .dh-launch {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
}
[data-mode="banzai"] .dh-launch:hover { background: rgba(255,255,255,0.06); }
[data-mode="banzai"] .dh-launch.is-disabled { background: transparent; }
[data-mode="banzai"] .dh-launch.is-suggested {
  background: rgba(237,8,0,0.10);
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}
[data-mode="banzai"] .dh-launch__glyph { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
[data-mode="banzai"] .dh-launch__status { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7); }
[data-mode="banzai"] .dh-step__dot { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.10); color: rgba(255,255,255,0.55); }
[data-mode="banzai"] .dh-step__item--done .dh-step__dot { background: #fff; color: #141412; border-color: #fff; }
[data-mode="banzai"] .dh-step__bar { background: rgba(255,255,255,0.10); }
[data-mode="banzai"] .dh-step__item--done .dh-step__bar { background: rgba(255,255,255,0.50); }
[data-mode="banzai"] .dh-dl dd { color: rgba(255,255,255,0.92); }
[data-mode="banzai"] .dh-activity__what { color: rgba(255,255,255,0.92); }
[data-mode="banzai"] .dh-activity li { border-top-color: rgba(255,255,255,0.08); }
[data-mode="banzai"] .dh-score__bar { background: rgba(255,255,255,0.06); }
[data-mode="banzai"] .dh-score__n { color: #fff; }
[data-mode="banzai"] .dh-stepwrap__r { border-left-color: rgba(255,255,255,0.10); }
[data-mode="banzai"] .dh-home-tabs,
[data-mode="banzai"] .comm-action,
[data-mode="banzai"] .comm-toolbar,
[data-mode="banzai"] .comm-panel__stats span,
[data-mode="banzai"] .comm-home,
[data-mode="banzai"] .comm-home__actions button,
[data-mode="banzai"] .comm-home__recent,
[data-mode="banzai"] .comm-timeline-shell,
[data-mode="banzai"] .comm-composer,
[data-mode="banzai"] .comm-action-tabs,
[data-mode="banzai"] .comm-view-toggle,
[data-mode="banzai"] .comm-item,
[data-mode="banzai"] .comm-chat-card,
[data-mode="banzai"] .comm-chat-bubble,
[data-mode="banzai"] .comm-email-thread-card,
[data-mode="banzai"] .comm-email-message,
[data-mode="banzai"] .comm-settings__rail,
[data-mode="banzai"] .comm-editor,
[data-mode="banzai"] .comm-template-row {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.10);
}
[data-mode="banzai"] .comm-chat-viewport { background: rgba(255,255,255,0.02); border-top-color: rgba(255,255,255,0.10); }
[data-mode="banzai"] .comm-chat-row--outbound .comm-chat-bubble { background: #fff; border-color: #fff; color: #141412; }
[data-mode="banzai"] .comm-chat-row--outbound .comm-chat-bubble__meta { color: rgba(20,20,18,0.55); }
[data-mode="banzai"] .comm-email-thread-viewport { background: rgba(255,255,255,0.02); border-top-color: rgba(255,255,255,0.10); }
[data-mode="banzai"] .comm-email-rowlog--outbound .comm-email-message { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.18); }
[data-mode="banzai"] .comm-action textarea,
[data-mode="banzai"] .comm-action input,
[data-mode="banzai"] .comm-action select,
[data-mode="banzai"] .comm-field input,
[data-mode="banzai"] .comm-field textarea,
[data-mode="banzai"] .comm-field select,
[data-mode="banzai"] .comm-inline-input {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.92);
  border-color: rgba(255,255,255,0.10);
}
[data-mode="banzai"] .comm-filter button,
[data-mode="banzai"] .dh-activity-filter button,
[data-mode="banzai"] .comm-merge button {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.72);
}
[data-mode="banzai"] .dh-activity-filter button.is-on {
  background: #fff;
  border-color: #fff;
  color: #141412;
}
[data-mode="banzai"] .comm-item p,
[data-mode="banzai"] .comm-template-row strong { color: rgba(255,255,255,0.90); }
