/* TidyHeadings site. Paper, ink, teal and the yellow number blocks of the add-on icon.
   Fonts are self-hosted (fonts/, SIL Open Font License, licence files next to them). */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-500-italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #f6f3ec;
  --paper-2: #eeeadf;
  --paper-glass: rgba(246, 243, 236, 0.88);
  --sheet: #fffdf8;
  --ink: #17201e;
  --ink-2: #4c5754;
  --rule: #dcd5c6;
  --rule-2: #c4bba8;
  --teal: #0f766e;
  --teal-ink: #0b5f58;
  --teal-wash: #e3efe9;
  --on-teal: #ffffff;
  --marker: #fde68a;
  --marker-ink: #3b2c00;
  --strike: #a4372a;
  --band: #0d3b37;
  --band-ink: #e9f1ee;
  --band-ink-2: #b4cbc5;
  --band-rule: #2a5a55;
  --band-link: #a7e3d9;
  /* Documents stay paper-white in both themes, like a printed page. */
  --doc-bg: #fffdf8;
  --doc-ink: #1d2422;
  --doc-ink-2: #56605d;
  --doc-bar: #e8e3d7;
  --doc-strike: #a4372a;
  --shadow-sheet: 0 1px 1px rgba(23, 32, 30, 0.05), 0 18px 40px -18px rgba(23, 32, 30, 0.28);
  --shadow-panel: 0 1px 1px rgba(23, 32, 30, 0.04), 0 10px 30px -16px rgba(23, 32, 30, 0.22);
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1514;
    --paper-2: #141c1a;
    --paper-glass: rgba(15, 21, 20, 0.86);
    --sheet: #18211f;
    --ink: #e8ece9;
    --ink-2: #a8b5b1;
    --rule: #27322f;
    --rule-2: #3a4744;
    --teal: #5cc4b7;
    --teal-ink: #7fd5ca;
    --teal-wash: #16302c;
    --on-teal: #062420;
    --marker: #fde68a;
    --marker-ink: #3b2c00;
    --strike: #e4907f;
    --band: #0b2623;
    --band-ink: #e6efec;
    --band-ink-2: #a9c2bc;
    --band-rule: #22413d;
    --band-link: #8fdccf;
    --doc-bg: #f1ede4;
    --doc-ink: #1d2422;
    --doc-ink-2: #535d5a;
    --doc-bar: #dcd6c8;
    --shadow-sheet: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 24px 50px -20px rgba(0, 0, 0, 0.75);
    --shadow-panel: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  font-kerning: normal;
  font-variant-numeric: tabular-nums; /* "1.1.1" reads as three numbers, not "111" */
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }

a { color: var(--teal-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

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

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 12px; top: -60px;
  background: var(--ink); color: var(--paper);
  padding: 10px 14px; border-radius: 8px;
  z-index: 10; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

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

.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
@media (min-width: 901px) {
  .site-header {
    position: sticky; top: 0; z-index: 5;
    background: var(--paper-glass);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
  }
  [id] { scroll-margin-top: 84px; }
  .panel { top: 88px; }
  .how-grid .section-head, .faq-grid .section-head { top: 104px; }
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--serif); font-size: 1.35rem; letter-spacing: -0.01em;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-size: 0.95rem; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 6px 0; }
.nav a:hover { color: var(--ink); text-decoration: underline; }
.nav .nav-install {
  color: var(--on-teal); background: var(--teal);
  padding: 7px 14px; border-radius: 9px; font-weight: 600;
}
.nav .nav-install:hover { color: var(--on-teal); text-decoration: none; filter: brightness(1.08); }
@media (max-width: 640px) {
  .nav .nav-wide { display: none; }
}

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

.button, .button-demo, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem/1.2 var(--sans);
  padding: 14px 22px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.button, .button-demo, .btn-primary {
  background: var(--teal); color: var(--on-teal);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 8px 20px -10px rgba(15, 118, 110, 0.7);
}
.button:hover, .button-demo:hover, .btn-primary:hover { transform: translateY(-1px); text-decoration: none; }
.button:active, .button-demo:active, .btn-primary:active { transform: translateY(0); }
.btn-quiet {
  background: transparent; color: var(--ink);
  border-color: var(--rule-2);
  padding: 8px 12px; font-size: 0.9rem; border-radius: 8px;
}
.btn-quiet:hover { background: var(--paper-2); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.button-demo::after, .link-arrow::after { content: "\2193"; content: "\2193" / ""; font-weight: 400; }
.link-arrow {
  display: inline-flex; gap: 6px; align-items: center;
  font-weight: 600; color: var(--ink); text-decoration: none;
  padding: 12px 4px;
}
.link-arrow:hover { text-decoration: underline; }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
  padding-block: clamp(40px, 7vw, 104px) clamp(56px, 8vw, 120px);
}
.eyebrow {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--teal-ink); margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.7rem, 6vw, 5.2rem);
  line-height: 1.0;
  letter-spacing: -0.022em;
}
.hero h1 em { font-style: italic; color: var(--teal-ink); }
.lead {
  margin-top: 24px; max-width: 34em;
  font-size: clamp(1.08rem, 1.5vw, 1.22rem); line-height: 1.55; color: var(--ink-2);
}
.cta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px;
  margin-top: 32px;
}
.soon {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-size: 0.95rem; color: var(--ink-2);
}
.soon::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; transform: translateY(-1px);
  background: var(--teal); box-shadow: 0 0 0 4px var(--teal-wash);
  flex: none;
}
.facts {
  list-style: none; margin: 40px 0 0; padding: 18px 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 22px;
  font-size: 0.9rem; line-height: 1.4; color: var(--ink-2);
  border-top: 1px solid var(--rule);
}
.facts li { display: flex; gap: 10px; align-items: baseline; }
.facts li::before {
  content: ""; flex: none; width: 9px; height: 5px;
  border: solid var(--teal); border-width: 0 0 2px 2px;
  transform: translateY(-0.25em) rotate(-45deg);
}
.facts strong { color: var(--ink); font-weight: 600; }

/* The proof sheet: a contract after Number headings, with the typed numbers it replaced. */
.proof { margin: 0; }
.proof-stack { position: relative; }
.proof-stack::before {
  /* the page underneath */
  content: ""; position: absolute; inset: 22px -14px -16px 18px;
  background: var(--doc-bg); border-radius: 6px;
  box-shadow: var(--shadow-sheet); opacity: 0.55;
  transform: rotate(2.2deg);
}
.proof-sheet {
  position: relative;
  background: var(--doc-bg); color: var(--doc-ink);
  border-radius: 6px; box-shadow: var(--shadow-sheet);
  padding: clamp(22px, 3.4vw, 44px) clamp(18px, 3.4vw, 44px) clamp(22px, 3vw, 36px);
}
.doc-kicker {
  font: 600 0.7rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--doc-ink-2); margin-bottom: 10px;
}
.proof-title {
  font-family: var(--serif); font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.1;
  padding-bottom: 16px; margin-bottom: 6px; border-bottom: 1px solid var(--doc-bar);
}
.proof-lines { list-style: none; margin: 0; padding: 0; }
.pl {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.42em;
  font-family: var(--serif); line-height: 1.25;
  padding: 7px 0;
}
.pl-1 { font-size: clamp(1.08rem, 1.5vw, 1.24rem); padding-top: 12px; }
.pl-2 { font-size: clamp(0.98rem, 1.25vw, 1.06rem); color: #2b3431; }
.pl-num {
  display: inline-block; white-space: nowrap; overflow: hidden;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(transparent 14%, var(--marker) 14%, var(--marker) 90%, transparent 90%);
  padding: 0 0.14em; margin-left: -0.14em;
}
.pl-old {
  font-size: 0.9em; color: var(--doc-strike);
  text-decoration: line-through; text-decoration-thickness: 1.5px;
}
.pl.is-off .pl-text { color: var(--doc-ink-2); }
.pl-note {
  margin-left: auto; align-self: center;
  font: 600 0.68rem/1.2 var(--sans); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--doc-ink-2); white-space: nowrap;
  padding-left: 10px;
}
.pl-note::before { content: "\2190\00a0"; content: "\2190\00a0" / ""; letter-spacing: 0; }
.proof figcaption {
  position: relative; margin-top: 30px; font-size: 0.88rem; color: var(--ink-2);
  max-width: 36em;
}
.key { display: inline-block; padding: 0 0.3em; border-radius: 2px; color: var(--ink); }
.key-new { background: var(--marker); color: var(--marker-ink); }
.key-old { color: var(--strike); text-decoration: line-through; }

@media (prefers-reduced-motion: no-preference) {
  .pl-num { animation: th-insert 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(0.5s + var(--i, 0) * 0.11s); }
  .pl-old { animation: th-strike 0.45s ease-out both; animation-delay: calc(0.35s + var(--i, 0) * 0.11s); }
  .pl-note { animation: th-fade 0.5s ease-out both; animation-delay: calc(1.3s + var(--i, 0) * 0.08s); }
}
@keyframes th-insert {
  /* starts with no width and cancels the row gap, so the line begins where an unnumbered one does */
  from { max-width: 0; opacity: 0; padding-inline: 0; margin-left: 0; margin-right: -0.42em; }
  60% { opacity: 1; }
  to { max-width: 4em; opacity: 1; }
}
@keyframes th-strike {
  from { color: var(--doc-ink); text-decoration-color: transparent; font-size: 1em; }
  to { color: var(--doc-strike); text-decoration-color: currentColor; }
}
@keyframes th-fade { from { opacity: 0; transform: translateX(-4px); } }

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

.section { padding-block: clamp(64px, 9vw, 128px); }
.section-head { max-width: 40rem; margin-bottom: clamp(32px, 4vw, 52px); }
.section-head h2 { font-size: clamp(2rem, 3.8vw, 3.1rem); }
.section-head p { margin-top: 16px; color: var(--ink-2); font-size: 1.08rem; }
.secnum {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.55em; height: 1.4em; padding: 0 0.3em;
  margin-right: 0.45em; vertical-align: 0.28em;
  font: 600 0.42em/1 var(--sans); letter-spacing: 0;
  background: var(--marker); color: var(--marker-ink); border-radius: 0.28em;
}
.step-num {
  font: 600 0.82rem/1 var(--sans); font-variant-numeric: tabular-nums;
  color: var(--teal-ink); letter-spacing: 0.02em;
}

/* ---------- Demo ---------- */

.demo-section { background: var(--paper-2); border-block: 1px solid var(--rule); }
.demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}
.doc-wrap { min-width: 0; }
.doc-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px; min-height: 38px;
}
.doc-label { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); letter-spacing: 0.02em; }
.doc-tools { display: flex; gap: 8px; }
.doc-tools[hidden] { display: none; }
.btn-quiet[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.doc {
  background: var(--doc-bg); color: var(--doc-ink);
  border-radius: 6px; box-shadow: var(--shadow-sheet);
  padding: clamp(24px, 4.4vw, 60px) clamp(20px, 5vw, 72px) clamp(28px, 4.4vw, 60px);
  min-height: 100%;
}
.doc-title {
  font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.1;
  margin-bottom: 4px;
}
.doc-sub { font-size: 0.85rem; color: var(--doc-ink-2); margin-bottom: 8px; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.dh {
  font-family: var(--serif); line-height: 1.2; overflow-wrap: anywhere;
  border-radius: 3px;
}
.dh::after {
  /* body text under each heading, drawn as grey bars */
  content: ""; display: block; height: 30px; margin-top: 12px;
  background:
    linear-gradient(var(--doc-bar) 0 0) 0 0 / 96% 7px no-repeat,
    linear-gradient(var(--doc-bar) 0 0) 0 12px / 88% 7px no-repeat,
    linear-gradient(var(--doc-bar) 0 0) 0 24px / 54% 6px no-repeat;
}
.dh:nth-child(3n+2)::after { height: 18px; background:
    linear-gradient(var(--doc-bar) 0 0) 0 0 / 92% 7px no-repeat,
    linear-gradient(var(--doc-bar) 0 0) 0 12px / 38% 6px no-repeat; }
.dh:nth-child(3n)::after { background:
    linear-gradient(var(--doc-bar) 0 0) 0 0 / 90% 7px no-repeat,
    linear-gradient(var(--doc-bar) 0 0) 0 12px / 95% 7px no-repeat,
    linear-gradient(var(--doc-bar) 0 0) 0 24px / 70% 6px no-repeat; }
.dh-1 { font-size: clamp(1.3rem, 2.1vw, 1.6rem); margin-top: 26px; }
.dh-2 { font-size: clamp(1.1rem, 1.6vw, 1.26rem); margin-top: 20px; }
.dh-3 { font-size: clamp(1rem, 1.3vw, 1.08rem); margin-top: 16px; color: var(--doc-ink-2); }
.dh:first-child { margin-top: 20px; }
.dh .empty { font-style: italic; color: var(--doc-ink-2); }
.dh.is-hover { box-shadow: -10px 0 0 -6px var(--teal); }
.dh { position: relative; z-index: 0; }
.dh::before {
  /* style gutter: which paragraph style each heading has */
  content: "H" attr(data-level);
  content: "H" attr(data-level) / ""; /* each heading already says "Heading N" to screen readers */
  position: absolute; left: clamp(-48px, -4vw, -30px); top: 0.55em;
  font: 600 0.62rem/1 var(--sans); letter-spacing: 0.06em; color: var(--doc-ink-2);
}
.dh .just { position: relative; }
.dh .just::before {
  /* brief marker sweep on what Apply just wrote; it fades, like the real heading has no highlight */
  content: ""; position: absolute; z-index: -1; inset: 0.1em -0.12em 0.02em;
  background: var(--marker); border-radius: 2px;
  transform-origin: left center;
  animation: th-flash 2.8s ease-out both;
}
@keyframes th-flash {
  0% { transform: scaleX(0); opacity: 1; }
  14% { transform: scaleX(1); opacity: 1; }
  62% { opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* Heading editor (Edit headings) */
.ed { list-style: none; margin: 18px 0 0; padding: 0; }
.ed-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 6px 0; border-bottom: 1px dashed var(--doc-bar);
}
.ed-row select, .ed-row input {
  font: inherit; color: var(--doc-ink); background: #fff;
  border: 1px solid #cfc8b8; border-radius: 7px;
}
.ed-row select { font: 600 0.8rem/1 var(--sans); padding: 7px 4px; }
.ed-row input {
  width: 100%; font-family: var(--serif); padding: 6px 9px; line-height: 1.2;
}
.ed-row[data-level="1"] input { font-size: 1.2rem; }
.ed-row[data-level="2"] input { font-size: 1.06rem; margin-left: 14px; width: calc(100% - 14px); }
.ed-row[data-level="3"] input { font-size: 0.98rem; margin-left: 28px; width: calc(100% - 28px); }
.ed-del {
  font: 600 1.1rem/1 var(--sans); width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--doc-ink-2); cursor: pointer;
}
.ed-del:hover { background: #efe9dc; color: var(--doc-ink); }
.ed-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.ed-add {
  font: 600 0.9rem/1 var(--sans); padding: 10px 14px; border-radius: 8px; cursor: pointer;
  border: 1px dashed #b9b09c; background: transparent; color: var(--doc-ink);
}
.ed-add:hover { background: #f3eee3; }
.ed-hint { font-size: 0.82rem; color: var(--doc-ink-2); }
.ed :focus-visible, .ed-foot :focus-visible { outline-color: #0f766e; }

/* The sidebar panel */
.panel {
  background: var(--sheet); border: 1px solid var(--rule);
  border-radius: 14px; box-shadow: var(--shadow-panel);
  overflow: hidden;
  position: sticky; top: 16px;
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--rule);
  font-weight: 600;
}
.panel-head img { width: 22px; height: 22px; border-radius: 6px; }
.panel-tag {
  margin-left: auto; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2); border: 1px solid var(--rule-2); border-radius: 999px; padding: 2px 8px;
}
.opts { padding: 14px 16px 4px; display: grid; gap: 12px; }
.opts[hidden] { display: none; }
.opts fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.opts legend, .opt-row label {
  font-size: 0.78rem; font-weight: 600; color: var(--ink-2);
  letter-spacing: 0.04em; text-transform: uppercase; padding: 0; margin-bottom: 6px;
}
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt-row { display: grid; min-width: 0; }
.opt-row select {
  font: 500 0.95rem/1.2 var(--sans); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule-2); border-radius: 8px;
  padding: 8px 8px; width: 100%;
}
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
  background: var(--paper); border: 1px solid var(--rule-2); border-radius: 10px; padding: 3px;
}
.seg label { position: relative; display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: block; text-align: center; padding: 8px 6px; border-radius: 7px;
  font-size: 0.9rem; font-weight: 600; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.seg label:hover span { color: var(--ink); }
.seg input:checked + span:hover, .seg label:hover input:checked + span { color: var(--paper); }
.opts-number[hidden] { display: none; }
.opts-number { display: grid; gap: 12px; }

.review { padding: 12px 16px 6px; }
.review[hidden] { display: none; }
.rv-counts { font-weight: 600; font-size: 1rem; }
.rv-hint { font-size: 0.82rem; color: var(--ink-2); margin-top: 4px; line-height: 1.45; }
.rv { list-style: none; margin: 12px -16px 0; padding: 0; border-top: 1px solid var(--rule); }
.rv-row { border-bottom: 1px solid var(--rule); }
.rv-row > label, .rv-row > .rv-static {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 9px 16px 9px calc(16px + (var(--lvl, 1) - 1) * 14px);
}
.rv-row > label { cursor: pointer; }
.rv-row > label:hover { background: var(--paper); }
.rv-row input[type="checkbox"] {
  width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--teal); cursor: pointer;
}
.rv-box {
  width: 16px; height: 16px; margin-top: 3px; border-radius: 4px;
  background: var(--teal); position: relative;
}
.rv-box::after {
  content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px;
  border: solid var(--on-teal); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.is-off .rv-box { background: transparent; border: 1.5px solid var(--rule-2); }
.is-off .rv-box::after { display: none; }
.rv-text { min-width: 0; overflow-wrap: anywhere; font-size: 0.93rem; line-height: 1.35; }
.rv-new { display: block; font-weight: 500; }
.rv-new .num { font-weight: 600; color: var(--teal-ink); font-variant-numeric: tabular-nums; margin-right: 0.15em; }
.is-off .rv-new { color: var(--ink-2); }
.rv-old { display: block; font-size: 0.8rem; color: var(--ink-2); margin-top: 1px; }
.rv-was {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  margin-right: 0.35em;
}
.tag {
  display: inline-block; margin-top: 4px;
  font-size: 0.72rem; font-weight: 600; line-height: 1.5;
  background: var(--marker); color: var(--marker-ink);
  padding: 0 6px; border-radius: 4px;
}
.rv-empty { font-style: italic; color: var(--ink-2); }
.rv-row.is-hover > label { background: var(--paper); }

.panel-foot { padding: 14px 16px 16px; border-top: 1px solid var(--rule); display: grid; gap: 10px; }
.panel-foot[hidden] { display: none; }
.panel-foot .btn { width: 100%; }
.msg {
  font-size: 0.92rem; line-height: 1.45; border-radius: 9px; padding: 10px 12px;
}
.msg[hidden] { display: none; }
.msg-ok { background: var(--teal-wash); color: var(--ink); }
.msg-ok strong { color: var(--teal-ink); }
.toc-note { font-size: 0.82rem; color: var(--ink-2); }
.toc-note[hidden] { display: none; }
.nojs-note {
  margin: 0; padding: 12px 16px 16px; font-size: 0.85rem; color: var(--ink-2);
  border-top: 1px solid var(--rule);
}
.nojs-note[hidden] { display: none; }
.demo-foot {
  margin-top: 22px; font-size: 0.9rem; color: var(--ink-2); max-width: 54rem;
}

/* ---------- How it works ---------- */

.how-grid {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(28px, 6vw, 96px); align-items: start;
}
.how-grid .section-head { position: sticky; top: 32px; margin-bottom: 0; }
.steps { list-style: none; margin: 0; padding: 0; }
.step {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 18px 36px; align-items: start;
  padding: 30px 0; border-top: 1px solid var(--rule);
}
.step:last-child { border-bottom: 1px solid var(--rule); }
.step-copy h3 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); margin-top: 10px; }
.step-copy p { margin-top: 10px; color: var(--ink-2); }
.step-copy p strong { color: var(--ink); font-weight: 600; }
.specimen {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px;
  padding: 14px 16px; font-size: 0.9rem; box-shadow: var(--shadow-panel);
}
.styles-list { list-style: none; margin: 0; padding: 0; }
.styles-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 5px 0; border-bottom: 1px dashed var(--rule);
}
.styles-list li:last-child { border-bottom: 0; }
.styles-list .s-name { font-family: var(--serif); }
.styles-list .s-h1 { font-size: 1.2rem; }
.styles-list .s-h2 { font-size: 1.06rem; }
.styles-list .s-title { font-size: 1.32rem; }
.styles-list .s-normal { font-family: var(--sans); font-size: 0.92rem; }
.styles-list .s-yes { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal-ink); white-space: nowrap; }
.styles-list .s-no { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.menu-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 600; }
.menu-path span { background: var(--paper); border: 1px solid var(--rule); border-radius: 7px; padding: 4px 9px; }
.menu-path i { font-style: normal; color: var(--ink-2); }
.menu-items { list-style: none; margin: 10px 0 0; padding: 6px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }
.menu-items li { padding: 6px 10px; border-radius: 6px; color: var(--ink-2); }
.menu-items li.on { background: var(--teal); color: var(--on-teal); font-weight: 600; }
.specimen .rv { margin: 8px -16px -14px; }
.specimen .rv-row:last-child { border-bottom: 0; }
.specimen .rv-counts { font-size: 0.95rem; }
.result-line { font-weight: 600; }
.result-line + .toc-note { margin-top: 8px; }
.how-again {
  grid-column: 2; margin-top: 8px; font-family: var(--serif); font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  line-height: 1.35;
}
.how-again em { color: var(--teal-ink); }

.factsheet {
  margin: 30px 0 0; padding: 0; border-top: 1px solid var(--rule);
  font-size: 0.92rem;
}
.factsheet > div {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.factsheet dt {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2); padding-top: 0.2em;
}
.factsheet dd { margin: 0; color: var(--ink); }

/* ---------- Trust band ---------- */

.trust { background: var(--band); color: var(--band-ink); }
.trust .section-head p { color: var(--band-ink-2); }
.trust a { color: var(--band-link); }
.trust .step-num { color: var(--band-link); }
.trust :focus-visible { outline-color: var(--band-link); }
.rules {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(28px, 5vw, 72px);
}
.rule-item { padding: 28px 0 34px; border-top: 1px solid var(--band-rule); }
.rule-item h3 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); margin-top: 10px; }
.rule-item p { margin-top: 10px; color: var(--band-ink-2); }
.rule-item p strong { color: var(--band-ink); font-weight: 600; }
.rule-item q { color: var(--band-ink); font-style: italic; }
.rule-item .anatomy p { color: var(--doc-ink); margin: 0; }
.anatomy {
  margin-top: 20px; background: var(--doc-bg); color: var(--doc-ink);
  border-radius: 8px; padding: 16px 18px 12px; box-shadow: var(--shadow-sheet);
}
.an-line { font-family: var(--serif); font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.3; }
.an-num {
  outline: 1.5px dashed #0f766e; outline-offset: 2px; border-radius: 2px;
  background: linear-gradient(transparent 12%, var(--marker) 12%, var(--marker) 92%, transparent 92%);
  padding: 0 0.1em;
}
.an-link { color: #1d5fae; text-decoration: underline; }
.rule-item .an-labels { color: var(--doc-ink-2); margin-top: 10px; }
.an-labels {
  display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px;
  font: 600 0.72rem/1.2 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--doc-ink-2);
}
.an-labels .a { color: #0b5f58; }
.trust-more { margin-top: 26px; color: var(--band-ink-2); }

/* ---------- Pricing (only when prices are set) ---------- */

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.plan {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-panel);
}
.plan h3 { font-size: 1.5rem; }
.plan p { margin-top: 10px; color: var(--ink-2); }
.plan-buy { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- FAQ ---------- */

.faq-grid {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(28px, 6vw, 96px); align-items: start;
}
.faq-grid .section-head { position: sticky; top: 32px; margin-bottom: 0; }
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: baseline; gap: 18px;
  padding: 20px 0;
  font-family: var(--serif); font-size: clamp(1.15rem, 1.8vw, 1.38rem); line-height: 1.25;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  /* a plus drawn with two bars, so screen readers have nothing to read out */
  content: ""; flex: none; width: 14px; height: 14px; align-self: center;
  background:
    linear-gradient(var(--teal-ink) 0 0) center / 14px 2px no-repeat,
    linear-gradient(var(--teal-ink) 0 0) center / 2px 14px no-repeat;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--teal-ink); }
.faq .answer { padding: 0 0 22px; color: var(--ink-2); max-width: 40rem; }
.faq .answer p + p { margin-top: 10px; }
.faq .answer strong { color: var(--ink); font-weight: 600; }

/* ---------- Support + closing ---------- */

.closing { background: var(--paper-2); border-top: 1px solid var(--rule); }
.closing-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px;
  padding-block: clamp(40px, 6vw, 72px);
}
.closing-inner img { width: 56px; height: 56px; border-radius: 13px; }
.closing-line {
  flex: 1 1 18rem; font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.15;
}

.support { border-top: 1px solid var(--rule); }
.support-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 96px); align-items: end;
}
.support-mail {
  font-family: var(--serif); font-size: clamp(1.5rem, 3.2vw, 2.4rem); line-height: 1.15;
  overflow-wrap: anywhere;
}
.support-mail a { color: var(--ink); text-decoration-color: var(--teal); text-decoration-thickness: 2px; }
.support-mail a:hover { color: var(--teal-ink); }
.support-copy p + p { margin-top: 12px; }
.support-copy p { color: var(--ink-2); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); padding-block: 40px 48px; font-size: 0.9rem; color: var(--ink-2); }
.footer-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px;
}
.footer-row .brand { font-size: 1.15rem; }
.footer-row .brand img { width: 22px; height: 22px; border-radius: 6px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-nav a { color: var(--ink-2); }
.footer-nav a:hover { color: var(--ink); }
.footer-legal { margin-top: 22px; display: grid; gap: 6px; max-width: 52rem; }
.footer-legal p { color: var(--ink-2); }

/* ---------- Legal pages ---------- */

.legal { padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 112px); }
.legal-head { max-width: 46rem; margin: 0 auto; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.legal-head h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.02; }
.legal-head .note { margin-top: 14px; color: var(--ink-2); font-size: 0.95rem; }
.legal-body {
  max-width: 46rem; margin: 0 auto; counter-reset: section;
  font-size: 1.04rem; line-height: 1.7;
}
.legal-body > p:first-child { margin-top: 28px; font-size: 1.12rem; color: var(--ink); }
.legal-body h2 {
  counter-increment: section;
  font-size: clamp(1.45rem, 2.4vw, 1.8rem);
  margin: 44px 0 12px; padding-top: 20px; border-top: 1px solid var(--rule);
  display: flex; gap: 0.6em; align-items: baseline;
}
.legal-body h2::before {
  content: counter(section);
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.6em; height: 1.35em; padding: 0 0.3em; flex: none;
  font: 600 0.55em/1 var(--sans); font-variant-numeric: tabular-nums;
  background: var(--marker); color: var(--marker-ink); border-radius: 0.28em;
  transform: translateY(-0.2em);
}
.legal-body p { margin: 12px 0 0; color: var(--ink-2); }
.legal-body p strong, .legal-body li strong { color: var(--ink); }
.legal-body ul { margin: 12px 0 0; padding-left: 1.3em; color: var(--ink-2); }
.legal-body li { margin: 8px 0; padding-left: 0.3em; }
.legal-body li::marker { color: var(--teal); }

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
  .demo { grid-template-columns: minmax(0, 1fr) minmax(290px, 340px); }
  .step { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .proof { max-width: 560px; }
  .how-grid, .faq-grid, .support-inner { grid-template-columns: minmax(0, 1fr); }
  .how-grid .section-head, .faq-grid .section-head { position: static; }
  .how-again { grid-column: 1; }
  .demo { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  body { font-size: 1rem; }
  .dh::before { display: none; }
  .dh::after, .dh:nth-child(3n)::after, .dh:nth-child(3n+2)::after {
    height: 7px; margin-top: 9px;
    background: linear-gradient(var(--doc-bar) 0 0) 0 0 / 82% 7px no-repeat;
  }
  .dh-1 { margin-top: 20px; }
  .dh-2, .dh-3 { margin-top: 14px; }
  .proof-stack::before { inset: 16px -6px -10px 10px; }
  .pl-note { margin-left: 0; padding-left: 0; flex-basis: 100%; font-size: 0.62rem; }
  .pl-note::before { content: ""; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cta-row .button, .cta-row .button-demo { width: 100%; }
  .opt-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.support-head { margin-bottom: 18px; }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 2px; }
