/* ============================================================================
 * BigPDF (bigpdf.app) — Swiss Architectural Print & Drafting Studio CSS System
 * File: /web/brand.css
 * Self-contained, zero-framework, zero-CLS design system covering:
 *   1. --bp-* Color, Surface, Typography & Elevation Tokens
 *   2. Floating Dark Pill Navigation (.bp-nav) & Mobile Drawer
 *   3. Editorial Landing, Proof Frames (.bp-proof-frame), Cards, Tables, Prose
 *   4. Interactive Visual Workbench UI System (.bp-wb-*)
 *   5. Compact Tutorial Embed Mode (html.bp-embed / body.bp-embed)
 *   6. Bulletproof Mobile Responsiveness (<=960px, <=640px, <=390px)
 * ============================================================================ */

:root {
  color-scheme: light;

  /* Typography */
  --bp-font-display: "Space Grotesk", "Avenir Next", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bp-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --bp-font-mono: "JetBrains Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Archival Paper Surfaces & Drafting Chrome */
  --bp-paper: #FAF8F4;
  --bp-sub: #F2EFE8;
  --bp-sheet: #FFFFFF;
  --bp-control: #EBE7DE;
  --bp-nav: #1B2028;
  --bp-nav-elevated: #242B35;
  --bp-nav-hover: #2C3441;

  /* Press Ink Hierarchy */
  --bp-ink: #171B21;
  --bp-ink-strong: #272D36;
  --bp-ink-secondary: #4F5763;
  --bp-ink-muted: #5E6672;
  --bp-ink-on-dark: #FAF8F4;
  --bp-ink-on-dark-muted: #C5CBD4;

  /* Architectural Hairline Rules */
  --bp-line: #E2DDD3;
  --bp-line-strong: #CCC5B8;
  --bp-line-dark: rgba(255, 255, 255, 0.10);
  --bp-line-dark-strong: rgba(255, 255, 255, 0.18);

  /* Primary Accent — Editorial Vermilion / Proofreader's Mark */
  --bp-accent: #D94526;
  --bp-accent-hover: #BE371B;
  --bp-accent-soft: #FFF1EC;
  --bp-accent-border: #F8CBBF;
  --bp-accent-text: #B23015;
  --bp-accent-on-dark: #F06444;

  /* Secondary Technical Accent — Blueprint Drafting Teal */
  --bp-teal: #0E6E6E;
  --bp-teal-hover: #0A5858;
  --bp-teal-soft: #EAF6F5;
  --bp-teal-border: #B8DFDC;
  --bp-teal-on-dark: #4FD1C5;

  /* Semantic Tokens */
  --bp-emerald: #047857;
  --bp-emerald-bg: #ECFDF5;
  --bp-emerald-border: #A7F3D0;

  --bp-amber: #B45309;
  --bp-amber-bg: #FFFBEB;
  --bp-amber-border: #FDE68A;

  --bp-rose: #BE123C;
  --bp-rose-bg: #FFF1F2;
  --bp-rose-border: #FECDD3;

  /* Layout, Radius & Shadows */
  --bp-max-w: 1140px;
  --bp-prose-w: 760px;
  --bp-radius-xs: 6px;
  --bp-radius-sm: 8px;
  --bp-radius-md: 12px;
  --bp-radius-lg: 18px;
  --bp-radius-pill: 999px;

  --bp-shadow-sm: 0 1px 2px rgba(23, 27, 33, 0.05), 0 1px 3px rgba(23, 27, 33, 0.04);
  --bp-shadow-md: 0 6px 20px rgba(23, 27, 33, 0.07), 0 1px 3px rgba(23, 27, 33, 0.05);
  --bp-shadow-nav: 0 8px 24px rgba(23, 27, 33, 0.14);
  --bp-shadow-sheet: 0 12px 32px rgba(23, 27, 33, 0.11), 0 2px 6px rgba(23, 27, 33, 0.06);
  --bp-shadow-modal: 0 24px 64px rgba(23, 27, 33, 0.24);

  --bp-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--bp-paper);
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bp-paper);
  color: var(--bp-ink);
  font-family: var(--bp-font-sans);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
  width: 100%;
}

img, svg, canvas, video {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4 {
  font-family: var(--bp-font-display);
  color: var(--bp-ink);
  letter-spacing: -0.025em;
  margin-top: 0;
}

p {
  margin-top: 0;
}

a {
  color: var(--bp-accent-text);
  text-decoration: none;
  transition: color 0.14s var(--bp-ease), background-color 0.14s var(--bp-ease), border-color 0.14s var(--bp-ease);
}

a:hover {
  color: var(--bp-accent-hover);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--bp-teal);
  outline-offset: 2px;
}

.bp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bp-mono {
  font-family: var(--bp-font-mono);
  font-variant-numeric: tabular-nums;
}

.bp-embed-only {
  display: none;
}

/* Protect navigation and interactive workbenches from automated ad-injection CLS */
header .google-auto-placed,
.bp-nav .google-auto-placed,
.bp-wb .google-auto-placed,
.bp-embed-shell .google-auto-placed {
  display: none !important;
}

/* ---------- Floating Dark Pill Navigation (.bp-nav) ---------- */
.bp-nav {
  position: sticky;
  top: 14px;
  z-index: 60;
  width: calc(100% - 32px);
  max-width: var(--bp-max-w);
  height: 70px;
  margin: 14px auto 0;
  padding: 0 16px 0 22px;
  display: flex;
  align-items: center;
  gap: 22px;
  border-radius: var(--bp-radius-pill);
  background: var(--bp-nav);
  border: 1px solid var(--bp-line-dark);
  color: var(--bp-ink-on-dark);
  box-shadow: var(--bp-shadow-nav);
  contain: layout style;
}

.bp-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--bp-ink-on-dark);
  font-family: var(--bp-font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  text-decoration: none;
}

.bp-wordmark img {
  display: block;
  height: 32px;
  width: auto;
}

.bp-wordmark:hover {
  color: #FFFFFF;
}

.bp-wordmark-accent {
  color: var(--bp-accent-on-dark);
}

.bp-nav-links {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-width: 0;
}

.bp-nav-links > a {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-family: var(--bp-font-display);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--bp-ink-on-dark-muted);
}

.bp-nav-links > a:hover,
.bp-nav-links > a.is-active {
  color: #FFFFFF;
}

.bp-nav-links > a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 13px;
  height: 2px;
  border-radius: 2px;
  background: var(--bp-accent-on-dark);
}

.bp-nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.bp-menu-details {
  position: relative;
}

.bp-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--bp-radius-pill);
  background: var(--bp-accent);
  color: #FFFFFF;
  font-family: var(--bp-font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border: 0;
  transition: background-color 0.14s var(--bp-ease), transform 0.12s var(--bp-ease);
}

.bp-nav-cta::-webkit-details-marker {
  display: none;
}

.bp-nav-cta:hover {
  background: var(--bp-accent-hover);
  color: #FFFFFF;
}

.bp-caret {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  opacity: 0.9;
  transition: transform 0.16s var(--bp-ease);
}

.bp-menu-details[open] .bp-caret {
  transform: rotate(180deg);
}

.bp-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 310px;
  padding: 8px;
  border-radius: var(--bp-radius-md);
  background: var(--bp-sheet);
  border: 1px solid var(--bp-line-strong);
  box-shadow: var(--bp-shadow-modal);
  color: var(--bp-ink);
  z-index: 80;
}

.bp-dropdown-label {
  padding: 6px 10px 4px;
  font-family: var(--bp-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bp-ink-muted);
}

.bp-dropdown a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--bp-radius-sm);
  color: var(--bp-ink);
}

.bp-dropdown a:hover {
  background: var(--bp-sub);
  color: var(--bp-ink);
}

.bp-dropdown-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--bp-font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--bp-ink);
}

.bp-dropdown-desc {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--bp-ink-muted);
}

/* Mobile Menu (pure CSS <details> + JS-compatible) */
.bp-mobile-menu {
  display: none;
  position: relative;
}

.bp-mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--bp-radius-pill);
  background: var(--bp-nav-elevated);
  border: 1px solid var(--bp-line-dark-strong);
  color: var(--bp-ink-on-dark);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.bp-mobile-toggle::-webkit-details-marker {
  display: none;
}

.bp-mobile-toggle:hover {
  background: var(--bp-nav-hover);
}

.bp-mobile-drawer {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: min(304px, calc(100vw - 32px));
  padding: 12px;
  border-radius: var(--bp-radius-md);
  background: var(--bp-nav);
  border: 1px solid var(--bp-line-dark-strong);
  box-shadow: var(--bp-shadow-modal);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 90;
}

.bp-mobile-drawer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--bp-radius-sm);
  color: var(--bp-ink-on-dark);
  font-family: var(--bp-font-display);
  font-size: 14.5px;
  font-weight: 600;
}

.bp-mobile-drawer a:hover,
.bp-mobile-drawer a.is-active {
  background: var(--bp-nav-elevated);
  color: #FFFFFF;
}

.bp-mobile-drawer-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--bp-line-dark);
}

/* ---------- Layout Containers & Sections ---------- */
.bp-container {
  width: 100%;
  max-width: var(--bp-max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.bp-container-narrow {
  width: 100%;
  max-width: var(--bp-prose-w);
  margin: 0 auto;
  padding: 0 20px;
}

.bp-section {
  padding: 56px 0;
  scroll-margin-top: 96px;
}

.bp-section-tight {
  padding: 36px 0;
}

.bp-section-bordered {
  border-top: 1px solid var(--bp-line);
}

.bp-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.bp-section-title {
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  font-weight: 700;
  line-height: 1.18;
  margin-bottom: 8px;
}

.bp-section-sub {
  font-size: 15.5px;
  color: var(--bp-ink-secondary);
  max-width: 640px;
  margin-bottom: 0;
}

.bp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--bp-font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bp-accent-text);
  margin-bottom: 12px;
}

.bp-kicker-teal {
  color: var(--bp-teal);
}

.bp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 22px 0 14px;
  font-family: var(--bp-font-mono);
  font-size: 12px;
  color: var(--bp-ink-muted);
}

.bp-breadcrumb a {
  color: var(--bp-ink-muted);
}

.bp-breadcrumb a:hover {
  color: var(--bp-accent-text);
}

/* ---------- Signature Motif 1: Corner-Ticked Proof Frame (.bp-proof-frame) ---------- */
.bp-proof-frame {
  position: relative;
  --bp-tick-color: rgba(23, 27, 33, 0.42);
  --bp-tick-size: 14px;
  --bp-tick-offset: -7px;
}

.bp-proof-frame-teal {
  --bp-tick-color: var(--bp-teal);
}

.bp-proof-frame-accent {
  --bp-tick-color: var(--bp-accent);
}

.bp-proof-frame::before {
  content: "";
  position: absolute;
  inset: var(--bp-tick-offset);
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(var(--bp-tick-color), var(--bp-tick-color)) left top / var(--bp-tick-size) 1.5px no-repeat,
    linear-gradient(var(--bp-tick-color), var(--bp-tick-color)) left top / 1.5px var(--bp-tick-size) no-repeat,
    linear-gradient(var(--bp-tick-color), var(--bp-tick-color)) right top / var(--bp-tick-size) 1.5px no-repeat,
    linear-gradient(var(--bp-tick-color), var(--bp-tick-color)) right top / 1.5px var(--bp-tick-size) no-repeat,
    linear-gradient(var(--bp-tick-color), var(--bp-tick-color)) left bottom / var(--bp-tick-size) 1.5px no-repeat,
    linear-gradient(var(--bp-tick-color), var(--bp-tick-color)) left bottom / 1.5px var(--bp-tick-size) no-repeat,
    linear-gradient(var(--bp-tick-color), var(--bp-tick-color)) right bottom / var(--bp-tick-size) 1.5px no-repeat,
    linear-gradient(var(--bp-tick-color), var(--bp-tick-color)) right bottom / 1.5px var(--bp-tick-size) no-repeat;
}

/* ---------- Signature Motif 2: Drafting Dot-Grid (.bp-dot-grid) ---------- */
.bp-dot-grid {
  background-color: var(--bp-sub);
  background-image: radial-gradient(rgba(23, 27, 33, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* ---------- Pills, Badges & Mono Specs ---------- */
.bp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--bp-radius-pill);
  font-family: var(--bp-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid var(--bp-line-strong);
  background: var(--bp-sheet);
  color: var(--bp-ink-strong);
}

.bp-pill::before {
  content: none;
}

.bp-pill-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.bp-pill-local {
  background: var(--bp-teal-soft);
  border-color: var(--bp-teal-border);
  color: var(--bp-teal);
}

.bp-pill-onnx {
  background: var(--bp-amber-bg);
  border-color: var(--bp-amber-border);
  color: var(--bp-amber);
}

.bp-pill-live {
  background: var(--bp-accent-soft);
  border-color: var(--bp-accent-border);
  color: var(--bp-accent-text);
}

.bp-pill-success {
  background: var(--bp-emerald-bg);
  border-color: var(--bp-emerald-border);
  color: var(--bp-emerald);
}

.bp-pill-danger {
  background: var(--bp-rose-bg);
  border-color: var(--bp-rose-border);
  color: var(--bp-rose);
}

.bp-pill-dark {
  background: rgba(79, 209, 197, 0.14);
  border-color: rgba(79, 209, 197, 0.42);
  color: var(--bp-teal-on-dark);
}

.bp-pill-dark-onnx {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.42);
  color: #FCD34D;
}

.bp-spec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--bp-radius-xs);
  background: var(--bp-sub);
  border: 1px solid var(--bp-line);
  font-family: var(--bp-font-mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--bp-ink-strong);
  max-width: 100%;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.bp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.bp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--bp-radius-sm);
  border: 1px solid transparent;
  font-family: var(--bp-font-display);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.14s var(--bp-ease), border-color 0.14s var(--bp-ease), color 0.14s var(--bp-ease), transform 0.12s var(--bp-ease);
}

.bp-btn:active {
  transform: translateY(1px);
}

.bp-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.bp-btn-primary {
  background: var(--bp-accent);
  color: #FFFFFF;
}

.bp-btn-primary:hover {
  background: var(--bp-accent-hover);
  color: #FFFFFF;
}

.bp-btn-teal {
  background: var(--bp-teal);
  color: #FFFFFF;
}

.bp-btn-teal:hover {
  background: var(--bp-teal-hover);
  color: #FFFFFF;
}

.bp-btn-dark {
  background: var(--bp-ink);
  color: #FFFFFF;
}

.bp-btn-dark:hover {
  background: var(--bp-nav-elevated);
  color: #FFFFFF;
}

.bp-btn-secondary {
  background: var(--bp-sheet);
  border-color: var(--bp-line-strong);
  color: var(--bp-ink);
}

.bp-btn-secondary:hover {
  background: var(--bp-sub);
  border-color: var(--bp-ink-muted);
  color: var(--bp-ink);
}

.bp-btn-ghost {
  background: transparent;
  color: var(--bp-ink-strong);
}

.bp-btn-ghost:hover {
  background: var(--bp-control);
  color: var(--bp-ink);
}

.bp-btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13.5px;
}

.bp-btn-lg {
  min-height: 50px;
  padding: 0 24px;
  font-size: 15.5px;
}

.bp-btn-block {
  width: 100%;
}

/* ---------- Editorial Hero ---------- */
.bp-hero {
  padding: 46px 0 40px;
}

.bp-hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 38px;
  align-items: center;
}

.bp-hero-title {
  font-size: clamp(2.15rem, 4.4vw, 3.35rem);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.036em;
  margin-bottom: 18px;
}

.bp-hero-title .bp-dot-accent {
  color: var(--bp-accent);
}

.bp-hero-lead {
  font-size: 1.07rem;
  line-height: 1.66;
  color: var(--bp-ink-secondary);
  margin-bottom: 24px;
  max-width: 58ch;
}

.bp-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

/* ---------- Metric Strip ---------- */
.bp-metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--bp-line);
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius-md);
  overflow: hidden;
  box-shadow: var(--bp-shadow-sm);
}

.bp-metric-item {
  background: var(--bp-sheet);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bp-metric-label {
  font-family: var(--bp-font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bp-ink-muted);
}

.bp-metric-value {
  font-family: var(--bp-font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--bp-ink);
  letter-spacing: -0.02em;
}

.bp-metric-value.is-teal {
  color: var(--bp-teal);
}

.bp-metric-value.is-emerald {
  color: var(--bp-emerald);
}

.bp-metric-value.is-accent {
  color: var(--bp-accent-text);
}

.bp-metric-sub {
  font-size: 12.5px;
  color: var(--bp-ink-muted);
}

/* ---------- Tool Cards (.bp-tool-card) ---------- */
.bp-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.bp-tool-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.bp-tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: var(--bp-radius-md);
  background: var(--bp-sheet);
  border: 1px solid var(--bp-line);
  box-shadow: var(--bp-shadow-sm);
  color: var(--bp-ink);
  transition: border-color 0.16s var(--bp-ease), box-shadow 0.16s var(--bp-ease), transform 0.16s var(--bp-ease);
}

.bp-tool-card:hover {
  border-color: var(--bp-line-strong);
  box-shadow: var(--bp-shadow-md);
  transform: translateY(-2px);
  color: var(--bp-ink);
}

.bp-tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bp-tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bp-sub);
  border: 1px solid var(--bp-line);
  color: var(--bp-ink);
  flex: none;
}

.bp-tool-icon.is-accent {
  background: var(--bp-accent-soft);
  border-color: var(--bp-accent-border);
  color: var(--bp-accent-text);
}

.bp-tool-icon.is-teal {
  background: var(--bp-teal-soft);
  border-color: var(--bp-teal-border);
  color: var(--bp-teal);
}

.bp-card-title {
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.26;
  margin-bottom: 6px;
}

.bp-card-desc {
  font-size: 14.5px;
  line-height: 1.58;
  color: var(--bp-ink-secondary);
  margin-bottom: 0;
}

.bp-tool-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.bp-tool-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--bp-font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--bp-accent-text);
  margin-top: 4px;
}

.bp-tool-card:hover .bp-tool-link {
  color: var(--bp-accent-hover);
}

/* ---------- Topic Cards (.bp-topic-card) ---------- */
.bp-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.bp-topic-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border-radius: var(--bp-radius-md);
  background: var(--bp-sub);
  border: 1px solid var(--bp-line);
  color: var(--bp-ink);
  transition: background-color 0.14s var(--bp-ease), border-color 0.14s var(--bp-ease);
}

.bp-topic-card:hover {
  background: var(--bp-sheet);
  border-color: var(--bp-line-strong);
  color: var(--bp-ink);
}

.bp-topic-index {
  font-family: var(--bp-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--bp-teal);
  letter-spacing: 0.05em;
}

.bp-topic-title {
  font-family: var(--bp-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.bp-topic-count {
  font-family: var(--bp-font-mono);
  font-size: 12px;
  color: var(--bp-ink-muted);
  margin-top: auto;
}

/* ---------- Guide Cards (.bp-guide-card) ---------- */
.bp-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.bp-guide-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: var(--bp-radius-md);
  background: var(--bp-sheet);
  border: 1px solid var(--bp-line);
  box-shadow: var(--bp-shadow-sm);
  color: var(--bp-ink);
  transition: border-color 0.16s var(--bp-ease), box-shadow 0.16s var(--bp-ease), transform 0.16s var(--bp-ease);
}

.bp-guide-card:hover {
  border-color: var(--bp-line-strong);
  box-shadow: var(--bp-shadow-md);
  transform: translateY(-2px);
  color: var(--bp-ink);
}

.bp-guide-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bp-guide-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--bp-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--bp-font-mono);
  font-size: 12px;
  color: var(--bp-ink-muted);
}

/* ---------- Comparison Tables (.bp-table) ---------- */
.bp-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--bp-radius-md);
  border: 1px solid var(--bp-line);
  background: var(--bp-sheet);
  box-shadow: var(--bp-shadow-sm);
}

.bp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.bp-table th,
.bp-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--bp-line);
  vertical-align: top;
}

.bp-table thead th {
  background: var(--bp-sub);
  font-family: var(--bp-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bp-ink-strong);
  max-width: 100%;
  white-space: nowrap;
}

.bp-table tbody tr:last-child td {
  border-bottom: 0;
}

.bp-table tbody tr:hover {
  background: rgba(242, 239, 232, 0.45);
}

.bp-table .is-highlight {
  background: var(--bp-teal-soft);
  color: var(--bp-ink);
  font-weight: 600;
}

/* ---------- Callout Boxes (.bp-callout) ---------- */
.bp-callout {
  padding: 16px 20px;
  border-radius: var(--bp-radius-md);
  border: 1px solid var(--bp-line-strong);
  border-left: 4px solid var(--bp-ink);
  background: var(--bp-sub);
  color: var(--bp-ink-strong);
  margin: 22px 0;
}

.bp-callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--bp-font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--bp-ink);
}

.bp-callout p:last-child {
  margin-bottom: 0;
}

.bp-callout-teal {
  background: var(--bp-teal-soft);
  border-color: var(--bp-teal-border);
  border-left-color: var(--bp-teal);
}

.bp-callout-teal .bp-callout-title {
  color: var(--bp-teal);
}

.bp-callout-accent {
  background: var(--bp-accent-soft);
  border-color: var(--bp-accent-border);
  border-left-color: var(--bp-accent);
}

.bp-callout-accent .bp-callout-title {
  color: var(--bp-accent-text);
}

.bp-callout-amber {
  background: var(--bp-amber-bg);
  border-color: var(--bp-amber-border);
  border-left-color: var(--bp-amber);
}

.bp-callout-amber .bp-callout-title {
  color: var(--bp-amber);
}

.bp-callout-emerald {
  background: var(--bp-emerald-bg);
  border-color: var(--bp-emerald-border);
  border-left-color: var(--bp-emerald);
}

.bp-callout-emerald .bp-callout-title {
  color: var(--bp-emerald);
}

.bp-callout-rose {
  background: var(--bp-rose-bg);
  border-color: var(--bp-rose-border);
  border-left-color: var(--bp-rose);
}

.bp-callout-rose .bp-callout-title {
  color: var(--bp-rose);
}

/* ---------- FAQ Accordions (.bp-faq) ---------- */
.bp-faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bp-faq-item {
  border-radius: var(--bp-radius-md);
  border: 1px solid var(--bp-line);
  background: var(--bp-sheet);
  overflow: hidden;
  transition: border-color 0.14s var(--bp-ease);
}

.bp-faq-item[open] {
  border-color: var(--bp-line-strong);
  box-shadow: var(--bp-shadow-sm);
}

.bp-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  font-family: var(--bp-font-display);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--bp-ink);
}

.bp-faq-item summary::-webkit-details-marker {
  display: none;
}

.bp-faq-item summary::after {
  content: "+";
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bp-sub);
  border: 1px solid var(--bp-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--bp-font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--bp-ink-strong);
  transition: transform 0.16s var(--bp-ease), background-color 0.16s var(--bp-ease);
}

.bp-faq-item[open] summary::after {
  content: "−";
  background: var(--bp-accent-soft);
  border-color: var(--bp-accent-border);
  color: var(--bp-accent-text);
}

.bp-faq-body {
  padding: 0 20px 18px;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--bp-ink-secondary);
}

.bp-faq-body p:last-child {
  margin-bottom: 0;
}

/* ---------- Editorial Prose (.bp-prose) ---------- */
.bp-prose {
  max-width: var(--bp-prose-w);
  font-size: 16px;
  line-height: 1.76;
  color: var(--bp-ink-strong);
}

.bp-prose h2 {
  font-size: clamp(1.38rem, 2.2vw, 1.75rem);
  line-height: 1.22;
  margin: 2.1em 0 0.7em;
  padding-top: 0.4em;
  border-top: 1px solid var(--bp-line);
}

.bp-prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.bp-prose h3 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 1.6em 0 0.55em;
}

.bp-prose p {
  margin-bottom: 1.15em;
}

.bp-prose ul,
.bp-prose ol {
  margin: 0 0 1.25em;
  padding-left: 1.35em;
}

.bp-prose li {
  margin-bottom: 0.45em;
}

.bp-prose strong {
  color: var(--bp-ink);
  font-weight: 600;
}

.bp-prose code {
  font-family: var(--bp-font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bp-sub);
  border: 1px solid var(--bp-line);
  color: var(--bp-ink);
}

.bp-prose pre {
  margin: 1.4em 0;
  padding: 16px 18px;
  border-radius: var(--bp-radius-md);
  background: var(--bp-nav);
  color: var(--bp-ink-on-dark);
  overflow-x: auto;
  font-family: var(--bp-font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.bp-prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

.bp-prose blockquote {
  margin: 1.5em 0;
  padding: 10px 18px;
  border-left: 3px solid var(--bp-accent);
  background: var(--bp-sub);
  border-radius: 0 var(--bp-radius-sm) var(--bp-radius-sm) 0;
  color: var(--bp-ink-strong);
}

/* ---------- Embedded Tutorial Workbench Shell (.bp-embed-shell) ---------- */
.bp-embed-shell {
  margin: 28px 0;
  border-radius: var(--bp-radius-lg);
  border: 1px solid var(--bp-line-strong);
  background: var(--bp-sheet);
  box-shadow: var(--bp-shadow-md);
  overflow: visible;
}

.bp-embed-inner {
  border-radius: calc(var(--bp-radius-lg) - 1px);
  overflow: hidden;
}

.bp-embed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--bp-nav);
  color: var(--bp-ink-on-dark);
  border-bottom: 1px solid var(--bp-line-dark);
}

.bp-embed-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: var(--bp-font-display);
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
}

.bp-embed-open {
  font-family: var(--bp-font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--bp-teal-on-dark);
  white-space: nowrap;
}

.bp-embed-open:hover {
  color: #FFFFFF;
}

.bp-embed-frame {
  display: block;
  width: 100%;
  min-height: 620px;
  border: 0;
  background: var(--bp-sub);
}

/* ============================================================================
 * INTERACTIVE VISUAL WORKBENCH UI SYSTEM (.bp-wb-*)
 * Shared drafting studio shell for Reflow, Crop/2-Up, Compressor, Split/Poster
 * ============================================================================ */

.bp-wb {
  border-radius: var(--bp-radius-lg);
  border: 1px solid var(--bp-line-strong);
  background: var(--bp-sheet);
  box-shadow: var(--bp-shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Top Dark Drafting Chrome Bar */
.bp-wb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 54px;
  padding: 9px 14px;
  background: var(--bp-nav);
  color: var(--bp-ink-on-dark);
  border-bottom: 1px solid var(--bp-line-dark);
}

.bp-wb-bar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.bp-wb-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--bp-font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--bp-ink-on-dark);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-wb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bp-teal-on-dark);
  flex: none;
}

.bp-wb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: var(--bp-radius-xs);
  border: 1px solid var(--bp-line-dark-strong);
  background: var(--bp-nav-elevated);
  color: var(--bp-ink-on-dark);
  font-family: var(--bp-font-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s var(--bp-ease), border-color 0.14s var(--bp-ease);
}

.bp-wb-btn:hover {
  background: var(--bp-nav-hover);
  border-color: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
}

.bp-wb-btn.is-active {
  background: var(--bp-teal);
  border-color: var(--bp-teal-on-dark);
  color: #FFFFFF;
}

.bp-wb-btn-accent {
  background: var(--bp-accent);
  border-color: var(--bp-accent);
  color: #FFFFFF;
}

.bp-wb-btn-accent:hover {
  background: var(--bp-accent-hover);
  border-color: var(--bp-accent-hover);
}

/* Segmented Control inside Dark Bar */
.bp-wb-seg {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--bp-radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--bp-line-dark);
  gap: 2px;
}

.bp-wb-seg button {
  border: 0;
  background: transparent;
  color: var(--bp-ink-on-dark-muted);
  font-family: var(--bp-font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s var(--bp-ease), color 0.14s var(--bp-ease);
}

.bp-wb-seg button:hover {
  color: #FFFFFF;
}

.bp-wb-seg button.is-active {
  background: var(--bp-sheet);
  color: var(--bp-ink);
}

/* Main Workbench 2-Column Workspace */
.bp-wb-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  min-height: 540px;
}

.bp-wb-body-wide {
  grid-template-columns: minmax(0, 1fr) 356px;
}

/* Central Drafting Canvas Stage */
.bp-wb-stage {
  position: relative;
  min-width: 0;
  min-height: 520px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bp-sub);
  background-image: radial-gradient(rgba(23, 27, 33, 0.15) 1px, transparent 1px);
  background-size: 18px 18px;
  overflow: hidden;
}

.bp-wb-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
  z-index: 5;
}

.bp-wb-hud > * {
  pointer-events: auto;
}

.bp-wb-hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--bp-radius-xs);
  background: rgba(23, 27, 33, 0.88);
  color: var(--bp-ink-on-dark);
  font-family: var(--bp-font-mono);
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
}

/* Rendered PDF Sheet inside Stage */
.bp-sheet-frame {
  position: relative;
  background: var(--bp-sheet);
  border: 1px solid var(--bp-line-strong);
  border-radius: 3px;
  box-shadow: var(--bp-shadow-sheet);
  line-height: 0;
  max-width: 100%;
}

.bp-sheet-frame canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Dropzone (Empty / Initial State) */
.bp-wb-dropzone {
  width: 100%;
  max-width: 560px;
  padding: 36px 28px;
  border-radius: var(--bp-radius-md);
  border: 2px dashed var(--bp-line-strong);
  background: rgba(255, 255, 255, 0.86);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: border-color 0.16s var(--bp-ease), background-color 0.16s var(--bp-ease), transform 0.16s var(--bp-ease);
}

.bp-wb-dropzone:hover,
.bp-wb-dropzone.is-dragover {
  border-color: var(--bp-teal);
  background: var(--bp-teal-soft);
}

.bp-wb-dropzone-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--bp-ink);
  color: var(--bp-paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bp-wb-dropzone-title {
  font-family: var(--bp-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.bp-wb-dropzone-sub {
  font-size: 14px;
  color: var(--bp-ink-secondary);
  margin: 0;
  max-width: 44ch;
}

.bp-sample-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.bp-arxiv-row {
  display: flex;
  width: 100%;
  max-width: 420px;
  gap: 8px;
  margin-top: 6px;
}

/* Right Inspector Rail (.bp-wb-inspector) */
.bp-wb-inspector {
  background: var(--bp-sheet);
  border-left: 1px solid var(--bp-line);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bp-wb-panel {
  padding: 16px 18px;
  border-bottom: 1px solid var(--bp-line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bp-wb-panel:last-child {
  border-bottom: 0;
}

.bp-wb-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--bp-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bp-ink-muted);
  margin: 0;
}

.bp-wb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bp-wb-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--bp-ink-strong);
}

.bp-wb-field-val {
  font-family: var(--bp-font-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--bp-teal);
}

.bp-input,
.bp-select {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--bp-radius-xs);
  border: 1px solid var(--bp-line-strong);
  background: var(--bp-paper);
  color: var(--bp-ink);
  font-size: 13.5px;
  transition: border-color 0.14s var(--bp-ease), background-color 0.14s var(--bp-ease);
}

.bp-input:focus,
.bp-select:focus {
  outline: none;
  border-color: var(--bp-teal);
  background: var(--bp-sheet);
  box-shadow: 0 0 0 3px rgba(14, 110, 110, 0.12);
}

/* Drafting Range Slider (.bp-range) */
.bp-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--bp-radius-pill);
  background: var(--bp-control);
  border: 1px solid var(--bp-line);
  cursor: pointer;
}

.bp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bp-teal);
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(23, 27, 33, 0.28);
  cursor: grab;
  transition: transform 0.12s var(--bp-ease), background-color 0.12s var(--bp-ease);
}

.bp-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  background: var(--bp-teal-hover);
}

.bp-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bp-teal);
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(23, 27, 33, 0.28);
  cursor: grab;
}

.bp-range-accent::-webkit-slider-thumb {
  background: var(--bp-accent);
}

.bp-range-accent::-moz-range-thumb {
  background: var(--bp-accent);
}

/* Preset Chips (.bp-chip-group / .bp-chip) */
.bp-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 31px;
  padding: 0 11px;
  border-radius: var(--bp-radius-xs);
  border: 1px solid var(--bp-line-strong);
  background: var(--bp-paper);
  color: var(--bp-ink-strong);
  font-family: var(--bp-font-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.13s var(--bp-ease);
}

.bp-chip:hover {
  background: var(--bp-sub);
  border-color: var(--bp-ink-muted);
}

.bp-chip.is-active {
  background: var(--bp-teal-soft);
  border-color: var(--bp-teal);
  color: var(--bp-teal);
  font-weight: 600;
}

.bp-chip-accent.is-active {
  background: var(--bp-accent-soft);
  border-color: var(--bp-accent);
  color: var(--bp-accent-text);
}

/* Live Telemetry Box inside Inspector */
.bp-wb-telemetry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-radius: var(--bp-radius-sm);
  background: var(--bp-sub);
  border: 1px solid var(--bp-line);
}

.bp-wb-tel-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bp-wb-tel-label {
  font-family: var(--bp-font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bp-ink-muted);
}

.bp-wb-tel-val {
  font-family: var(--bp-font-mono);
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--bp-ink);
}

.bp-wb-actions {
  margin-top: auto;
  padding: 16px 18px;
  border-top: 1px solid var(--bp-line);
  background: var(--bp-paper);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Split-Screen 300% Loupe (.bp-loupe) ---------- */
.bp-loupe {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 16 / 10;
  border-radius: var(--bp-radius-md);
  border: 1.5px solid var(--bp-ink);
  background: var(--bp-sheet);
  box-shadow: var(--bp-shadow-sheet);
  overflow: hidden;
  user-select: none;
  touch-action: none;
  --bp-split: 50%;
}

.bp-loupe-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.bp-loupe-after {
  clip-path: inset(0 0 0 var(--bp-split));
}

.bp-loupe-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--bp-split);
  width: 2px;
  background: var(--bp-teal);
  transform: translateX(-1px);
  pointer-events: none;
  z-index: 6;
}

.bp-loupe-handle {
  position: absolute;
  top: 50%;
  left: var(--bp-split);
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bp-teal);
  border: 2.5px solid #FFFFFF;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(23, 27, 33, 0.3);
  cursor: ew-resize;
  z-index: 7;
  font-family: var(--bp-font-mono);
  font-size: 13px;
  font-weight: 700;
}

.bp-loupe-handle:hover {
  background: var(--bp-teal-hover);
  transform: translate(-50%, -50%) scale(1.07);
}

.bp-loupe-tag {
  position: absolute;
  top: 10px;
  padding: 4px 9px;
  border-radius: 5px;
  background: rgba(23, 27, 33, 0.86);
  color: #FFFFFF;
  font-family: var(--bp-font-mono);
  font-size: 11px;
  font-weight: 600;
  z-index: 5;
  pointer-events: none;
}

.bp-loupe-tag-left {
  left: 10px;
}

.bp-loupe-tag-right {
  right: 10px;
  background: var(--bp-teal);
}

/* ---------- Interactive Crop Box & 2-Up Gutter (.bp-crop-*) ---------- */
.bp-crop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.bp-crop-box {
  position: absolute;
  border: 2px solid var(--bp-teal);
  background: rgba(14, 110, 110, 0.07);
  box-shadow: 0 0 0 9999px rgba(23, 27, 33, 0.24);
  pointer-events: auto;
  cursor: move;
}

.bp-crop-gutter {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  border-left: 2px dashed var(--bp-accent);
  cursor: col-resize;
  pointer-events: auto;
}

.bp-crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #FFFFFF;
  border: 2px solid var(--bp-teal);
  box-shadow: 0 1px 4px rgba(23, 27, 33, 0.28);
  pointer-events: auto;
}

.bp-crop-handle[data-pos="nw"] { top: -6px; left: -6px; cursor: nwse-resize; }
.bp-crop-handle[data-pos="n"]  { top: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.bp-crop-handle[data-pos="ne"] { top: -6px; right: -6px; cursor: nesw-resize; }
.bp-crop-handle[data-pos="e"]  { top: 50%; right: -6px; transform: translateY(-50%); cursor: ew-resize; }
.bp-crop-handle[data-pos="se"] { bottom: -6px; right: -6px; cursor: nwse-resize; }
.bp-crop-handle[data-pos="s"]  { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.bp-crop-handle[data-pos="sw"] { bottom: -6px; left: -6px; cursor: nesw-resize; }
.bp-crop-handle[data-pos="w"]  { top: 50%; left: -6px; transform: translateY(-50%); cursor: ew-resize; }

.bp-crop-dims {
  position: absolute;
  top: -28px;
  left: 0;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bp-teal);
  color: #FFFFFF;
  font-family: var(--bp-font-mono);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- Mobile Reflow Phone Bezel (.bp-phone-bezel) ---------- */
.bp-phone-bezel {
  width: min(310px, 100%);
  padding: 10px;
  border-radius: 28px;
  background: var(--bp-ink);
  box-shadow: var(--bp-shadow-sheet);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.bp-phone-screen {
  border-radius: 20px;
  background: var(--bp-paper);
  color: var(--bp-ink);
  padding: 18px 16px;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(23, 27, 33, 0.08);
}

/* ---------- Bottom Thumbnail Filmstrip (.bp-wb-thumbs) ---------- */
.bp-wb-thumbs {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bp-paper);
  border-top: 1px solid var(--bp-line);
  overflow-x: auto;
  scrollbar-width: thin;
}

.bp-thumb-card {
  position: relative;
  flex: none;
  width: 86px;
  padding: 6px;
  border-radius: var(--bp-radius-sm);
  border: 1.5px solid var(--bp-line);
  background: var(--bp-sheet);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.13s var(--bp-ease), box-shadow 0.13s var(--bp-ease), transform 0.13s var(--bp-ease);
}

.bp-thumb-card:hover {
  border-color: var(--bp-line-strong);
  transform: translateY(-1px);
}

.bp-thumb-card.is-active {
  border-color: var(--bp-teal);
  background: var(--bp-teal-soft);
  box-shadow: 0 0 0 2px rgba(14, 110, 110, 0.16);
}

.bp-thumb-card.is-selected {
  border-color: var(--bp-accent);
  background: var(--bp-accent-soft);
}

.bp-thumb-preview {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 3px;
  background: var(--bp-sub);
  border: 1px solid var(--bp-line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-thumb-num {
  font-family: var(--bp-font-mono);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--bp-ink-secondary);
}

.bp-thumb-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bp-ink);
  color: #FFFFFF;
  font-family: var(--bp-font-mono);
  font-size: 9.5px;
  font-weight: 600;
}

.bp-thumb-cut {
  flex: none;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
}

.bp-thumb-cut::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  border-left: 2px dashed var(--bp-line-strong);
}

.bp-thumb-cut.is-cut::before {
  border-left-color: var(--bp-accent);
}

.bp-thumb-cut span {
  position: relative;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bp-sheet);
  border: 1px solid var(--bp-line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--bp-ink-muted);
}

.bp-thumb-cut.is-cut span {
  background: var(--bp-accent);
  border-color: var(--bp-accent);
  color: #FFFFFF;
}

/* ---------- Modal / Sheet (.bp-modal) ---------- */
.bp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(23, 27, 33, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bp-modal-backdrop[hidden] {
  display: none;
}

.bp-modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border-radius: var(--bp-radius-lg);
  background: var(--bp-sheet);
  border: 1px solid var(--bp-line-strong);
  box-shadow: var(--bp-shadow-modal);
  overflow: hidden;
}

.bp-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bp-line);
}

.bp-modal-title {
  font-family: var(--bp-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.bp-modal-body {
  padding: 20px;
  overflow-y: auto;
}

.bp-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--bp-line);
  background: var(--bp-paper);
}

/* ---------- Footer Grid (.bp-footer) ---------- */
.bp-footer {
  margin-top: 64px;
  background: var(--bp-nav);
  color: var(--bp-ink-on-dark-muted);
  border-top: 1px solid var(--bp-line-dark);
}

.bp-footer-inner {
  width: 100%;
  max-width: var(--bp-max-w);
  margin: 0 auto;
  padding: 48px 20px 34px;
}

.bp-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--bp-line-dark);
}

.bp-footer-brand p {
  margin: 14px 0 16px;
  font-size: 14px;
  line-height: 1.62;
  color: var(--bp-ink-on-dark-muted);
  max-width: 34ch;
}

.bp-footer-col h4 {
  font-family: var(--bp-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bp-ink-on-dark);
  margin: 0 0 14px;
}

.bp-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bp-footer-col a {
  color: var(--bp-ink-on-dark-muted);
  font-size: 14px;
}

.bp-footer-col a:hover {
  color: #FFFFFF;
}

.bp-footer-bottom {
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--bp-font-mono);
  font-size: 12px;
  color: #9AA3B0;
}

/* ============================================================================
 * COMPACT TUTORIAL EMBED MODE (html.bp-embed / body.bp-embed)
 * Activated via ?embed=1 by pdf-core.js initEmbedBridge()
 * ============================================================================ */
html.bp-embed,
body.bp-embed {
  background: var(--bp-sheet);
  min-height: 0;
}

html.bp-embed .bp-nav,
body.bp-embed .bp-nav,
html.bp-embed .bp-footer,
body.bp-embed .bp-footer,
html.bp-embed .bp-breadcrumb,
body.bp-embed .bp-breadcrumb,
html.bp-embed .bp-tool-head-compact,
body.bp-embed .bp-tool-head-compact,
html.bp-embed .bp-embed-hide,
body.bp-embed .bp-embed-hide {
  display: none !important;
}

html.bp-embed .bp-embed-only,
body.bp-embed .bp-embed-only {
  display: inline-flex;
}

html.bp-embed .bp-container,
body.bp-embed .bp-container {
  max-width: none;
  padding: 0;
}

html.bp-embed .bp-section,
body.bp-embed .bp-section {
  padding: 0;
}

html.bp-embed .bp-wb,
body.bp-embed .bp-wb {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

html.bp-embed .bp-wb-body,
body.bp-embed .bp-wb-body {
  min-height: 460px;
}

html.bp-embed .bp-wb-stage,
body.bp-embed .bp-wb-stage {
  min-height: 420px;
  padding: 18px;
}

html.bp-embed .bp-wb.is-empty .bp-wb-stage,
body.bp-embed .bp-wb.is-empty .bp-wb-stage {
  min-height: 300px;
  padding: 18px 14px;
}

/* ============================================================================
 * WAVE 1 CONVERSION, PROGRESSIVE DISCLOSURE & CROSS-TOOL HANDOFF SYSTEM
 *   1. Progressive Disclosure Empty State (.bp-wb.is-empty)
 *   2. Compact Tool Page Header (.bp-tool-head-compact)
 *   3. Homepage Universal PDF Dropbar & Smart Diagnosis (.bp-uni-drop / .bp-diag-*)
 *   4. Cross-Tool "Continue in ->" Handoff Bar (.bp-handoff-*)
 *   5. Guide Quick-Drop / Jump Action Strip (.bp-guide-quickdrop)
 *   6. Searchable-Text Caution Banner (.bp-callout-caution-inline)
 * ============================================================================ */

/* 1. Progressive Disclosure Empty State (.bp-wb.is-empty) */
.bp-wb.is-empty .bp-wb-bar {
  min-height: 40px;
  padding: 5px 14px;
}

.bp-wb.is-empty .bp-wb-body,
.bp-wb.is-empty .bp-wb-body-wide {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.bp-wb.is-empty .bp-wb-inspector {
  display: none;
}

.bp-wb.is-empty .bp-wb-needs-doc {
  display: none !important;
}

.bp-wb.is-empty .bp-wb-stage {
  min-height: 360px;
  padding: 16px 20px 24px;
  justify-content: flex-start;
}

.bp-wb.is-empty .bp-wb-dropzone,
.bp-wb-dropzone-compact {
  max-width: 620px;
  padding: 26px 24px;
  gap: 11px;
}

.bp-wb.is-empty .bp-wb-dropzone-icon,
.bp-wb-dropzone-compact .bp-wb-dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.bp-wb.is-empty .bp-wb-dropzone-title,
.bp-wb-dropzone-compact .bp-wb-dropzone-title {
  font-size: 1.18rem;
  line-height: 1.24;
}

.bp-wb-dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

.bp-wb-dropzone-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--bp-font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bp-ink-muted);
  margin: 2px 0;
}

.bp-wb-dropzone-divider::before,
.bp-wb-dropzone-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--bp-line);
}

.bp-wb-dropzone-privacy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--bp-font-mono);
  font-size: 11.5px;
  color: var(--bp-teal);
  font-weight: 500;
}

/* 2. Compact Tool Page Header (.bp-tool-head-compact) */
.bp-tool-head-compact {
  padding: 12px 0 10px;
}

.bp-tool-head-compact .bp-breadcrumb {
  margin: 0 0 6px;
  font-size: 11.5px;
}

.bp-tool-head-compact .bp-kicker {
  margin-bottom: 4px;
  font-size: 11px;
}

.bp-tool-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.bp-tool-head-main {
  min-width: 0;
  flex: 1 1 380px;
}

.bp-tool-head-compact h1,
.bp-tool-head-title {
  font-family: var(--bp-font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.05rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--bp-ink);
  margin: 0 0 5px;
}

.bp-tool-head-compact h1 .bp-dot-accent,
.bp-tool-head-title .bp-dot-accent {
  color: var(--bp-accent);
}

.bp-tool-head-sub {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--bp-ink-secondary);
  margin: 0;
  max-width: 68ch;
}

.bp-tool-head-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: none;
}

.bp-tool-head-compact .bp-pill {
  padding: 3px 10px;
  font-size: 11px;
}

.bp-tool-head-compact .bp-spec {
  padding: 2px 7px;
  font-size: 11px;
}

/* 3. Homepage Universal PDF Dropbar & Smart Diagnosis Panel */
.bp-uni-drop {
  width: 100%;
  padding: 18px 20px;
  border-radius: var(--bp-radius-md);
  border: 1.5px dashed var(--bp-line-strong);
  background: var(--bp-sheet);
  box-shadow: var(--bp-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.16s var(--bp-ease), background-color 0.16s var(--bp-ease), box-shadow 0.16s var(--bp-ease);
}

.bp-uni-drop:hover {
  border-color: var(--bp-teal);
}

.bp-uni-drop.is-dragover {
  border-style: solid;
  border-color: var(--bp-teal);
  background: var(--bp-teal-soft);
  box-shadow: 0 0 0 4px rgba(14, 110, 110, 0.12);
}

.bp-uni-drop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}

.bp-uni-drop-copy {
  min-width: 0;
  flex: 1 1 220px;
}

.bp-uni-drop-title {
  font-family: var(--bp-font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--bp-ink);
  margin: 0 0 3px;
}

.bp-uni-drop-sub {
  font-size: 13px;
  line-height: 1.45;
  color: var(--bp-ink-secondary);
  margin: 0;
}

.bp-uni-drop-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: none;
}

.bp-uni-drop-samples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 11px;
  border-top: 1px solid var(--bp-line);
}

.bp-uni-drop-samples-label {
  font-family: var(--bp-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bp-ink-muted);
  margin-right: 2px;
}

.bp-diag-panel {
  margin-top: 14px;
  border-radius: var(--bp-radius-md);
  border: 1px solid var(--bp-teal-border);
  background: var(--bp-sheet);
  box-shadow: var(--bp-shadow-md);
  overflow: hidden;
}

.bp-diag-panel[hidden] {
  display: none !important;
}

.bp-diag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 11px 16px;
  background: var(--bp-nav);
  color: var(--bp-ink-on-dark);
  border-bottom: 1px solid var(--bp-line-dark);
}

.bp-diag-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  font-family: var(--bp-font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: #FFFFFF;
  overflow-wrap: anywhere;
}

.bp-diag-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bp-diag-summary {
  font-size: 14px;
  line-height: 1.55;
  color: var(--bp-ink-strong);
  margin: 0;
}

.bp-diag-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bp-diag-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bp-diag-rec {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 6px;
  padding: 13px 14px;
  border-radius: var(--bp-radius-sm);
  border: 1px solid var(--bp-line-strong);
  background: var(--bp-paper);
  color: var(--bp-ink);
  cursor: pointer;
  text-decoration: none;
  min-width: 0;
  transition: border-color 0.14s var(--bp-ease), background-color 0.14s var(--bp-ease), box-shadow 0.14s var(--bp-ease), transform 0.14s var(--bp-ease);
}

.bp-diag-rec:hover {
  border-color: var(--bp-teal);
  background: var(--bp-sheet);
  box-shadow: var(--bp-shadow-sm);
  transform: translateY(-1px);
  color: var(--bp-ink);
}

.bp-diag-rec.is-primary {
  background: var(--bp-accent-soft);
  border: 1.5px solid var(--bp-accent);
  box-shadow: var(--bp-shadow-sm);
}

.bp-diag-rec.is-primary:hover {
  background: #FFE7DF;
  border-color: var(--bp-accent-hover);
}

.bp-diag-rec-head {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.bp-diag-rec-title {
  font-family: var(--bp-font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--bp-ink);
}

.bp-diag-rec-reason {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--bp-ink-secondary);
  margin: 0;
}

.bp-diag-rec-cta {
  margin-top: auto;
  padding-top: 4px;
  font-family: var(--bp-font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--bp-teal);
}

.bp-diag-rec.is-primary .bp-diag-rec-cta {
  color: var(--bp-accent-text);
}

/* 4. Cross-Tool "Continue in ->" Handoff Bar (.bp-handoff-*) */
.bp-handoff-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 11px 15px;
  border-radius: var(--bp-radius-sm);
  background: var(--bp-sub);
  border: 1px solid var(--bp-line-strong);
  border-left: 3px solid var(--bp-teal);
}

.bp-handoff-bar[hidden] {
  display: none !important;
}

.bp-wb > .bp-handoff-bar {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-top: 1px solid var(--bp-line);
}

.bp-handoff-bar.is-compact {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
}

.bp-handoff-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--bp-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bp-teal);
  white-space: nowrap;
}

.bp-handoff-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.bp-handoff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--bp-radius-xs);
  border: 1px solid var(--bp-line-strong);
  background: var(--bp-sheet);
  color: var(--bp-ink);
  font-family: var(--bp-font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color 0.14s var(--bp-ease), background-color 0.14s var(--bp-ease), color 0.14s var(--bp-ease), transform 0.12s var(--bp-ease);
}

.bp-handoff-btn:hover {
  border-color: var(--bp-teal);
  background: var(--bp-teal-soft);
  color: var(--bp-teal);
}

.bp-handoff-btn:active {
  transform: translateY(1px);
}

.bp-handoff-btn:disabled,
.bp-handoff-btn.is-loading {
  opacity: 0.56;
  cursor: wait;
  transform: none;
}

/* 5. Guide Quick-Drop / Jump Action Strip (.bp-guide-quickdrop) */
.bp-guide-quickdrop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin: 16px 0 24px;
  padding: 14px 18px;
  border-radius: var(--bp-radius-md);
  background: var(--bp-sheet);
  border: 1.5px dashed var(--bp-teal-border);
  box-shadow: var(--bp-shadow-sm);
  transition: border-color 0.16s var(--bp-ease), background-color 0.16s var(--bp-ease), box-shadow 0.16s var(--bp-ease);
}

.bp-guide-quickdrop:hover {
  border-color: var(--bp-teal);
}

.bp-guide-quickdrop.is-dragover {
  border-style: solid;
  border-color: var(--bp-teal);
  background: var(--bp-teal-soft);
  box-shadow: 0 0 0 4px rgba(14, 110, 110, 0.10);
}

.bp-guide-quickdrop-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 240px;
}

.bp-guide-quickdrop-title {
  font-family: var(--bp-font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--bp-ink);
  margin: 0;
}

.bp-guide-quickdrop-sub {
  font-size: 13px;
  line-height: 1.45;
  color: var(--bp-ink-secondary);
  margin: 0;
}

.bp-guide-quickdrop-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: none;
}

/* 6. Searchable-Text Caution Banner (.bp-callout-caution-inline) */
.bp-callout-caution-inline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-radius: var(--bp-radius-sm);
  background: linear-gradient(90deg, var(--bp-amber-bg) 0%, var(--bp-amber-bg) 68%, var(--bp-teal-soft) 100%);
  border: 1px solid var(--bp-amber-border);
  border-left: 3.5px solid var(--bp-amber);
  color: var(--bp-ink-strong);
  font-size: 13px;
  line-height: 1.5;
}

.bp-callout-caution-inline[hidden] {
  display: none !important;
}

.bp-callout-caution-body {
  flex: 1 1 240px;
  min-width: 0;
}

.bp-callout-caution-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--bp-font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--bp-amber);
  margin-bottom: 2px;
}

.bp-callout-caution-body p {
  margin: 0;
  color: var(--bp-ink-strong);
}

.bp-callout-caution-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  align-self: center;
}

/* ============================================================================
 * RESPONSIVE BREAKPOINTS (<=960px, <=640px, <=390px) — ZERO OVERFLOW
 * ============================================================================ */
@media (max-width: 960px) {
  .bp-nav {
    height: 62px;
    padding: 0 12px 0 18px;
    gap: 12px;
  }

  .bp-nav-links {
    display: none;
  }

  .bp-mobile-menu {
    display: block;
  }

  .bp-hero-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .bp-hero-split > * {
    min-width: 0;
    max-width: 100%;
  }

  .bp-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bp-tool-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bp-topic-grid,
  .bp-guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bp-wb-body,
  .bp-wb-body-wide {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .bp-wb-stage {
    min-height: 360px;
    padding: 18px 14px;
  }

  .bp-wb-inspector {
    border-left: 0;
    border-top: 1px solid var(--bp-line);
  }

  .bp-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bp-diag-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  /* Prevent iOS Safari auto-zoom when tapping form controls */
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Keep workbench HUD pills above the canvas on phones (iPhone 375–440px+) so they never overlap sheets */
  .bp-wb-hud {
    position: static;
    width: 100%;
    margin-bottom: 12px;
  }
}

@media (max-width: 640px) {
  .bp-nav {
    top: 10px;
    width: calc(100% - 20px);
    margin-top: 10px;
    height: 58px;
    padding: 0 10px 0 14px;
  }

  .bp-wordmark img {
    height: 27px;
  }

  .bp-nav-cta {
    min-height: 36px;
    padding: 0 13px;
    font-size: 13px;
  }

  .bp-container,
  .bp-container-narrow {
    padding: 0 16px;
  }

  .bp-section {
    padding: 38px 0;
  }

  .bp-hero {
    padding: 24px 0 24px;
  }

  .bp-hero-title {
    font-size: clamp(1.85rem, 7.6vw, 2.45rem);
    overflow-wrap: break-word;
  }

  .bp-spec {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .bp-proof-frame {
    --bp-tick-offset: -3px;
    --bp-tick-size: 10px;
  }

  .bp-wb-seg {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .bp-wb-seg button {
    padding: 5px 8px;
    font-size: 11.5px;
  }

  .bp-tool-grid,
  .bp-tool-grid-4,
  .bp-topic-grid,
  .bp-guide-grid,
  .bp-footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bp-wb-bar {
    padding: 10px 12px;
  }

  .bp-wb-file {
    max-width: 190px;
  }

  .bp-wb-dropzone {
    padding: 24px 16px;
  }

  .bp-wb.is-empty .bp-wb-stage {
    min-height: 300px;
    padding: 14px 12px 18px;
  }

  .bp-wb.is-empty .bp-wb-dropzone,
  .bp-wb-dropzone-compact {
    padding: 18px 14px;
    gap: 10px;
  }

  .bp-tool-head-compact {
    padding: 12px 0 10px;
  }

  .bp-tool-head-compact .bp-breadcrumb {
    margin: 0 0 6px;
  }

  .bp-tool-head-compact h1,
  .bp-tool-head-title {
    font-size: clamp(1.36rem, 6.2vw, 1.7rem);
    margin-bottom: 4px;
  }

  .bp-tool-head-sub {
    font-size: 13.5px;
    line-height: 1.45;
  }

  .bp-uni-drop {
    padding: 14px;
  }

  .bp-uni-drop-controls {
    width: 100%;
  }

  .bp-diag-body {
    padding: 13px;
  }

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

  .bp-handoff-bar {
    padding: 10px 12px;
  }

  .bp-handoff-btn {
    min-height: 36px;
    font-size: 12.5px;
  }

  .bp-guide-quickdrop {
    padding: 13px 14px;
    margin: 14px 0 20px;
  }

  .bp-guide-quickdrop-actions {
    width: 100%;
  }

  .bp-callout-caution-inline {
    padding: 10px 12px;
    background: var(--bp-amber-bg);
  }

  .bp-arxiv-row {
    flex-direction: column;
  }

  .bp-embed-frame {
    min-height: 540px;
  }

  .bp-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .bp-modal {
    width: 100%;
    max-height: 88vh;
    border-radius: var(--bp-radius-lg) var(--bp-radius-lg) 0 0;
  }
}

@media (max-width: 390px) {
  .bp-container,
  .bp-container-narrow {
    padding: 0 14px;
  }

  .bp-nav {
    width: calc(100% - 16px);
    padding: 0 8px 0 12px;
  }

  .bp-nav-cta {
    padding: 0 11px;
    font-size: 12.5px;
  }

  .bp-metric-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .bp-proof-frame {
    --bp-tick-offset: 0px;
    --bp-tick-size: 10px;
  }

  .bp-wb-seg button {
    padding: 5px 7px;
    font-size: 11px;
  }

  .bp-wb-telemetry {
    grid-template-columns: minmax(0, 1fr);
  }

  .bp-wb.is-empty .bp-wb-stage {
    min-height: 280px;
    padding: 14px 10px;
  }

  .bp-handoff-actions {
    width: 100%;
  }

  .bp-handoff-btn {
    flex: 1 1 auto;
  }
}
