/* Docket LM — Design tokens & base styles */

:root {
  /* Surface — warm paper */
  --paper: #f6f4ef;
  --paper-2: #efece4;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --surface-3: #f0ede5;

  /* Ink */
  --ink: #1a1a1a;
  --ink-2: #4a4a48;
  --ink-3: #7d7a72;
  --ink-4: #a8a399;
  --ink-5: #c9c5b9;

  /* Rules */
  --rule: #e8e3d8;
  --rule-2: #ded8c9;
  --rule-strong: #c9c2b0;

  /* Accents */
  --navy: #1f3a5f;
  --navy-2: #2c4a73;
  --navy-soft: #e9eef5;
  --navy-soft-2: #d8e1ed;

  --sage: #2f5d3a;
  --sage-soft: #e3ebe1;
  --sage-soft-2: #d2dfce;

  --amber: #8a6a2b;
  --amber-soft: #f1ead7;

  --brick: #9a3a2e;
  --brick-soft: #f3e3df;
  --brick-soft-2: #ebd2cc;

  /* Type */
  --font-sans: "Geist", "Söhne", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Geometry */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-1: 0 1px 2px rgba(20, 18, 12, 0.04), 0 0 0 1px rgba(20, 18, 12, 0.04);
  --shadow-2: 0 4px 16px rgba(20, 18, 12, 0.06), 0 1px 2px rgba(20, 18, 12, 0.04);
  --shadow-3: 0 12px 40px rgba(20, 18, 12, 0.12), 0 2px 8px rgba(20, 18, 12, 0.06);
}

/* Editorial mode (vibe = editorial) — slightly warmer paper, serif headings */
[data-vibe="editorial"] {
  --paper: #f4f0e6;
  --surface: #fbf7ec;
  --surface-2: #f6f1e3;
  --rule: #e3dcc8;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}

#root { min-height: 100vh; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--navy-soft-2); }

/* ─────────── Type scale ─────────── */
.display {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -0.022em;
  color: var(--ink);
}
[data-vibe="modern"] .display {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.028em;
}

.h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.018em;
}
[data-vibe="modern"] .h1 {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.022em;
}

.h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.012em;
}
[data-vibe="modern"] .h2 {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.014em;
}

.h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.008em;
}

.body { font-size: 15px; line-height: 1.55; color: var(--ink); }
.body-2 { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.small { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.micro { font-size: 11.5px; line-height: 1.4; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* Brief reading type — always serif for prose */
.prose {
  font-family: var(--font-serif);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  letter-spacing: -0.003em;
}
.prose p { margin: 0 0 0.85em 0; }

/* ─────────── Chrome ─────────── */
.app-chrome {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 244, 239, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.chrome-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.012em;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--navy);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
}
.nav {
  display: flex;
  gap: 2px;
  margin-left: 28px;
}
.nav button {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 450;
  transition: background 120ms, color 120ms;
}
.nav button:hover { color: var(--ink); background: rgba(20,18,12,0.04); }
.nav button[data-active="true"] {
  color: var(--ink);
  background: rgba(20,18,12,0.06);
}
.chrome-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Network badge — the ambient local-processing cue */
.netbadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: var(--sage-soft);
  border: 1px solid var(--sage-soft-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--sage);
  letter-spacing: -0.01em;
  cursor: default;
}
.netbadge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .netbadge .dot { animation: none; }
}

/* Trial pill */
.trial-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(138,106,43,0.15);
}
.trial-pill a {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Page container */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}
.page-narrow {
  max-width: 880px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}

/* ─────────── Buttons ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background 120ms, transform 60ms;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: translateY(0.5px); }
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: var(--navy-2); }
.btn-primary:disabled { background: var(--ink-4); cursor: not-allowed; }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--ink-4); }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover { background: rgba(20,18,12,0.04); color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }

/* ─────────── Inputs ─────────── */
.input, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color 120ms, box-shadow 120ms;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input-lg { padding: 12px 14px; font-size: 16px; }

/* ─────────── Cards ─────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 160ms, box-shadow 160ms, transform 160ms;
}
.card-hover {
  cursor: pointer;
}
.card-hover:hover {
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-2);
}
.card-flat {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 20px;
}

/* ─────────── Chips ─────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.chip-navy { background: var(--navy-soft); color: var(--navy); }
.chip-sage { background: var(--sage-soft); color: var(--sage); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-brick { background: var(--brick-soft); color: var(--brick); }
.chip-neutral { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--rule); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }

/* Source-state — text-only variant */
[data-source-state-style="text"] .chip-source-state {
  background: transparent !important;
  padding: 0 !important;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
[data-source-state-style="text"] .chip-source-state .dot { display: none; }

/* ─────────── Footer ─────────── */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 28px;
  background: rgba(246, 244, 239, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--rule);
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
  z-index: 40;
  letter-spacing: -0.002em;
}

/* ─────────── Divider ─────────── */
.divider { height: 1px; background: var(--rule); margin: 24px 0; }
.divider-strong { height: 1px; background: var(--rule-strong); margin: 24px 0; }

/* ─────────── Tables ─────────── */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  text-align: left;
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--rule);
}
.table th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 500;
}
.table td.num { font-variant-numeric: tabular-nums; }

/* ─────────── Footnote / citation chip ─────────── */
.fn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  margin: 0 2px;
  cursor: pointer;
  vertical-align: 1px;
  transition: background 120ms, color 120ms;
  border: 1px solid transparent;
}
.fn:hover {
  background: var(--navy);
  color: #fff;
}
.fn.fn-active {
  background: var(--navy);
  color: #fff;
}
/* Muted variant for the suppression list — same chip system, struck-through */
.fn.fn-muted {
  background: var(--surface-3);
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--ink-4);
  cursor: default;
}
.fn.fn-muted:hover {
  background: var(--surface-3);
  color: var(--ink-3);
}

/* ─── Reviewed-state dot inside a citation chip ─── */
.fn { gap: 4px; padding-right: 5px; }
.reviewed-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-5);
  display: inline-block;
  transition: background 160ms, transform 160ms;
  flex-shrink: 0;
  cursor: pointer;
}
.fn:hover .reviewed-dot { background: rgba(255,255,255,0.5); }
.fn.fn-active .reviewed-dot { background: rgba(255,255,255,0.6); }
.reviewed-dot.reviewed-dot-on { background: var(--sage); }
.fn:hover .reviewed-dot.reviewed-dot-on,
.fn.fn-active .reviewed-dot.reviewed-dot-on { background: #b7d5b1; }
.reviewed-dot:hover { transform: scale(1.4); }

/* The strike-through type treatment for suppressed-claim row text */
.mq-strike {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
  font-style: italic;
  text-decoration: line-through;
  text-decoration-color: var(--ink-5);
  text-decoration-thickness: 1px;
}

/* Matter Quality — section rows (citation density, verification) */
.mq-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background 120ms, border-color 120ms;
}
.mq-row:hover {
  background: var(--surface-2);
  border-color: var(--rule);
}

.mq-suppressed {
  border-bottom: 1px solid var(--rule);
}
.mq-suppressed:last-child { border-bottom: none; }

.mq-caret {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  color: var(--ink-3);
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  flex-shrink: 0;
  margin-top: 2px;
}
.mq-caret.mq-caret-open { transform: rotate(90deg); }

.mq-doc-thumb {
  width: 30px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: grid; place-items: center;
  color: var(--ink-3);
  flex-shrink: 0;
}

/* Deprecated banner (the old /eval route) */
.deprecated-card {
  max-width: 640px;
  margin: 64px auto;
  padding: 28px 32px;
  border: 1px dashed var(--rule-strong);
  border-radius: 10px;
  background: var(--surface-2);
}

/* ─────────── Animations ─────────── */
@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.slide-right { animation: slideInRight 240ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.slide-up { animation: slideInUp 240ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.fade-in { animation: fadeIn 200ms ease; }

/* ─────────── Layout helpers ─────────── */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.between { justify-content: space-between; }
.center { align-items: center; }
.start { align-items: flex-start; }
.flex-1 { flex: 1; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }

/* ─────────────────────────────────────────────────────────────
   Landing page — responsive overrides
   Inline styles in landing.jsx are tuned for desktop. These !important
   rules collapse the layout for tablet (≤960px) and phone (≤720px).
   ───────────────────────────────────────────────────────────── */

/* Tablet — collapse 2-col grids, shrink section padding */
@media (max-width: 960px) {
  .landing-b .lb-header-inner { padding: 14px 24px !important; gap: 12px; flex-wrap: wrap; }

  .landing-b .lb-hero { padding: 48px 24px 56px !important; }
  .landing-b .lb-hero-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .landing-b .lb-hero-h1 { font-size: 52px !important; }
  .landing-b .lb-hero-mock { height: 460px !important; }

  .landing-b .lb-workflow,
  .landing-b .lb-material,
  .landing-b .lb-audit,
  .landing-b .lb-local { padding: 64px 24px 72px !important; }
  .landing-b .lb-workflow-head,
  .landing-b .lb-material-grid,
  .landing-b .lb-audit-grid,
  .landing-b .lb-local-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .landing-b .lb-workflow-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
  .landing-b .lb-source-list { grid-template-columns: 1fr 1fr !important; }
  .landing-b .lb-workflow-h2,
  .landing-b .lb-material-h2,
  .landing-b .lb-audit-h2,
  .landing-b .lb-local-h2 { font-size: 36px !important; }

  .landing-b .lb-arch { padding: 64px 24px !important; }
  .landing-b .lb-arch-head { grid-template-columns: 1fr !important; gap: 24px !important; align-items: start !important; margin-bottom: 36px !important; }
  .landing-b .lb-arch-h2 { font-size: 38px !important; }
  .landing-b .lb-arch-frame { padding: 36px 24px 28px !important; }
  .landing-b .lb-arch-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  .landing-b .lb-arch-foot { grid-template-columns: 1fr !important; gap: 18px !important; }

  .landing-b .lb-principles { padding: 64px 24px 56px !important; }
  .landing-b .lb-principles-head { grid-template-columns: 1fr !important; gap: 24px !important; margin-bottom: 40px !important; }
  .landing-b .lb-principles-h2 { font-size: 36px !important; }
  .landing-b .lb-principle-wide { grid-template-columns: 1fr !important; padding: 32px 28px !important; gap: 28px !important; }
  .landing-b .lb-principle { padding: 28px 24px !important; }

  .landing-b .lb-isnt { padding: 56px 24px !important; }
  .landing-b .lb-isnt-grid { grid-template-columns: 1fr !important; gap: 36px !important; }

  .landing-b .lb-cta { padding: 56px 24px !important; }
  .landing-b .lb-cta-card { padding: 44px 32px !important; }
  .landing-b .lb-cta-h2 { font-size: 32px !important; }

  .landing-b .lb-footer-wrap { padding: 0 24px !important; }
}

/* Phone portrait — flatten hero mock to a single static card, stack disc tables, reduce h1s. */
@media (max-width: 720px) {
  .landing-b { overflow-x: hidden; }

  /* Header — tighter padding, smaller chip */
  .landing-b .lb-header-inner { padding: 12px 18px !important; gap: 10px; }

  /* Hero */
  .landing-b .lb-hero { padding: 32px 18px 44px !important; }
  .landing-b .lb-hero-grid { gap: 28px !important; }
  .landing-b .lb-hero-h1 {
    font-size: 38px !important;
    line-height: 1.05 !important;
    letter-spacing: -0.022em !important;
  }
  /* The mock composition uses position:absolute with negative offsets.
     On phone, flatten to a single static card and HIDE the floating bits. */
  .landing-b .lb-hero-mock {
    height: auto !important;
    min-height: 0 !important;
    position: static !important;
    margin-top: 8px !important;
    width: 100% !important;
  }
  .landing-b .lb-hero-mock > div {
    position: static !important;
    width: 100% !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    inset: auto !important;
    margin: 0 0 14px !important;
  }
  /* Hide decorative floating cards (contradiction + source) — primary brief card is enough */
  .landing-b .lb-hero-mock > div:nth-child(2),
  .landing-b .lb-hero-mock > div:nth-child(3) { display: none !important; }

  /* Email signup form — allow stacking the input above the button */
  .landing-b .lb-hero form,
  .landing-b .lb-cta form {
    flex-wrap: wrap !important;
  }
  .landing-b .lb-hero form > input,
  .landing-b .lb-cta form > input {
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }
  .landing-b .lb-hero form > button,
  .landing-b .lb-cta form > button {
    flex: 1 1 100% !important;
    justify-content: center !important;
  }

  /* Workflow, material, Source Audit, and local processing sections */
  .landing-b .lb-workflow,
  .landing-b .lb-material,
  .landing-b .lb-audit,
  .landing-b .lb-local { padding: 48px 18px 56px !important; }
  .landing-b .lb-workflow-h2,
  .landing-b .lb-material-h2,
  .landing-b .lb-audit-h2,
  .landing-b .lb-local-h2 { font-size: 30px !important; line-height: 1.12 !important; }
  .landing-b .lb-source-list {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .landing-b .lb-audit-table > div,
  .landing-b .lb-local-grid div[style*="grid-template-columns: 150px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* Architecture */
  .landing-b .lb-arch { padding: 48px 18px !important; }
  .landing-b .lb-arch-h2 { font-size: 28px !important; }
  .landing-b .lb-arch-frame { padding: 28px 16px 22px !important; }
  .landing-b .lb-arch-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
  /* The architecture frame pill labels must wrap to one line; if not, scale them down */
  .landing-b .lb-arch-frame > div[style*="top: -12"] {
    font-size: 9.5px !important;
    padding: 3px 8px !important;
  }

  /* Principles */
  .landing-b .lb-principles { padding: 48px 18px !important; }
  .landing-b .lb-principles-h2 { font-size: 28px !important; line-height: 1.12 !important; }
  .landing-b .lb-principle-wide { padding: 26px 20px !important; gap: 20px !important; }
  .landing-b .lb-principle { padding: 22px 20px !important; }

  /* Is / Isn't */
  .landing-b .lb-isnt { padding: 44px 18px !important; }

  /* Closing CTA */
  .landing-b .lb-cta { padding: 44px 18px !important; }
  .landing-b .lb-cta-card { padding: 32px 22px !important; border-radius: 14px !important; }
  .landing-b .lb-cta-h2 { font-size: 24px !important; line-height: 1.18 !important; }

  .landing-b .lb-footer-wrap { padding: 0 18px !important; }
}

/* Prevent horizontal overflow caused by any leftover negative offsets */
@media (max-width: 960px) {
  body { overflow-x: hidden; }
  /* Big display headings — allow soft-break on the rare overlong word */
  .landing-b .lb-hero-h1,
  .landing-b .lb-workflow-h2,
  .landing-b .lb-material-h2,
  .landing-b .lb-audit-h2,
  .landing-b .lb-local-h2,
  .landing-b .lb-arch-h2,
  .landing-b .lb-principles-h2,
  .landing-b .lb-cta-h2 {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }
}

/* ─────────────────────────────────────────────────────────────
   Phone portrait — full mobile pass for the principles section,
   inner mock-UIs, and the architecture frame. Every section is
   bound to viewport width; no horizontal scroll anywhere.
   ───────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  /* Universal: shrink-to-fit any nested flex/grid child so long
     mono strings and chips can't blow out the row. */
  .landing-b .lb-principle,
  .landing-b .lb-principle-wide,
  .landing-b .lb-principle *,
  .landing-b .lb-principle-wide *,
  .landing-b .lb-arch-grid > *,
  .landing-b .lb-arch-grid > * *,
  .landing-b .lb-isnt *,
  .landing-b .lb-cta-card *,
  .landing-b .lb-hero-mock * {
    min-width: 0 !important;
  }

  /* ── Principles: collapse the 2-col grid and any wide rows ── */
  .landing-b .lb-principles-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .landing-b .lb-principle-wide {
    grid-column: auto !important;
    grid-template-columns: 1fr !important;
    padding: 26px 22px !important;
    gap: 22px !important;
  }
  .landing-b .lb-principle {
    padding: 24px 22px !important;
  }
  .landing-b .lb-principle h3,
  .landing-b .lb-principle-wide h3 {
    font-size: 22px !important;
    line-height: 1.2 !important;
  }

  /* ── Inner mock UIs — bound everything to the card width ── */

  /* Contradiction card: stack the "vs." columns vertically */
  .landing-b .mock-contradiction-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 12px !important;
  }
  .landing-b .mock-contradiction-grid > div[style*="placeItems"],
  .landing-b .mock-contradiction-grid > div:nth-child(2) {
    padding: 2px 0 !important;
    text-align: center;
  }

  /* Local matter-data panel: 1 col, allow long mono strings to wrap */
  .landing-b .mock-local-data {
    padding: 16px 16px !important;
  }
  .landing-b .mock-local-data-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .landing-b .mock-local-data-grid > div {
    gap: 10px;
  }
  .landing-b .mock-local-data-grid > div > span:last-child {
    text-align: right;
    word-break: break-all;
  }

  /* Drafting-declined mock: tighten padding */
  .landing-b .mock-drafting {
    padding: 14px 16px !important;
  }

  /* ── Architecture frame: pill labels go inline (no overlap) ── */
  .landing-b .lb-arch-frame {
    padding: 22px 14px 18px !important;
    border-radius: 14px !important;
  }
  /* Targets both label pills (top:-12 substring) */
  .landing-b .lb-arch-frame > div[style*="top: -12"] {
    position: static !important;
    display: inline-flex !important;
    margin: 0 6px 8px 0 !important;
    font-size: 9.5px !important;
    padding: 3px 8px !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
  }
  /* The matter-data boundary label is long - let it shrink */
  .landing-b .lb-arch-frame > div[style*="top: -12"][style*="brick"] {
    max-width: 100%;
    white-space: normal !important;
  }
  .landing-b .lb-arch-grid > div {
    padding: 18px 16px !important;
  }
  .landing-b .lb-arch-grid h3 {
    font-size: 18px !important;
  }

  /* ── "Is / Isn't" lists: stack and shrink type ── */
  .landing-b .lb-isnt-grid {
    gap: 28px !important;
  }
  .landing-b .lb-isnt-grid ul li {
    font-size: 15px !important;
    padding: 12px 0 !important;
  }

  /* ── Hero mock floating cards: any leftover absolute children
        get fully flattened to the column width (override inline) ── */
  .landing-b .lb-hero-mock > div {
    max-width: 100% !important;
  }

  /* ── Closing CTA card: clamp inner ── */
  .landing-b .lb-cta-card form,
  .landing-b .lb-cta-card form > * {
    max-width: 100% !important;
  }

  /* ── Footer rows: wrap, don't squeeze ── */
  .landing-b .lb-footer-wrap .row {
    flex-wrap: wrap;
  }
}

/* Very small viewports — iPhone SE / older Androids */
@media (max-width: 380px) {
  .landing-b .lb-hero-h1 { font-size: 34px !important; }
  .landing-b .lb-workflow-h2,
  .landing-b .lb-material-h2,
  .landing-b .lb-audit-h2,
  .landing-b .lb-local-h2 { font-size: 28px !important; }
  .landing-b .lb-arch-h2,
  .landing-b .lb-principles-h2 { font-size: 26px !important; }
  .landing-b .lb-cta-h2 { font-size: 22px !important; }
  .landing-b .lb-hero,
  .landing-b .lb-workflow,
  .landing-b .lb-material,
  .landing-b .lb-audit,
  .landing-b .lb-local,
  .landing-b .lb-arch,
  .landing-b .lb-principles,
  .landing-b .lb-isnt,
  .landing-b .lb-cta { padding-left: 14px !important; padding-right: 14px !important; }
  .landing-b .lb-cta-card { padding: 28px 18px !important; }
}

/* ─────────── Scrollbars ─────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--ink-5);
  border-radius: 8px;
  border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }
