/* ═════════════════════════════════════════════════════════════════════════════
   js/lead-detail-redesign.css — WIP-UI-LEAD-DETAIL-CLEANUP-01
   Lead detail page refresh. Classes are `ld-*` namespaced (lead-detail).

   All bubble / pulse animations are gated behind prefers-reduced-motion.
   ═════════════════════════════════════════════════════════════════════════════ */

@keyframes ld-pulse-overdue {
  0%, 100% { box-shadow: inset 3px 0 0 var(--red, #a16207), 0 0 0 0 rgba(250,204,21,.45); }
  70%      { box-shadow: inset 3px 0 0 var(--red, #a16207), 0 0 0 10px rgba(250,204,21,0); }
}
@keyframes ld-pulse-hot-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(21,128,61,.55), 0 0 0 2px var(--q-hot, #15803D); }
  70%      { box-shadow: 0 0 0 7px rgba(21,128,61,0), 0 0 0 2px var(--q-hot, #15803D); }
}
@media (prefers-reduced-motion: reduce) {
  .ld-page .focus-overdue,
  .ld-page .av.is-hot {
    animation: none !important;
  }
}

/* ── Page chassis ─────────────────────────────────────────────────────── */
.ld-page {
  padding: 4px 0 32px;
  font-family: var(--ff-sans, 'Archivo', system-ui, sans-serif);
}

/* ── Header ───────────────────────────────────────────────────────────── */
.ld-page .lh {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--s200, #E7E5E4);
  flex-wrap: wrap;
}
.ld-page .lh-l {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.ld-page .lh-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--s500, #78716C);
  padding: 5px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  letter-spacing: 0.02em;
  text-decoration: none;
  width: fit-content;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.ld-page .lh-back:hover {
  border-color: var(--ink, #0A0A0A);
  color: var(--ink, #0A0A0A);
}
.ld-page .lh-back .ico { color: var(--s400, #A8A29E); }
.ld-page .lh-h1-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.ld-page .lh-h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink, #0A0A0A);
  margin: 0;
  line-height: 1;
}
.ld-page .lh-h1-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.ld-page .lh-r {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Header chips ─────────────────────────────────────────────────────── */
.ld-page .ld-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--s100, #F5F5F4);
  color: var(--s700, #44403C);
  box-shadow: inset 0 0 0 1px var(--s200, #E7E5E4);
}
.ld-page .ld-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.ld-page .ld-chip-q.hot  { background: var(--ok-bg, #DCFCE7); color: var(--q-hot, #15803D); box-shadow: inset 0 0 0 1px var(--ok-border, rgba(21,128,61,.18)); }
.ld-page .ld-chip-q.warm { background: var(--warn-bg, #FEF3C7); color: var(--q-warm, #D97706); box-shadow: inset 0 0 0 1px var(--warn-border, rgba(146,64,14,.18)); }
.ld-page .ld-chip-q.cold { background: var(--s100, #F5F5F4); color: var(--s500, #78716C); }
.ld-page .ld-chip-status.New        { background: var(--info-bg, #DBEAFE); color: var(--info-fg, #1D4ED8); box-shadow: inset 0 0 0 1px rgba(29,78,216,.15); }
.ld-page .ld-chip-status.Contacted  { background: var(--warn-bg, #FEF3C7); color: var(--warn-fg, #92400E); }
.ld-page .ld-chip-status.Qualified  { background: var(--ok-bg, #DCFCE7); color: var(--ok-fg, #15803D); }
.ld-page .ld-chip-src {
  padding-left: 5px;
}
.ld-page .ld-chip-src .src-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  background: var(--src-fb, #1877F2);
  flex-shrink: 0;
}
.ld-page .ld-chip-src.google .src-mark { background: var(--src-google, #EA4335); }
.ld-page .ld-chip-src.facebook .src-mark { background: var(--src-fb, #1877F2); }
.ld-page .ld-chip-src.referral .src-mark { background: var(--src-ref, #15803D); }
.ld-page .ld-chip-src.trade .src-mark { background: var(--src-trade, #6D28D9); }
.ld-page .ld-chip-src.website .src-mark { background: var(--ink, #0A0A0A); }
.ld-page .ld-chip-src.phone .src-mark { background: var(--red, #a16207); }

/* ── Layout grid (left 320px + right flex) ───────────────────────────── */
.ld-page .ld-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) {
  .ld-page .ld-layout { grid-template-columns: 1fr; }
}

.ld-page .ld-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 110px;
  align-self: start;
  min-width: 0;
}
.ld-page .ld-rail > * {
  position: relative;
  width: 100%;
  flex-shrink: 0;
}
.ld-page .ld-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* ── Cards (shared) ──────────────────────────────────────────────────── */
/* WIP-UI-LEAD-DETAIL-FIX-01 §1 — every rail card explicit position:relative
   + flex-shrink:0 + width:100% so they tile cleanly inside the sticky rail
   and never overflow / overlap sibling cards. */
.ld-page .ld-card {
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-rest, 0 1px 2px rgba(10,10,10,.03));
  transition: box-shadow 180ms cubic-bezier(.4,0,.2,1);
  position: relative;
  flex-shrink: 0;
  width: 100%;
}
.ld-page .ld-card:hover {
  box-shadow: var(--shadow-hover, 0 1px 2px rgba(10,10,10,.04), 0 12px 28px -12px rgba(10,10,10,.18));
}
.ld-page .ld-card-h {
  padding: 13px 16px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--s100, #F5F5F4);
}
.ld-page .ld-card-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--s500, #78716C);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.ld-page .ld-card-title .ico { width: 13px; height: 13px; color: var(--s400, #A8A29E); }
.ld-page .ld-card-body { padding: 14px 16px; }

/* ── Summary card ─────────────────────────────────────────────────────── */
.ld-page .summary {
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-rest);
}
.ld-page .summary-h {
  padding: 18px 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ld-page .summary-av {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--fos-plate, #facc15);
  color: var(--fos-on-plate, #000);
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.ld-page .summary-av.is-hot { animation: ld-pulse-hot-ring 2s ease-in-out infinite; }
.ld-page .summary-meta { flex: 1; min-width: 0; }
.ld-page .summary-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink, #0A0A0A);
  letter-spacing: -0.015em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ld-page .summary-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--s500, #78716C);
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ld-page .summary-sub .ico { color: var(--ok-fg, #15803D); }
.ld-page .summary-rows {
  padding: 0 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ld-page .summary-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--s700, #44403C);
}
.ld-page .summary-row .ico { color: var(--s400, #A8A29E); flex-shrink: 0; }
.ld-page .summary-row .v {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.ld-page .summary-row .v a {
  color: var(--ink, #0A0A0A);
  text-decoration: none;
  font-weight: 700;
}
.ld-page .summary-row .v a:hover { text-decoration: underline; }
.ld-page .summary-row .call-it {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--fos-plate, #facc15);
  color: var(--fos-on-plate, #000);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(250,204,21,.2);
}
.ld-page .summary-row .call-it:hover {
  background: var(--fos-plate-hover, #eab308);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(250,204,21,.4);
}
.ld-page .summary-row .call-it .ico { color: var(--fos-on-plate, #000); width: 13px; height: 13px; }

/* Quick Actions */
.ld-page .quick-actions {
  padding: 0 16px 16px;
  border-top: 1px solid var(--s100, #F5F5F4);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ld-page .qa-primary {
  background: var(--fos-plate, #facc15);
  color: var(--fos-on-plate, #000);
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: -0.005em;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(250,204,21,.2), 0 4px 12px -3px rgba(250,204,21,.35);
}
.ld-page .qa-primary:hover {
  background: var(--fos-plate-hover, #eab308);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(250,204,21,.25), 0 8px 18px -4px rgba(250,204,21,.5);
}
.ld-page .qa-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.ld-page .qa-secondary {
  background: #fff;
  color: var(--s700, #44403C);
  border: 1px solid var(--s200, #E7E5E4);
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
  font-family: inherit;
}
.ld-page .qa-secondary:hover {
  border-color: var(--ink, #0A0A0A);
  color: var(--ink, #0A0A0A);
  transform: translateY(-1px);
  box-shadow: var(--shadow-rest);
}

/* Claim banner (when unassigned) */
.ld-page .claim-banner {
  margin: 0 16px 16px;
  padding: 11px 13px;
  background: var(--pale-red, #fefce8);
  border: 1px solid rgba(161,98,7,.18);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ld-page .claim-banner .ico { color: var(--red, #a16207); flex-shrink: 0; }
.ld-page .claim-mid { flex: 1; min-width: 0; }
.ld-page .claim-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--red, #a16207);
  letter-spacing: -0.005em;
}
.ld-page .claim-sub {
  font-size: 10.5px;
  color: var(--s600, #57534E);
  margin-top: 2px;
  font-weight: 600;
}
.ld-page .claim-btn {
  background: var(--fos-plate, #facc15);
  color: var(--fos-on-plate, #000);
  border: none;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.ld-page .claim-btn:hover { background: var(--fos-plate-hover, #eab308); }

/* ── Original Enquiry card ────────────────────────────────────────────── */
.ld-page .enquiry .enquiry-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ld-page .enquiry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.ld-page .enquiry-row .k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--s500, #78716C);
}
.ld-page .enquiry-row .v {
  color: var(--s700, #44403C);
  font-weight: 600;
  text-align: right;
}
.ld-page .enquiry-row .v b { color: var(--ink, #0A0A0A); font-weight: 800; }
.ld-page .enquiry-row .v .q {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--info-bg, #DBEAFE);
  color: var(--info-fg, #1D4ED8);
}
.ld-page .enquiry-foot {
  padding: 10px 16px;
  border-top: 1px dashed var(--s200, #E7E5E4);
  background: var(--s50, #FAFAF9);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--s500, #78716C);
  letter-spacing: 0.01em;
}
.ld-page .enquiry-foot b { color: var(--s700, #44403C); font-weight: 800; }

/* ── Smart cluster card ───────────────────────────────────────────────── */
.ld-page .cluster-card {
  background: linear-gradient(135deg, #fff 0%, var(--pale-red, #fefce8) 100%);
  border: 1px solid rgba(161,98,7,.15);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-rest);
}
.ld-page .cluster-card-h {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(161,98,7,.1);
}
.ld-page .cluster-card-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red, #a16207);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.ld-page .cluster-card-title .ico { width: 13px; height: 13px; }
.ld-page .cluster-list {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ld-page .cluster-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 180ms cubic-bezier(.4,0,.2,1);
}
.ld-page .cluster-row:hover { background: rgba(255,255,255,.6); }
.ld-page .cluster-q {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ld-page .cluster-q.hot  { background: var(--q-hot, #15803D); }
.ld-page .cluster-q.warm { background: var(--q-warm, #D97706); }
.ld-page .cluster-q.cold { background: var(--s400, #A8A29E); }
.ld-page .cluster-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink, #0A0A0A);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.ld-page .cluster-dist {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--red, #a16207);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.ld-page .cluster-cta {
  margin: 0 12px 12px;
  padding: 9px 11px;
  background: var(--ink, #0A0A0A);
  color: #fff;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.005em;
  font-family: inherit;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.ld-page .cluster-cta:hover {
  background: var(--fos-plate, #facc15);
  color: var(--fos-on-plate, #000);
  transform: translateY(-1px);
}

/* ── Details card ─────────────────────────────────────────────────────── */
.ld-page .details {
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-rest);
}
.ld-page .details-rows {
  padding: 4px 16px;
}
.ld-page .details-row {
  padding: 9px 0;
  border-bottom: 1px solid var(--s100, #F5F5F4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.ld-page .details-row:last-child { border-bottom: 0; }
.ld-page .details-row .k {
  font-size: 11px;
  color: var(--s500, #78716C);
  font-weight: 600;
}
.ld-page .details-row .v {
  font-size: 12px;
  font-weight: 700;
  color: var(--s700, #44403C);
  text-align: right;
}
.ld-page .details-row code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  background: var(--s50, #FAFAF9);
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--s700, #44403C);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

/* ── Labels card ──────────────────────────────────────────────────────── */
.ld-page .labels-add {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--red, #a16207);
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 5px;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.ld-page .labels-add:hover { background: var(--pale-red, #fefce8); }
.ld-page .labels-body { padding: 12px 16px; }
.ld-page .labels-empty {
  font-size: 11px;
  font-style: italic;
  color: var(--s400, #A8A29E);
  font-weight: 500;
}

/* ── Map card (160px) ─────────────────────────────────────────────────── */
/* WIP-UI-LEAD-DETAIL-FIX-01 §1 — explicit position:relative + flex-shrink:0
   so the card never floats over its siblings. Map pins are absolutely
   positioned but only inside `.map-wrap`. */
.ld-page .map-card {
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-rest);
  position: relative;
  flex-shrink: 0;
  width: 100%;
}
.ld-page .map-wrap {
  height: 160px;
  background: linear-gradient(135deg, #E8F0E5 0%, #DDE9D8 100%);
  position: relative;
  overflow: hidden;
}
.ld-page .map-wrap .map-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ld-page .map-wrap.map-img-failed {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--s500, #78716C);
  font-weight: 600;
}
.ld-page .map-wrap.map-img-failed::after {
  content: 'Map unavailable';
}
.ld-page .map-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 70%, rgba(255,255,255,.5) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(255,255,255,.4) 0%, transparent 45%);
}
.ld-page .map-pin {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  background: var(--warn-fg, #D97706);
  transform: rotate(-45deg) translate(-12px, -12px);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.ld-page .map-pin > span { transform: rotate(45deg); }
.ld-page .map-pin.is-hot { background: var(--q-hot, #15803D); }
.ld-page .map-pin.is-warm { background: var(--q-warm, #D97706); }
.ld-page .map-pin.is-cold { background: var(--s500, #78716C); }
.ld-page .map-pin.is-neighbour {
  width: 12px;
  height: 12px;
  border-width: 2px;
  transform: rotate(-45deg) translate(-6px, -6px);
}
.ld-page .map-foot {
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--s100, #F5F5F4);
  background: var(--s50, #FAFAF9);
  font-size: 11px;
  font-weight: 700;
  color: var(--s600, #57534E);
}
.ld-page .map-foot .ico { color: var(--s400, #A8A29E); margin-right: 4px; }
.ld-page .map-foot-r {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--red, #a16207);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.ld-page .map-foot-r:hover { background: var(--pale-red, #fefce8); }

/* ── Overdue focus banner ─────────────────────────────────────────────── */
.ld-page .focus-overdue {
  background: #fff;
  border: 1px solid rgba(161,98,7,.25);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-rest);
  position: relative;
}
.ld-page .focus-overdue::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--red, #a16207);
  animation: ld-pulse-overdue 1.6s ease-in-out infinite;
}
.ld-page .focus-overdue-body {
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, var(--pale-red, #fefce8) 0%, #fff 60%);
}
.ld-page .focus-overdue-ico {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--fos-plate, #facc15);
  color: var(--fos-on-plate, #000);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -2px rgba(250,204,21,.4);
}
.ld-page .focus-overdue-mid { flex: 1; min-width: 0; }
.ld-page .focus-overdue-eyebrow {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red, #a16207);
}
.ld-page .focus-overdue-eyebrow .sep { color: rgba(161,98,7,.3); margin: 0 4px; }
.ld-page .focus-overdue-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink, #0A0A0A);
  margin-top: 3px;
  letter-spacing: -0.015em;
}
.ld-page .focus-overdue-sub {
  font-size: 11px;
  color: var(--s500, #78716C);
  margin-top: 2px;
  font-weight: 600;
}
.ld-page .focus-overdue-sub b { color: var(--s700, #44403C); font-weight: 800; }
.ld-page .focus-overdue-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.ld-page .tabs-card {
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-rest);
}
.ld-page .tabs-row {
  display: flex;
  background: var(--s50, #FAFAF9);
  border-bottom: 1px solid var(--s200, #E7E5E4);
}
.ld-page .tab {
  flex: 1;
  background: none;
  border: none;
  padding: 13px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--s500, #78716C);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
  letter-spacing: -0.005em;
  font-family: inherit;
  border-bottom: 2px solid transparent;
}
.ld-page .tab:hover { color: var(--ink, #0A0A0A); }
.ld-page .tab.on {
  color: var(--ink, #0A0A0A);
  background: #fff;
  border-bottom-color: var(--red, #a16207);
}
.ld-page .tab .ico { width: 13px; height: 13px; }
.ld-page .tab-c {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--fos-plate, #facc15);
  color: var(--fos-on-plate, #000);
  letter-spacing: 0;
}
.ld-page .tab-c.green { background: var(--q-hot, #15803D); }
.ld-page .tab.on .tab-c { background: var(--fos-plate, #facc15); }
.ld-page .tab-body { padding: 16px 18px; }

/* ── Activity composer ────────────────────────────────────────────────── */
.ld-page .composer {
  padding: 0 0 16px;
  border-bottom: 1px solid var(--s100, #F5F5F4);
  margin-bottom: 14px;
}
.ld-page .composer-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--s500, #78716C);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.ld-page .action-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ld-page .action-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--s700, #44403C);
  cursor: pointer;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
  font-family: inherit;
  letter-spacing: -0.005em;
}
.ld-page .action-chip:hover {
  border-color: var(--ink, #0A0A0A);
  color: var(--ink, #0A0A0A);
  transform: translateY(-1px);
}
.ld-page .action-chip.on.primary {
  background: var(--fos-plate, #facc15);
  color: var(--fos-on-plate, #000);
  border-color: var(--red, #a16207);
  box-shadow: 0 1px 2px rgba(250,204,21,.2);
}
.ld-page .action-chip .ico { width: 12px; height: 12px; }
.ld-page .composer-input textarea {
  width: 100%;
  background: var(--s50, #FAFAF9);
  border: 1px solid var(--s200, #E7E5E4);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.4;
  min-height: 60px;
  color: var(--ink, #0A0A0A);
  resize: vertical;
  font-family: inherit;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.ld-page .composer-input textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--ink, #0A0A0A);
  box-shadow: 0 0 0 3px rgba(10,10,10,.05);
}
.ld-page .composer-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.ld-page .composer-foot-r {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ld-page .composer-hint {
  font-size: 10px;
  color: var(--s400, #A8A29E);
  font-weight: 600;
}
.ld-page .composer-hint b {
  background: var(--s100, #F5F5F4);
  color: var(--s700, #44403C);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

/* ── Timeline ─────────────────────────────────────────────────────────── */
.ld-page .timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ld-page .timeline-day {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--s400, #A8A29E);
  padding: 6px 0 2px;
  border-bottom: 1px dashed var(--s200, #E7E5E4);
  margin-top: 4px;
}
.ld-page .tl-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.ld-page .tl-ico-wrap { flex-shrink: 0; }
.ld-page .tl-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--s100, #F5F5F4);
  color: var(--s600, #57534E);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ld-page .tl-ico.overdue { background: var(--pale-red, #fefce8); color: var(--red, #a16207); }
.ld-page .tl-ico.task    { background: var(--info-bg, #DBEAFE); color: var(--info-fg, #1D4ED8); }
.ld-page .tl-ico.note    { background: var(--warn-bg, #FEF3C7); color: var(--warn-fg, #92400E); }
.ld-page .tl-ico.call-out { background: var(--ok-bg, #DCFCE7); color: var(--q-hot, #15803D); }
.ld-page .tl-ico.call-in  { background: var(--info-bg, #DBEAFE); color: var(--info-fg, #1D4ED8); }
.ld-page .tl-ico.sms     { background: var(--pale-red, #fefce8); color: var(--red, #a16207); }
.ld-page .tl-ico .ico { width: 13px; height: 13px; }
.ld-page .tl-mid { flex: 1; min-width: 0; }
.ld-page .tl-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.ld-page .tl-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink, #0A0A0A);
  letter-spacing: -0.005em;
}
.ld-page .tl-meta {
  font-size: 10.5px;
  color: var(--s400, #A8A29E);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ld-page .tl-body {
  font-size: 12px;
  color: var(--s600, #57534E);
  line-height: 1.5;
}
.ld-page .tl-tags { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.ld-page .tl-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--s100, #F5F5F4);
  color: var(--s600, #57534E);
}
.ld-page .tl-tag.overdue { background: var(--pale-red, #fefce8); color: var(--red, #a16207); }
.ld-page .tl-actions { display: flex; gap: 5px; margin-top: 7px; }
.ld-page .tl-action {
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--s600, #57534E);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.ld-page .tl-action:hover { border-color: var(--ink, #0A0A0A); color: var(--ink, #0A0A0A); }

/* ── Empty state (Conversations / Files) ──────────────────────────────── */
.ld-page .empty-state {
  text-align: center;
  padding: 40px 24px 32px;
}
.ld-page .empty-state .ico-lg { width: 32px; height: 32px; color: var(--s400, #A8A29E); }
.ld-page .empty-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink, #0A0A0A);
  margin-top: 10px;
  letter-spacing: -0.015em;
}
.ld-page .empty-sub {
  font-size: 12px;
  color: var(--s500, #78716C);
  font-weight: 500;
  margin-top: 4px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}
.ld-page .empty-actions {
  margin-top: 14px;
  display: inline-flex;
  gap: 7px;
}

/* ── Integrations card ────────────────────────────────────────────────── */
.ld-page .integrations {
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-rest);
}
.ld-page .integrations-h {
  padding: 13px 16px;
  border-bottom: 1px solid var(--s100, #F5F5F4);
}
.ld-page .integrations-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink, #0A0A0A);
  letter-spacing: -0.015em;
}
.ld-page .integrations-sub {
  font-size: 11px;
  color: var(--s500, #78716C);
  margin-top: 3px;
  font-weight: 600;
}
.ld-page .integrations-body {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 700px) {
  .ld-page .integrations-body { grid-template-columns: 1fr; }
}
.ld-page .integration-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  background: var(--s50, #FAFAF9);
  border-radius: 10px;
  border: 1px solid var(--s100, #F5F5F4);
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.ld-page .integration-card:hover {
  background: #fff;
  border-color: var(--s300, #D6D3D1);
}
.ld-page .integration-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  color: var(--s600, #57534E);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ld-page .integration-mid { flex: 1; min-width: 0; }
.ld-page .integration-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink, #0A0A0A);
  letter-spacing: -0.005em;
}
.ld-page .integration-status {
  font-size: 10.5px;
  color: var(--s500, #78716C);
  font-weight: 600;
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ld-page .integration-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--s400, #A8A29E);
}
.ld-page .integration-status.connected { color: var(--q-hot, #15803D); }
.ld-page .integration-status.connected .dot { background: var(--q-hot, #15803D); }
.ld-page .integration-cta {
  background: var(--ink, #0A0A0A);
  color: #fff;
  border: none;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.ld-page .integration-cta:hover { background: var(--s900, #1C1917); }
.ld-page .integration-card .integration-status.connected ~ .integration-cta {
  background: #fff;
  color: var(--s700, #44403C);
  border: 1px solid var(--s200, #E7E5E4);
}

/* ── Quotes tab (lead detail V2) ───────────────────────────────────────────
   Mirror of .dd2-page's .qt-* quote-row classes (deal-detail-v2-redesign.css)
   scoped to .ld-page instead — same visual language, kept as a duplicate
   block (matching this codebase's existing pattern of separate per-page-
   scoped stylesheets for deal vs lead detail) rather than sharing a
   selector across both page root classes. */
.ld-page .qt-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ld-page .qt-row:hover,
.ld-page .qt-row:focus-within {
  border-color: rgba(161, 98, 7, .4);
  box-shadow: 0 2px 6px rgba(28, 25, 23, .06), 0 10px 24px -12px rgba(250, 204, 21, .35);
  transform: translateY(-1px);
}
.ld-page .qt-row.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--red, #a16207);
}
.ld-page .qt-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--s100, #F5F5F4);
  color: var(--s600, #57534E);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background .15s ease, color .15s ease;
}
.ld-page .qt-ico .ico { width: 18px; height: 18px; }
.ld-page .qt-row:hover .qt-ico { background: var(--pale-red, #fefce8); color: var(--red, #a16207); }
.ld-page .qt-main { flex: 1; min-width: 0; }
.ld-page .qt-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink, #0A0A0A);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.ld-page .qt-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--s500, #78716C);
  margin-top: 2px;
}
.ld-page .qt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
}
.ld-page .qt-chip .ico { width: 10px; height: 10px; }
.ld-page .qt-chip-active {
  background: var(--pale-red, #fefce8);
  color: var(--red, #a16207);
  border: 1px solid rgba(161, 98, 7, .25);
}
.ld-page .qt-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.ld-page .qt-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--s600, #57534E);
  background: #fff;
  border: 1px solid var(--s200, #E7E5E4);
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.ld-page .qt-act .ico { width: 11px; height: 11px; }
.ld-page .qt-act:hover {
  border-color: var(--ink, #0A0A0A);
  color: var(--ink, #0A0A0A);
  background: var(--s50, #FAFAF9);
}
.ld-page .qt-act.qt-act-danger:hover {
  border-color: #FECACA;
  color: #B91C1C;
  background: #FEF2F2;
}
.ld-page .qt-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.ld-page .qt-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink, #0A0A0A);
  font-variant-numeric: tabular-nums;
}
/* A real <button> — the card's discrete keyboard/AT control. */
.ld-page .qt-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 800;
  font-family: inherit;
  padding: 4px 10px;
  border-radius: 7px;
  color: var(--red, #a16207);
  background: var(--pale-red, #fefce8);
  border: 1px solid rgba(161, 98, 7, .2);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ld-page .qt-open .ico { width: 11px; height: 11px; }
.ld-page .qt-open:focus-visible { outline: 2px solid var(--red, #a16207); outline-offset: 2px; }
.ld-page .qt-row:hover .qt-open,
.ld-page .qt-open:focus-visible {
  background: var(--fos-plate, #facc15);
  color: var(--fos-on-plate, #000);
  border-color: var(--red, #a16207);
}
.ld-page .qt-chev {
  width: 15px;
  height: 15px;
  color: var(--s300, #D6D3D1);
  flex: 0 0 auto;
  transition: color .15s ease, transform .15s ease;
}
.ld-page .qt-row:hover .qt-chev { color: var(--red, #a16207); transform: translateX(2px); }
@media (max-width: 640px) {
  .ld-page .qt-row { flex-wrap: wrap; }
  .ld-page .qt-side {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    padding-left: 52px;
    box-sizing: border-box;
  }
  .ld-page .qt-chev { display: none; }
}

/* ── Build Quote hero button (mirror of .dd2-page's .qa-cad, deal-detail-
   v2-redesign.css) — same gradient/shimmer/hover treatment scoped to
   .ld-page instead, duplicated per this codebase's existing convention
   rather than sharing a selector across both page root classes. The
   @keyframes dd2-shimmer it animates with is defined once in
   deal-detail-v2-redesign.css and is a global keyframe name (unscoped),
   so both pages reference the same one — nothing to duplicate there. */
.ld-page .qa-cad {
  background: linear-gradient(135deg, var(--fos-plate, #facc15) 0%, var(--fos-plate-hover, #eab308) 100%);
  color: var(--fos-on-plate, #000);
  border: 1px solid var(--red, #a16207);
  padding: 13px;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(250,204,21,.2), 0 8px 18px -4px rgba(250,204,21,.5);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  border-radius: 10px;
  font-family: inherit;
  width: 100%;
  transition: all 180ms cubic-bezier(.4,0,.2,1);
}
.ld-page .qa-cad::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: dd2-shimmer 3s infinite;
}
@media (prefers-reduced-motion: reduce) {
  .ld-page .qa-cad::before { animation: none !important; }
}
.ld-page .qa-cad:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(250,204,21,.25), 0 14px 26px -6px rgba(250,204,21,.6);
}
.ld-page .qa-cad .ico { width: 18px; height: 18px; position: relative; z-index: 1; color: var(--fos-on-plate, #000); }
.ld-page .qa-cad-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.ld-page .qa-cad-main {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.005em;
  color: var(--fos-on-plate, #000);
}
.ld-page .qa-cad-sub {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0,0,0,.62);
}
