:root {
  --blue: #2563EB;
  --blue-50: #EAF1FF;
  --blue-100: #DCE7FF;
  --coral: #FF6B4A;
  --slate: #1F2937;
  --slate-2: #334155;
  --muted: #6B7280;
  --hair: #E7EAF0;
  --hair-2: #EFF1F5;
  --gray: #F3F4F6;
  --bg: #FEFEFE;
  --white: #FFFFFF;
  --radius: 14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Cross-document view transitions (Chromium 126+; gracefully ignored
   elsewhere). Pairs with site.js for a CSS-only fallback fade on
   browsers that don't support cross-doc transitions yet. */
@view-transition { navigation: auto; }
::view-transition-old(root) {
  animation: trex-page-out .22s cubic-bezier(.4, 0, .2, 1) both;
}
::view-transition-new(root) {
  animation: trex-page-in .26s cubic-bezier(.2, 0, 0, 1) both;
}
@keyframes trex-page-out {
  to { opacity: 0; transform: translate3d(0, -8px, 0); }
}
@keyframes trex-page-in {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
}
/* Fallback fade for browsers without cross-doc transitions */
html.nav-fading body {
  opacity: 0;
  transform: translate3d(0, -6px, 0);
  transition: opacity .14s ease, transform .14s ease;
}
body {
  font-family: 'Google Sans Flex', 'Google Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--slate);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.msym {
  font-family: 'Material Symbols Outlined';
  font-weight: normal; font-style: normal;
  line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; word-wrap: normal;
  direction: ltr; -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'opsz' 24, 'wght' 400, 'FILL' 0, 'GRAD' 0;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }
::selection { background: var(--blue-100); color: var(--slate); }

/* layout */
.page { max-width: 920px; margin: 0 auto; padding: 28px 32px 80px; }
@media (max-width: 720px) { .page { padding: 20px 20px 64px; } }

/* nav */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: 0.04em; font-size: 14px; color: var(--slate);
}
.brand .mark {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  background: #fff url('/assets/avatar-default.png') no-repeat center / 78%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: transform .15s ease;
}
.brand .mark::before {
  content: "";
  position: absolute; inset: 0;
  background: url('/assets/avatar-rawr.png') no-repeat center / 78%;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 1;
}
.brand .mark::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--blue);
  opacity: 0.15;
  pointer-events: none;
  border-radius: inherit;
  z-index: 2;
}
.brand:hover .mark::before,
.brand .mark.rawr::before,
.brand .mark.rawring::before { opacity: 1; }
.brand:hover .mark,
.brand .mark.rawr { animation: rawr-pop .55s cubic-bezier(.36,1.5,.55,1) both; }
.brand .mark.rawring { animation: rawr-wiggle 1.4s ease-in-out infinite; }
@keyframes rawr-pop {
  0%   { transform: scale(1) rotate(0); }
  18%  { transform: scale(1.22) rotate(-7deg); }
  35%  { transform: scale(1.18) rotate(6deg); }
  52%  { transform: scale(1.15) rotate(-4deg); }
  70%  { transform: scale(1.12) rotate(2deg); }
  100% { transform: scale(1.08) rotate(0); }
}
@keyframes rawr-wiggle {
  0%, 100% { transform: scale(1.06) rotate(0); }
  25%      { transform: scale(1.10) rotate(-4deg); }
  75%      { transform: scale(1.10) rotate(4deg); }
}
.nav-links {
  display: flex; align-items: center; gap: 28px;
  margin-left: auto;
  font-size: 14px; font-weight: 600; color: var(--blue);
}
.nav-links a { color: inherit; text-decoration: none; }
.nav-links a:hover { color: #1d54c9; }
@media (max-width: 720px) { .nav-links { display: none; } }

/* hero */
.hero {
  display: grid;
  grid-template-columns: 280px minmax(0, 540px);
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  text-align: left;
}
.hero .copy { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.mascot {
  width: 280px; height: 280px;
  background: url('/assets/rex.webp') center/contain no-repeat;
  animation: bob 4.5s ease-in-out infinite;
  transform-origin: center bottom;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(1.2deg); }
}
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 18px; }
  .hero .copy { align-items: center; }
  .mascot { width: 200px; height: 200px; }
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--hair); background: var(--white);
  padding: 5px 11px; border-radius: 999px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }
.eyebrow .eyebrow-ic { color: var(--blue); flex-shrink: 0; display: block; }
.eyebrow strong { font-weight: 600; color: var(--slate); }
.micro-features {
  list-style: none; margin: 4px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 13px; color: var(--slate-2);
}
.micro-features li {
  display: inline-flex; align-items: center; gap: 6px;
}
.micro-features .msym {
  font-size: 16px; color: var(--blue);
  font-variation-settings: 'opsz' 20, 'wght' 500, 'FILL' 1, 'GRAD' 0;
}
@media (max-width: 720px) {
  .micro-features { justify-content: center; }
}
h1 {
  font-size: 54px; line-height: 1.02; letter-spacing: -0.035em;
  font-weight: 600; margin: 0; max-width: 560px;
  text-wrap: balance;
}
h1 em { font-style: normal; color: var(--blue); }
.sub {
  font-size: 16.5px; color: var(--muted); margin: 0;
  text-wrap: pretty; line-height: 1.55;
}
@media (max-width: 720px) { h1 { font-size: 40px; } }

/* drop zone */
.drop-wrap { margin: 34px auto 0; width: 100%; }
/* On wider viewports only the rich result card breaks out of the
   .page max-width — the idle / file-confirm / analyzing states stay
   at the normal page width. */
@media (min-width: 1100px) {
  .drop.drop-results-rich {
    margin-left: -88px;
    margin-right: -88px;
    width: auto;
  }
}
.drop {
  position: relative;
  background: var(--white);
  border: 1.5px dashed #C9D2E0;
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
  cursor: pointer;
  text-align: center;
}
.drop:hover { border-color: var(--blue); background: #FCFDFF; }
.drop.dragover { border-color: var(--blue); background: var(--blue-50); border-style: solid; }
.drop[data-state="file"] { cursor: default; border-style: solid; border-color: var(--hair); }
.drop[data-state="analyzing"],
.drop[data-state="results"] {
  cursor: default; border-style: solid; border-color: var(--hair);
  text-align: left; padding: 0; overflow: hidden;
}
.drop.drop-results-rich {
  background: var(--blue-50);
  border: 0;
  padding: 0;
  border-radius: var(--radius-lg);
}

/* rich result card */
.rich-card { padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.rich-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 4px; flex-wrap: wrap;
}
.rich-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase;
  margin-bottom: 6px;
  display: inline-flex; align-items: center; gap: 8px;
}
.rich-eyebrow .free-pill {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: var(--blue);
  background: #DCE4FE;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.rich-headline {
  font-size: 26px; font-weight: 600; letter-spacing: -0.025em;
  margin: 0; color: var(--slate);
}
.tier-pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tier-pill {
  font-family: inherit;
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--hair);
  background: var(--white); color: var(--slate);
  padding: 11px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
}
.tier-pill:hover {
  border-color: var(--blue); transform: translate3d(0, -1px, 0);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}
.tier-pill.active {
  background: var(--blue); color: #fff; border-color: var(--blue);
}
.tier-pill.active:hover {
  background: #1d54c9; border-color: #1d54c9;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32);
}

/* doc card */
.doc-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 22px 4px;
  display: flex; flex-direction: column; gap: 22px;
}
.doc-card .doc-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.doc-card .doc-icon {
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--blue-50); color: var(--blue);
  display: grid; place-items: center; flex-shrink: 0;
}
.doc-card .doc-meta { flex: 1; min-width: 200px; }
.doc-card .doc-title {
  font-size: 17px; font-weight: 600; color: var(--slate);
  letter-spacing: -0.01em;
}
.doc-card .doc-title.muted { color: var(--muted); font-style: italic; font-weight: 500; }
.doc-card .doc-sub {
  font-size: 13px; color: var(--muted);
  margin-top: 2px;
}
.doc-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-badges .badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 5px 11px; border-radius: 999px;
  background: var(--gray); color: var(--slate);
}
.doc-badges .badge.warn { background: #FFF1EC; color: #B33B1F; }
.doc-badges .badge.ok { background: #E8F6EE; color: #1B6E3D; }
.doc-badges .badge .pip {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}
.doc-badges .badge .msym {
  font-size: 14px;
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
  line-height: 1;
}

/* terms grid */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 18px;
  padding: 0 0 22px;
}
@media (max-width: 880px) {
  .terms-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .terms-grid { grid-template-columns: 1fr; }
}
.term {
  display: grid;
  grid-template-rows: 14px minmax(28px, auto) auto;
  row-gap: 6px;
  align-content: start;
  min-width: 0;
}
.term-label {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em;
  color: var(--muted); text-transform: uppercase;
  line-height: 14px;
  display: flex; align-items: center;
}
.term-value {
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--slate); line-height: 1.2;
  word-break: break-word;
  display: flex; align-items: center;
  min-height: 28px;
}
.term-value.empty {
  font-size: 14px; font-weight: 500;
  font-style: italic;
  color: #9aa3b2;
  letter-spacing: 0;
  gap: 8px;
}
.term-value.empty::before {
  content: "";
  width: 10px; height: 1px;
  background: currentColor;
  opacity: 0.6;
  flex-shrink: 0;
}
.term-note {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  min-height: 18px;
}
.term-empty .term-note { color: #9aa3b2; }
.term-warning {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px;
  background: #FFF1EC;
  color: #B33B1F;
  padding: 6px 10px 6px 8px;
  border-radius: 10px;
  font-size: 11.5px; line-height: 1.4;
  align-self: flex-start;
  max-width: 100%;
}
.term-warning .msym {
  font-size: 14px;
  font-variation-settings: 'opsz' 20, 'wght' 700, 'FILL' 1, 'GRAD' 0;
  line-height: 1;
  flex-shrink: 0;
}

/* locked row */
.locked-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  border-top: 1px solid rgba(37, 99, 235, 0.1);
  padding-top: 22px;
  margin-top: 4px;
}
@media (max-width: 720px) {
  .locked-row { grid-template-columns: 1fr; }
}
.locked-card { display: flex; flex-direction: column; gap: 8px; }
.locked-pill {
  display: inline-flex; align-items: center; gap: 5px;
  align-self: flex-start;
  font-size: 11px; font-weight: 600;
  background: #B33B1F; color: #fff;
  border: 0;
  padding: 5px 11px; border-radius: 999px;
  letter-spacing: 0.02em;
}
.locked-pill svg { stroke: currentColor; }
.locked-label {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em;
  color: var(--muted); text-transform: uppercase;
  margin-top: 4px;
}
.locked-desc {
  font-size: 13.5px; color: var(--slate-2); line-height: 1.5;
  margin: 0; max-width: 360px;
}
.locked-cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue); color: #fff;
  border: 0; padding: 9px 16px;
  border-radius: 9px;
  font-size: 13px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  margin-top: 6px;
  transition: background .15s, transform .12s;
}
.locked-cta:hover { background: #1d54c9; transform: translate3d(0, -1px, 0); }

/* blue CTA strip — bottom chin of the rich-card */
.agent-cta[hidden] { display: none; }
.agent-cta {
  background: var(--blue);
  color: #fff;
  border-radius: 0;
  /* extend to the rich-card edges (cancel rich-card padding 28/24) */
  margin: 16px -28px -24px;
  padding: 28px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.agent-cta p {
  margin: 0;
  font-size: 14px; line-height: 1.6;
  max-width: 560px;
  flex: 1; min-width: 240px;
}
.agent-cta strong { font-weight: 600; }
.agent-cta-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.agent-cta-btn {
  font-family: inherit;
  font-size: 13.5px; font-weight: 500;
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 0;
  padding: 12px 22px;
  border-radius: 11px;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.agent-cta-btn:hover {
  background: rgba(255,255,255,0.28);
  transform: translate3d(0, -1px, 0);
}
.agent-cta-btn.primary { background: #fff; color: var(--blue); }
.agent-cta-btn.primary:hover { background: #f3f5fb; }

/* foot row */
.rich-foot-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding-top: 4px;
}
.rich-foot-disclaim {
  font-size: 12px; color: var(--muted);
  margin: 0; max-width: 460px; line-height: 1.5;
}
.rich-foot-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.ghost-light {
  background: var(--white);
  border: 1px solid var(--hair);
}
.rich-foot-note {
  font-size: 13px; color: var(--muted);
  margin: 0;
}
.rich-foot-note.error { color: #B33B1F; }

.drop-illu {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--blue-50);
  display: grid; place-items: center; margin: 0 auto 18px;
  color: var(--blue);
}
.drop-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 6px; }
.drop-sub { font-size: 14px; color: var(--muted); margin: 0; }
.meta-row {
  margin-top: 22px; display: flex; justify-content: center; gap: 18px;
  font-size: 12px; color: var(--muted);
}
.meta-row span { display: inline-flex; align-items: center; gap: 6px; }

.file-in { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Demo CTA — small tertiary link below the drop zone */
.demo-cta-row { margin-top: 14px; text-align: center; }
.demo-cta {
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .15s, background .15s;
}
.demo-cta:hover { color: var(--blue); background: rgba(37, 99, 235, 0.06); }
.demo-cta .msym {
  font-size: 16px;
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
  color: var(--blue);
}
.demo-cta .demo-cta-hint { color: #9aa3b2; font-weight: 400; }
@media (max-width: 540px) {
  .demo-cta .demo-cta-hint { display: none; }
}

/* file selected state */
.file-confirm { padding: 28px 24px; }
.file-confirm-row {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin-bottom: 18px;
}
.file-confirm-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* analyzing */
.analyzing { padding: 28px 28px 24px; }
.analyzing-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.file-pill {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--gray); border-radius: 10px; padding: 8px 12px;
  font-size: 13px; font-weight: 500; color: var(--slate);
}
.file-pill .ic { color: var(--blue); display: inline-flex; }
.progress-track {
  margin-top: 22px; height: 4px; background: var(--hair-2);
  border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--blue); border-radius: 999px;
  transition: width .4s ease;
  width: 0%;
}
.steps { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.server-status {
  margin: 14px 0 0;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}
.server-status:empty { display: none; }
.step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.step.done { color: var(--slate); }
.step.active { color: var(--slate); }
.step .tick {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--hair); display: grid; place-items: center; flex-shrink: 0;
  background: var(--white); color: var(--blue);
  font-size: 10px;
}
.step.done .tick { background: var(--blue); border-color: var(--blue); color: #fff; }
.step.active .tick { border-color: var(--blue); background: var(--white); }
.step.active .tick::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(.6); opacity: .6; }
  50% { transform: scale(1); opacity: 1; }
}

/* results */
.results { display: grid; grid-template-columns: 1fr; }
.results-head {
  padding: 22px 28px; border-bottom: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.results-head .left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.doc-icon {
  width: 36px; height: 36px; border-radius: 9px; background: var(--blue-50);
  display: grid; place-items: center; color: var(--blue); flex-shrink: 0;
}
.doc-meta { display: flex; flex-direction: column; min-width: 0; }
.doc-name {
  font-size: 14px; font-weight: 600; color: var(--slate);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px;
}
.doc-stats { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  background: var(--gray); color: var(--slate);
  padding: 5px 10px; border-radius: 999px;
}
.badge.warn { background: #FFF1EC; color: #B33B1F; }
.badge.ok { background: #E8F6EE; color: #1B6E3D; }
.badge .pip { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.results-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 720px) { .results-body { grid-template-columns: 1fr; } }
.col { padding: 24px 28px; }
.col + .col { border-left: 1px solid var(--hair); }
@media (max-width: 720px) {
  .col + .col { border-left: 0; border-top: 1px solid var(--hair); }
}
.col h4 {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 14px;
}
.summary { font-size: 14.5px; line-height: 1.6; color: var(--slate-2); margin: 0; }
.summary + .summary { margin-top: 10px; }

.issues { display: flex; flex-direction: column; gap: 10px; }
.issue {
  border: 1px solid var(--hair); border-radius: 12px; padding: 14px;
  display: flex; gap: 12px; align-items: flex-start; background: var(--white);
  transition: border-color .15s;
}
.issue:hover { border-color: #C9D2E0; }
.issue .sev {
  width: 8px; align-self: stretch; border-radius: 4px; flex-shrink: 0; background: var(--muted);
}
.issue.high .sev { background: var(--coral); }
.issue.med .sev,
.issue.medium .sev { background: #F5B445; }
.issue.low .sev { background: #9AA3B2; }
.issue-body { flex: 1; min-width: 0; }
.issue-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 4px;
}
.issue-title { font-size: 14px; font-weight: 600; color: var(--slate); margin: 0; }
.issue-loc { font-size: 11px; color: var(--muted); }
.issue-desc { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }
.issue-quote {
  margin-top: 10px; font-size: 12.5px; line-height: 1.55; color: var(--slate-2);
  border-left: 2px solid var(--hair); padding: 2px 0 2px 10px;
  font-style: italic;
}
.issue-fix {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--blue); cursor: pointer;
}
.issue-fix:hover { text-decoration: underline; }

.actions {
  padding: 18px 28px; border-top: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; background: #FCFCFD;
}

/* shared buttons */
.btn {
  font-size: 13.5px; font-weight: 500; border-radius: 9px; cursor: pointer;
  padding: 9px 14px; border: 1px solid var(--hair); background: var(--white); color: var(--slate);
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { border-color: #C9D2E0; background: #FAFBFC; }
.btn.primary { background: var(--slate); color: #fff; border-color: var(--slate); }
.btn.primary:hover { background: #000; border-color: #000; }
.btn.unlock { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.unlock:hover { background: #1d54c9; border-color: #1d54c9; }
.btn.panel {
  background: linear-gradient(135deg, #2563EB 0%, #FF6B4A 100%);
  border: 0; color: #fff;
  position: relative; overflow: hidden;
}
.btn.panel:hover { filter: brightness(1.05); }
.btn.panel .msym { font-size: 16px; font-variation-settings: 'opsz' 20, 'wght' 500, 'FILL' 1, 'GRAD' 0; }
.btn.panel .badge-mini {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  background: rgba(255,255,255,0.22); padding: 2px 6px; border-radius: 999px;
  margin-left: 2px;
}
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--slate); background: transparent; }
.browse {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--white); background: var(--slate);
  padding: 10px 16px; border-radius: 10px; border: 0; cursor: pointer;
}

/* error */
.error-msg {
  margin-top: 14px;
  background: #FFF1EC;
  border: 1px solid #FFD2C2;
  color: #B33B1F;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

/* below the fold */
.section { margin-top: 96px; }
.section-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 8px;
}
.kicker {
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue); font-weight: 600;
}
.section h2 { font-size: 24px; letter-spacing: -0.02em; font-weight: 600; margin: 10px 0 0; }
.section-h-link { font-size: 13px; color: var(--muted); text-decoration: none; }
.section-h-link:hover { color: var(--slate); }

.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 720px) { .three { grid-template-columns: 1fr; } }
.card {
  background: var(--white); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 24px;
}
.step-icon {
  width: 42px; height: 42px; border-radius: 11px; background: var(--blue-50);
  display: grid; place-items: center; color: var(--blue); margin-bottom: 14px;
}
.step-icon .msym { font-size: 22px; }
.num {
  font-size: 11px; color: var(--blue); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px;
}
.card h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.card p { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0; }

/* =============================================================
   Homepage features grid — three product-style cards with animated
   SVG pictograms. Each card sells one of the three flagship views:
   Instant Contract Scan, Visual Comparison, Live Contract Chat.
   ============================================================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 880px) {
  .features-grid { grid-template-columns: 1fr; }
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color .18s ease, transform .18s ease, box-shadow .2s ease;
}
.feature-card:hover {
  border-color: #C9D2E0;
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.feature-pictogram {
  background: linear-gradient(180deg, #F5F8FF 0%, #EAF1FF 100%);
  border: 1px solid #E1E8FE;
  border-radius: var(--radius);
  padding: 18px;
  margin: -8px -8px 22px;
  aspect-ratio: 16 / 11;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.feature-pictogram svg {
  width: 100%;
  height: 100%;
  display: block;
}
.feature-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}
.feature-card h3 {
  font-family: 'Google Sans Flex', ui-sans-serif, system-ui, sans-serif;
  font-size: 22px; line-height: 1.15; letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--slate);
  margin: 0 0 12px;
  text-wrap: balance;
}
.feature-card p {
  font-size: 14.5px; line-height: 1.55; color: var(--muted);
  margin: 0 0 18px;
  text-wrap: pretty;
  flex: 1;
}
.feature-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  align-self: flex-start;
  padding: 4px 0;
  transition: gap .15s ease;
}
.feature-cta svg {
  transition: transform .15s ease;
}
.feature-cta:hover { color: #1d54c9; }
.feature-cta:hover svg { transform: translateX(2px); }

/* ---- Pictogram animations ---- */

/* SCAN: a horizontal beam slides down the document, looping. The
   gradient gives the beam a soft glowing edge; a thin solid edge
   line at its top makes the leading edge crisp. */
.feature-scan .scan-beam {
  animation: feature-scan-beam 3.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.feature-scan .scan-edge {
  animation: feature-scan-edge 3.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.feature-scan .scan-flag {
  opacity: 0;
  animation: feature-scan-flag 3.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.feature-scan .scan-flag-2 { animation-delay: 0.6s; }
@keyframes feature-scan-beam {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(98px); opacity: 0; }
}
@keyframes feature-scan-edge {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: 0.95; }
  85%  { opacity: 0.95; }
  100% { transform: translateY(98px); opacity: 0; }
}
@keyframes feature-scan-flag {
  0%, 35%   { opacity: 0; transform: scale(0.6); }
  45%, 80%  { opacity: 1; transform: scale(1); }
  100%      { opacity: 1; transform: scale(1); }
}

/* OVERLAY: front document gently slides L↔R across the back document,
   reading as "compare". */
.feature-overlay .cmp-front {
  animation: feature-overlay-slide 5.4s ease-in-out infinite;
  transform-origin: center;
}
@keyframes feature-overlay-slide {
  0%, 100% { transform: translateX(-6px); }
  50%      { transform: translateX(6px); }
}

/* CHAT: typing dots bounce with staggered delays, classic "is typing"
   indicator. */
.feature-chat .chat-dot {
  animation: feature-chat-dot 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.feature-chat .chat-dot-2 { animation-delay: 0.18s; }
.feature-chat .chat-dot-3 { animation-delay: 0.36s; }
@keyframes feature-chat-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30%           { transform: translateY(-3px); opacity: 1; }
}

/* Reduce motion respects user preference. */
@media (prefers-reduced-motion: reduce) {
  .feature-scan .scan-beam,
  .feature-scan .scan-edge,
  .feature-scan .scan-flag,
  .feature-overlay .cmp-front,
  .feature-chat .chat-dot {
    animation: none;
  }
  .feature-scan .scan-beam,
  .feature-scan .scan-edge { opacity: 0; }
}

/* SEO form farm */
.farm {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--hair); border: 1px solid var(--hair);
  border-radius: var(--radius); overflow: hidden;
}
@media (max-width: 980px) { .farm { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .farm { grid-template-columns: 1fr; } }
.form-card {
  background: var(--white); padding: 22px 22px 22px;
  display: flex; flex-direction: column; gap: 8px;
  color: inherit;
}
.form-card .num-pill {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: flex-start;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--blue); background: var(--blue-50);
  padding: 3px 8px; border-radius: 6px;
}
.form-card .soon-pill {
  display: inline-flex; align-items: center;
  font-family: 'Google Sans Flex', inherit;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #B33B1F; background: #FFF1EC;
  padding: 3px 8px; border-radius: 6px;
  flex-shrink: 0;
}
.form-card.soon h3,
.form-card.soon p { color: var(--muted); }
.form-card-foot {
  margin-top: auto;
  padding-top: 16px;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 12px;
}
.form-card .start-review-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, gap .14s, transform .12s;
}
.form-card .start-review-btn:hover {
  background: #1d54c9;
  gap: 8px;
  transform: translate3d(0, -1px, 0);
}
.form-card .trec-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  text-decoration: none;
  transition: gap .14s, color .14s;
}
.form-card .trec-link:hover { gap: 7px; color: var(--blue); }
.form-card h3 {
  font-size: 15px; font-weight: 600; margin: 6px 0 0;
  letter-spacing: -0.01em; line-height: 1.3;
}
.form-card p { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }
.form-card .go {
  margin-top: auto; padding-top: 10px;
  font-size: 12.5px; color: var(--blue); font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
  transition: gap .14s;
}
.form-card:hover .go { gap: 8px; }
.farm-foot {
  margin-top: 18px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--muted);
}
.farm-foot a { color: var(--slate); text-decoration: none; font-weight: 500; }
.farm-foot a:hover { color: var(--blue); }
.farm-foot > div { font-size: 14px; line-height: 1.6; max-width: 720px; }
.farm-foot strong { color: var(--slate); font-weight: 600; }
.see-all-forms.popped {
  animation: see-all-pop .55s cubic-bezier(.36, 1.5, .55, 1) both;
  pointer-events: none;
}
@keyframes see-all-pop {
  0%   { transform: scale(1) rotate(0); opacity: 1; }
  35%  { transform: scale(1.18) rotate(-2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* SEO copy block */
.seo-prose {
  margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--hair);
  columns: 2; column-gap: 48px;
  font-size: 14px; color: var(--muted); line-height: 1.7;
}
@media (max-width: 720px) { .seo-prose { columns: 1; } }
.seo-prose p { margin: 0 0 14px; break-inside: avoid; }
.seo-prose b { color: var(--slate); font-weight: 600; }

/* faq */
.faq { display: flex; flex-direction: column; }
.faq details { border-top: 1px solid var(--hair); padding: 18px 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--hair); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; font-weight: 500; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 18px; }
.faq details[open] summary::after { content: "–"; }
.faq p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 10px 0 0; max-width: 680px; }

/* legal disclaimer */
.legal-disclaim {
  margin: 64px 0 0;
  padding: 22px 26px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  color: var(--blue);
  font-size: 13px;
  line-height: 1.55;
  display: flex;
  align-items: center;
  gap: 18px;
}
.legal-disclaim .cool-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  background: #fff url('/assets/avatar-cool.png') no-repeat center / 78%;
  flex-shrink: 0;
}
.legal-disclaim .text { flex: 1; }
.legal-disclaim strong {
  color: var(--blue);
  font-weight: 700;
}
@media (max-width: 540px) {
  .legal-disclaim { flex-direction: column; text-align: center; }
}

/* footer */
footer {
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--muted); flex-wrap: wrap; gap: 8px;
}
footer a { color: inherit; text-decoration: none; margin-left: 18px; }
footer a:hover { color: var(--slate); }

/* fade-in */
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* chat widget */
.chat-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.35), 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  z-index: 9998;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translate3d(0, 80px, 0) scale(.6);
  opacity: 0;
  transition: transform .55s cubic-bezier(.36, 1.5, .55, 1),
              opacity .35s ease,
              box-shadow .2s ease;
}
.chat-fab.show {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}
.chat-fab:hover {
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.5), 0 6px 16px rgba(0, 0, 0, 0.12);
  transform: translate3d(0, -2px, 0) scale(1.04);
}
.chat-fab .fab-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #fff url('/assets/avatar-default.png') no-repeat center / 86%;
  transition: background-image .15s ease;
  position: relative;
  overflow: hidden;
}
.chat-fab .fab-avatar::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--blue);
  opacity: 0.15;
  pointer-events: none;
  border-radius: inherit;
}
.chat-fab:hover .fab-avatar {
  background-image: url('/assets/avatar-rawr.png');
  animation: rawr-pop .55s cubic-bezier(.36, 1.5, .55, 1) both;
}
.chat-fab .fab-pulse {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  opacity: 0;
  animation: fab-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
.chat-fab.show .fab-pulse {
  opacity: 1;
}
@keyframes fab-pulse {
  0%   { transform: scale(.85); opacity: .6; }
  70%  { transform: scale(1.4);  opacity: 0; }
  100% { transform: scale(1.4);  opacity: 0; }
}
.chat-fab .fab-tooltip {
  position: absolute;
  right: 78px;
  top: 50%;
  transform: translate3d(8px, -50%, 0);
  background: var(--slate);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .25s cubic-bezier(.36, 1.4, .55, 1);
}
.chat-fab.show .fab-tooltip {
  opacity: 1;
  transform: translate3d(0, -50%, 0);
}
.chat-fab.fab-open .fab-tooltip { opacity: 0; }

.chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  height: 580px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18), 0 8px 16px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transform: translate3d(0, 24px, 0) scale(.96);
  opacity: 0;
  transform-origin: bottom right;
  transition: transform .35s cubic-bezier(.36, 1.4, .55, 1), opacity .25s ease;
  pointer-events: none;
}
.chat-panel.open {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Inline mode — used inside the /r/<code> dashboard's Chat tab.
   Panel becomes a tall in-page card instead of a floating window:
   no fixed positioning, full container width, comfortable height. */
.chat-panel.is-inline {
  position: static;
  width: 100%;
  max-width: 100%;
  height: min(calc(100vh - 220px), 760px);
  max-height: none;
  bottom: auto;
  right: auto;
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
  transform: none;
  opacity: 1;
  pointer-events: auto;
  z-index: auto;
  transition: none;
}
.chat-panel.is-inline.open { transform: none; }
.chat-panel.is-inline .chat-header {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.chat-header {
  background: linear-gradient(135deg, #2563EB 0%, #1d54c9 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.chat-header .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  background: #fff url('/assets/avatar-cool.png') no-repeat center / 78%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.chat-header .avatar::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--blue);
  opacity: 0.15;
  pointer-events: none;
  border-radius: inherit;
}
.chat-header .name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.chat-header .status {
  font-size: 11.5px; opacity: .8;
  display: inline-flex; align-items: center; gap: 5px;
}
.chat-header .status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
}
.chat-header .close {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.15);
  border: 0; color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s;
  font-family: inherit;
}
.chat-header .close:hover { background: rgba(255, 255, 255, 0.28); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  background: linear-gradient(180deg, #FAFBFD 0%, #F5F7FB 100%);
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: #d6dae3; border-radius: 3px; }

.chat-msg {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  animation: msg-in .28s ease-out both;
}
@keyframes msg-in {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: none; }
}
.chat-msg.bot { align-items: flex-end; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg .bot-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff url('/assets/avatar-cool.png') no-repeat center / 78%;
  border: 1.5px solid var(--blue-100);
  flex-shrink: 0;
  margin-bottom: 2px;
}
.chat-msg .bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg.bot .bubble {
  background: #fff;
  color: var(--slate-2);
  border: 1px solid var(--hair);
  border-bottom-left-radius: 4px;
}
.chat-msg.user .bubble {
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg .bubble a {
  color: inherit;
  text-decoration: underline;
}
.chat-msg .bubble strong { font-weight: 600; }

.chat-typing {
  display: inline-flex; gap: 4px; align-items: center;
  padding: 6px 4px;
}
.chat-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: translate3d(0, 0, 0); opacity: .35; }
  40%           { transform: translate3d(0, -5px, 0); opacity: 1; }
}

.chat-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 6px;
}
.chat-suggestion {
  font-family: inherit;
  background: #fff;
  border: 1px solid var(--hair);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.chat-suggestion:hover {
  border-color: var(--blue);
  background: var(--blue-50);
}

.chat-input-row {
  border-top: 1px solid var(--hair);
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #fff;
}
.chat-input {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  color: var(--slate);
  background: var(--bg-alt, #FAFBFC);
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 9px 12px;
  resize: none;
  max-height: 96px;
  line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
.chat-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.chat-send {
  background: var(--blue);
  color: #fff;
  border: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background .15s, transform .12s;
}
.chat-send:hover:not(:disabled) {
  background: #1d54c9;
  transform: scale(1.05);
}
.chat-send:disabled {
  background: var(--hair);
  color: var(--muted);
  cursor: not-allowed;
}

.chat-disclaimer {
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  padding: 6px 12px 10px;
  background: #fff;
  line-height: 1.4;
}

@media (max-width: 540px) {
  .chat-panel {
    bottom: 0; right: 0;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .chat-fab { bottom: 16px; right: 16px; width: 56px; height: 56px; }
}

/* prose pages (privacy, terms) */
.prose {
  max-width: 640px;
  margin: 24px 0 0;
  color: var(--slate-2);
  font-size: 16px;
  line-height: 1.65;
}
.prose .page-title {
  font-size: 36px;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--slate);
  margin: 0 0 6px;
}
.prose .page-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 32px;
}
.prose h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--slate);
  margin: 28px 0 8px;
}
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--blue); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose .last-updated {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
  font-size: 12px;
  color: var(--muted);
}

/* contact form */
.contact-form {
  max-width: 540px;
  margin: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-form .field {
  display: flex; flex-direction: column; gap: 6px;
}
.contact-form label {
  font-size: 13px; font-weight: 500; color: var(--slate);
}
.contact-form input,
.contact-form textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--slate);
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: 11px 14px;
  transition: border-color .15s, box-shadow .15s;
  -webkit-font-smoothing: antialiased;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.contact-form textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}
.contact-form .honeypot { display: none; }
.contact-form .submit-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 4px;
}
.contact-form .submit-btn {
  background: var(--blue); color: #fff;
  border: 0; padding: 11px 22px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.contact-form .submit-btn:hover:not(:disabled) { background: #1d54c9; }
.contact-form .submit-btn:disabled {
  background: var(--hair); color: var(--muted); cursor: not-allowed;
}
.contact-form .form-error {
  background: #FFF1EC;
  border: 1px solid #FFD2C2;
  color: #B33B1F;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

.form-success {
  margin: 24px 0 0;
  padding: 32px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 540px;
}
.form-success .icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid; place-items: center;
  margin: 0 auto 18px;
}
.form-success h2 {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--slate);
  margin: 0 0 8px;
}
.form-success p {
  font-size: 15px; color: var(--slate-2);
  margin: 0 0 18px;
  line-height: 1.55;
}
.form-success .home-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--blue);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}
.form-success .home-link:hover { text-decoration: underline; }

.full-report-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

/* full report (post-payment) */
.full-report-section {
  margin-top: 18px;
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.full-report-section h3 {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 24px 0 14px;
}
.full-report-section h3:first-child { margin-top: 0; }
.full-report-section p { font-size: 14.5px; line-height: 1.6; color: var(--slate-2); margin: 0 0 10px; }
.full-report-section .mod {
  border: 1px solid var(--hair); border-radius: 12px; padding: 16px;
  margin-bottom: 12px;
}
.full-report-section .mod-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.full-report-section .mod-clause { font-weight: 600; flex: 1; font-size: 14px; }
.full-report-section .risk-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: #fff; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.full-report-section .risk-low { background: #1B6E3D; }
.full-report-section .risk-medium,
.full-report-section .risk-med { background: #F5B445; color: #5a3a00; }
.full-report-section .risk-high { background: var(--coral); }
.full-report-section .mod-text-block {
  font-size: 13px; margin: 8px 0; padding: 10px 12px;
  background: var(--gray); border-radius: 8px;
}
.full-report-section .mod-text-block .label {
  display: block; font-weight: 600; color: var(--muted);
  font-size: 11px; margin-bottom: 3px; letter-spacing: 0.04em; text-transform: uppercase;
}
.full-report-section .mod-questions { margin-top: 10px; }
.full-report-section .mod-questions ul { margin: 6px 0 0; padding-left: 20px; }
.full-report-section .mod-questions li { font-size: 13.5px; color: var(--slate-2); }
.full-report-section table { width: 100%; border-collapse: collapse; font-size: 14px; }
.full-report-section table td { padding: 6px 0; vertical-align: top; }
.full-report-section table td:first-child { color: var(--muted); width: 36%; }
.full-report-section table tr + tr td { border-top: 1px solid var(--hair-2); }

/* panel report */
.panel-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.panel-status {
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.panel-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border: 1px solid var(--hair); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 18px;
  background: var(--white);
}
.panel-tab {
  background: var(--bg-alt, #FAFBFC); border: 0; cursor: pointer;
  padding: 14px 16px; text-align: left;
  border-right: 1px solid var(--hair);
  display: flex; flex-direction: column; gap: 4px;
  font-family: inherit;
  transition: background .15s;
}
.panel-tab:last-child { border-right: 0; }
.panel-tab:hover { background: #FAFBFC; }
.panel-tab.active { background: var(--white); }
.panel-tab.active .panel-tab-name { color: var(--blue); }
.panel-tab-name {
  font-size: 14px; font-weight: 600; color: var(--slate);
}
.panel-tab-state {
  font-size: 11px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 4px;
}
.panel-tab-state.complete { color: var(--ok, #1B6E3D); }
.panel-tab-state.complete::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.panel-tab-state.running::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #F5B445; animation: pulse 1s ease-in-out infinite;
}
.panel-tab-state.error { color: #B33B1F; }
.panel-tab-state.error::before {
  content: "!"; width: 12px; height: 12px; border-radius: 50%;
  background: currentColor; color: #fff;
  display: grid; place-items: center; font-size: 9px; font-weight: 700;
}
@media (max-width: 720px) {
  .panel-tabs { grid-template-columns: 1fr; }
  .panel-tab { border-right: 0; border-bottom: 1px solid var(--hair); }
  .panel-tab:last-child { border-bottom: 0; }
}

.panel-pane-loading {
  padding: 24px; text-align: center; color: var(--muted); font-size: 14px;
  background: var(--gray); border-radius: 10px;
}

.recovery-note {
  margin-top: 16px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--slate-2);
}
.recovery-note strong { color: var(--slate); }
.recovery-note code {
  display: block; margin-top: 6px;
  word-break: break-all; font-size: 11.5px; color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

/* checkout dialog */
dialog#checkout-dialog {
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 440px;
  width: 92%;
  background: var(--white);
  color: var(--slate);
  font-family: inherit;
}
dialog#checkout-dialog::backdrop { background: rgba(15, 23, 42, 0.4); }
dialog#checkout-dialog h2 {
  font-size: 18px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.015em;
}
.dialog-sub { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
dialog .close {
  position: absolute; top: 10px; right: 10px;
  background: none; border: 0; font-size: 22px; cursor: pointer;
  line-height: 1; color: var(--muted); padding: 4px 8px;
}
dialog .close:hover { color: var(--slate); }
.tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  border-bottom: 1px solid var(--hair);
}
.tab {
  background: none; border: 0; padding: 8px 12px;
  border-bottom: 2px solid transparent;
  cursor: pointer; font-size: 14px; color: var(--muted);
  font-family: inherit;
}
.tab.active { border-bottom-color: var(--blue); color: var(--slate); font-weight: 600; }
.pane { min-height: 200px; }
#payment-element { margin-bottom: 14px; }
#pay-card {
  width: 100%;
  background: var(--blue); color: #fff;
  border: 0; padding: 12px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: inherit;
}
#pay-card:disabled { background: var(--hair); color: var(--muted); cursor: not-allowed; }
#pay-card:hover:not(:disabled) { background: #1d54c9; }
#card-error { margin-top: 10px; color: #B33B1F; font-size: 13px; }
#qr { display: block; margin: 0 auto; }
.ln-amount {
  text-align: center; font-size: 15px; font-weight: 600; margin: 14px 0 8px;
}
.ln-actions {
  display: flex; gap: 8px; justify-content: center; margin: 8px 0;
}
.ln-actions button, .ln-actions a {
  padding: 7px 12px; font-size: 12.5px;
  border: 1px solid var(--hair); border-radius: 8px;
  background: var(--white); color: var(--slate);
  text-decoration: none; cursor: pointer;
  font-family: inherit;
}
.ln-actions button:hover, .ln-actions a:hover { border-color: #C9D2E0; }
.ln-status { text-align: center; color: var(--muted); margin-top: 12px; font-size: 13px; }

.coupon-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--hair);
}
.coupon-toggle {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.coupon-toggle:hover { color: var(--slate); }
.coupon-form[hidden] { display: none; }
.coupon-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.coupon-form input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--white);
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.coupon-form input:focus { outline: none; border-color: var(--blue); }
.coupon-form button {
  padding: 9px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--white);
  color: var(--slate);
  cursor: pointer;
}
.coupon-form button:hover:not(:disabled) { border-color: #C9D2E0; }
.coupon-form button:disabled { opacity: 0.5; cursor: not-allowed; }
.coupon-error {
  flex-basis: 100%;
  color: #B33B1F;
  font-size: 12.5px;
  margin: 4px 0 0;
}

/* generating-loader: post-payment loading scene */
.generating-loader[hidden] { display: none; }
.generating-loader {
  margin: 22px 0 0;
  display: block;
}
.generating-card {
  position: relative;
  background:
    radial-gradient(120% 80% at 50% 0%, #EEF3FF 0%, #F8FAFF 55%, #FFFFFF 100%);
  border: 1px solid var(--hair);
  border-radius: 18px;
  padding: 36px 32px 28px;
  text-align: center;
  overflow: hidden;
}
/* soft animated decoration */
.generating-card::before,
.generating-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  pointer-events: none;
}
.generating-card::before {
  width: 240px; height: 240px;
  top: -60px; left: -40px;
  background: #C9D7FF;
  animation: gen-drift-a 14s ease-in-out infinite alternate;
}
.generating-card::after {
  width: 280px; height: 280px;
  bottom: -80px; right: -60px;
  background: #DDE8FF;
  animation: gen-drift-b 18s ease-in-out infinite alternate;
}
@keyframes gen-drift-a {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.1); }
}
@keyframes gen-drift-b {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-30px, -20px) scale(1.05); }
}

.rex-stage[hidden] { display: none; }
.rex-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: end;
  margin: 0 auto 20px;
  z-index: 1;
}
.rex-stage[data-mode="single"] { min-height: 240px; }

.rex-spotlight {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  width: 220px; height: 36px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(38, 78, 222, 0.25), transparent 70%);
  border-radius: 50%;
  filter: blur(2px);
  animation: rex-pulse 3.2s ease-in-out infinite;
}
@keyframes rex-pulse {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(1); }
  50%      { opacity: 0.9;  transform: translateX(-50%) scale(1.08); }
}

.rex-hero {
  position: relative;
  width: 220px; height: auto;
  animation: rex-bob 2.4s ease-in-out infinite;
  transition: opacity 0.4s ease;
  user-select: none;
  -webkit-user-drag: none;
}
@keyframes rex-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-8px) rotate(1deg); }
}
.rex-hero.swapping { opacity: 0; }

/* trio for panel tier */
.rex-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}
.rex-trio-card {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.rex-trio-spot {
  position: absolute;
  bottom: 50px;
  width: 110px; height: 18px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(38, 78, 222, 0.18), transparent 70%);
  border-radius: 50%;
  filter: blur(1px);
}
.rex-trio-img {
  position: relative;
  width: 120px; height: auto;
  animation: rex-bob 2.4s ease-in-out infinite;
  transition: opacity 0.4s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.rex-trio-card[data-model="gpt"] .rex-trio-img { animation-delay: 0.5s; }
.rex-trio-card[data-model="gemini"] .rex-trio-img { animation-delay: 1.0s; }
.rex-trio-img.swapping { opacity: 0; }
.rex-trio-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  margin-top: 4px;
}
.rex-trio-state {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.rex-trio-card.is-done .rex-trio-state {
  color: var(--ok, #1B6E3D);
  font-weight: 600;
}
.rex-trio-card.is-done .rex-trio-state::before {
  content: "✓ ";
}

.generating-headline {
  position: relative;
  font-size: 20px;
  font-weight: 700;
  color: var(--slate);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  z-index: 1;
}
.generating-status {
  position: relative;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 20px;
  min-height: 22px;
  transition: opacity 0.35s ease;
  z-index: 1;
}
.generating-status.swapping { opacity: 0; }

.generating-bar {
  position: relative;
  width: min(420px, 100%);
  height: 6px;
  background: rgba(38, 78, 222, 0.10);
  border-radius: 999px;
  margin: 0 auto 14px;
  overflow: hidden;
  z-index: 1;
}
.generating-bar-fill {
  position: absolute;
  top: 0; bottom: 0;
  width: 35%;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  border-radius: 999px;
  animation: gen-bar-slide 1.8s ease-in-out infinite;
}
@keyframes gen-bar-slide {
  0%   { left: -35%; }
  100% { left: 100%; }
}
.generating-meta {
  position: relative;
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  z-index: 1;
}

.generating-actions[hidden] { display: none; }
.generating-actions {
  position: relative;
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: center;
  z-index: 1;
}
.generating-actions .btn {
  padding: 9px 18px;
  font-size: 13px;
}

/* Error mode: concerned rex, warmer tone, no progress bar */
.generating-card.is-error {
  background:
    radial-gradient(120% 80% at 50% 0%, #FFF1ED 0%, #FFF8F5 55%, #FFFFFF 100%);
  border-color: #F5C9B6;
}
.generating-card.is-error::before { background: #FFD3BD; }
.generating-card.is-error::after  { background: #FFE3D2; }
.generating-card.is-error .rex-spotlight {
  background: radial-gradient(50% 50% at 50% 50%, rgba(179, 59, 31, 0.22), transparent 70%);
}
.generating-card.is-error .rex-trio-spot {
  background: radial-gradient(50% 50% at 50% 50%, rgba(179, 59, 31, 0.16), transparent 70%);
}
.generating-card.is-error .generating-headline {
  color: #8C2A12;
}
.generating-card.is-error .generating-status {
  color: #B33B1F;
}
.generating-card.is-error #generating-bar { display: none; }

@media (max-width: 600px) {
  .rex-trio {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .generating-card { padding: 28px 18px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .generating-card::before,
  .generating-card::after,
  .rex-spotlight,
  .rex-hero,
  .rex-trio-img,
  .generating-bar-fill {
    animation: none;
  }
}

/* =============================================================
   Standalone /r/<code> dashboard
   ============================================================= */

/* Page chrome — Inter for body, Google Sans Flex for headings,
   matches the homepage page-grid container. */
.r-page {
  background: var(--bg);
  min-height: 100vh;
  font-family: 'Inter', 'Google Sans Flex', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--slate);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.r-page-frame { padding-bottom: 80px; }
.r-nav { padding-bottom: 32px; }
.r-shell {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Report intro: eyebrow + headline + deck. Uses the brand's display
   font for the headline so dashboards feel like a continuation of
   the homepage hero. */
.report-header { display: flex; flex-direction: column; gap: 8px; }
.report-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: .14em;
  color: var(--blue); text-transform: uppercase;
}
.report-eyebrow .msym {
  font-size: 14px; color: inherit;
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
.report-title {
  font-family: 'Google Sans Flex', ui-sans-serif, system-ui, sans-serif;
  font-size: 38px; line-height: 1.05; letter-spacing: -0.028em;
  font-weight: 600; color: var(--slate);
  margin: 4px 0 0; max-width: 720px;
  text-wrap: balance;
}
.report-deck {
  font-size: 16px; line-height: 1.5; color: var(--muted);
  margin: 0; max-width: 640px; text-wrap: pretty;
}
@media (max-width: 720px) {
  .report-title { font-size: 30px; }
}

/* Share card: the friendly Google-Docs-style "this URL is your login"
   surface. Replaces the yellow alert. Uses a soft blue header strip
   instead of warning colors. */
.share-card {
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.share-card-head {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 22px 16px;
  background: linear-gradient(180deg, var(--blue-50) 0%, #F3F7FF 100%);
  border-bottom: 1px solid #E1E8FE;
}
.share-card-icon {
  flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--white);
  border: 1px solid #D8E1FD;
  color: var(--blue);
  display: grid; place-items: center;
}
.share-card-icon .msym {
  font-size: 19px;
  font-variation-settings: 'opsz' 24, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
.share-card-headings { flex: 1; min-width: 0; }
.share-card-title {
  font-family: 'Google Sans Flex', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--slate); margin: 2px 0 4px;
}
.share-card-title em { font-style: normal; color: var(--blue); }
.share-card-blurb {
  margin: 0;
  font-size: 13.5px; line-height: 1.55; color: var(--slate-2);
}
.share-card-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
}
.share-card-row-icon {
  font-size: 18px; color: var(--muted); flex-shrink: 0;
  font-variation-settings: 'opsz' 20, 'wght' 500, 'FILL' 0, 'GRAD' 0;
}
.share-card-input {
  flex: 1; min-width: 0;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 13.5px;
  padding: 10px 12px;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: #FAFBFD;
  color: var(--slate);
  letter-spacing: 0.01em;
  transition: border-color .12s, background .12s;
}
.share-card-input:hover { border-color: #C9D2E0; }
.share-card-input:focus { outline: none; border-color: var(--blue); background: var(--white); }
.share-card-copy {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--slate); color: var(--white);
  border: 1px solid var(--slate);
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 14px; border-radius: 10px;
  cursor: pointer; flex-shrink: 0;
  transition: background .12s, transform .12s;
}
.share-card-copy:hover { background: #000; transform: translate3d(0, -1px, 0); }
.share-card-copy.is-copied { background: #1B6E3D; border-color: #1B6E3D; }
.share-card-copy .msym {
  font-size: 16px;
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
@media (max-width: 600px) {
  .share-card-row { flex-wrap: wrap; }
  .share-card-input { flex: 1 1 100%; order: 1; }
  .share-card-row-icon { display: none; }
  .share-card-copy { order: 2; margin-left: auto; }
}

/* Tabs — pill-row inside a soft frame. Uses Material Symbols icons. */
.r-tabs {
  display: flex;
  gap: 4px;
  background: var(--gray);
  padding: 6px;
  border-radius: 14px;
  align-self: flex-start;
  flex-wrap: wrap;
}
.r-tab {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 0; cursor: pointer;
  font-family: inherit;
  font-size: 13.5px; font-weight: 500;
  color: var(--muted);
  padding: 9px 14px; border-radius: 10px;
  transition: background .12s, color .12s;
}
.r-tab .msym {
  font-size: 17px; line-height: 1;
  font-variation-settings: 'opsz' 20, 'wght' 500, 'FILL' 0, 'GRAD' 0;
}
.r-tab:hover { color: var(--slate); }
.r-tab.active {
  background: var(--white);
  color: var(--blue);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.r-tab.active .msym {
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
.r-tab[disabled] { opacity: 0.45; cursor: not-allowed; }

.r-tab-pane[hidden] { display: none; }

/* Footer meta */
.r-footer-meta {
  margin-top: 12px;
  padding-top: 22px;
  border-top: 1px dashed var(--hair);
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
}
.r-footer-meta .msym { font-size: 14px; vertical-align: -2px; margin-right: 4px; }
.r-footer-meta strong { color: var(--slate-2); font-weight: 600; }

/* Toast — the post-payment "Payment confirmed" momentary notice */
.r-paid-toast {
  display: inline-flex; align-items: center; gap: 8px;
  background: #ECF8EF;
  border: 1px solid #BCE0C5;
  color: #19663A;
  border-radius: 999px;
  padding: 8px 14px 8px 12px;
  font-size: 13px;
  font-weight: 500;
  animation: r-toast-in 0.4s ease;
  align-self: flex-start;
}
.r-paid-toast .msym {
  font-size: 17px;
  font-variation-settings: 'opsz' 20, 'wght' 700, 'FILL' 1, 'GRAD' 0;
}
@keyframes r-toast-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================================
   Single-tier full report (paid result)
   Page 1 = at-a-glance dashboard. Pages 2+ = editorial sections.
   ============================================================= */

.full-report-actions {
  display: flex; justify-content: flex-end; align-items: center;
  margin: 0;
}

/* Section anchor — every report block sits inside this scaffold so
   spacing + hairline borders compose consistently. */
.report-section {
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.report-section + .report-section { margin-top: 18px; }
/* Snapshot card sits right above the first content section — pull a
   matching gap so it doesn't kiss the next card. */
.report-snapshot + .report-section { margin-top: 18px; }
/* Same gap when a generic tab-loading sits above sections. */
.tab-loading + .report-section,
.tab-loading + .report-snapshot { margin-top: 18px; }
.report-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.report-section-head .kicker {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.report-section-head .kicker .msym {
  font-size: 13px; color: var(--blue);
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
.report-section-head h2 {
  font-family: 'Google Sans Flex', ui-sans-serif, system-ui, sans-serif;
  font-size: 22px; line-height: 1.15; letter-spacing: -0.018em;
  font-weight: 600; color: var(--slate);
  margin: 4px 0 0;
}
.report-section-head .report-section-side {
  font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Page 1: hero card — eyebrow + form + headline + verdict + actions */
.report-snapshot {
  background: var(--blue-50);
  border: 1px solid #DCE4FE;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 24px;
  align-items: center;
}
.snapshot-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.snapshot-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--blue);
  display: inline-flex; align-items: center; gap: 8px;
}
.snapshot-eyebrow .msym {
  font-size: 14px; color: inherit;
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
.snapshot-form {
  font-family: 'Google Sans Flex', ui-sans-serif, system-ui, sans-serif;
  font-size: 22px; line-height: 1.2; letter-spacing: -0.018em;
  font-weight: 600; color: var(--slate);
  margin: 0;
}
.snapshot-form-id {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 12.5px; color: var(--muted); font-weight: 500;
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.snapshot-actions {
  display: inline-flex; align-items: center; gap: 8px;
}
@media (max-width: 720px) {
  .report-snapshot { grid-template-columns: 1fr; }
}

/* Severity ribbon — the at-a-glance verdict bar. */
.severity-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 4px;
}
.severity-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white);
  border: 1px solid var(--hair);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  color: var(--slate-2);
}
.severity-pill .pip {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}
.severity-pill .count {
  font-family: 'Google Sans Flex', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700; color: var(--slate);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.severity-pill.is-high   { color: #B33B1F; background: #FFF1EC; border-color: #FBD9CB; }
.severity-pill.is-medium { color: #8B5A18; background: #FFF6E5; border-color: #F1DFB7; }
.severity-pill.is-low    { color: #1B6E3D; background: #ECF8EF; border-color: #BCE0C5; }
.severity-pill.is-clean  { color: #1B6E3D; background: var(--white); border-color: #BCE0C5; }

/* Page 1: the deal grid — 4-col rich card grid borrowed from the
   homepage `.terms-grid` pattern. Adds an inline severity-list panel
   to its right for a richer at-a-glance read. */
.report-deal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 22px;
}
@media (max-width: 880px) {
  .report-deal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .report-deal-grid { grid-template-columns: 1fr; }
}
.deal-cell {
  display: grid;
  grid-template-rows: 14px minmax(28px, auto) auto;
  row-gap: 6px; align-content: start; min-width: 0;
}
.deal-cell-label {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase;
  line-height: 14px;
  display: flex; align-items: center; gap: 6px;
}
.deal-cell-label .msym {
  font-size: 13px; color: var(--blue);
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
.deal-cell-value {
  font-family: 'Google Sans Flex', ui-sans-serif, system-ui, sans-serif;
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--slate); line-height: 1.2;
  word-break: break-word;
  display: flex; align-items: center;
  font-variant-numeric: tabular-nums;
  min-height: 28px;
}
.deal-cell-value.empty {
  font-family: inherit;
  font-size: 14px; font-weight: 500;
  font-style: italic;
  color: #9aa3b2;
  letter-spacing: 0;
}
.deal-cell-note {
  font-size: 12.5px; line-height: 1.45; color: var(--muted);
  min-height: 18px;
}
.deal-cell-warning {
  display: inline-flex; align-items: flex-start; gap: 6px;
  margin-top: 8px;
  background: #FFF1EC; color: #B33B1F;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11.5px; line-height: 1.4;
  align-self: flex-start; max-width: 100%;
}
.deal-cell-warning .msym {
  font-size: 14px; flex-shrink: 0;
  font-variation-settings: 'opsz' 20, 'wght' 700, 'FILL' 1, 'GRAD' 0;
}

/* Page 1: red-flags column — the headline "things to look at" list.
   Sits in its own card alongside the grid. */
.report-flags {
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.report-flags h3 {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  margin: 0;
}
.report-flag {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hair-2);
  font-size: 13.5px; color: var(--slate-2);
  line-height: 1.45;
}
.report-flag:last-child { border-bottom: 0; }
.report-flag .pip {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
}
.report-flag.is-high   .pip { background: #C0392B; }
.report-flag.is-medium .pip { background: #D68910; }
.report-flag.is-low    .pip { background: #1B6E3D; }
.report-flags-empty {
  display: flex; align-items: center; gap: 10px;
  color: #1B6E3D; font-size: 13.5px;
}
.report-flags-empty .msym {
  font-size: 18px;
  font-variation-settings: 'opsz' 20, 'wght' 700, 'FILL' 1, 'GRAD' 0;
}

/* Editorial: prose summary section (page 2) */
.report-prose {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 15.5px; line-height: 1.65; color: var(--slate-2);
}
.report-prose p { margin: 0 0 12px; }
.report-prose p:last-child { margin-bottom: 0; }

/* Modifications — sibling list inside the .report-section. The card
   itself is neutral (white, hairline border); severity is conveyed by
   the badge alone (and a single priority icon for high). No colored
   left-edge stripes — they read as pasted-on dropshadows when the card
   has a border-radius. */
.mod-list { display: flex; flex-direction: column; gap: 14px; }
.mod-card {
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 0;
  display: flex; flex-direction: column;
  overflow: hidden; /* keeps the head's bleed-to-edge underline tidy */
}

/* Head — the card's title bar. Numbered index + risk badge + clause.
   A single hairline divider separates it from the body. */
.mod-head {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-bottom: 1px solid var(--hair-2);
  background: #FCFCFD;
}
.mod-num {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 22px;
}
.mod-clause-icon {
  font-size: 18px;
  color: #C0392B;
  font-variation-settings: 'opsz' 20, 'wght' 700, 'FILL' 1, 'GRAD' 0;
  flex-shrink: 0;
}

/* Body — wraps the comparison panels, explanation, questions. */
.mod-body {
  display: flex; flex-direction: column;
  gap: 14px;
  padding: 18px 22px 20px;
}

/* Risk badge — the primary severity signal. Slightly punchier
   backgrounds (more saturated than the prior pastels) so it carries
   the color cue without help from a card-edge stripe. Pip is bigger
   for visibility. */
.risk-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.risk-badge .pip {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.risk-badge.risk-high   { color: #8C2A12; background: #FCDED4; }
.risk-badge.risk-medium,
.risk-badge.risk-med    { color: #6F4310; background: #FBE7B8; }
.risk-badge.risk-low    { color: #14552E; background: #CFE8D7; }

.mod-clause {
  font-family: 'Google Sans Flex', ui-sans-serif, system-ui, sans-serif;
  font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--slate);
  line-height: 1.35;
  flex: 1; min-width: 180px;
}
.mod-cmp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px) {
  .mod-cmp { grid-template-columns: 1fr; }
}
.mod-cmp-block {
  background: #FAFBFD;
  border: 1px solid var(--hair-2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px; line-height: 1.55; color: var(--slate-2);
}
.mod-cmp-block.is-contract {
  background: var(--blue-50);
  border-color: #DCE4FE;
  color: var(--slate);
}
.mod-cmp-label {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  display: block; margin-bottom: 4px;
}
.mod-cmp-block.is-contract .mod-cmp-label { color: var(--blue); }
.mod-explanation {
  font-size: 14px; line-height: 1.6; color: var(--slate-2);
  margin: 0;
}
.mod-questions {
  border-top: 1px dashed var(--hair);
  padding-top: 12px;
  margin-top: 4px;
}
.mod-questions[open] summary { color: var(--slate); }
.mod-questions summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.mod-questions summary::-webkit-details-marker { display: none; }
.mod-questions summary .msym {
  font-size: 14px; transition: transform .15s ease;
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 0, 'GRAD' 0;
}
.mod-questions[open] summary .msym { transform: rotate(90deg); }
.mod-questions ul {
  margin: 10px 0 0; padding-left: 0; list-style: none;
  display: flex; flex-direction: column; gap: 6px;
}
.mod-questions li {
  position: relative; padding-left: 18px;
  font-size: 13.5px; line-height: 1.5; color: var(--slate-2);
}
.mod-questions li::before {
  content: ""; position: absolute;
  left: 0; top: 0.6em;
  width: 8px; height: 1px; background: var(--blue);
}

.mod-empty {
  display: flex; align-items: center; gap: 12px;
  background: #ECF8EF;
  border: 1px solid #BCE0C5;
  color: #1B6E3D;
  border-radius: 12px;
  padding: 14px 18px;
}
.mod-empty .msym {
  font-size: 22px;
  font-variation-settings: 'opsz' 24, 'wght' 700, 'FILL' 1, 'GRAD' 0;
}

/* Compact rex-themed loader for tab transitions and initial fetches.
   Distinct from the big generating-loader (which is for AI work);
   this one is shorter, friendlier, used for "the data is on its way"
   moments — initial /api/r/<code> resolve, overlay tab opening, etc.
   The rex WebPs are preloaded in <head> so this animates immediately. */
.tab-loading {
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  padding: 64px 24px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}
.tab-loading-rex {
  position: relative;
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
}
.tab-loading-rex img {
  position: relative;
  width: 160px;
  height: 160px;
  animation: tab-loading-bob 2.4s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
}
.tab-loading-rex::before {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 130px;
  height: 18px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(38, 78, 222, 0.22), transparent 70%);
  border-radius: 50%;
  transform: translateX(-50%);
  animation: tab-loading-pulse 2.4s ease-in-out infinite;
  z-index: 0;
}
@keyframes tab-loading-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-8px) rotate(1.5deg); }
}
@keyframes tab-loading-pulse {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(1); }
  50%      { opacity: 0.95; transform: translateX(-50%) scale(1.08); }
}
.tab-loading-headline {
  font-family: 'Google Sans Flex', ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--slate);
  margin: 0;
}
.tab-loading-text {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  min-height: 20px;
  transition: opacity 0.35s ease;
}
.tab-loading-text.swapping { opacity: 0; }
.tab-loading-bar {
  width: min(280px, 60%);
  height: 4px;
  background: rgba(38, 78, 222, 0.10);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-top: 6px;
}
.tab-loading-bar::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 35%;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  border-radius: 999px;
  animation: tab-loading-bar-slide 1.6s ease-in-out infinite;
}
@keyframes tab-loading-bar-slide {
  0%   { left: -35%; }
  100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .tab-loading-rex img,
  .tab-loading-rex::before,
  .tab-loading-bar::after { animation: none; }
}

/* Full-terms reference table — grouped, striped, monospace values. */
.terms-table {
  display: flex; flex-direction: column; gap: 22px;
}
.terms-group { display: flex; flex-direction: column; gap: 0; }
.terms-group-head {
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 0 8px;
}
.terms-group-head .msym {
  font-size: 14px; color: var(--blue);
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
.terms-rows { display: flex; flex-direction: column; }
.terms-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(0, 1fr);
  gap: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  align-items: baseline;
}
.terms-row + .terms-row { border-top: 1px solid var(--hair-2); border-radius: 0; }
.terms-row:first-child { border-radius: 8px 8px 0 0; }
.terms-row:last-child  { border-radius: 0 0 8px 8px; }
.terms-row:nth-child(even) { background: #FAFBFD; }
.terms-row-key {
  font-size: 13px; color: var(--muted);
  text-transform: capitalize;
  letter-spacing: 0.005em;
}
.terms-row-val {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 13px; color: var(--slate);
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}
.terms-row-val.empty {
  color: #9aa3b2; font-style: italic; font-family: inherit;
}

/* Buttons used inside the report header */
.r-action {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit;
  font-size: 13.5px; font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, transform .12s, box-shadow .15s;
}
.r-action.primary {
  background: var(--blue); color: var(--white); border: 1px solid var(--blue);
}
.r-action.primary:hover {
  background: #1d54c9; border-color: #1d54c9;
  transform: translate3d(0, -1px, 0);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}
.r-action.ghost {
  background: var(--white); color: var(--slate);
  border: 1px solid var(--hair);
}
.r-action.ghost:hover { border-color: #C9D2E0; transform: translate3d(0, -1px, 0); }
.r-action .msym {
  font-size: 17px;
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}

/* Hide chrome (nav, share card, tabs) when generating a PDF — both
   the @media print path AND the html2pdf.js path (which captures the
   live DOM via html2canvas and doesn't honor print media queries).
   Section breaks become page breaks for readability. */
.is-printing .r-nav,
.is-printing .share-card,
.is-printing .r-tabs,
.is-printing .r-paid-toast,
.is-printing .r-tab-pane[data-pane="overlay"],
.is-printing .r-tab-pane[data-pane="chat"],
.is-printing .snapshot-actions,
.is-printing .r-footer-meta,
.is-printing #generating-loader,
.is-printing .chat-fab,
.is-printing .chat-panel { display: none !important; }
.is-printing { background: #fff; }
.is-printing .r-page-frame { padding-bottom: 0; }
.is-printing .r-shell { gap: 18px; }

@media print {
  body { background: #fff; }
  .r-nav, .share-card, .r-tabs, .r-paid-toast,
  .r-tab-pane[data-pane="overlay"],
  .r-tab-pane[data-pane="chat"],
  .full-report-actions, .snapshot-actions,
  #generating-loader { display: none !important; }
  .r-shell { gap: 18px; }
  .report-section, .report-snapshot {
    border: 1px solid #d8dde5; box-shadow: none;
    page-break-inside: avoid; break-inside: avoid;
  }
  .report-section + .report-section,
  .report-snapshot + .report-section,
  .report-section.report-section--mods {
    page-break-before: auto;
  }
  .mod-card { page-break-inside: avoid; break-inside: avoid; }
  .report-title { font-size: 28px; }
  .snapshot-form { font-size: 18px; }
  .deal-cell-value { font-size: 18px; }
}

/* =============================================================
   Visual overlay viewer — lazy-loaded inside /r/<code> dashboard.
   Two-column layout: page (left, sized to fit viewport) + controls
   (right, sticky panel with slider, autoflip, thumbs, alignment).
   ============================================================= */

.overlay-viewer {
  --mix: 1;
  margin: 0 auto;
}
.overlay-loading,
.overlay-error,
.overlay-unsupported {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.overlay-error { color: #B33B1F; }
.overlay-error .btn { margin-top: 16px; }

.overlay-stage[hidden] { display: none; }

.overlay-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.overlay-page-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.overlay-controls-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 16px;
  align-self: start;
}

.overlay-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.overlay-label-user  { opacity: var(--mix); transition: opacity 200ms ease; color: var(--blue); }
.overlay-label-blank { opacity: calc(1 - var(--mix)); transition: opacity 200ms ease; }

/* Page stack — sized so the entire page fits the viewport. Height
   drives the size; width follows aspect-ratio. The container's
   max-width keeps it from overflowing the column on narrow viewports. */
.overlay-stack {
  position: relative;
  background: #fff;
  border: 1px solid var(--hair);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
  height: min(calc(100vh - 220px), 1100px);
  aspect-ratio: 1200 / 1553;
  width: auto;
  max-width: 100%;
  flex-shrink: 0;
}
.overlay-stack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.overlay-stack img.overlay-img-user {
  opacity: var(--mix);
  transform: translate(var(--off-x, 0px), var(--off-y, 0px))
             scale(var(--scale, 1));
  transform-origin: top left;
  transition: opacity 200ms ease;
}
.overlay-viewer.is-autoflip .overlay-img-user,
.overlay-viewer.is-autoflip .overlay-label-user,
.overlay-viewer.is-autoflip .overlay-label-blank {
  transition: opacity 1100ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Controls column — small section cards. */
.overlay-control-card {
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.overlay-control-card-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.overlay-control-card-head .msym {
  font-size: 13px;
  color: var(--blue);
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
.overlay-control-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
}
.overlay-control-hint kbd {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  background: var(--gray);
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 0 5px;
  color: var(--slate);
}

/* Slider — full width of its card, with axis labels. */
.overlay-slider {
  width: 100%;
  accent-color: var(--blue);
}
.overlay-slider-axis {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -4px;
}

/* Auto-flip toggle. */
.overlay-autoflip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--hair);
  color: var(--slate);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.overlay-autoflip:hover { border-color: #C9D2E0; }
.overlay-autoflip.is-on {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.overlay-autoflip .msym {
  font-size: 16px;
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
.overlay-autoflip.is-on .overlay-autoflip-icon {
  animation: overlay-spin 1.6s linear infinite;
}
@keyframes overlay-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Page nav + thumbnails — vertical strip in the controls column. */
.overlay-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.overlay-nav-btn {
  display: inline-grid;
  place-items: center;
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--slate);
  flex-shrink: 0;
}
.overlay-nav-btn .msym { font-size: 18px; line-height: 1; }
.overlay-nav-btn:hover { border-color: #C9D2E0; }
.overlay-nav-page {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 12px;
  color: var(--slate-2);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  flex: 1;
  text-align: center;
}
.overlay-thumbs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px;
  background: var(--gray);
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: #C9D2E0 transparent;
}
.overlay-thumbs::-webkit-scrollbar { width: 6px; }
.overlay-thumbs::-webkit-scrollbar-thumb {
  background: #C9D2E0;
  border-radius: 4px;
}
.overlay-thumb {
  flex: 0 0 auto;
  width: 100%;
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: border-color .12s, transform .12s;
}
.overlay-thumb:hover { transform: translate3d(0, -1px, 0); }
.overlay-thumb img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: var(--white);
}
.overlay-thumb span {
  position: absolute;
  top: 4px; left: 4px;
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}
.overlay-thumb.is-active { border-color: var(--blue); }
.overlay-thumb.is-active span { background: var(--blue); }

/* Alignment-nudge details — collapsed by default in the controls column. */
.overlay-align {
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 12px 18px;
}
.overlay-align summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.overlay-align summary::-webkit-details-marker { display: none; }
.overlay-align summary .msym {
  font-size: 13px;
  color: var(--blue);
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
.overlay-align[open] summary { color: var(--slate); }
.overlay-align-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--hair);
}
.overlay-align-controls label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: var(--muted);
  gap: 4px;
}
.overlay-align-controls label input[type="range"] { accent-color: var(--blue); }
.overlay-align-controls .overlay-nav-btn {
  width: 100%;
  height: auto;
  padding: 6px 14px;
}

/* Note shown when the user's PDF has more pages than the standard
   form's blank reference — addenda, disclosures, etc. */
.overlay-extra-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #FFF8EE;
  border: 1px solid #F5DDB6;
  color: #8B5A18;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0;
}
.overlay-extra-note .msym {
  font-size: 16px;
  flex-shrink: 0;
  color: inherit;
  font-variation-settings: 'opsz' 20, 'wght' 600, 'FILL' 1, 'GRAD' 0;
}
.overlay-extra-note strong {
  color: #6B4310;
  font-weight: 700;
}

/* Mobile — stack vertically. Page first, controls below; thumbs go
   horizontal so the panel doesn't get tall. */
@media (max-width: 900px) {
  .overlay-layout { grid-template-columns: 1fr; }
  .overlay-controls-col { position: static; }
  .overlay-thumbs {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px;
  }
  .overlay-thumb { width: 72px; flex-shrink: 0; }
  .overlay-stack { height: min(70vh, 800px); }
}
