/* =====================================================================
   Sinatra Labs — B40 Lead — Grayscale-02 iteration
   Direction: contemporary monochrome luxury / editorial restraint.
   References: One&Only · Hodbourg-Wagner · Hyphen · Aesthetics.
   Strategy: grayscale baseline, single warm accent revealed only on action.
   ===================================================================== */

:root {
  /* ---------- Console (left, charcoal-to-near-black) ---------- */
  --b40-lead-coal: #0c0c0e;          /* deepest void */
  --b40-lead-coal-2: #131418;        /* console base */
  --b40-lead-coal-3: #1c1d22;        /* console hi */
  --b40-lead-coal-4: #25272d;        /* card / chip on coal */
  --b40-lead-coal-line: rgba(245, 245, 247, 0.08);
  --b40-lead-coal-line-strong: rgba(245, 245, 247, 0.14);
  --b40-lead-coal-grid: rgba(245, 245, 247, 0.035);

  /* ---------- Offer (right, pale silver / off-white) ---------- */
  --b40-lead-paper: #f3f4f6;         /* base wash */
  --b40-lead-paper-2: #ebecef;       /* shadow band */
  --b40-lead-paper-3: #e3e5e9;       /* deeper shadow */
  --b40-lead-paper-hi: #fafbfc;      /* highlight */

  /* ---------- Ink ---------- */
  --b40-lead-ink: #131418;           /* primary text on paper */
  --b40-lead-ink-2: #2a2c33;         /* sub-headline / list head */
  --b40-lead-ink-3: #4a4d56;         /* body */
  --b40-lead-ink-4: #6c6f78;         /* muted */
  --b40-lead-ink-5: #94969d;         /* faint / placeholder */
  --b40-lead-ink-line: rgba(19, 20, 24, 0.10);
  --b40-lead-ink-line-soft: rgba(19, 20, 24, 0.05);

  /* ---------- Foreground on coal ---------- */
  --b40-lead-bone: #f5f5f7;          /* primary text on coal */
  --b40-lead-bone-2: #d8d8dc;        /* secondary */
  --b40-lead-bone-3: #a8a9b0;        /* muted */
  --b40-lead-bone-4: #74757c;        /* faint */

  /* ---------- The single accent (action only) ----------
     Warm desaturated copper-ember. NOT amber, NOT blue.
     Used on: composer focus ring, send hover, CTA hover, ghost hover,
     status pill (only persistent surface, in its lowest-saturation form),
     starter-message reveal underline. */
  --b40-lead-ember: #b6754f;          /* warm copper, full */
  --b40-lead-ember-soft: #c98e6c;     /* lighter */
  --b40-lead-ember-deep: #8f5639;     /* deeper */
  --b40-lead-ember-glow: rgba(182, 117, 79, 0.22);
  --b40-lead-ember-glow-faint: rgba(182, 117, 79, 0.10);
  --b40-lead-ember-on-coal: #d39575;  /* lifted for dark bg legibility */

  /* ---------- Composer fade gradients ---------- */
  --b40-lead-coal-fade-0: rgba(12, 12, 14, 0);
  --b40-lead-coal-fade-1: rgba(12, 12, 14, 0.78);
  --b40-lead-coal-fade-2: rgba(12, 12, 14, 0.96);

  /* ---------- Shadows ---------- */
  --b40-lead-shadow-deep:
    0 32px 90px rgba(0, 0, 0, 0.55),
    0 8px 22px rgba(0, 0, 0, 0.34);
  --b40-lead-shadow-mid:
    0 18px 56px rgba(0, 0, 0, 0.40),
    0 4px 12px rgba(0, 0, 0, 0.26);
  --b40-lead-shadow-paper:
    0 18px 50px rgba(19, 20, 24, 0.07),
    0 2px 6px rgba(19, 20, 24, 0.04);
  --b40-lead-shadow-cta:
    0 14px 36px rgba(19, 20, 24, 0.18),
    0 2px 6px rgba(19, 20, 24, 0.12);
  --b40-lead-shadow-cta-hover:
    0 22px 50px rgba(143, 86, 57, 0.20),
    0 4px 10px rgba(19, 20, 24, 0.20);

  /* ---------- Type-system locals ---------- */
  --b40-lead-display: var(--font-display);   /* Fraunces */
  --b40-lead-body: var(--font-body);          /* Inter */
  --b40-lead-mono: var(--font-mono);          /* JetBrains Mono */

  --b40-lead-clear: rgba(255, 255, 255, 0);
}

/* =====================================================================
   Page reset
   ===================================================================== */

html {
  overflow-x: hidden;
}

.b40-lead-page {
  box-sizing: border-box;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: var(--b40-lead-coal);
  color: var(--b40-lead-ink);
  font-family: var(--b40-lead-body);
  font-feature-settings: "ss01", "kern", "liga", "calt";
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.b40-lead-page *,
.b40-lead-page *::before,
.b40-lead-page *::after {
  box-sizing: inherit;
}

.b40-lead-shell {
  min-height: 100vh;
  background: var(--b40-lead-coal);
}

.b40-lead-split {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 40fr) minmax(0, 60fr);
  overflow: hidden;
  background: var(--b40-lead-coal);
}

.b40-lead-room,
.b40-lead-offer {
  min-width: 0;
  min-height: 0;
}

/* =====================================================================
   LEFT — console (charcoal, dimensional grayscale)
   ===================================================================== */

.b40-lead-room {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 90% at 18% 12%,
      var(--b40-lead-coal-3) 0%,
      var(--b40-lead-coal-2) 38%,
      var(--b40-lead-coal) 100%),
    linear-gradient(180deg,
      var(--b40-lead-coal-2) 0%,
      var(--b40-lead-coal) 100%);
}

.b40-lead-room::before {
  /* faint vignette frame — Hodbourg-Wagner flatness with depth */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%,
      rgba(0, 0, 0, 0.45) 0%,
      transparent 60%);
  mix-blend-mode: multiply;
}

.b40-lead-console {
  position: relative;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  color: var(--b40-lead-bone);
}

/* film-grain noise overlay — tiny inline SVG, low opacity */
.b40-lead-console__grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.95  0 0 0 0 0.95  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

/* warm rim-light radial — single accent in baseline, very subtle */
.b40-lead-console__rim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 38% at 92% 88%,
      var(--b40-lead-ember-glow-faint) 0%,
      transparent 60%);
}

.b40-lead-console__topbar {
  position: relative;
  z-index: 1;
  min-height: 60px;
  padding-top: max(clamp(20px, 3vh, 30px), env(safe-area-inset-top));
  padding-right: max(clamp(22px, 3.4vw, 56px), env(safe-area-inset-right));
  padding-bottom: 0;
  padding-left: max(clamp(22px, 3.4vw, 56px), env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.b40-lead-console__path {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--b40-lead-bone-2);
  font-family: var(--b40-lead-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.2;
  min-width: 0;
  white-space: nowrap;
}

.b40-lead-console__path em {
  font-style: normal;
  margin: 0 2px;
  color: var(--b40-lead-bone-4);
}

.b40-lead-console__path span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.b40-lead-console__folder {
  position: relative;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 1px solid var(--b40-lead-bone-3);
  color: var(--b40-lead-bone-3);
  background: transparent;
}

.b40-lead-console__folder::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid currentColor;
  opacity: 0.6;
}

.b40-lead-console__index {
  font-family: var(--b40-lead-display);
  font-style: italic;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--b40-lead-bone-3);
  font-variation-settings: "opsz" 14;
}

/* ---------- thread ---------- */

.b40-lead-thread {
  position: relative;
  z-index: 1;
  min-height: 0;
  padding: clamp(40px, 7vh, 80px) clamp(22px, 3.4vw, 56px) 24px;
  display: grid;
  align-content: end;
  gap: clamp(28px, 4.5vh, 52px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.b40-lead-message {
  margin: 0;
  animation: b40-lead-message-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.b40-lead-message--starter {
  opacity: 0.6;
  animation: none;
  transition: opacity 360ms ease;
}

.b40-lead-thread--engaged .b40-lead-message--starter {
  opacity: 1;
}

.b40-lead-message p,
.b40-lead-message__body {
  margin: 0;
  overflow-wrap: break-word;
}

.b40-lead-message--model .b40-lead-message__body,
.b40-lead-message--model > p {
  grid-column: 2;
}

.b40-lead-message__body {
  display: grid;
  gap: 10px;
  white-space: normal;
}

.b40-lead-message__body > * {
  margin: 0;
}

.b40-lead-message__body ul,
.b40-lead-message__body ol {
  display: grid;
  gap: 6px;
  padding-left: 1.1rem;
}

.b40-lead-message__body li {
  padding-left: 2px;
}

.b40-lead-message__body strong {
  font-weight: 620;
  color: var(--b40-lead-bone);
}

.b40-lead-message__body em {
  font-style: italic;
  color: var(--b40-lead-ember-on-coal);
}

.b40-lead-message__body code {
  padding: 1px 5px;
  border: 1px solid var(--b40-lead-coal-line-strong);
  background: var(--b40-lead-coal-3);
  color: var(--b40-lead-bone);
  font-family: var(--b40-lead-mono);
  font-size: 0.92em;
}

.b40-lead-message__heading {
  color: var(--b40-lead-bone);
  font-weight: 620;
  letter-spacing: 0.005em;
}

.b40-lead-message--user {
  width: min(100%, 480px);
  padding: 16px 18px;
  border: 1px solid var(--b40-lead-coal-line-strong);
  background:
    linear-gradient(180deg,
      rgba(245, 245, 247, 0.06) 0%,
      rgba(245, 245, 247, 0.02) 100%);
  color: var(--b40-lead-bone);
  font-size: clamp(14px, 1vw, 15.5px);
  line-height: 1.55;
  letter-spacing: 0.005em;
  box-shadow:
    inset 0 1px 0 rgba(245, 245, 247, 0.05),
    0 18px 38px rgba(0, 0, 0, 0.32);
}

.b40-lead-message--model {
  max-width: 600px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 16px;
  color: var(--b40-lead-bone-2);
  font-size: clamp(14px, 1vw, 15.5px);
  line-height: 1.6;
  letter-spacing: 0.005em;
}

.b40-lead-message__mark {
  grid-column: 1;
  grid-row: 1;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--b40-lead-display);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--b40-lead-bone-3);
  background: transparent;
  clip-path: none;
  font-variation-settings: "opsz" 18;
}

.b40-lead-message__mark::before {
  content: "S";
  display: inline-block;
  line-height: 1;
}

/* handoff card — unchanged structurally, restyled for grayscale */
.b40-lead-handoff {
  width: min(100%, 580px);
  margin: -2px 0 0 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--b40-lead-bone);
  box-shadow: none;
}

.b40-lead-handoff__intro {
  margin: 0 0 10px;
  color: var(--b40-lead-bone-3);
  font-size: 12.5px;
  line-height: 1.4;
}

.b40-lead-handoff__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.b40-lead-handoff__button,
.b40-lead-handoff__link {
  min-height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font: 500 12px / 1 var(--b40-lead-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.b40-lead-handoff__button {
  border: 1px solid var(--b40-lead-bone-2);
  background: transparent;
  color: var(--b40-lead-bone);
}

.b40-lead-handoff__button:hover {
  border-color: var(--b40-lead-ember-on-coal);
  color: var(--b40-lead-ember-on-coal);
  box-shadow: 0 0 0 4px var(--b40-lead-ember-glow-faint);
}

.b40-lead-handoff__link {
  border: 1px solid var(--b40-lead-coal-line-strong);
  background: transparent;
  color: var(--b40-lead-bone-3);
}

.b40-lead-handoff__link:hover {
  border-color: var(--b40-lead-bone-3);
  color: var(--b40-lead-bone);
}

.b40-lead-handoff__form {
  margin-top: 14px;
  display: none;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--b40-lead-coal-line-strong);
  background: var(--b40-lead-coal-2);
  box-shadow: var(--b40-lead-shadow-mid);
}

.b40-lead-handoff.is-open .b40-lead-handoff__form {
  display: grid;
}

.b40-lead-handoff__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.b40-lead-handoff__field {
  display: grid;
  gap: 5px;
}

.b40-lead-handoff__field--wide {
  grid-column: 1 / -1;
}

.b40-lead-handoff__field span,
.b40-lead-handoff__consent {
  color: var(--b40-lead-bone-3);
  font-family: var(--b40-lead-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.3;
}

.b40-lead-handoff__field input,
.b40-lead-handoff__field textarea {
  width: 100%;
  border: 1px solid var(--b40-lead-coal-line-strong);
  background: var(--b40-lead-coal);
  color: var(--b40-lead-bone);
  font: 400 13.5px / 1.4 var(--b40-lead-body);
  letter-spacing: 0.005em;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.b40-lead-handoff__field input {
  min-height: 40px;
  padding: 0 11px;
}

.b40-lead-handoff__field textarea {
  min-height: 120px;
  padding: 11px;
  resize: vertical;
}

.b40-lead-handoff__field input:focus,
.b40-lead-handoff__field textarea:focus {
  outline: 0;
  border-color: var(--b40-lead-ember-on-coal);
  box-shadow: 0 0 0 3px var(--b40-lead-ember-glow);
}

.b40-lead-handoff__consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--b40-lead-body);
  font-size: 11.5px;
}

.b40-lead-handoff__consent input {
  margin: 2px 0 0;
  accent-color: var(--b40-lead-ember-on-coal);
}

.b40-lead-handoff__submit {
  min-height: 44px;
  border: 0;
  background: var(--b40-lead-bone);
  color: var(--b40-lead-coal);
  font: 600 12px / 1 var(--b40-lead-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.b40-lead-handoff__submit:hover {
  background: var(--b40-lead-ember);
  color: var(--b40-lead-bone);
  box-shadow: 0 12px 30px rgba(143, 86, 57, 0.30);
}

.b40-lead-handoff__submit:disabled {
  cursor: wait;
  opacity: 0.55;
}

.b40-lead-handoff__status {
  min-height: 16px;
  margin: 0;
  color: var(--b40-lead-bone-3);
  font-size: 12px;
  line-height: 1.4;
}

/* ---------- composer ---------- */

.b40-lead-composer {
  position: relative;
  z-index: 2;
  padding: 14px clamp(22px, 3.4vw, 56px) calc(20px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg,
      var(--b40-lead-coal-fade-0) 0%,
      var(--b40-lead-coal-fade-1) 28%,
      var(--b40-lead-coal-fade-2) 60%,
      var(--b40-lead-coal) 100%);
}

.b40-lead-composer__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 11px;
}

.b40-lead-composer__chip {
  height: 28px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--b40-lead-coal-line-strong);
  background: transparent;
  color: var(--b40-lead-bone-3);
  font-family: var(--b40-lead-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.b40-lead-composer__chip:hover {
  border-color: var(--b40-lead-bone-3);
  color: var(--b40-lead-bone);
}

.b40-lead-composer__chip--local::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--b40-lead-bone-3);
  box-shadow: 0 0 0 3px var(--b40-lead-coal-line);
}

.b40-lead-composer__chip--folder::before {
  content: "";
  width: 8px;
  height: 6px;
  margin-right: 8px;
  border: 1px solid currentColor;
  opacity: 0.7;
}

.b40-lead-composer__chip--new {
  width: 28px;
  padding: 0;
  font-weight: 400;
  color: var(--b40-lead-bone-3);
}

.b40-lead-composer__form {
  min-height: 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  align-items: end;
  border: 1px solid var(--b40-lead-coal-line-strong);
  background: var(--b40-lead-coal-3);
  box-shadow:
    inset 0 1px 0 rgba(245, 245, 247, 0.04),
    var(--b40-lead-shadow-mid);
  transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.b40-lead-composer__form:focus-within {
  border-color: var(--b40-lead-ember-on-coal);
  background: var(--b40-lead-coal-4);
  box-shadow:
    inset 0 1px 0 rgba(245, 245, 247, 0.05),
    0 0 0 3px var(--b40-lead-ember-glow),
    var(--b40-lead-shadow-mid);
}

.b40-lead-composer__input {
  width: 100%;
  height: 58px;
  min-height: 58px;
  max-height: min(28svh, 168px);
  box-sizing: border-box;
  padding: 18px 16px 16px;
  border: 0;
  outline: 0;
  resize: none;
  overflow-y: auto;
  background: transparent;
  color: var(--b40-lead-bone);
  font: 400 15px / 1.4 var(--b40-lead-body);
  letter-spacing: 0;
}

.b40-lead-composer__input::placeholder {
  color: var(--b40-lead-bone-4);
  font-style: italic;
}

.b40-lead-composer__send {
  width: 56px;
  height: 58px;
  border: 0;
  border-left: 1px solid var(--b40-lead-coal-line-strong);
  background: transparent;
  color: var(--b40-lead-bone-3);
  font-size: 0;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}

.b40-lead-composer__send::before {
  content: "\21B5";
  font-size: 20px;
  line-height: 1;
}

.b40-lead-composer__send:hover,
.b40-lead-composer__send:focus-visible {
  background: rgba(182, 117, 79, 0.10);
  color: var(--b40-lead-ember-on-coal);
}

.b40-lead-composer__send:focus-visible {
  outline: 2px solid var(--b40-lead-ember-on-coal);
  outline-offset: -4px;
}

.b40-lead-composer__foot {
  min-height: 22px;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  color: var(--b40-lead-bone-3);
  font-family: var(--b40-lead-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.b40-lead-composer__foot > span:first-child {
  color: var(--b40-lead-bone-2);
}

.b40-lead-composer__meta {
  color: var(--b40-lead-bone-4);
}

.b40-lead-composer__status {
  margin-left: auto;
  min-height: 24px;
  padding: 0 11px 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--b40-lead-coal-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--b40-lead-bone-2);
  font-family: var(--b40-lead-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color 220ms ease, color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.b40-lead-composer__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--b40-lead-bone-2);
  box-shadow: 0 0 0 3px rgba(216, 216, 220, 0.10);
  animation: b40-lead-pulse 1.8s ease-in-out infinite;
}

.b40-lead-composer__model {
  color: var(--b40-lead-bone-3);
  font-family: var(--b40-lead-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.b40-lead-composer__spinner {
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--b40-lead-coal-line-strong);
  border-top-color: var(--b40-lead-ember-on-coal);
  border-radius: 999px;
  opacity: 0.42;
  animation: b40-lead-spin 1.8s linear infinite;
  transition: opacity 200ms ease;
}

/* thinking state — accent appears only here (interaction-revealed) */
.b40-lead-console.is-thinking .b40-lead-composer__status {
  border-color: var(--b40-lead-ember-on-coal);
  color: var(--b40-lead-ember-on-coal);
  box-shadow: 0 0 0 3px var(--b40-lead-ember-glow-faint);
}

.b40-lead-console.is-thinking .b40-lead-composer__dot {
  background: var(--b40-lead-ember-on-coal);
  box-shadow: 0 0 0 3px var(--b40-lead-ember-glow);
  animation-duration: 0.8s;
}

.b40-lead-console.is-thinking .b40-lead-composer__spinner {
  opacity: 1;
  animation-duration: 0.85s;
}

.b40-lead-console.is-thinking .b40-lead-composer__form {
  border-color: var(--b40-lead-ember-on-coal);
  box-shadow:
    inset 0 1px 0 rgba(245, 245, 247, 0.05),
    0 0 0 3px var(--b40-lead-ember-glow-faint),
    var(--b40-lead-shadow-mid);
}

@keyframes b40-lead-message-in {
  from {
    transform: translateY(6px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes b40-lead-pulse {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.65;
  }

  50% {
    transform: scale(1.10);
    opacity: 1;
  }
}

@keyframes b40-lead-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =====================================================================
   RIGHT — offer panel (pale silver, editorial-luxury)
   ===================================================================== */

.b40-lead-offer {
  position: relative;
  display: grid;
  align-items: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(30px, 3.8vw, 56px) clamp(34px, 4.4vw, 66px) 78px;
  background: var(--b40-lead-paper);
}

/* Aesthetics-style soft silver wave — the gradient IS the design */
.b40-lead-offer__wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 110% 8%,
      var(--b40-lead-paper-hi) 0%,
      transparent 55%),
    radial-gradient(ellipse 90% 70% at -10% 100%,
      var(--b40-lead-paper-3) 0%,
      transparent 55%),
    linear-gradient(168deg,
      var(--b40-lead-paper-hi) 0%,
      var(--b40-lead-paper) 38%,
      var(--b40-lead-paper-2) 100%);
}

.b40-lead-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  min-height: 0;
}

.b40-lead-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 1.7vw, 24px);
  align-self: center;
  min-height: 0;
}

@media (max-width: 940px) {
  .b40-lead-copy {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: clamp(16px, 1.7vw, 24px);
  }
  .b40-lead-stack {
    display: contents;
  }
}

/* topline: brand wordmark left, ghost CTA right (One&Only register) */
.b40-lead-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(2px, 0.6vw, 8px);
}

.b40-lead-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--b40-lead-ink);
  text-decoration: none;
  line-height: 1;
}

.b40-lead-brand__mark {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--b40-lead-ink);
  background: transparent;
  color: var(--b40-lead-ink);
  font-family: var(--b40-lead-display);
  font-style: italic;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  font-variation-settings: "opsz" 14;
  clip-path: none;
}

.b40-lead-brand__word {
  font-family: var(--b40-lead-display);
  font-weight: 400;
  font-size: 16.5px;
  letter-spacing: 0.005em;
  color: var(--b40-lead-ink);
  font-variation-settings: "opsz" 24;
}

.b40-lead-brand__word em {
  font-style: italic;
  font-weight: 400;
}

.b40-lead-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--b40-lead-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--b40-lead-ink);
  font-family: var(--b40-lead-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.b40-lead-ghost:hover,
.b40-lead-ghost:focus-visible {
  border-color: var(--b40-lead-ember-deep);
  color: var(--b40-lead-ember-deep);
  background: rgba(182, 117, 79, 0.06);
  box-shadow: 0 6px 18px rgba(143, 86, 57, 0.10);
  outline: 0;
}

.b40-lead-ghost:active {
  transform: translateY(1px);
}

/* hero */

.b40-lead-hero {
  display: grid;
  gap: clamp(12px, 1.2vw, 18px);
}

.b40-lead-eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--b40-lead-ink-3);
  font-family: var(--b40-lead-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.2;
  text-transform: uppercase;
}

.b40-lead-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--b40-lead-ink-3);
  display: inline-block;
}

.b40-lead-title {
  max-width: 720px;
  margin: 0;
  color: var(--b40-lead-ink);
  font-family: var(--b40-lead-display);
  font-size: clamp(36px, 3.5vw, 52px);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.04;
  text-wrap: balance;
  font-variation-settings: "opsz" 144;
}

.b40-lead-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--b40-lead-ink-2);
  display: inline-block;
  opacity: 0;
  transform: translateY(0.18em);
  filter: blur(2px);
  animation: b40-lead-title-italic 720ms cubic-bezier(0.2, 0.7, 0.2, 1) 240ms forwards;
}

.b40-lead-title em:nth-of-type(2) {
  animation-delay: 380ms;
}

@keyframes b40-lead-title-italic {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.b40-lead-body {
  max-width: 600px;
  margin: 0;
  color: var(--b40-lead-ink-3);
  font-family: var(--b40-lead-body);
  font-size: clamp(15px, 1.0vw, 17px);
  font-weight: 400;
  line-height: 1.55;
  text-wrap: pretty;
}

/* services — editorial 5-row list, hairlines, mono ordinals */

.b40-lead-services {
  order: 4;
  display: grid;
  border-top: 1px solid var(--b40-lead-ink-line);
  margin-top: clamp(2px, 0.6vw, 8px);
}

.b40-lead-service {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: baseline;
  gap: 18px;
  padding: clamp(8px, 1.0vw, 13px) 0;
  border-bottom: 1px solid var(--b40-lead-ink-line-soft);
  transition: padding-left 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.b40-lead-service::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: 0;
  height: 1px;
  background: var(--b40-lead-ember);
  transform: translateY(-50%);
  transition: width 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.b40-lead-service:hover {
  padding-left: 14px;
}

.b40-lead-service:hover::before {
  width: 8px;
}

.b40-lead-service:hover h2 {
  color: var(--b40-lead-ember-deep);
}

.b40-lead-service > span {
  margin: 0;
  color: var(--b40-lead-ink-4);
  font-family: var(--b40-lead-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.b40-lead-service h2 {
  margin: 0;
  color: var(--b40-lead-ink);
  font-family: var(--b40-lead-display);
  font-size: clamp(16px, 1.25vw, 19px);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.16;
  font-variation-settings: "opsz" 36;
  transition: color 220ms ease;
}

.b40-lead-service p {
  margin: 4px 0 0;
  color: var(--b40-lead-ink-4);
  font-size: 13px;
  line-height: 1.4;
  text-wrap: pretty;
}

/* action — single primary CTA, sharp 0px rectangle, deep ink */

.b40-lead-action {
  order: 5;
  width: 100%;
  max-width: 580px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(18px, 1.6vw, 26px);
  padding-top: clamp(20px, 1.6vw, 28px);
}

.b40-lead-action p {
  margin: 0;
  display: flex;
  align-items: center;
  color: var(--b40-lead-ink-2);
  font-family: var(--b40-lead-display);
  font-style: italic;
  font-size: clamp(14px, 1.05vw, 16px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-wrap: pretty;
  font-variation-settings: "opsz" 24;
}

.b40-lead-action__button {
  position: relative;
  width: 100%;
  min-height: 60px;
  padding: 0 22px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--b40-lead-ink);
  color: var(--b40-lead-paper);
  border: 1px solid var(--b40-lead-ink);
  text-decoration: none;
  text-align: left;
  font-family: var(--b40-lead-display);
  font-size: 16px;
  font-weight: 400;
  font-variation-settings: "opsz" 24;
  letter-spacing: -0.005em;
  line-height: 1.15;
  border-radius: 0;
  box-shadow: var(--b40-lead-shadow-cta);
  cursor: pointer;
  transition: background 240ms ease, color 240ms ease, transform 220ms ease, box-shadow 240ms ease, border-color 240ms ease;
  overflow: hidden;
}

.b40-lead-action__button::before {
  /* warm under-glow revealed on hover only */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg,
    transparent 0%,
    rgba(182, 117, 79, 0) 50%,
    rgba(182, 117, 79, 0.22) 100%);
  opacity: 0;
  transition: opacity 280ms ease;
}

.b40-lead-action__button > span:first-child {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.b40-lead-action__button > span:last-child {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--b40-lead-paper);
  font-family: var(--b40-lead-display);
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  opacity: 0.86;
  transition: opacity 240ms ease, transform 240ms ease;
}

.b40-lead-action__button:hover,
.b40-lead-action__button:focus-visible {
  background: var(--b40-lead-coal);
  border-color: var(--b40-lead-ember);
  box-shadow: var(--b40-lead-shadow-cta-hover);
  transform: translateY(-1px);
  outline: 0;
}

.b40-lead-action__button:hover::before,
.b40-lead-action__button:focus-visible::before {
  opacity: 1;
}

.b40-lead-action__button:hover > span:last-child,
.b40-lead-action__button:focus-visible > span:last-child {
  color: var(--b40-lead-ember-on-coal);
  opacity: 1;
  transform: translate(2px, -2px);
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-height: 920px) and (min-width: 941px) {
  .b40-lead-offer {
    padding-top: 36px;
    padding-bottom: 78px;
  }

  .b40-lead-copy {
    gap: 18px;
  }

  .b40-lead-title {
    font-size: clamp(34px, 3.2vw, 46px);
  }

  .b40-lead-body {
    font-size: 14.75px;
    line-height: 1.5;
  }

  .b40-lead-service {
    padding: 8px 0;
  }

  .b40-lead-service h2 {
    font-size: 16px;
  }

  .b40-lead-service p {
    font-size: 12.75px;
    line-height: 1.36;
  }

  .b40-lead-action__button {
    min-height: 60px;
  }
}

@media (max-height: 820px) and (min-width: 941px) {
  .b40-lead-offer {
    padding-top: 28px;
    padding-bottom: 78px;
  }

  .b40-lead-copy {
    gap: 14px;
  }

  .b40-lead-title {
    font-size: clamp(32px, 3.0vw, 42px);
  }

  .b40-lead-body {
    font-size: 14px;
    line-height: 1.46;
  }

  .b40-lead-service {
    padding: 7px 0;
  }

  .b40-lead-service h2 {
    font-size: 15.5px;
  }

  .b40-lead-service p {
    font-size: 12.5px;
    line-height: 1.32;
  }

  .b40-lead-action__button {
    min-height: 56px;
  }
}

@media (max-width: 1140px) {
  .b40-lead-offer {
    padding: 24px 24px 78px;
  }

  .b40-lead-copy {
    gap: 14px;
  }

  .b40-lead-title {
    font-size: clamp(30px, 3.4vw, 40px);
  }

  .b40-lead-body {
    font-size: 14.5px;
    line-height: 1.48;
  }

  .b40-lead-service {
    padding: 9px 0;
  }

  .b40-lead-service h2 {
    font-size: 16px;
  }

  .b40-lead-service p {
    font-size: 12.75px;
    line-height: 1.32;
  }

  .b40-lead-action {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .b40-lead-action p {
    font-size: 14.5px;
  }

  .b40-lead-action__button {
    width: 100%;
    min-height: 56px;
  }
}

@media (max-width: 940px) {
  .b40-lead-split {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    overflow: visible;
    overflow-x: hidden;
  }

  .b40-lead-room {
    height: 100dvh;
    min-height: 100dvh;
    border-bottom: 1px solid var(--b40-lead-coal-line-strong);
  }

  .b40-lead-console {
    height: 100vh;
    height: 100dvh;
    min-height: 100svh;
  }

  .b40-lead-offer {
    align-items: start;
    padding-top: 36px;
    padding-bottom: 40px;
  }

  .b40-lead-copy {
    gap: 22px;
  }

  .b40-lead-services {
    order: 4;
  }

  .b40-lead-action {
    order: 5;
  }
}

@media (max-width: 620px) {
  .b40-lead-console__topbar,
  .b40-lead-thread,
  .b40-lead-composer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .b40-lead-console__topbar {
    min-height: 52px;
    padding-top: 18px;
  }

  .b40-lead-console__index {
    font-size: 12px;
  }

  .b40-lead-thread {
    padding-top: clamp(20px, 3svh, 28px);
    padding-bottom: 16px;
    gap: clamp(16px, 2.5svh, 22px);
    align-content: end;
    overflow-x: hidden;
  }

  .b40-lead-console {
    height: 100vh;
    height: 100dvh;
    min-height: 100svh;
  }

  .b40-lead-console__path {
    font-size: 10.5px;
  }

  .b40-lead-message--user {
    width: auto;
    padding: 14px 16px;
    font-size: 14px;
  }

  .b40-lead-message--model {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 12px;
    font-size: 14px;
  }

  .b40-lead-handoff {
    width: 100%;
    margin-left: 0;
    padding: 14px;
  }

  .b40-lead-handoff__actions,
  .b40-lead-handoff__grid {
    grid-template-columns: 1fr;
  }

  .b40-lead-offer {
    padding: 28px 22px 36px;
  }

  .b40-lead-copy {
    gap: 18px;
  }

  .b40-lead-topline {
    align-items: center;
  }

  .b40-lead-brand__word {
    font-size: 15.5px;
  }

  .b40-lead-ghost {
    height: 34px;
    padding: 0 12px;
    font-size: 9.5px;
    letter-spacing: 0.16em;
  }

  .b40-lead-composer__foot {
    margin-top: 8px;
    gap: 8px 11px;
    font-size: 10px;
  }

  .b40-lead-composer {
    padding-top: 12px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .b40-lead-composer__chips {
    margin-bottom: 8px;
  }

  .b40-lead-composer__chip {
    height: 26px;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 10px;
  }

  .b40-lead-composer__chip--new {
    width: 26px;
    padding: 0;
  }

  .b40-lead-composer__form {
    min-height: 54px;
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  .b40-lead-composer__input {
    height: 52px;
    min-height: 52px;
    padding-top: 16px;
    padding-bottom: 14px;
  }

  .b40-lead-composer__send {
    width: 52px;
    height: 52px;
  }

  .b40-lead-composer__meta {
    display: none;
  }

  .b40-lead-eyebrow {
    font-size: 10px;
    letter-spacing: 0.20em;
  }

  .b40-lead-eyebrow::before {
    width: 16px;
  }

  .b40-lead-title {
    font-size: clamp(29px, 7.6vw, 36px);
    line-height: 1.06;
  }

  .b40-lead-body {
    font-size: 14.25px;
    line-height: 1.5;
  }

  .b40-lead-service {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
  }

  .b40-lead-service:hover {
    padding-left: 8px;
  }

  .b40-lead-service h2 {
    font-size: 16px;
    line-height: 1.2;
  }

  .b40-lead-service p {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.36;
  }

  .b40-lead-action {
    order: 5;
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 0;
  }

  .b40-lead-action p {
    display: block;
    max-width: none;
    font-size: 14px;
    line-height: 1.4;
  }

  .b40-lead-action__button {
    width: 100%;
    min-height: 54px;
    padding: 12px 18px 12px 20px;
    gap: 12px;
    font-size: 13.5px;
    line-height: 1.18;
  }

  .b40-lead-action__button > span:first-child {
    white-space: normal;
  }

  .b40-lead-action__button > span:last-child {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 360px) {
  .b40-lead-console__topbar,
  .b40-lead-thread,
  .b40-lead-composer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .b40-lead-console {
    height: 100vh;
    height: 100dvh;
    min-height: 100svh;
  }

  .b40-lead-thread {
    padding-top: 22px;
    padding-bottom: 20px;
    gap: 18px;
  }

  .b40-lead-offer {
    padding-right: 20px;
    padding-left: 20px;
    padding-top: 26px;
  }

  .b40-lead-composer__model,
  .b40-lead-composer__spinner {
    display: none;
  }

  .b40-lead-composer__input {
    font-size: 14px;
  }

  .b40-lead-title {
    font-size: 27px;
  }

  .b40-lead-body {
    font-size: 14px;
    line-height: 1.5;
  }

  .b40-lead-service {
    padding: 10px 0;
  }

  .b40-lead-service p {
    line-height: 1.34;
  }

  .b40-lead-ghost {
    font-size: 9px;
    letter-spacing: 0.14em;
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .b40-lead-page *,
  .b40-lead-page *::before,
  .b40-lead-page *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
