.hero-actions, .local-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.hero-actions { pointer-events: auto; width: fit-content; }
.hero-actions > *, .local-actions > *, .local-steps a {
  min-height: 44px;
  text-decoration: none;
}
.hero-actions .quiet { font-size: 13px; }
.hero-actions .quiet, .local-review a.quiet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
}
.hero-note { font-size: 12px; }
body:has(#records-view:not([hidden])) .demo-badge { visibility: hidden; }
.local-review {
  --local-width: min(92%, 1260px);
  --local-blue-paper: #eef1fa;
  --local-ink-border: #b7bdc6;
  overflow-wrap: anywhere;
  min-height: calc(100svh - 90px);
}
.local-review [hidden] { display: none !important; }
.local-heading, .local-stage {
  width: var(--local-width);
  margin: 0 auto;
}
.local-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 20px;
  gap: 16px;
}
.local-heading h1, .local-stage h2 {
  font: 400 clamp(38px, 5vw, 66px)/1 var(--serif);
  letter-spacing: -.035em;
  margin: 10px 0 0;
}
.local-heading h1 { font-size: clamp(33px, 4.2vw, 52px); }
.local-heading h1 span { color: var(--blue); }
.local-heading-tools { display: flex; align-items: center; gap: 16px; }
.privacy-chip {
  color: #254638;
  background: #e4ebe1;
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.privacy-chip i { width: 7px; height: 7px; border-radius: 50%; background: #3f6b55; }
.local-steps {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  padding-inline: max(4vw, calc((100% - 1260px) / 2));
  border-block: 1px solid var(--line);
  background: var(--paper);
}
.local-steps a {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  min-height: 58px;
  font-size: 14px;
  padding: 8px 14px;
}
.local-steps a + a { border-left: 1px solid var(--line); }
.local-steps a span {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 11px;
}
.local-steps a[aria-current=step] { background: var(--local-blue-paper); color: var(--blue); }
.local-steps a[aria-current=step]::after { content: ''; position: absolute; inset: auto 0 -1px; border-bottom: 2px solid var(--blue); }
.local-steps a[aria-current=step] span { background: var(--blue); color: white; border-color: var(--blue); }
.local-stage { padding: 40px 0 68px; }
.local-stage-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
}
.local-stage-heading p {
  color: var(--muted);
  max-width: 62ch;
  margin: 14px 0 0;
  line-height: 1.65;
}
.local-sample-box { flex: 0 0 auto; }
.local-sample-box > .eyebrow { display: block; margin-bottom: 4px; }
.local-sample-box .quiet { min-height: 44px; }
.local-source-grid, .local-return-grid, .local-draft-grid, .local-fields {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: start;
  gap: 16px;
}
.local-draft-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.local-document, .local-paper, .local-editor {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  padding: clamp(16px, 2.3vw, 28px);
  box-shadow: 0 9px 22px -18px #17274466;
  min-width: 0;
}
.local-document.entry { border-top: 3px solid #a04d39; }
.local-document.support, .local-paper { border-top: 3px solid var(--blue); }
.local-doc-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
}
.local-doc-top span:last-child { color: var(--blue); text-align: right; }
.local-doc-name { margin: 18px 0 16px; }
.local-doc-name h3, .local-paper h3 {
  font: 400 clamp(26px, 3vw, 38px)/1.08 var(--serif);
  margin: 0 0 8px;
}
.local-doc-name p, .local-review .local-status, .local-review [role=status], .local-empty {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.local-review [role=status]:not(:empty) { margin-top: 10px; }
.local-review [role=status]:empty { margin: 0; }
.local-review #local-clear-status:not(:empty) { width: var(--local-width); margin: 16px auto 0; }
.pdf-drop {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 19px;
  background: #f5f6fa;
  border: 1px dashed #8c9abb;
  border-radius: 4px;
}
.local-return-grid .pdf-drop { margin-top: 18px; }
.pdf-drop.drop-active { border-color: var(--blue); background: #e0e7ff; }
.pdf-drop strong, .pdf-drop small { display: block; }
.pdf-drop strong { font-size: 15px; }
.pdf-drop small { color: var(--muted); margin-top: 4px; font-size: 11px; line-height: 1.5; }
.pdf-drop .quiet { grid-column: 2; justify-self: start; min-height: 44px; background: var(--paper); }
.pdf-icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 50px;
  border: 1px solid #c5cfee;
  border-radius: 4px;
  color: var(--blue);
  background: #e9edfa;
}
.pdf-icon svg { width: 22px; height: 25px; }
.local-file-bar, .local-reader-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 12px;
  font-size: 13px;
}
.local-file-bar strong { color: var(--ink); }
.local-reader-actions { margin-bottom: 8px; }
.local-review .text-button { display: inline-flex; align-items: center; min-height: 44px; }
.local-review label { display: block; font-weight: 600; font-size: 13px; margin-block: 10px 6px; }
.local-review input, .local-review select, .local-review textarea {
  font: 400 16px/1.5 var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--local-ink-border);
  border-radius: 3px;
  max-width: 100%;
}
.local-review input, .local-review select { min-height: 44px; padding: 6px 10px; }
.local-review textarea, .local-fields input, .local-fields select { display: block; width: 100%; }
.local-review textarea { padding: 11px; resize: vertical; }
.local-review textarea[readonly] { background: #f8f7f2; }
.capture-button { margin-top: 10px; min-height: 44px; }
.local-citation, .local-redline > div, .local-notice {
  padding: 12px 15px;
  background: var(--local-blue-paper);
  border-left: 2px solid var(--blue);
}
.local-citation { margin-top: 16px; }
.local-citation blockquote { font-size: 15px; line-height: 1.55; margin: 6px 0; white-space: pre-wrap; }
.local-next {
  margin-top: 18px;
  padding: 14px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.local-next strong { font-size: 14px; }
.local-next p { color: var(--muted); font-size: 12px; margin: 3px 0 0; }
.local-next .primary { text-decoration: none; min-height: 44px; }
.local-paper { position: relative; }
.local-paper > h3 { margin-top: 15px; }
.local-paper .draft-tag { display: inline-block; margin-bottom: 10px; }
.local-paper .packet-issue { margin-top: 12px; padding-top: 16px; }
.local-paper .packet-issue h3 { font: 600 18px/1.35 var(--sans); }
.local-paper .packet-issue blockquote { margin-inline: 0; white-space: pre-wrap; }
.local-paper .packet-issue p, .local-paper .comparison-issue p { white-space: pre-wrap; }
.local-paper .packet-issue .evidence-ref { color: var(--muted); }
.local-paper .packet-issue .local-actions { margin-top: 8px; }
.local-paper .local-status { margin-top: 12px; }
.local-editor .local-actions, .local-paper .local-actions { margin-top: 14px; }
.local-editor .local-notice { margin-top: 12px; font-size: 13px; }
.local-editor .local-notice p { margin: 0; }
.local-empty { margin-top: 16px; padding: 14px 0; }
.local-redline { margin-top: 14px; display: grid; gap: 6px; }
.local-redline > div:first-child { background: #f6ebe7; border-color: #a04d39; }
.local-redline .eyebrow { display: block; margin-bottom: 5px; }
.local-redline del, .local-redline ins { display: block; white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.local-redline del { color: #823d2d; }
.local-redline ins { color: #173a94; text-decoration: none; }
.local-optional { font-weight: 400; color: var(--muted); }
.local-review button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.local-review :is(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
#local-clear-dialog { max-width: min(500px, calc(100% - 28px)); }
#local-clear-dialog .quiet { position: static; }
@media (min-width: 1000px) {
  .local-draft-grid > .local-paper { position: sticky; top: 16px; }
}
@media (max-width: 760px) {
  .hero { min-height: 920px; }
  .hero-art { top: 455px; }
  .hero-actions .primary { gap: 12px; }
  .hero-actions .quiet { padding-inline: 10px; }
  .local-heading { padding-block: 18px; flex-wrap: wrap; gap: 5px 12px; }
  .local-heading-tools { gap: 12px; }
  .local-steps a { font-size: 12px; padding: 8px 7px; gap: 5px; line-height: 1.3; }
  .local-steps a span { width: 23px; height: 23px; font-size: 9px; }
  .local-stage { padding-block: 24px 38px; }
  .local-stage-heading { display: block; margin-bottom: 16px; }
  .local-stage-heading > a, .local-sample-box { margin-top: 12px; }
  .local-sample-box > .eyebrow { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .local-source-grid, .local-draft-grid, .local-return-grid { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  .local-fields { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 360px) {
  .hero { min-height: 960px; }
  .hero-art { top: 515px; }
  .local-steps a { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  #motion { visibility: hidden; }
}
.local-steps { position: sticky; top: 0; z-index: 5; }
.local-document, .local-paper, .local-editor { background: #fcfaf5; }
.local-editor-empty { padding-block: 18px 4px; }
.local-editor-empty h3 { font: 400 29px/1.1 var(--serif); margin: 0 0 9px; }
.local-editor-empty p { color: var(--muted); max-width: 50ch; line-height: 1.6; margin: 0 0 12px; }
.local-editor-empty a { min-height: 44px; }
.local-review .pdf-drop .quiet {
  color: #18378e;
  border-color: #9daed9;
  font-size: 12px;
  font-weight: 600;
}
.local-review .pdf-drop .quiet:hover { background: #e9edfa; }
.local-review .local-redline ins:empty::after { content: 'Your exact wording will appear here.'; color: var(--muted); }
.local-review :is(a, button, input, select, textarea) { scroll-margin-top: 76px; }
@media (max-height: 760px) and (min-width: 761px) {
  .local-heading { padding-block: 14px; }
  .local-stage { padding-top: 24px; }
  .local-stage h2 { font-size: 50px; }
}
.source-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 9px;
}
.source-mode {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: #eeeef1;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.source-mode button {
  padding: 7px 9px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  font: 600 12px/1.2 var(--sans);
}
.source-mode button[aria-pressed=true] {
  background: #fff;
  border-color: #c8d1eb;
  color: #1b3d9b;
}
.source-search {
  display: flex;
  flex: 1 1 190px;
  align-items: stretch;
  gap: 6px;
  max-width: 270px;
}
.source-search input { min-width: 0; width: 100%; }
.source-search button { min-height: 44px; }
.source-search-results {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.source-search-results:has(select:not([hidden])),
.source-search-results:has(p:not(:empty)) { margin-bottom: 9px; }
.source-search-results p[role=status]:not(:empty) { margin: 0; }
.source-search-results select { font-size: 13px; }
.source-preview {
  background: #e7e7e9;
  border: 1px solid var(--local-ink-border);
  border-radius: 4px;
}
.source-preview[aria-busy=true] { min-height: 180px; }
.source-preview > [role=status]:not(:empty) { margin: 0; padding: 14px; }
.source-preview .page-surface {
  max-height: 540px;
  overflow: auto;
  overscroll-behavior: contain;
}
.source-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  background: white;
}
.local-paper .packet-issue .text-button { margin-bottom: 4px; }
.local-paper .comparison-issue .match-preview { display: flex; margin-top: 4px; }
#citation-preview {
  width: min(720px, calc(100% - 30px));
  max-width: none;
  max-height: calc(100% - 32px);
  padding: clamp(15px, 3vw, 28px);
  overflow: auto;
}
.citation-dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
#citation-preview .citation-dialog-top h2 { margin: 8px 0 12px; font-size: clamp(25px, 4vw, 37px); }
#citation-preview .citation-dialog-top button { position: static; min-height: 44px; white-space: nowrap; }
#citation-preview blockquote { margin: 0 0 12px; white-space: pre-wrap; }
#citation-preview .page-surface { max-height: min(57svh, 540px); }
@media (max-width: 500px) {
  .source-search { max-width: none; }
  .source-preview .page-surface { max-height: 390px; }
}
.source-search button { flex: none; white-space: nowrap; }
.evidence-view-actions { display: flex; justify-content: flex-end; }
.evidence-view-actions button { margin-bottom: 12px; min-height: 44px; }
.preview-zoom {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-bottom: 1px solid var(--local-ink-border);
  background: #f1f1f3;
}
.preview-zoom button { min-height: 44px; min-width: 44px; background: #fff; }
.source-preview canvas { width: var(--page-zoom, 100%); max-width: none; }
.source-preview .page-surface:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.captured-summary { display: none; }
#entry-preview { scroll-margin-top: 136px; }
.wording-change { margin: 12px 0; padding: 12px; background: #efede6; overflow-wrap: anywhere; white-space: pre-wrap; }
.wording-change p { margin: 0; font-size: 14px; }
.wording-change p + p { margin-top: 8px; }
.wording-change strong { display: block; font-size: 12px; }
.wording-change del { background: #f7ddd5; color: #752f24; }
.wording-change ins { background: #dce6ff; color: #173ca2; }
#local-results .match-context { margin: 8px 0; }
@media (max-width: 760px) {
  .captured-summary:not([hidden]) { display: block; margin: 0 0 16px; padding: 14px; border: 1px solid #d7d4ca; background: #f9f7f1; }
  .captured-summary h3 { margin: 0; font-size: 18px; }
  .captured-summary p { margin: 8px 0; font-size: 14px; overflow-wrap: anywhere; }
}

.passage-finder { margin: 0 0 18px; padding: clamp(15px, 3vw, 24px); background: #eef1f9; border-top: 3px solid var(--blue); }
.passage-finder h3 { margin: 0 0 8px; font-size: 23px; }
.passage-finder p { font-size: 14px; margin: 8px 0; }
.passage-finder label { font-size: 13px; font-weight: 650; display: block; margin: 14px 0 5px; }
.finder-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.finder-actions input { flex: 1 1 260px; min-width: 0; padding: 10px; font: inherit; border: 1px solid #8894b0; background: white; }
.finder-scan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 8px 0 0; }
.finder-scan-row p { margin: 0; max-width: 60ch; font-size: 12px; color: #5e6764; }
#finder-status:empty { display: none; }
#finder-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#finder-results h4 { margin: 10px 0 6px; }
#passage-finder .scan-results { grid-column: 1 / -1; }
#passage-finder .scan-results h4 { margin: 4px 0; font-size: 20px; }
#passage-finder .scan-note { margin: 0 0 12px; font-size: 12px; color: #5e6764; }
#passage-finder .scan-pair { background: #fff; border-left: 3px solid #b86555; padding: 14px; margin: 0 0 12px; }
#passage-finder .scan-difference { margin: 0 0 10px; font-size: 13px; line-height: 1.7; }
#passage-finder .scan-difference strong { display: inline-block; margin-right: 6px; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #5e6764; }
#passage-finder .scan-difference del { color: #823d2d; }
#passage-finder .scan-difference ins { color: #173a94; text-decoration: none; font-weight: 600; }
#passage-finder .scan-quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#passage-finder .scan-quotes article { background: #f8f7f2; border: 1px solid #dedbd2; margin: 0; padding: 10px; }
#passage-finder .scan-quotes .captured-passage { border-left: 3px solid #2e6954; background: #f4faf6; }
#passage-finder .scan-role { display: block; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #5e6764; }
#passage-finder .scan-quotes blockquote { margin: 5px 0; font-size: 14px; line-height: 1.65; }
#passage-finder .scan-quotes p { margin: 4px 0; font-size: 11px; color: #5e6764; }
#passage-finder article { background: #fff; padding: 10px; margin-bottom: 6px; overflow-wrap: anywhere; }
#passage-finder blockquote, .comparison-issue blockquote { margin: 4px 0; white-space: pre-wrap; }
#finder-results .quiet, .finder-actions button { min-height: 44px; }
.source-preview .pdf-sheet { position: relative; width: var(--page-zoom, 100%); }
.source-preview .pdf-sheet canvas { width: 100%; }
.pdf-highlight { position: absolute; background: #ffe06c88; pointer-events: none; transform-origin: left top; }
#citation-use { margin: 8px 10px 8px 0; }
#citation-use[hidden], #finder-cancel[hidden] { display: none; }
@media (max-width: 600px) {
  #finder-results { grid-template-columns: 1fr; }
  #passage-finder .scan-quotes { grid-template-columns: 1fr; }
}

#finder-draft { margin-top: 12px; }
#finder-draft[hidden] { display: none; }

#finder-results section { min-width: 0; }
#finder-alternatives details { margin: 5px 0; }
#finder-alternatives summary { cursor: pointer; color: #233c87; font-size: 13px; padding: 10px 4px; }
#passage-finder article { border-left: 3px solid transparent; }
#passage-finder .captured-passage { border-left-color: #2e6954; background: #f4faf6; }
#passage-finder .captured-passage button { color: #235741; }
#finder-alternatives { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#finder-alternatives:empty { display: none; }
@media (max-width: 600px) { #finder-alternatives { grid-template-columns: 1fr; gap: 3px; } }

.local-sample-box select { max-width: 100%; min-height: 44px; padding: 6px 10px; border: 1px solid #a9a79f; border-radius: 3px; background: #fff; color: #202628; font: inherit; }
.local-sample-box select:disabled { opacity: 1; background: #efede6; }

.sample-handoff {
  margin: 18px auto 0;
  width: min(1260px, 92%);
  padding: 14px clamp(14px, 3vw, 28px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 30px;
  background: #181f30;
  color: #f7f7fc;
  border-left: 4px solid #99aeff;
}
.sample-handoff[hidden] { display: none; }
.sample-handoff .eyebrow { color: #becbff; }
.sample-handoff h2 { font-size: clamp(23px, 3vw, 32px); margin: 2px 0 0; line-height: 1.1; }
.sample-handoff dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 25px; margin: 0; }
.sample-handoff dt { font-size: 11px; color: #cbd0de; }
.sample-handoff dd { font-size: clamp(16px, 2vw, 21px); margin: 3px 0 0; }
.sample-handoff dl > div + div { border-left: 1px solid #687492; padding-left: 15px; }
@media (max-width: 600px) { .sample-handoff { flex-direction: column; align-items: stretch; } }
