.bw-lead-capture {
  --lc-surface: #f6f9fd;
  --lc-border: #d9e2ee;
  --lc-ink: #17263d;
  --lc-muted: #536174;
  --lc-accent: #245b9e;
  --lc-accent-ink: #ffffff;
  display: grid;
  gap: 10px;
  /* The panel paints its own surface, so its subtree must resolve the shared
     surface tokens against that surface, not the page's dark scheme. */
  --ui-bg: var(--lc-surface);
  --ui-surface: var(--lc-surface);
  --ui-ink: var(--lc-ink);
  --ui-muted: var(--lc-muted);
  --ui-line: var(--lc-border);
  color: var(--lc-ink);
  max-width: 760px;
  margin: 1.5rem auto;
  padding: 18px;
  border: 1px solid var(--lc-border);
  border-radius: 14px;
  background: var(--lc-surface);
  color: var(--lc-ink);
}.bw-lead-capture[data-theme="dark"] { --lc-surface: #141220;
  --lc-border: rgba(192, 132, 252, .34);
  --lc-ink: #f5f3fa;
  --lc-muted: #b8c4d4;
  --lc-accent: #e9d5ff;
  --lc-accent-ink: #211b31;
}
.bw-lead-capture[data-theme="auto"] {
  --lc-surface: rgba(127, 127, 127, .07);
  --lc-border: rgba(127, 127, 127, .28);
  --lc-ink: inherit;
  --lc-muted: inherit;
  --lc-accent: inherit;
  --lc-accent-ink: var(--page-bg, #fff);
  color: inherit;
}
.bw-lead-capture-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 750;
  line-height: 1.35;
}
.bw-lead-capture-copy {
  margin: 0;
  color: var(--lc-muted);
  font-size: .9rem;
  line-height: 1.6;
}
.bw-lead-capture-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: end;
}
.bw-lead-capture-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.bw-lead-capture input::placeholder {
  color: var(--lc-muted);
  opacity: 1;
}
.bw-lead-capture input[type="email"] {
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--lc-border);
  border-radius: 9px;
  padding: 0 12px;
  background: #fff;
  color: #17263d;
  font: inherit;
}
.bw-lead-capture[data-theme="dark"] input[type="email"] {
  background: #0b0a07;
  color: #fff;
}
.bw-lead-capture[data-theme="auto"] input[type="email"] {
  background: rgba(127, 127, 127, .08);
  color: inherit;
  border-color: rgba(127, 127, 127, .35);
}
.bw-lead-capture button[type="submit"] {
  min-height: 46px;
  border: 0;
  border-radius: 9px;
  padding: 0 18px;
  background: var(--lc-accent);
  color: var(--lc-accent-ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.bw-lead-capture[data-theme="auto"] button[type="submit"] {
  background: currentColor;
  color: var(--page-bg, #fff);
}
.bw-lead-capture button[type="submit"]:hover {
  filter: brightness(.94);
}
.bw-lead-capture button[type="submit"]:disabled {
  opacity: .65;
  cursor: wait;
}
.bw-lead-capture-consent {
  margin: 0;
  color: var(--lc-muted);
  font-size: .74rem;
  line-height: 1.5;
}
.bw-lead-capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: .82rem;
}
.bw-lead-capture-actions a {
  color: var(--lc-accent);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bw-lead-capture-status {
  min-height: 18px;
  margin: 0;
  color: var(--lc-muted);
  font-size: .78rem;
  line-height: 1.45;
}
.bw-lead-capture [data-lead-success][hidden] {
  display: none;
}
.bw-lead-capture [data-lead-success] {
  display: grid;
  gap: 8px;
  font-size: .9rem;
  line-height: 1.6;
}
.bw-lead-capture [data-lead-success] a {
  color: var(--lc-accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bw-lead-capture input:focus-visible,
.bw-lead-capture button:focus-visible,
.bw-lead-capture a:focus-visible {
  outline: 3px solid #8ab8f0;
  outline-offset: 2px;
}
@media (max-width: 560px) {
  .bw-lead-capture-fields {
    grid-template-columns: 1fr;
  }
  .bw-lead-capture button[type="submit"] {
    width: 100%;
  }
}

/* Contrast 1123: Save button on lesson lead cards outside content-remake pages (.bwcr keeps its own fill). The auto variant filled with currentColor, which is white on Paper. */
html[data-bw-theme="paper"] .bw-lead-capture[data-theme="auto"]:not(:is(.bwcr *)) button[type="submit"]{background:#6845a0;color:#fff}
/* Contrast 1123: free QBank lead card in Night (placeholder and action links). */
html[data-bw-theme="night"] body[data-bw-page^="qbank-free"] .bw-lead-capture input::placeholder{color:#a3a3b2;opacity:1}
html[data-bw-theme="night"] body[data-bw-page^="qbank-free"] .bw-lead-capture-actions a{color:#b9d5ff}
html[data-bw-theme="system"][data-bw-study-scheme="light"]:has(head link[rel="canonical"][href^="https://bonewizardry.com/omm/"]) body main#lesson .bw-lead-capture[data-theme="auto"] button[type="submit"]{background:#6845a0!important;color:#fff!important}
/* Contrast 1123: Night Save button. The auto variant filled with currentColor, which is white on Night, so the label was invisible. */
html[data-bw-theme="night"] .bw-lead-capture[data-theme="auto"]:not(:is(.bwcr *)) button[type="submit"]{background:#c6b2f5;color:#10111b}

/* Public OMM lesson auto lead card: resolved dark palette. */
html[data-bw-study-scheme="dark"]:has(head link[rel="canonical"][href^="https://bonewizardry.com/omm/"]) body main#lesson .bw-lead-capture[data-theme="auto"] button[type="submit"]{background:#c6b2f5!important;color:#10111b!important}

/* Public lesson-end lead cards must follow the resolved study scheme, including
   System. Keep the existing lesson palette and leave QBank/test surfaces alone. */
html[data-bw-study-scheme="light"] body main#lesson .bw-lead-capture[data-theme="auto"][data-source="lesson-end"] button[type="submit"] {
  background: #6845a0 !important;
  color: #fff !important;
}
html[data-bw-study-scheme="dark"] body main#lesson .bw-lead-capture[data-theme="auto"][data-source="lesson-end"] button[type="submit"] {
  background: #c6b2f5 !important;
  color: #10111b !important;
}
