/* Pipeline — Verve visual language.
   Acid Grotesk (self-hosted) + JetBrains Mono. White, flat, 6px corners. */

@font-face {
  font-family: "Acid Grotesk";
  src: url("/fonts/FFF-AcidGrotesk-Regular.woff2") format("woff2"),
       url("/fonts/FFF-AcidGrotesk-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Acid Grotesk";
  src: url("/fonts/FFF-AcidGrotesk-Medium.woff2") format("woff2"),
       url("/fonts/FFF-AcidGrotesk-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Acid Grotesk";
  src: url("/fonts/FFF-AcidGrotesk-ExtraBold.woff2") format("woff2"),
       url("/fonts/FFF-AcidGrotesk-ExtraBold.woff") format("woff");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface-alt: #f4f4f5;
  --surface-alt-strong: #ececee;
  --border: #e4e4e7;
  --accent: #84cc16;
  --text: #09090b;
  --text-muted: #52525b;
  --text-dim: #a1a1aa;
  --score-high: #46B770;
  --score-mid: #FEF254;
  --score-low: #FF316B;

  --font-body: "Acid Grotesk", Inter, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 6px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 32px;
}
.hdr-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hdr-logo {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hdr-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 2px;
}
.hdr-right { display: flex; align-items: center; gap: 14px; position: relative; }
.hdr-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 5px 9px;
  font-weight: 500;
  white-space: nowrap;
}
.hdr-nav { display: flex; gap: 4px; }
.hdr-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
}
.hdr-link:hover { background: var(--surface-alt); color: var(--text); }
.inline-form { display: inline; }

/* Avatar + user-menu */
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; display: block; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar-initials {
  display: grid;
  place-items: center;
  background: var(--text);
  color: #fafafa;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.user-wrap { position: relative; }
.user-menu {
  position: absolute;
  top: 44px;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 230px;
  z-index: 30;
  animation: menuIn 0.14s ease-out;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}
.user-menu-email {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  padding: 10px 12px 9px;
  border-bottom: 1px solid var(--surface-alt);
  margin-bottom: 4px;
  white-space: nowrap;
}
.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 9px 12px;
  cursor: pointer;
}
.user-menu-item:hover { background: var(--surface-alt); }

/* ---------- Layout ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 32px 80px;
}
.wrap-wide { max-width: 1180px; }
.wrap-narrow { max-width: 640px; }

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 8px 0 0;
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 28px;
}
.page-title {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}
.page-actions { display: flex; gap: 8px; align-items: center; }
.page-status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin: 8px 0 0;
}
.section-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 40px 0 16px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 40px 0 16px;
}
.section-head .section-title { margin: 0; }
.section-actions { display: flex; gap: 14px; align-items: center; }
.sep { opacity: 0.4; margin: 0 6px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-sm { font-size: 13px; padding: 8px 13px; }
.btn-primary { background: var(--text); color: #fafafa; }
.btn-primary:hover { background: #000; }
.btn-ghost { background: var(--surface-alt); color: var(--text); }
.btn-ghost:hover { background: var(--surface-alt-strong); }
.btn-danger-ghost {
  background: transparent;
  color: #b91c1c;
  font-size: 12px;
  padding: 8px 10px;
}
.btn-danger-ghost:hover { background: #fef1f2; }
.btn-link {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: 0;
  padding: 4px 2px;
  cursor: pointer;
  text-decoration: none;
}
.btn-link:hover { color: var(--text); }
.btn-link-danger { color: #b91c1c; }
.btn-link-danger:hover { color: #7f1d1d; }

/* ---------- Badges & priority ---------- */
.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 2px;
  color: #1a1a18;
  white-space: nowrap;
}
.badge-watching  { background: var(--surface-alt); color: var(--text-muted); }
.badge-active    { background: var(--score-high); }
.badge-upsell    { background: var(--accent); }
.badge-qualified { background: var(--score-mid); }
.badge-parked    { background: var(--surface-alt-strong); color: var(--text-muted); }
.badge-stale     { background: var(--score-low); }
.badge-hubspot   { background: var(--surface-alt); color: var(--text-dim); }

.prio {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.prio-high   { color: var(--text); font-weight: 500; }
.prio-medium { color: var(--text-muted); }

/* Staleness dot: tiny square with 2px radius, per house style */
.stale-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--score-low);
}
.stale-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--score-low);
  letter-spacing: 0.03em;
}

/* ---------- Dashboard rows ---------- */
.client-rows { display: flex; flex-direction: column; gap: 10px; }
.client-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) 1.4fr auto;
  column-gap: 20px;
  align-items: center;
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 18px 24px 18px 20px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease, transform 0.15s ease;
}
.client-row:hover { background: var(--surface-alt-strong); transform: translateY(-1px); }
.client-rows.is-archived .client-row { opacity: 0.6; }

.row-id { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-name { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.row-owner {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-top-opp { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row-opp-title {
  font-size: 13.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-opp-none {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.row-meta { display: flex; gap: 14px; align-items: center; justify-content: flex-end; }
.row-facts {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- Opportunity rows: one calm line, controls on hover ---------- */
.opp-rows { display: flex; flex-direction: column; gap: 6px; }
.opp-rows.is-dimmed .opp-row { opacity: 0.65; }
.opp-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(0, 1.35fr) 68px 96px 56px 74px;
  column-gap: 10px;
  align-items: center;
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 9px 14px 9px 30px;
  min-height: 46px;
}
.opp-value-cell { display: flex; justify-content: flex-end; }
.value-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  white-space: nowrap;
}
.value-text:hover { background: var(--surface-alt-strong); }
.value-text.is-empty {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  opacity: 0;
}
.opp-row:hover .value-text.is-empty, .value-text.is-empty:focus { opacity: 1; }
.value-text.is-empty:hover { color: var(--text); }
.value-input-inline { width: 60px; text-align: right; font-size: 12px; }
.value-static { font-size: 13px; font-weight: 500; color: var(--text-muted); }

/* Flash for a freshly added row: one yellow pulse, then settle */
@keyframes rowFlash {
  0%   { background: var(--score-mid); }
  60%  { background: var(--score-mid); }
  100% { background: var(--surface-alt); }
}
.opp-row.is-new { animation: rowFlash 1.8s ease-out 1; }
/* Owner: avatar + first name are the control — an invisible select sits on
   top, so a click opens the native picker and reassigns the deal */
.owner-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  min-width: 0;
}
.owner-first {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.owner-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  padding: 0;
  border: 0;
}
.owner-wrap:hover .opp-avatar { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 50%; }
.opp-avatar { display: inline-flex; width: 22px; height: 22px; flex: 0 0 auto; cursor: default; }
.opp-avatar img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; display: block; }
.opp-avatar-initials {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--text);
  color: #fafafa;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.opp-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.opp-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }

/* Star: a focus pin living in the row's left gutter, so it never shifts the
   title. Invisible until the row is hovered; gold and always shown when set. */
.star-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.opp-row:hover .star-btn { opacity: 0.45; }
.star-btn:hover { opacity: 1 !important; color: #e0a91b; }
.star-btn.is-starred { opacity: 1; color: #e0a91b; }
@media (hover: none) { .star-btn { opacity: 0.45; } }

.group-divider.is-star { color: #b5850f; }
.opp-rows.is-starred .opp-row { background: #fdfbe9; }
.opp-rows.is-starred .opp-row:hover { background: #fbf7d8; }
/* Client label on its own line above the title — titles align, labels
   don't push anything around */
.opp-client {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.opp-client:hover { color: var(--text); text-decoration: underline; }

/* Staleness: quiet age mark next to the title */
.stale-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--score-low);
  white-space: nowrap;
  cursor: default;
}
.opp-title {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 60px;
}
a.opp-title:hover { text-decoration: underline; }
a.opp-title:hover { text-decoration: underline; }
.opp-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opp-owner {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg);
  border-radius: 2px;
  padding: 3px 5px;
  cursor: default;
  white-space: nowrap;
}
.opp-value {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.opp-controls { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.opp-next { display: flex; gap: 6px; align-items: center; min-width: 0; }
.parked-note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Due date reads as text; the picker appears only when you click it */
.due-wrap { flex: 0 0 auto; display: inline-flex; align-items: center; }
.due-text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 4px 7px;
  cursor: pointer;
  white-space: nowrap;
}
.due-text:hover { background: var(--bg); color: var(--text); }
.due-text.is-overdue { color: var(--score-low); font-weight: 500; }
.due-text.is-empty { opacity: 0; }
.opp-row:hover .due-text.is-empty, .due-text.is-empty:focus { opacity: 1; }
.opp-next-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
/* Value: € and k sit inside one bordered field, so it reads as a single input */
.value-field {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
}
.value-field:focus-within { border-color: var(--text); }
.value-field input {
  border: 0;
  padding: 11px 0;
  background: transparent;
  width: 100%;
}
.value-field input:focus { border: 0; }
.value-affix { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); flex: 0 0 auto; }

/* Two-column form so the whole thing fits one screen */
.form-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.form-col { display: flex; flex-direction: column; gap: 22px; }
.field-grow { flex: 1; }
.field-grow textarea { flex: 1; min-height: 120px; height: 100%; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* Client combobox */
.combobox { position: relative; }
.combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 260px;
  overflow-y: auto;
}
.combo-item {
  padding: 9px 10px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}
.combo-item:hover, .combo-item.is-active { background: var(--surface-alt); }
.combo-create {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-ink, #4d7c0f);
  border-top: 1px solid var(--surface-alt);
  margin-top: 2px;
}

.group-divider {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 28px 0 10px;
  font-weight: 500;
}

.client-focus {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 8px;
}

/* Client top: intro card beside an updates panel (room for Slack/news later) */
.client-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}
.updates-card {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.updates-empty {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 8px 0 0;
}

/* Client intro card: owner + open value + activity at a glance */
.intro-card {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.intro-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
}
.intro-stat { display: flex; flex-direction: column; gap: 7px; }
.intro-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.intro-owner { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.intro-owner .opp-avatar { width: 24px; height: 24px; }
.intro-owner .opp-avatar img, .intro-owner .opp-avatar-initials { width: 24px; height: 24px; border-radius: 50%; }
.intro-value { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; line-height: 1; }
.intro-value-sm { font-size: 15px; font-weight: 500; }
.intro-focus {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.intro-focus .detail-label { margin: 0 0 8px; }
.intro-focus-text {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
}
.intro-focus-empty { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin: 0; }
.intro-focus-empty a { color: var(--text-muted); }

/* Note composer on the client timeline */
.note-form { display: flex; gap: 8px; margin-bottom: 16px; }
.note-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
}
.note-input:focus { border-color: var(--text); }
.note-form .btn { flex: 0 0 auto; }
.event-icon.is-note { background: var(--score-mid); color: #1a1a18; }
.event-text.is-note { color: var(--text); }

/* A note reads like a note: a soft card with a yellow edge, not a log line */
.note-card {
  background: #fdfce8;
  border: 1px solid #f2edb8;
  border-left: 3px solid var(--score-mid);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 4px 0;
}
.note-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.note-card-head .event-avatar { width: 20px; height: 20px; }
.note-card-head .event-avatar img,
.note-card-head .event-avatar .opp-avatar-initials { width: 20px; height: 20px; border-radius: 50%; }
.note-author { font-size: 12.5px; font-weight: 500; color: var(--text); }
.note-card-head .event-when { margin-left: auto; }
.note-card-body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}
/* Scope tag: which opportunity/level an entry belongs to. Quiet — the name
   is the signal, not the colour. */
.note-scope {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.note-scope-client { color: var(--text-dim); }
a.note-scope-opp:hover { color: var(--text); border-color: var(--text-dim); }

/* Timeline runs: a person's consecutive activity, quoted under one header. */
.tl-group { padding: 10px 0; }
.tl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tl-head .event-avatar { width: 22px; height: 22px; flex: 0 0 auto; }
.tl-head .event-avatar img, .tl-head .event-avatar .opp-avatar-initials {
  width: 22px; height: 22px; border-radius: 50%;
}
.tl-actor { font-size: 13px; font-weight: 500; color: var(--text); }
.tl-lines {
  margin-left: 10px;                 /* line sits under the avatar's centre */
  padding-left: 16px;
  border-left: 2px solid var(--border);   /* the quote rule */
}
.tl-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  min-height: 26px;
  padding: 3px 0;
}
.tl-text { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.tl-when {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  flex: 0 0 auto;
}
.tl-done { color: var(--score-high); font-weight: 700; margin-right: 6px; }

.banner-archived {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ---------- Inline editing ---------- */
.inline-select, .inline-input {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.inline-input:hover, .inline-input:focus {
  border-color: var(--border);
  background: var(--bg);
}
/* Selects (prio/status) get a compact, quiet hover that hugs the text —
   they shrink to their content and sit at the right edge of their cell */
.inline-select:hover, .inline-select:focus {
  background: var(--surface-alt-strong);
  border-color: transparent;
}
.prio-select, .status-select { width: auto; justify-self: end; }
.inline-select:disabled, .inline-input:disabled { opacity: 0.5; }
.inline-input { min-width: 0; flex: 1; }
.inline-date { flex: 0 0 auto; width: auto; font-family: var(--font-mono); font-size: 11.5px; }
.inline-date.is-overdue { color: var(--score-low); border-color: var(--score-low); }

/* Priority: quiet mono text, no native select chrome */
.prio-select {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--text-dim);
  appearance: none;
  -webkit-appearance: none;
  padding: 4px 6px;
  text-align: right;
}
.prio-select.prio-high { color: var(--text); font-weight: 500; }
.prio-select.prio-medium { color: var(--text-muted); }

/* ---------- Radar buckets & filter ---------- */
.group-divider.is-alert { color: var(--score-low); }
.group-count { opacity: 0.6; margin-left: 2px; }
.group-hint { text-transform: none; letter-spacing: 0; opacity: 0.7; font-weight: 400; }
.seg-filter {
  display: inline-flex;
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}
.seg-filter-opt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-filter-opt.is-on { background: var(--bg); color: var(--text); font-weight: 500; }
/* The teammate picker sits in the same segmented control as a quiet pill */
.owner-filter {
  border: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  max-width: 140px;
  text-overflow: ellipsis;
}
.sort-bar {
  display: flex;
  gap: 4px;
  align-items: baseline;
  margin: -10px 0 22px;
}
/* A caption, not a toggle — kept visually subordinate to the sort options so
   nobody mistakes it for a clickable button. */
.sort-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.65;
  margin-right: 12px;
  cursor: default;
  align-self: center;
}
.sort-opt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
}
.sort-opt:hover { color: var(--text); background: var(--surface-alt); }
.sort-opt.is-on { color: var(--text); background: var(--surface-alt); font-weight: 500; }

.parked-details summary { cursor: pointer; list-style: none; }
.parked-details summary::-webkit-details-marker { display: none; }
.parked-details summary::after { content: ' ▸'; opacity: 0.5; }
.parked-details[open] summary::after { content: ' ▾'; }
.opp-row.is-parked { opacity: 0.6; }

/* Type chip: what a deal IS — small, quiet, never colored like a phase */
.chip {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
}
.chip-new { background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); }
.chip-upsell { background: var(--accent); color: #1a1a18; }

/* Status: one quiet select like priority; only the color signals state */
.status-select {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding: 4px 6px;
  text-align: right;
}
.status-select.status-active { color: var(--score-high); font-weight: 500; }
.status-select.status-watching { color: var(--text-muted); }
.status-select.status-paused { color: var(--text-dim); }
@media (hover: none) {
  /* No hover on touch — reveal the "+ date" prompt and the row actions. */
  .due-text.is-empty { opacity: 1; }
  .opp-actions { opacity: 1; }
}

/* Next-step check: THE core action. Square with radius, house style. */
.step-check {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--text-dim);
  border-radius: 3px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.step-check:hover { border-color: var(--accent); background: #f5fbe1; }

/* Client index: compact reachability for accounts without open deals */
.client-index {
  margin-top: 48px;
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
  align-items: baseline;
}
.client-index.is-archived { margin-top: 12px; opacity: 0.65; }
.client-index-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}
.client-index-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.client-index-link:hover { color: var(--text); text-decoration: underline; }
.client-index-link.is-toggle {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

/* Recap: promises per person */
.recap-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.recap-col-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 10px;
}
.recap-col-title.is-kept { color: var(--score-high); }
.recap-col-title.is-broken { color: var(--score-low); }
.recap-col-title.is-open { color: var(--score-low); }
.recap-col-title-done { margin-top: 30px; }

/* Done: same wide-row look as the editable blocks, but read-only — a green
   ✓ sits in the left gutter (where the star lives on live rows). */
.recap-done-row { grid-template-columns: minmax(240px, 1.2fr) minmax(0, 1.5fr) 150px 66px; }
.done-check {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--score-high);
  font-weight: 700;
  font-size: 13px;
}
.recap-done-step {
  color: var(--text-muted);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recap-done-actor { display: flex; align-items: center; gap: 8px; min-width: 0; }
.recap-done-when {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-align: right;
  white-space: nowrap;
}
.recap-person { margin-bottom: 20px; }
.person-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}
.person-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text);
}
.person-name.is-alert {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--score-low);
}
.person-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}
.recap-all-set {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  background: #f5fbe1;
  border: 1px solid #d4ee9e;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 18px;
}
.recap-line {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13px;
}
.recap-line:nth-of-type(odd) { background: var(--surface-alt); }
.recap-line-client {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  margin-right: 5px;
}
.recap-line-client:hover { color: var(--text); }
.recap-line-text { color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-line-text strong { color: var(--text); font-weight: 500; }
.recap-opp-link { color: var(--text); text-decoration: none; }
.recap-opp-link:hover { text-decoration: underline; }
.dim-note { color: var(--text-dim); }
.event-icon.is-open { background: #fef1f2; border: 1px solid #fecdd3; }
.event-icon.is-alert { background: var(--score-low); }

/* ---------- Opportunity detail ---------- */
.opp-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.opp-detail-card { padding: 16px 20px; }
.detail-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 8px;
  font-weight: 500;
}
.detail-value { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.detail-value-sm { font-size: 14px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.03em; }
.notes-card { white-space: pre-wrap; font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.page-title .chip { vertical-align: middle; margin-left: 8px; }
.page-status .opp-avatar { vertical-align: -6px; margin-right: 4px; }
.due-text.always-visible { opacity: 1; }

/* ---------- Event list (opportunity detail): who did what ---------- */
.event-list { display: flex; flex-direction: column; }
.event-row {
  display: grid;
  grid-template-columns: 20px 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 4px;
}
.event-row:nth-child(odd) { background: var(--surface-alt); }
.event-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  background: var(--surface-alt-strong);
  color: var(--text-dim);
}
.event-icon.is-done { background: var(--score-high); color: #1a1a18; }
.event-icon.is-created { background: var(--accent); color: #1a1a18; }
.event-icon.is-hubspot { background: var(--text); color: #fafafa; }
.event-avatar { display: inline-flex; width: 20px; height: 20px; }
.event-avatar img, .event-avatar .opp-avatar-initials { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.event-avatar .opp-avatar-initials { font-size: 7.5px; }
.event-body { min-width: 0; font-size: 13.5px; line-height: 1.45; }
.event-actor { font-weight: 500; color: var(--text); margin-right: 5px; }
.event-text { color: var(--text-muted); }
.event-when {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  cursor: default;
}

/* ---------- Changelog ---------- */
.changelog-entry { margin-bottom: 36px; }
.changelog-date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 4px;
}
.changelog-title { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 10px; }
.changelog-items { margin: 0; padding-left: 18px; }
.changelog-items li { font-size: 13.5px; color: var(--text-muted); line-height: 1.65; }
.new-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  margin-left: 5px;
  vertical-align: 2px;
}

/* HubSpot hand-offs on the radar: read-only reference rows */
.opp-row.hs-row { grid-template-columns: minmax(250px, 1.2fr) 1fr 76px; }
.hs-moved {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

/* ---------- Admin ---------- */
.admin-table { display: flex; flex-direction: column; }
.admin-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 90px 70px 60px 110px 110px;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
}
.admin-row:nth-child(even) { background: var(--surface-alt); }
.admin-head {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: none !important;
}
.admin-num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-head .admin-num { text-align: right; }
.admin-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-person .opp-avatar { width: 28px; height: 28px; }
.admin-person .opp-avatar img, .admin-person .opp-avatar-initials { width: 28px; height: 28px; border-radius: 50%; }
.admin-person-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.admin-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-email {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-when {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.role-chip {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 2px;
  background: var(--surface-alt-strong);
  color: var(--text-muted);
}
.role-chip.is-admin { background: var(--accent); color: #1a1a18; }
.admin-note {
  margin-top: 28px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
}
.admin-note code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-alt);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 2px; }
.timeline-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 4px;
  align-items: baseline;
}
.timeline-row:nth-child(odd) { background: var(--surface-alt); }
.timeline-when {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.timeline-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }

/* ---------- Recap ---------- */
.week-nav { display: flex; gap: 6px; align-items: center; }
.week-nav .is-current { background: var(--text); color: #fafafa; }
.week-arrow { padding: 8px 12px; }
.week-arrow.is-disabled { opacity: 0.35; cursor: default; }

.focus-rows { display: flex; flex-direction: column; gap: 8px; }
.focus-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) auto 1.4fr;
  column-gap: 20px;
  align-items: center;
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease, transform 0.15s ease;
}
.focus-row:hover { background: var(--surface-alt-strong); transform: translateY(-1px); }
.focus-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.focus-client {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.focus-title { font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em; }
.focus-badges { display: flex; gap: 10px; align-items: center; }
.focus-next { display: flex; gap: 10px; align-items: baseline; min-width: 0; justify-content: flex-end; }
.focus-step {
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.focus-step-missing { color: var(--text-dim); font-style: italic; }
.focus-due {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.focus-due.is-overdue { color: var(--score-low); font-weight: 500; }

/* Each moved-opportunity is its own quiet card, so consecutive deals read as
   distinct blocks instead of blurring together. */
.recap-group {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 14px 18px 8px;
  margin-bottom: 10px;
}
.recap-client {
  display: inline-block;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 6px;
}
.recap-client:hover { text-decoration: underline; }
/* Secondary line next to the group heading (the client under a deal, or the
   "client-level" tag). Quiet, so the deal title stays the anchor. */
.recap-group-sub {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 8px;
}
a.recap-group-sub:hover { color: var(--text-muted); text-decoration: underline; }

/* ---------- Empty states ---------- */
.empty {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
}
.empty-slim { padding: 32px; }
.empty-title { font-size: 18px; font-weight: 500; margin: 0 0 8px; }
.empty-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 460px;
  margin: 0 auto;
}
.empty .btn { margin-top: 20px; }
.muted-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.field .optional {
  margin-left: 6px;
  text-transform: lowercase;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
input[type="text"], input[type="email"], input[type="date"], select, textarea {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  width: 100%;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="date"]:focus,
select:focus, textarea:focus {
  border-color: var(--text);
}
textarea { resize: vertical; line-height: 1.5; }
/* Inline controls opt out of the full-width form-input defaults above:
   they read as plain text until hovered or focused */
input.inline-input {
  width: auto;
  padding: 5px 8px;
  font-size: 13px;
  background: transparent;
  border-color: transparent;
}
input.inline-input:hover, input.inline-input:focus {
  background: var(--bg);
  border-color: var(--border);
}
input.inline-date { flex: 0 0 auto; }
.opp-next .step-input { flex: 1; min-width: 0; text-overflow: ellipsis; }
.opp-next.is-missing .step-input::placeholder { color: var(--score-low); opacity: 0.8; }
.form-actions { display: flex; gap: 8px; margin-top: 6px; }
.form-error {
  background: #fef1f2;
  border: 1px solid #fecdd3;
  color: #b91c1c;
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 13.5px;
  margin-bottom: 20px;
}

/* ---------- AI: paste → opportunities ---------- */
/* A small, consistent "this came from AI" mark, so a human always knows what
   to double-check. Purple sets it apart from the app's lime accent. */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6d28d9;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 4px;
  padding: 3px 6px;
  vertical-align: middle;
  margin-left: 8px;
}
.ai-badge-sm { margin-left: 0; padding: 1px 4px; border: 0; background: none; }

/* "New opportunity" reveals Paste as an extra option on hover/focus. The
   primary button still adds manually; the menu is complementary. */
.opp-add { position: relative; display: inline-flex; }
.opp-add-caret { margin-left: 7px; font-size: 10px; opacity: 0.75; }
.opp-add-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 30;
  width: 296px; /* anchor the width: an absolute box won't honour the panel's min-width */
  padding-top: 4px; /* transparent bridge so hover survives the gap */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}
.opp-add:hover .opp-add-menu,
.opp-add:focus-within .opp-add-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.opp-add-panel {
  display: block; /* it's a <span>; without this the border fragments around the block link */
  background: var(--bg);
  border: 1px solid #d4d4d8;
  border-radius: var(--radius);
  padding: 5px;
}
.opp-add-alt {
  display: block;
  padding: 10px 12px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
}
.opp-add-alt:hover { background: var(--surface-alt); }
.opp-add-alt-title { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 3px; }
.opp-add-alt-sub { display: block; font-size: 11.5px; color: var(--text-dim); line-height: 1.4; }

/* Small "beta" tag, same family as the ✨ AI badge. */
.beta-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6d28d9;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.paste-form { display: flex; flex-direction: column; gap: 12px; }
.paste-box {
  width: 100%;
  min-height: 260px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  resize: vertical;
}
.paste-box:focus { outline: none; border-color: var(--text); }
.paste-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.paste-hint { font-size: 12.5px; color: var(--text-dim); }

/* Button loading state: swap the label for three bouncing dots and lock it. */
.btn-dots { display: none; align-items: center; gap: 5px; }
.btn.is-loading { pointer-events: none; min-width: 84px; justify-content: center; }
.btn.is-loading .btn-label { display: none; }
.btn.is-loading .btn-dots { display: inline-flex; }
.btn-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  animation: btn-bounce 0.6s infinite ease-in-out both;
}
.btn-dots i:nth-child(1) { animation-delay: -0.24s; }
.btn-dots i:nth-child(2) { animation-delay: -0.12s; }
@keyframes btn-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-dots i { animation: none; opacity: 0.6; }
}

.paste-client { padding: 18px 20px; margin-bottom: 26px; display: flex; flex-direction: column; gap: 16px; }
.paste-client-note { font-size: 12.5px; color: var(--text-dim); margin: 0; }

/* One suggestion, one card. Unticking dims it so it's clear it won't be made. */
.paste-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: opacity 0.15s ease;
}
.paste-card.is-off { opacity: 0.45; }
.paste-card.is-dup { border-color: #f59e0b; background: #fffbeb; }
.dup-warn {
  font-size: 12.5px;
  color: #92400e;
  background: #fef3c7;
  border-radius: var(--radius);
  padding: 9px 12px;
  margin: 0;
  line-height: 1.45;
}
.dup-warn a { color: #92400e; font-weight: 500; }
.paste-card-head { display: flex; align-items: center; gap: 12px; cursor: default; }
.paste-include { width: 18px; height: 18px; flex: 0 0 auto; accent-color: #6d28d9; cursor: pointer; }
.paste-title-input {
  flex: 1;
  font-size: 15px !important;
  font-weight: 500;
  padding: 8px 10px !important;
}
.paste-card-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr 0.9fr; gap: 14px; }
.paste-card-grid-2 { grid-template-columns: 2fr 1fr; }
/* A .field carries display:flex, which beats the browser's [hidden]{display:none};
   this makes the hidden attribute actually hide a field (e.g. new-client name). */
.field[hidden] { display: none; }
.ai-rationale {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: #faf9ff;
  border-radius: var(--radius);
  padding: 9px 12px;
  margin: 0;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .paste-card-grid, .paste-card-grid-2 { grid-template-columns: 1fr 1fr; }
}

/* ---------- Suggestions (Slack) ---------- */
.nav-badge {
  display: inline-block;
  min-width: 16px;
  padding: 0 5px;
  margin-left: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: var(--score-low);
  border-radius: 8px;
  vertical-align: middle;
}
.sugg-scaninfo {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  margin: 6px 0 0;
}

/* One suggestion = one tight card. Title reads as the headline; the Slack
   source and the fields sit compact underneath. */
/* Grey rounded card, same family as the radar rows — the identity block
   (client label over a bold title) mirrors an opp-row; the extra info and
   editable fields live underneath. */
.sugg-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 15px 18px;
  margin-bottom: 10px;
}
.sugg-head { display: flex; align-items: flex-start; gap: 12px; }
.sugg-ident { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
/* Client reads as the mono label from the radar rows, but stays editable. */
.sugg-client-input {
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  width: auto;
  padding: 2px 5px !important;
  margin-left: -5px;
  border-color: transparent !important;
  background: transparent !important;
}
.sugg-client-wrap { display: inline-flex; align-items: center; gap: 4px; }
.sugg-client-flag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}
.sugg-client-flag.is-existing { color: #4d7c0f; background: #f5fbe1; }
.sugg-client-flag.is-new { color: #6d28d9; background: #f5f3ff; }
.sugg-title-input {
  font-size: 15px !important;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 4px 6px !important;
  margin-left: -6px;
  border-color: transparent !important;
  background: transparent !important;
}
.sugg-client-input:hover, .sugg-title-input:hover { background: var(--surface-alt-strong) !important; }
.sugg-client-input:focus, .sugg-title-input:focus { background: var(--bg) !important; border-color: var(--text) !important; }
.sugg-source-meta {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}
.sugg-source-meta a { color: var(--accent-ink, #4d7c0f); text-decoration: none; }
.sugg-source-meta a:hover { text-decoration: underline; }

.sugg-quote {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 8px 11px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}
.sugg-quote-tag { flex: 0 0 auto; }
.sugg-excerpt {
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sugg-grid { display: grid; gap: 10px; }
.sugg-grid-lite { grid-template-columns: 1.2fr 0.8fr 2.4fr; }
.sugg-card .field { gap: 5px; }
.sugg-card .field label { font-size: 9px; letter-spacing: 0.07em; }
.sugg-card .field > select,
.sugg-card .field > input {
  padding: 7px 9px;
  font-size: 13px;
}
.sugg-foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }

@media (max-width: 720px) {
  .sugg-grid-lite { grid-template-columns: 1fr 1fr; }
}

/* Admin: watched Slack channels */
.slack-chan-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.slack-chan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius);
}
.slack-chan-name { font-weight: 500; }
.slack-chan-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-left: auto; }
.slack-chan-add { display: flex; gap: 8px; max-width: 520px; }
.slack-chan-add input { flex: 1; }

/* ---------- Toasts: quiet notices, bottom-left ---------- */
/* A single confetti bit — tiny square that flies out from the ticked box
   (JS positions + animates each one). */
.confetti-bit {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 60;
  will-change: transform, opacity;
}

.toast-wrap {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toast {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  opacity: 1;
  transition: opacity 0.15s ease;
}
.toast-error { background: #fef1f2; border-color: #fecdd3; color: #b91c1c; }
.toast.is-leaving { opacity: 0; }

/* ---------- Login / 404 ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.login-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px;
}
.login-logo {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.025em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.login-sub { font-size: 14.5px; color: var(--text-muted); margin: 0; max-width: 320px; line-height: 1.5; }
.login-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin: 0;
}
.btn-google { margin-top: 8px; }
.notfound-code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin: 0;
}
.login-foot { padding-bottom: 8px; }

/* ---------- Footer ---------- */
.app-foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px 32px;
  display: flex;
  gap: 16px;
}
.foot-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.foot-meta a { color: var(--text-dim); }

/* Mid-size windows: the next step gets its own full-width line instead of
   being squeezed between the fixed right-hand columns */
@media (max-width: 1080px) {
  .opp-row { grid-template-columns: minmax(0, 1fr) 68px 96px 56px 74px; }
  .opp-next { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Motion ---------- */
/* A subtle settle of the DATA on load — the list/cards fade in while the
   header, breadcrumb, page title and section labels stay put. Opacity only,
   nothing slides. Auto-disabled by the reduced-motion rule below. */
@keyframes contentFade { from { opacity: 0; } to { opacity: 1; } }
.opp-rows, .event-list, .intro-card, .recap-cols, .recap-group,
.recap-person, .client-index, .timeline, .changelog-entry {
  animation: contentFade 0.16s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .hdr { padding: 16px 20px; }
  .hdr-pill { display: none; }
  .wrap { padding: 8px 20px 60px; }
  .page-head { flex-direction: column; }
  .page-title { font-size: 27px; }
  .client-row { grid-template-columns: 1fr; row-gap: 10px; padding: 16px 18px; }
  .row-meta { justify-content: flex-start; }
  /* Opportunity row on mobile: title and next step each get their own full
     line; value, owner, priority and status flow together on a meta line. */
  .opp-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 14px 16px;
  }
  .opp-main { flex: 1 1 100%; }
  .opp-next { flex: 1 1 100%; }
  .opp-value-cell { flex: 0 0 auto; justify-content: flex-start; }
  .owner-wrap { flex: 0 0 auto; }
  /* value + owner sit left, priority + status pushed to the right edge */
  .prio-select, .status-select { justify-self: auto; }
  .prio-select { margin-left: auto; }
  /* Narrow screens: hover-to-reveal is awkward. Show the "+ date" prompt
     (it lives on the full-width next-step line) but drop the "+ budget"
     prompt from the meta line to avoid clutter and a reserved gap — budget
     stays editable via the edit page. */
  .due-text.is-empty { opacity: 1; }
  .opp-value-cell:has(.value-text.is-empty) { display: none; }
  .opp-detail-grid { grid-template-columns: 1fr; }
  .client-top { grid-template-columns: 1fr; }
  .sort-bar { flex-wrap: wrap; margin-top: 0; }
  .recap-cols { grid-template-columns: 1fr; }
  .page-actions { flex-wrap: wrap; }
  .focus-row { grid-template-columns: 1fr; row-gap: 8px; }
  .focus-next { justify-content: flex-start; }
  .field-row { grid-template-columns: 1fr; }
  .form-split { grid-template-columns: 1fr; gap: 22px; }
  .field-row-3 { grid-template-columns: 1fr; }
  .timeline-row { grid-template-columns: 1fr; gap: 2px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .recap-filter { flex-wrap: wrap; }
}
