/* PatchReply homepage.
   Colors come from the shared theme tokens in src/ui/theme.ts (injected by
   home.js before first paint). Fallbacks keep the page readable without JS.
   The staged client site ("Tidewell") keeps its own fixed palette because it
   stands in for a real customer's website. */

:root {
  color-scheme: light dark;

  --bg: var(--pr-bg, Canvas);
  --raised: var(--pr-raised, Canvas);
  --hover: var(--pr-hover, Canvas);
  --line: var(--pr-border, GrayText);
  --text: var(--pr-text, CanvasText);
  --muted: var(--pr-muted, GrayText);
  --accent: var(--pr-primary, LinkText);
  --accent-hover: var(--pr-primary-hover, LinkText);
  --accent-active: var(--pr-primary-active, LinkText);
  --on-accent: var(--pr-on-primary, Canvas);
  --brand: var(--pr-brand, #ff5c5c);
  --mark: var(--pr-red, #d92d20);
  --focus: var(--pr-focus, Highlight);
  --ok: var(--pr-success, CanvasText);
  --ok-text: var(--pr-success-text, CanvasText);
  --warn: var(--pr-warning, CanvasText);
  --danger-text: var(--pr-danger-text, CanvasText);
  --selected-bg: var(--pr-selected-bg, transparent);
  --selected-line: var(--pr-selected-border, GrayText);
  --shadow-pop: var(--pr-shadow-popover, none);

  --page: var(--bg);
  --band: var(--raised);
  --well: var(--raised);
  --line-soft: color-mix(in srgb, var(--line) 58%, transparent);

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-card: 16px;
  --radius-control: 8px;
  --header-h: 64px;
}

@supports (color: light-dark(#000, #fff)) {
  :root {
    --page: light-dark(color-mix(in srgb, var(--pr-raised) 40%, var(--pr-bg)), color-mix(in srgb, var(--pr-bg) 76%, #000));
    --band: light-dark(var(--pr-raised), color-mix(in srgb, var(--pr-bg) 90%, #000));
    --well: light-dark(var(--pr-raised), color-mix(in srgb, var(--pr-bg) 70%, #000));
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line) transparent;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, p, ol, ul, dl, dd, blockquote, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: 0.86em; font-variant-numeric: tabular-nums; }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.45em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 0.78em;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  vertical-align: 0.08em;
}

::selection { background: color-mix(in srgb, var(--brand) 26%, transparent); color: var(--text); }

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

[hidden] { display: none !important; }

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

.icon { width: 18px; height: 18px; flex: none; fill: currentColor; }

.skip {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 36px; padding: 0 12px; border-radius: var(--radius-control); font-size: 14px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); }
.btn-quiet { border-color: var(--line); background: var(--bg); color: var(--text); }
.btn-quiet:hover { background: var(--hover); }
.btn:disabled,
.btn[aria-disabled="true"] {
  border-color: var(--line-soft);
  background: var(--raised);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
}

/* ---------- Markers ----------
   The numbered pins are the product's marker component (src/ui/marker.ts),
   inserted by home.js. These rules only place and size them. */

.hero-marker { position: absolute; top: -0.36em; right: -0.34em; line-height: 0; }
.hero-marker .pr-marker { --pr-marker-height: clamp(28px, 2.8vw, 40px); }
.note-marker { display: inline-flex; line-height: 0; }
.note-marker .pr-marker { --pr-marker-height: 26px; }
.shot-marker { position: absolute; top: -16px; right: -18px; line-height: 0; }
.shot-marker .pr-marker { --pr-marker-height: 28px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--page) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1320px;
  min-height: var(--header-h);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-stretch: 108%;
  font-size: 18px;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.brand img { width: 28px; height: 28px; }
.site-menu { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.site-nav { display: flex; gap: 2px; }
.site-nav a {
  padding: 8px 10px;
  border-radius: var(--radius-control);
  color: var(--muted);
  font-size: 15px;
  font-weight: 550;
  text-decoration: none;
}
.site-nav a:hover { background: var(--hover); color: var(--text); }
.menu-toggle { display: none; }

.theme-switch {
  display: inline-flex;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.theme-switch label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 32px;
  min-height: 30px;
  padding: 0 7px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
}
.theme-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.theme-switch label:hover { color: var(--text); }
.theme-switch label:has(input:checked) { background: var(--hover); color: var(--text); }
.theme-switch label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.theme-switch .theme-name {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 1080px) {
  .site-nav a { padding-inline: 7px; }
}

@media (max-width: 960px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin-left: auto;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--bg);
    font-size: 15px;
    font-weight: 600;
  }
  .js .site-menu {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 12px clamp(16px, 4vw, 48px) 20px;
    border-bottom: 1px solid var(--line);
    background: var(--page);
    box-shadow: 0 18px 30px -18px rgb(0 0 0 / 0.4);
  }
  .js .site-menu.is-open { display: flex; }
  html:not(.js) .header-inner { flex-wrap: wrap; padding-block: 10px; }
  html:not(.js) .menu-toggle { display: none; }
  html:not(.js) .site-menu { flex: 1 1 100%; flex-wrap: wrap; gap: 8px 12px; min-width: 0; margin-left: 0; }
  html:not(.js) .site-nav { flex-wrap: wrap; min-width: 0; }
  html:not(.js) .site-nav a { padding: 10px 8px; }
  .js .site-nav { flex-direction: column; }
  .js .site-nav a { padding: 12px 8px; font-size: 17px; color: var(--text); border-bottom: 1px solid var(--line-soft); border-radius: 0; }
  .js .theme-switch { align-self: flex-start; }
  .js .theme-switch .theme-name { position: static; width: auto; height: auto; clip: auto; }
  .js .theme-switch label { padding: 0 12px; min-height: 38px; }
  .js .site-menu .btn { min-height: 46px; }
}

/* ---------- Hero ---------- */

.hero { padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(56px, 7vw, 96px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: end;
  margin-bottom: clamp(36px, 4.5vw, 64px);
}
.hero-title {
  font-size: clamp(2.55rem, 1.2rem + 4.1vw, 5.1rem);
  font-weight: 760;
  font-stretch: 112%;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.pinned {
  position: relative;
  display: inline-block;
  padding: 0 0.06em;
  border-radius: 0.06em;
  outline: 0.045em solid var(--brand);
  outline-offset: 0.02em;
}
.hero-side { display: grid; gap: 24px; padding-bottom: 0.4em; }
.lede { max-width: 38ch; font-size: clamp(1.1rem, 1rem + 0.35vw, 1.3rem); line-height: 1.5; color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { max-width: 44ch; color: var(--muted); font-size: 15px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-side { padding-bottom: 0; }
}

/* ---------- Live preview ----------
   The frame hosts /demo/home-preview.html, which runs the real handle and page agent. */

.preview { scroll-margin-top: calc(var(--header-h) + 16px); }
.preview-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 14px; }
.preview-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.preview-how { max-width: 72ch; color: var(--muted); font-size: 15px; }
.preview-how kbd { font-size: 0.8em; }
.preview-frame {
  display: block;
  width: 100%;
  height: clamp(560px, 72vh, 720px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--raised);
  box-shadow: 0 28px 48px -30px rgb(0 0 0 / 0.5), 0 2px 6px rgb(0 0 0 / 0.06);
}
.preview-fine { margin-top: 12px; color: var(--muted); font-size: 13.5px; }
.example-flag {
  padding: 3px 8px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .preview-frame { height: 600px; border-radius: 14px; }
}

/* Avatars and chips */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.av-dana { background: color-mix(in srgb, var(--mark) 26%, var(--bg)); box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 2.5px color-mix(in srgb, var(--mark) 50%, transparent); }
.av-leo { background: color-mix(in srgb, var(--muted) 26%, var(--bg)); box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 2.5px color-mix(in srgb, var(--muted) 45%, transparent); }
.av-priya { background: color-mix(in srgb, var(--focus) 30%, var(--bg)); }
.av-jordan { background: color-mix(in srgb, var(--accent) 30%, var(--bg)); }
.av-sam { background: color-mix(in srgb, var(--warn) 34%, var(--bg)); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
}
.chip .icon { width: 13px; height: 13px; }
.chip-ok { border-color: var(--selected-line); background: var(--selected-bg); color: var(--ok-text); }
/* On the green tint, light theme needs the darker primary-active green for 4.5:1; dark keeps success-text. */
@supports (color: light-dark(#000, #fff)) {
  .chip-ok { color: light-dark(var(--pr-primary-active), var(--pr-success-text)); }
}
.chip-warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); color: var(--warn); }
.chip-hi { border-color: color-mix(in srgb, var(--mark) 45%, transparent); color: var(--danger-text); }
.chip-team { border-color: var(--selected-line); color: var(--ok-text); }
.chip-open { border-color: color-mix(in srgb, var(--mark) 45%, transparent); color: var(--danger-text); }
.chip-lock { border-style: dashed; }
.mention { color: var(--focus); font-weight: 650; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: min(92vw, 460px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  font-size: 14.5px;
  font-weight: 550;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.3s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { border-color: color-mix(in srgb, var(--mark) 60%, transparent); }

/* The Note anatomy card shows a small crop of the example site. */
.tw { color: #10283a; font: 400 15px/1.5 "Avenir Next", "Segoe UI", system-ui, sans-serif; }
.tw-plan-name { font-weight: 700; font-size: 15px; }
.tw-plan-name em { margin-left: 6px; padding: 2px 8px; border-radius: 99px; background: #dcefed; color: #0f5158; font-size: 11.5px; font-style: normal; font-weight: 700; }
.tw-price { justify-self: start; font: 700 34px/1 Georgia, "Times New Roman", serif; letter-spacing: -0.02em; }
.tw-price small { color: #3d5566; font: 500 14px/1 "Avenir Next", "Segoe UI", system-ui, sans-serif; letter-spacing: 0; }
.tw-plan-copy { color: #3d5566; font-size: 14px; }
.tw-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px; border-radius: 99px; background: #f0b23a; color: #10283a; font-size: 14px; font-weight: 700; white-space: nowrap; }

/* ---------- Sections ---------- */

.section { padding-block: clamp(72px, 9vw, 132px); }
.section-band { background: var(--band); border-block: 1px solid var(--line-soft); }
.section h2 {
  font-size: clamp(2rem, 1.25rem + 2.4vw, 3.4rem);
  font-weight: 740;
  font-stretch: 110%;
  line-height: 1.03;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.section h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.012em; }
.section-head { display: grid; gap: 18px; max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head p { max-width: 62ch; color: var(--muted); font-size: 1.1rem; line-height: 1.55; }
.section-head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px; max-width: none; }
.section-head-row > div { display: grid; gap: 18px; max-width: 760px; }

/* Problem */
.why-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.why-copy { display: grid; gap: 20px; position: sticky; top: calc(var(--header-h) + 32px); }
.why-copy p { max-width: 50ch; color: var(--muted); font-size: 1.1rem; }
.ledger { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.ledger th {
  padding: 0 16px 14px 0;
  border-bottom: 1px solid var(--text);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
}
.ledger td { padding: 20px 16px 20px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger td:first-child { width: 42%; color: var(--muted); }
.ledger td:last-child { position: relative; padding-left: 40px; }
.ledger td:last-child .note-marker { position: absolute; left: 0; top: 18px; }

@media (max-width: 900px) {
  .why-grid { grid-template-columns: 1fr; }
  .why-copy { position: static; }
}
@media (max-width: 560px) {
  .ledger thead { display: none; }
  .ledger tr { display: block; padding: 18px 0; border-bottom: 1px solid var(--line); }
  .ledger td { display: block; width: auto !important; padding: 0; border: 0; }
  .ledger td:first-child { margin-bottom: 10px; }
  .ledger td:first-child::before { content: "Today: "; font-weight: 700; color: var(--text); }
  .ledger td:last-child .note-marker { top: 0; }
}

/* Capture */
.capture-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.capture-steps { display: grid; gap: 40px; }
.capture-steps li { display: grid; gap: 12px; }
.capture-steps p { max-width: 52ch; color: var(--muted); }
.capture-steps h3 kbd { font-size: 0.72em; }

.anatomy {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: grid;
  gap: 18px;
  padding: clamp(16px, 2.2vw, 24px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  box-shadow: 0 24px 40px -28px rgb(0 0 0 / 0.4);
}
.anatomy-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.seg, .gestures {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raised);
}
.seg button, .gestures button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}
.seg button .icon { width: 16px; height: 16px; }
.seg button:hover, .gestures button:hover { color: var(--text); }
.seg [aria-checked="true"], .gestures [aria-checked="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.14); }
.gestures { justify-self: start; }

.shot {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #efe8da;
  overflow: hidden;
}
.shot-canvas { position: relative; display: grid; place-items: center; padding: clamp(24px, 4vw, 40px); }
.tw-mini {
  position: relative;
  display: grid;
  gap: 8px;
  width: min(100%, 340px);
  min-height: 0;
  padding: 20px;
  border: 2px solid #17666f;
  border-radius: 14px;
  background: #fff;
}
.shot-target { position: relative; display: inline-block; }
.shot .shot-pin { position: absolute; top: -14px; right: -16px; }
[data-gesture-state="element"] .shot-target { outline: 2.5px solid #d92d20; outline-offset: 6px; border-radius: 4px; }
[data-gesture-state="area"] .tw-mini::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; top: 38px; height: 92px;
  border: 2.5px dashed #d92d20;
  border-radius: 6px;
  background: rgb(217 45 32 / 0.06);
}
[data-gesture-state="text"] [data-shot-copy] { background: rgb(217 45 32 / 0.16); box-shadow: 0 2px 0 #d92d20; }
[data-gesture-state="point"] .shot-target::after {
  content: "";
  position: absolute;
  left: 70%; top: 55%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2.5px solid #d92d20;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgb(217 45 32 / 0.18);
}
.anatomy-body .clip { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 650; }
.anatomy-body .clip .icon { width: 16px; height: 16px; }
.clip-len { font-family: var(--mono); font-size: 12px; }
.quote { padding-left: 14px; border-left: 1px solid var(--brand); font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); line-height: 1.5; }
.diff { display: grid; gap: 10px; }
.diff > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.diff dt { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.diff del { color: var(--danger-text); text-decoration-thickness: 1px; }
.diff ins { padding: 1px 3px; border-radius: 4px; background: var(--selected-bg); color: var(--ok-text); text-decoration: none; }
.evidence { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.evidence > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.evidence dt { color: var(--muted); font-size: 13px; font-weight: 650; }
.evidence dd { font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.evidence code { font-size: 1em; }

@media (max-width: 960px) {
  .capture-grid { grid-template-columns: 1fr; }
  .anatomy { position: static; }
}
@media (max-width: 480px) {
  .evidence > div, .diff > div { grid-template-columns: 1fr; gap: 2px; }
  .seg button, .gestures button { padding: 0 10px; }
}

/* Collaboration rows */
.rows { display: grid; gap: clamp(56px, 8vw, 112px); }
.row { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.row-flip .row-copy { order: 2; }
.row-copy { display: grid; gap: 14px; }
.row-copy p { max-width: 50ch; color: var(--muted); }
.row-copy .aside { padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; }

.ui-card {
  display: grid;
  gap: 16px;
  padding: clamp(16px, 2.2vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg);
  box-shadow: 0 24px 40px -28px rgb(0 0 0 / 0.4);
}
.ui-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.share-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); }
.share-link .mono { flex: 1; font-size: 13px; }
.share-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.share-rules dt { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.share-rules dd { font-size: 14px; font-weight: 600; }
.people { display: grid; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14.5px; font-weight: 600; }
.people li > span:nth-child(2) { flex: 1; min-width: 0; }
.people small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }

.thread-head { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.thread-head p { flex: 1; }
.thread { display: grid; gap: 14px; }
.thread li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; font-size: 14.5px; line-height: 1.5; }
.thread .who { font-weight: 700; font-size: 13.5px; }
.thread .who small { margin-left: 4px; color: var(--muted); font-weight: 550; }
.thread .internal > div { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--raised); }
.thread-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13.5px; }
.thread-foot > span:first-child { margin-right: auto; }
.thread-foot b { color: var(--text); }

.round-list { display: grid; }
.round-list li { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-soft); font-size: 14.5px; }
.round-no { font-weight: 700; }
.round-desc { color: var(--muted); }
.round-list .is-approved { padding: 14px 12px; margin-inline: -12px; border-top: 0; border-radius: 10px; background: var(--selected-bg); }
.rounds-foot { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 13.5px; }
.rounds-foot .mono { color: var(--text); font-weight: 600; }

@media (max-width: 900px) {
  .row { grid-template-columns: 1fr; }
  .row-flip .row-copy { order: 0; }
}
@media (max-width: 520px) {
  .share-rules { grid-template-columns: 1fr 1fr; }
  .round-list li { grid-template-columns: 1fr auto; }
  .round-list .round-desc { grid-column: 1; grid-row: 2; }
  .round-list .chip { grid-column: 2; grid-row: 1 / span 2; white-space: normal; text-align: right; }
  .people .chip { display: none; }
}

/* Handoff */
.handoff { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.handoff-tabs { display: grid; gap: 4px; }
.handoff-tabs [role="tab"] {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 15.5px;
  font-weight: 650;
  text-align: left;
}
.handoff-tabs [role="tab"]:hover { background: var(--hover); color: var(--text); }
.handoff-tabs [role="tab"][aria-selected="true"] { border-color: var(--line); background: var(--bg); color: var(--text); }
.handoff-tabs [data-htab="prompt"] { margin-top: 12px; }
.hpanel { min-width: 0; }
.js .hpanel + .hpanel { margin-top: 0; }
html:not(.js) .hpanel + .hpanel { margin-top: 16px; }
.issue, .prompt {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg);
}
.issue-where { color: var(--muted); font-size: 12.5px; }
.issue-title { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem); font-weight: 720; line-height: 1.25; letter-spacing: -0.015em; }
.issue-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: 14px; }
.issue-meta b { color: var(--text); font-weight: 650; }
.issue-body { display: grid; gap: 12px; padding: 16px 0; border-block: 1px solid var(--line-soft); font-size: 15px; }
.issue-body blockquote { padding-left: 12px; border-left: 2px solid var(--line); }
.issue-body .small { color: var(--muted); font-size: 12.5px; }
.attach { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.attach-thumb { width: 44px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #efe8da; box-shadow: inset 0 0 0 7px #fff, inset 0 0 0 9px #d92d20; }
.sync { display: flex; align-items: center; gap: 8px; color: var(--ok-text); font-size: 14px; font-weight: 600; }
.prompt-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.prompt-bar .mono { color: var(--muted); font-size: 12.5px; }
.prompt-text {
  max-height: 380px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--well);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.session { display: grid; gap: 14px; font-size: 15px; }
.session p { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
.who-you, .who-agent { font-family: var(--mono); font-size: 12px; font-weight: 600; padding-top: 3px; }
.who-you { color: var(--focus); }
.who-agent { color: var(--ok-text); }

@media (max-width: 820px) {
  .handoff { grid-template-columns: 1fr; }
  .handoff-tabs { display: flex; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .handoff-tabs::-webkit-scrollbar { display: none; }
  .handoff-tabs [role="tab"] { flex: none; min-height: 40px; font-size: 14.5px; }
  .handoff-tabs [data-htab="prompt"] { margin-top: 0; margin-left: 8px; }
  .session p { grid-template-columns: 1fr; gap: 2px; }
}

/* Where it works */
.where-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 0 clamp(32px, 6vw, 96px); align-items: start; }
.where { display: grid; }
.where li { display: grid; gap: 6px; padding: 18px 0; border-top: 1px solid var(--line); }
.where li:last-child { border-bottom: 1px solid var(--line); }
.where p { color: var(--muted); }
.where b { color: var(--text); font-weight: 700; }
.url-chip { justify-self: start; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--raised); font-size: 12.5px; }
.not-for { grid-column: 2; margin-top: 24px; max-width: 60ch; color: var(--muted); font-size: 15px; }

@media (max-width: 900px) {
  .where-grid { grid-template-columns: 1fr; }
  .not-for { grid-column: 1; }
}

/* Pricing */
.billing { display: inline-flex; margin: 0; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.billing label { position: relative; display: inline-flex; }
.billing input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.billing span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 9px; color: var(--muted); font-size: 15px; font-weight: 650; }
.billing label:hover span { color: var(--text); }
.billing input:checked + span { background: var(--text); color: var(--bg); }
.billing input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.plans { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.plan {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
}
.plan-team { border: 2px solid var(--accent); }
.plan h3 { font-size: 1.4rem; }
.price { display: flex; align-items: baseline; gap: 6px; }
.amount { font-size: clamp(2.8rem, 2rem + 2.4vw, 4rem); font-weight: 760; font-stretch: 108%; line-height: 1; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.per { color: var(--muted); font-size: 17px; font-weight: 600; }
.price-note { margin-top: -8px; color: var(--muted); font-size: 15px; }
.plan-desc { max-width: 52ch; }
.plan .btn { justify-self: start; }
.trial { margin-top: -6px; color: var(--ok-text); font-size: 14.5px; font-weight: 650; }
.seats { padding: 14px 16px; border-radius: 12px; background: var(--raised); font-size: 15.5px; }
.checks-lead { color: var(--muted); font-size: 14px; font-weight: 650; }
.checks { display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; font-size: 15.5px; line-height: 1.45; }
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.12em;
  width: 18px;
  height: 18px;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.plan-team .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
.plan-excl { padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 14.5px; }
.plans-fine { margin-top: 20px; color: var(--muted); font-size: 14.5px; }

@media (max-width: 1000px) {
  .plan-team .checks { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .plans { grid-template-columns: 1fr; }
  .plan-team { order: -1; }
}

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr); gap: 24px clamp(32px, 6vw, 96px); align-items: start; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq summary .icon { color: var(--muted); transition: transform 0.25s var(--ease); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { max-width: 64ch; padding: 0 0 22px; color: var(--muted); }
@media (max-width: 820px) {
  .faq-grid { grid-template-columns: 1fr; }
}

/* Close */
.close { padding-block: clamp(80px, 10vw, 144px); border-top: 1px solid var(--line-soft); }
.close-inner { display: grid; justify-items: start; gap: 28px; }
.close h2 { max-width: 16ch; font-size: clamp(2.4rem, 1.2rem + 4vw, 5rem); font-stretch: 112%; }

/* Footer */
.site-footer { padding-block: 40px 56px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 14.5px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; align-items: start; }
.site-footer .brand { color: var(--text); font-size: 16px; }
.site-footer .brand img { width: 24px; height: 24px; }
.footer-inner > div p { margin-top: 8px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { color: var(--text); text-decoration: underline; }
.footer-fine { grid-column: 1 / -1; font-size: 13px; }
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ---------- Motion ---------- */

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

@media (forced-colors: active) {
  .pr-marker { forced-color-adjust: none; }
  .btn { border: 1px solid ButtonText; }
}
