/* Grantee · Documents: the reader (#doc/:id) and the index (#documents).
   Plates are paper: their ink colours are fixed (a scan does not change with the theme); the chrome uses tokens. */

/* ───────── reader layout ───────── */
.dr { display: flex; flex-direction: column; height: 100%; }
.dr-hd { flex: none; background: var(--surface); border-bottom: 1px solid var(--rule); padding: 10px 20px 0; }
.dr-hd-row { display: flex; align-items: center; gap: 12px; min-height: 40px; min-width: 0; }
.dr-back { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 6px; margin-left: -6px; border-radius: 8px; color: var(--graphite); text-decoration: none; font-size: 13.5px; font-weight: 500; flex: none; transition: background-color 160ms var(--ease), color 160ms var(--ease); }
.dr-back:hover { background: var(--hover); color: var(--ink); }
.dr-hd h1 { margin: 0; font-size: 22px; line-height: 1.15; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; }
.dr-hd-row > .prov { flex: none; }
.dr-meta { font-size: 12.5px; color: var(--graphite); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dr-all { margin-left: auto; flex: none; }

/* chain of title: recorded instruments in the stamp frame, linked left to right */
.dr-chain { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px 0 10px; min-width: 0; }
.ch-title { flex: none; font-size: 12.5px; color: var(--quiet); }
.ch-row { display: flex; align-items: flex-end; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; padding: 3px 2px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 28px; }
.ch-row::-webkit-scrollbar { display: none; }
.ch-node {
  --c: 5px; position: relative; isolation: isolate; flex: none; max-width: 230px; min-width: 176px;
  display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 1px;
  padding: 6px 11px 7px; text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--stamp) 45%, transparent);
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
  transition: background-color 160ms var(--ease);
}
.ch-node::before {
  content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--surface); transition: background-color 160ms var(--ease);
  clip-path: polygon(4.6px 0, calc(100% - 4.6px) 0, 100% 4.6px, 100% calc(100% - 4.6px), calc(100% - 4.6px) 100%, 4.6px 100%, 0 calc(100% - 4.6px), 0 4.6px);
}
.ch-node:hover::before { background: color-mix(in srgb, var(--stamp) 6%, var(--surface)); }
.ch-node.is-cur { background: var(--stamp); }
.ch-node.is-cur::before { inset: 1.5px; background: color-mix(in srgb, var(--stamp) 8%, var(--surface)); }
.ch-node.is-today { background: color-mix(in srgb, var(--ink) 50%, transparent); }
.ch-node.is-today:hover::before { background: var(--hover); }
.ch-node.is-today.is-cur { background: var(--ink); }
.ch-node:focus-visible { outline: none; box-shadow: none; }
.ch-node:focus-visible::before { background: var(--hover); }
.ch-node:focus-visible { background: var(--ink); }
.ch-k { font: 500 11px/1.3 var(--mono); white-space: nowrap; }
.ch-k b { font-weight: 600; letter-spacing: .04em; color: var(--stamp); margin-right: 2px; }
.ch-node.is-today .ch-k b { color: var(--ink); }
.ch-d { font-size: 11px; line-height: 1.3; color: var(--graphite); white-space: nowrap; }
.ch-n { grid-column: 1 / -1; width: 0; min-width: 100%; font-size: 12.5px; color: var(--graphite); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-node.is-cur .ch-n { color: var(--ink); }
.ch-link { flex: none; position: relative; align-self: stretch; display: flex; flex-direction: column; justify-content: center; align-items: stretch; min-width: 26px; padding: 0 8px; }
.ch-link.bare { padding: 0; }
.ch-link > i { position: relative; display: block; height: 1px; background: var(--rule-strong); }
.ch-link > i::after { content: ""; position: absolute; right: 0; top: -3px; width: 6px; height: 6px; border: solid var(--rule-strong); border-width: 1px 1px 0 0; transform: rotate(45deg); }
.ch-cite { position: relative; display: block; height: 0; top: -28px; font: 400 10px/12px var(--mono); color: var(--graphite); white-space: nowrap; text-align: center; }
.ch-sep { flex: none; width: 1px; height: 34px; background: var(--rule); margin: 0 16px; }
.ch-side { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.ch-lbl { font-size: 12.5px; color: var(--quiet); white-space: nowrap; }

.dr-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }

/* ───────── the scan pane ───────── */
.dr-scanwrap { position: relative; min-width: 0; min-height: 0; background: var(--canvas); }
.dr-scan { position: absolute; inset: 0; overflow: auto; padding: 60px 32px 48px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.dr-scan:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.dr-stage { position: relative; margin: 0 auto; }
.dr-pages { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.dr-boxes { position: absolute; inset: 0; pointer-events: none; }

.dr-tools {
  position: absolute; z-index: 3; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.dr-tools button { min-width: 34px; height: 32px; border-radius: 8px; font: 500 15px/1 var(--sans); color: var(--ink); transition: background-color 160ms var(--ease); }
.dr-tools button:hover { background: var(--hover); }
.dr-tools button:disabled { color: var(--quiet); background: none; cursor: not-allowed; }
.dr-tools output { min-width: 50px; text-align: center; font-size: 12.5px; color: var(--graphite); }
.dr-tools .fit { font-size: 12.5px; font-weight: 600; padding: 0 11px; margin-left: 3px; position: relative; }
.dr-tools .fit::before { content: ""; position: absolute; left: -3px; top: 7px; bottom: 7px; width: 1px; background: var(--rule); }
.dr-tools .fit[aria-pressed="true"] { background: var(--canvas); }

/* ───────── plates: letter-portrait paper, 816 × 1056 at 100 % ───────── */
.pl-page {
  position: relative; width: 816px; height: 1056px; margin-bottom: 28px; overflow: hidden; color: #1d1f23;
  background: #FAFAF8 url(../images/paper/paper-2019.webp) 0 0 / 100% 100% no-repeat;
  box-shadow: 0 1px 2px rgba(22,24,29,.12), 0 10px 28px rgba(22,24,29,.12);
}
.pl-page:last-child { margin-bottom: 0; }
.pl-page.p-1962 { background-color: #F1E8D2; background-image: url(../images/paper/paper-1962.webp); }
.pl-page.p-1987 { background-color: #ECECEA; background-image: url(../images/paper/paper-1987.webp); }
:root[data-theme="dark"] .pl-page { box-shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 28px rgba(0,0,0,.5); }
:root[data-theme="dark"] .pl-page::after { content: ""; position: absolute; inset: 0; background: rgba(8,9,11,.12); pointer-events: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pl-page { box-shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 28px rgba(0,0,0,.5); }
  :root:not([data-theme="light"]) .pl-page::after { content: ""; position: absolute; inset: 0; background: rgba(8,9,11,.12); pointer-events: none; }
}

.pl-body { position: absolute; left: 84px; right: 84px; top: 70px; bottom: 60px; }
.pl-foot { position: absolute; left: 84px; right: 84px; bottom: 26px; text-align: right; font: 400 10.5px/1 "Courier Prime", "Courier New", monospace; color: #5a5c61; }

/* typewritten */
.t-type { font: 400 13px/1.62 "Courier Prime", "Courier New", monospace; color: #1f2024; }
.t-type p { margin: 0 0 11px; }
.t-type .ind { text-indent: 48px; }
.t-type .kv { margin-left: 48px; }
.pl-prep { font-size: 11.5px; line-height: 1.45 !important; max-width: 340px; margin-bottom: 34px !important; }
.pl-title { margin: 0 0 2px; font: 700 17px/1.25 "Courier Prime", "Courier New", monospace; letter-spacing: .14em; text-transform: uppercase; text-align: center; }
.pl-sub { text-align: center; font-size: 11.5px; margin-bottom: 18px !important; }
.pl-small { font-size: 11px; line-height: 1.6 !important; }
.pl-small .sg { font-size: 26px; vertical-align: -6px; margin: 0 4px; }

/* signatures: pen ink, never the theme */
.sg { display: inline-block; font: 400 38px/1 "Mrs Saint Delafield", cursive; color: #1C2A63; white-space: nowrap; transform: rotate(var(--sr, -3deg)); }
.pl-sigs { display: flex; justify-content: flex-end; gap: 40px; margin: 26px 0 14px; }
.pl-sigs.two { justify-content: space-between; }
.pl-sig { position: relative; width: 300px; padding-top: 36px; font-size: 12px; line-height: 1.45; }
.pl-sig .sg { position: absolute; left: 18px; top: -4px; }
.pl-sig i { display: block; border-top: 1px solid #2a2b2f; margin-bottom: 5px; }
.pl-sig.pl-llc { padding-top: 0; width: 330px; }
.pl-sig.pl-llc .sg { position: relative; left: 18px; top: 6px; margin-top: 8px; }
.llc-by { display: inline-block; font-size: 17px; line-height: 1.4; color: #1C2A63; transform: rotate(-1.5deg); margin-left: 6px; }
.pl-notary { justify-content: space-between; align-items: center; margin-top: 34px; }
.pl-seal { color: #8E9096; opacity: .5; font-family: "Courier Prime", monospace; filter: drop-shadow(.8px .8px 0 rgba(255,255,255,.95)) drop-shadow(-.6px -.6px 0 rgba(0,0,0,.28)); }
.pl-seal text { fill: currentColor; }

/* the recorder's AFN impression */
.pl-stamp {
  position: absolute; z-index: 1; width: 236px; height: 100px; padding-top: 10px;
  display: flex; flex-direction: column; align-items: center; text-transform: uppercase;
  color: #9E2A2B; opacity: .94; transform: rotate(var(--r, -2.2deg)); filter: url(#dr-ink); mix-blend-mode: multiply;
}
.pl-stamp .st-frame { position: absolute; inset: 0; }
.st-hd { font: 650 9.5px/1 var(--sans); font-stretch: 75%; letter-spacing: .15em; }
.st-afn { margin-top: 9px; font: 600 18px/1 var(--mono); letter-spacing: .01em; }
.st-dt { margin-top: 6px; font: 500 11px/1 var(--mono); }
.st-ft { margin-top: 6px; font: 650 9.5px/1 var(--sans); font-stretch: 75%; letter-spacing: .13em; }
.pl-stamp.is-copy { color: #262626; opacity: .82; }

/* 1962: a hand-copied deed-book page */
.p-1962 .pl-bookhd { position: absolute; left: 64px; right: 52px; top: 30px; display: flex; justify-content: space-between; padding-bottom: 6px; border-bottom: 1.5px solid rgba(64,52,38,.5); font-size: 11px; letter-spacing: .22em; color: #3b3a36; }
.p-1962 .pl-margin { position: absolute; left: 64px; top: 80px; bottom: 50px; width: 152px; border-right: 1px solid rgba(168,58,52,.45); }
.t-m { font: 400 15px/1.35 "Nothing You Could Do", cursive; color: #34363C; }
.pl-margin p { margin: 0; }
.pl-margin .m1 { margin: 8px 0 0 2px; transform: rotate(-4deg); transform-origin: 0 0; }
.pl-margin .m2 { margin: 54px 0 0 10px; font-size: 18px; transform: rotate(-2deg); transform-origin: 0 0; }
.pl-margin .m3 { margin: 70px 0 0 30px; font-size: 14px; text-align: center; width: 70px; color: #5a5650; }
.p-1962 .pl-body { left: 236px; right: 50px; top: 80px; bottom: 40px; }
.t-hand {
  font: 400 12px/27px "Homemade Apple", cursive; color: #22305E;
  background: repeating-linear-gradient(to bottom, transparent 0 25px, rgba(84,112,150,.2) 25px 26px, transparent 26px 27px);
}
.t-hand p { margin: 0; text-indent: 28px; }
.pl-form { margin: 0; font: 700 15px/27px "Courier Prime", "Courier New", monospace; letter-spacing: .2em; text-align: center; color: #2b2a28; }
.pl-hsigs { display: flex; justify-content: flex-end; gap: 26px; height: 54px; align-items: flex-end; }
.pl-hsigs > span { display: inline-flex; align-items: baseline; gap: 4px; }
.pl-hsigs .sg { font-size: 30px; color: #22305E; }
.pl-hsigs em { font: 400 11px/1 "Homemade Apple", cursive; color: #22305E; }
.pl-ack { font-size: 10.5px; text-indent: 0 !important; }

/* 1962: a printed form with typed fill-ins, copied into the deed book */
.t-form62 { font: 400 12.5px/25px "Times New Roman", Times, serif; color: #2b2a28; }
.t-form62 p { margin: 0 0 4px; text-indent: 28px; }
.t-form62 .f62-no { text-indent: 0; font-size: 9px; line-height: 14px; letter-spacing: .06em; text-transform: uppercase; color: #5a5650; }
.t-form62 .pl-form { font-family: "Times New Roman", Times, serif; font-size: 19px; letter-spacing: .24em; line-height: 30px; }
.t-form62 .f62-sub { text-indent: 0; text-align: center; font-style: italic; font-size: 11.5px; line-height: 18px; margin-bottom: 8px; }
.fi { display: inline; text-decoration: none; font: 400 12.5px/25px "Courier Prime", "Courier New", monospace; color: #1f2024; border-bottom: 1px dotted rgba(43,42,40,.55); padding: 0 3px; }
.t-form62 .pl-hsigs { height: 48px; }
.t-form62 .pl-ack { font-size: 10.5px; line-height: 18px; margin-top: 6px; }
.t-form62 .pl-ack .fi { font-size: 10.5px; line-height: 18px; }
.pl-margin .m4 { margin: 60px 0 0 14px; font-size: 13px; color: #5a5650; transform: rotate(-3deg); }

/* 1987: photocopied */
.p-1987 .t-type { color: #191919; }
.p-1987 .sg { color: #262626; }
.pl-page.is-copy .pl-body { filter: url(#dr-toner); transform: rotate(-.35deg); transform-origin: 50% 0; }

/* printed bills and filings */
.t-bill { font: 400 11.5px/1.5 var(--mono); color: #202226; }
.bill-hd { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; margin-bottom: 18px; border: 1.5px solid #202226; }
.bill-hd b { font-size: 14px; font-weight: 600; letter-spacing: .08em; }
table.bill { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
table.bill th { width: 40%; padding: 7px 10px; text-align: left; vertical-align: top; font-weight: 500; font-size: 10.5px; letter-spacing: .04em; border: 1px solid #9A9DA3; background: rgba(0,0,0,.035); }
table.bill td { padding: 7px 10px; border: 1px solid #9A9DA3; }
table.bill-n th, table.bill-n td { width: auto; text-align: right; }
.bill-note { margin: 0; font-size: 10.5px; color: #44464B; }
.is-bill .t-bill { bottom: 70px; }
.bill-stub { position: absolute; left: 0; right: 0; bottom: 0; padding-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 10.5px; border-top: 1.5px dashed #6B6E74; }

/* ───────── OCR boxes (drawn outside the zoom transform, on paper colours) ───────── */
.ocr { position: absolute; pointer-events: auto; cursor: pointer; color: rgba(22,24,29,.4); }
.ocr svg { position: absolute; left: 0; top: 0; overflow: visible; display: block; }
.ocr path { fill: transparent; stroke: currentColor; stroke-width: 1; transition: fill 160ms var(--ease); }
.ocr.is-low { color: #B7791F; }
.ocr.is-low path { stroke-width: 1.5; stroke-dasharray: 4 3; fill: rgba(183,121,31,.06); }
.ocr.is-acc { color: rgba(22,24,29,.55); }
.ocr.lit { color: #9E2A2B; z-index: 2; }
.ocr.lit path { stroke-width: 1.5; stroke-dasharray: none; fill: var(--lit); }
:root[data-theme="dark"] .ocr.lit path { fill: rgba(158,42,43,.12); }
.ocr-c { position: absolute; right: -1px; bottom: calc(100% + 3px); padding: 3px 4px; border-radius: 3px; font: 500 11px/1 var(--mono); white-space: nowrap; color: #fff; background: #16181D; opacity: 0; transition: opacity 160ms var(--ease); pointer-events: none; }
.ocr.lit .ocr-c { opacity: 1; }
.ocr.is-low .ocr-c { background: #A86C14; }
.ocr.lit .ocr-c { background: #9E2A2B; }

/* ───────── fields panel ───────── */
.dr-panel { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--rule); }
.dr-grip { display: none; }
.dr-ph { flex: none; padding: 16px 20px 12px; border-bottom: 1px solid var(--rule); }
.dr-ph h2 { margin: 0; font-size: 13.5px; font-weight: 600; }
.dr-ph p { margin: 3px 0 0; font-size: 12.5px; color: var(--graphite); }
.dr-ph b.is-low { color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.dr-ph b.is-low i, .fld-c.is-low i, .dx-need i, .dx-fn i { width: 6px; height: 6px; border-radius: 50%; background: var(--needs); flex: none; display: inline-block; }
.dr-fields { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 18px; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.fg h3 { margin: 0; padding: 16px 20px 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.fld { position: relative; padding: 9px 20px 11px; border-top: 1px solid var(--rule); outline: none; transition: background-color 160ms var(--ease); }
.fg h3 + .fld { border-top-color: var(--rule-strong); }
.fld.lit { background: var(--lit); }
.fld.lit::before { content: ""; position: absolute; left: 0; top: -1px; bottom: 0; width: 2px; background: var(--stamp); }
.fld:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.fld-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fld-l { font-size: 12.5px; color: var(--graphite); }
.fld-c { flex: none; font: 500 11px/1 var(--mono); color: var(--ink); white-space: nowrap; }
.fld-c.is-low { display: inline-flex; align-items: center; gap: 5px; color: var(--amber); font-weight: 500; }
.fld-c.is-acc { color: var(--graphite); }
.fld-c.is-der { color: var(--quiet); font-family: var(--sans); font-size: 11px; }
.fld-v { margin-top: 2px; font-size: 15px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.fld-v.mono { font-size: 13.5px; }
.fld-a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-strong); min-height: 28px; }
.fld-a:hover { text-decoration-color: var(--ink); }
.fld-a .ico { color: var(--graphite); }
.fld-s { margin-top: 2px; font-size: 12.5px; color: var(--graphite); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fld-p { margin-top: 7px; }
.fld-p .prov { max-width: 100%; }
.fld-fix { margin-top: 8px; padding: 10px 10px 11px; border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--rule)); border-radius: 8px; background: color-mix(in srgb, var(--amber) 6%, var(--surface)); }
.fld-fix .prov-un { height: auto; margin-bottom: 8px; display: flex; }
.fld-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.fld-row .input { flex: 1 1 100%; min-width: 0; height: 34px; min-height: 34px; padding: 6px 9px; font: 400 12.5px/1 var(--mono); }
.fld-row .btn { height: 34px; }
.fld-hint { margin: 7px 0 0; font-size: 12.5px; color: var(--graphite); }
.fld-odds { margin: 6px 0 0; padding-top: 6px; border-top: 1px dashed color-mix(in srgb, var(--amber) 35%, var(--rule)); font-size: 12.5px; color: var(--graphite); }
.fld-odds .mono { font-size: 11px; color: var(--amber); font-weight: 500; }
.dr-src { margin: 0; padding: 16px 20px 0; font-size: 12.5px; color: var(--quiet); }
.dr-foot { flex: none; padding: 12px 20px 14px; border-top: 1px solid var(--rule); background: var(--surface); }
.dr-foot-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; }
.dr-foot .link { gap: 6px; text-decoration: none; color: var(--graphite); font-weight: 500; font-size: 13.5px; }
.dr-foot .link:hover { color: var(--ink); }
.dr-foot .btn[aria-disabled="true"] { background: var(--canvas); color: var(--quiet); border: 1px solid var(--rule); cursor: pointer; }
.dr-use-note { margin: 7px 0 0; font-size: 12.5px; color: var(--graphite); }
.prov.dr-land { animation: dr-land 220ms var(--ease-stamp) both, dr-ink 160ms linear both; }
@keyframes dr-land { from { transform: scale(1.12) rotate(-3deg); } to { transform: none; } }
@keyframes dr-ink { from { opacity: 0; } to { opacity: 1; } }

/* ───────── documents index ───────── */
.dx { --dx-cols: 104px 44px 150px minmax(0, 1fr) 104px 196px; max-width: 1240px; }
.dx-hd { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 16px; row-gap: 0; }
.dx-hd p { grid-column: 1 / -1; }
.dx-hd .dx-count { font: 400 13.5px/1 var(--mono); color: var(--graphite); }
.dx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.dx-search { position: relative; flex: 1; min-width: 220px; max-width: 460px; }
.dx-search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--graphite); pointer-events: none; }
.dx-search .input::-webkit-search-cancel-button { display: none; }
.dx-search .input { height: 40px; padding-left: 34px; font-size: 13.5px; -webkit-appearance: none; appearance: none; }
.dx-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; }
.dx-seg button { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--graphite); transition: background-color 160ms var(--ease), color 160ms var(--ease); }
.dx-seg button:hover { color: var(--ink); }
.dx-seg [aria-checked="true"] { background: var(--ink); color: var(--on-ink); }
.dx-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 0 14px; }
.dx-f { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--graphite); font-size: 12.5px; transition: border-color 160ms var(--ease), color 160ms var(--ease); }
.dx-f:hover { border-color: var(--rule-strong); color: var(--ink); }
.dx-f.mono { font-size: 11px; letter-spacing: .04em; font-weight: 500; }
.dx-f .mono { font-size: 11px; color: var(--quiet); }
.dx-f[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dx-div { width: 1px; height: 20px; background: var(--rule-strong); margin: 0 4px; }
.dx-list { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.dx-head { display: grid; grid-template-columns: var(--dx-cols); gap: 0 14px; padding: 0 14px 7px; font-size: 12.5px; color: var(--quiet); }
.dx-head span:last-child { text-align: right; }
.dx-g + .dx-g { border-top: 1px solid var(--rule-strong); }
.dx-gh { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 12px 14px 10px; background: color-mix(in srgb, var(--canvas) 55%, var(--surface)); border-bottom: 1px solid var(--rule); }
.dx-gh h2 { margin: 0; font-size: 13.5px; font-weight: 600; }
.dx-gk { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--stamp); }
.dx-gn { font-size: 12.5px; color: var(--graphite); }
.dx-open { margin-left: auto; }
.dx-row { display: grid; grid-template-columns: var(--dx-cols); align-items: center; gap: 0 14px; min-height: 64px; padding: 8px 14px; color: var(--ink); text-decoration: none; transition: background-color 160ms var(--ease); }
.dx-row + .dx-row { border-top: 1px solid var(--rule); }
.dx-row:hover, .dx-row.lit { background: var(--hover); }
.dx-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.dx-th { display: block; width: 104px; }
/* the plate cropped to its stamp corner: a 248 × 114 slice of the page at 0.42 */
.dx-crop { --s: .42; position: relative; display: block; width: calc(248px * var(--s)); height: calc(114px * var(--s)); overflow: hidden; border: 1px solid var(--rule); border-radius: 3px;
  background: #FAFAF8 url(../images/paper/paper-2019.webp) 100% 0 / 340px auto no-repeat; transition: border-color 160ms var(--ease); }
.dx-crop.p-1962 { background-color: #F1E8D2; background-image: url(../images/paper/paper-1962.webp); }
.dx-crop.p-1987 { background-color: #ECECEA; background-image: url(../images/paper/paper-1987.webp); }
.dx-crop-in { position: absolute; left: 0; top: 0; width: 248px; height: 114px; transform: scale(var(--s)); transform-origin: 0 0; }
.dx-crop .pl-stamp { filter: none; }
.dxc-vp { position: absolute; left: 22px; top: 8px; font-size: 34px; line-height: 1.12; color: #34363C; transform: rotate(-3deg); }
.dxc-yr { position: absolute; right: 14px; top: 12px; font-size: 22px; letter-spacing: .1em; color: #3b3a36; }
.dx-crop.p-1962 .dx-crop-in::after { content: ""; position: absolute; left: 196px; top: 0; bottom: 0; width: 2px; background: rgba(168,58,52,.45); }
.dxc-bill { position: absolute; inset: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 6px 12px; border: 3px solid #202226; font-size: 17px; line-height: 1; white-space: nowrap; overflow: hidden; }
.dxc-bill b { font-size: 19px; font-weight: 600; letter-spacing: .06em; }
.dx-row:hover .dx-crop, .dx-row.lit .dx-crop { border-color: var(--stamp); }
.dx-k { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--stamp); }
.dx-ref { font-size: 12.5px; white-space: nowrap; }
.dx-main { min-width: 0; display: flex; flex-direction: column; }
.dx-main b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-p, .dx-a { font-size: 12.5px; color: var(--graphite); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-a { color: var(--quiet); }
.dx-arr { color: var(--quiet); }
.dx-d { font-size: 12.5px; color: var(--graphite); white-space: nowrap; }
.dx-s { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dx-need { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.dx-ok { font-size: 12.5px; color: var(--graphite); white-space: nowrap; }
.dx-tag { font-size: 11px; color: var(--graphite); border: 1px solid var(--rule-strong); border-radius: 3px; padding: 2px 5px; white-space: nowrap; }
.dx-empty { padding: 56px 16px; display: grid; justify-items: center; gap: 14px; text-align: center; color: var(--graphite); }
.dx-imp { --c: 6px; display: grid; justify-items: center; align-content: center; gap: 6px; min-width: 240px; min-height: 64px; padding: 12px 22px 10px; transform: rotate(-1.5deg); color: var(--graphite); }
.dx-imp b { font: 700 19px/1 var(--sans); font-stretch: 75%; letter-spacing: .08em; text-transform: uppercase; }
.dx-imp .mono { font-size: 11px; letter-spacing: .02em; }
.dx-empty p { margin: 0; max-width: 420px; font-size: 13.5px; line-height: 1.5; }

@media (max-width: 1100px) and (min-width: 721px) {
  .dr-main { grid-template-columns: minmax(0, 1fr) 360px; }
  .dr-meta { display: none; }
  .dx { --dx-cols: 104px 44px 140px minmax(0, 1fr) 96px 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .prov.dr-land { animation: dr-ink 150ms linear both; }
}

/* ───────── phone: scan on top, the fields in a bottom sheet ───────── */
@media (max-width: 720px) {
  .dr-hd { padding: 4px 8px 0 4px; }
  .dr-hd-row { gap: 4px; min-height: 44px; }
  .dr-back { width: 44px; height: 44px; justify-content: center; padding: 0; margin: 0; }
  .dr-back span, .dr-hd-row > .prov, .dr-meta { display: none; }
  .dr-hd h1 { flex: 1; min-width: 0; font-size: 21px; overflow: hidden; text-overflow: ellipsis; }
  .dr-all { font-size: 12.5px; padding: 0 8px; min-height: 44px; }
  .dr-chain { padding: 2px 0 8px 8px; }
  .ch-title { display: none; }
  .ch-node { max-width: 220px; padding: 5px 9px 6px; }
  .ch-link { min-width: 16px; padding: 0 6px; }
  .ch-sep { margin: 0 10px; }
  .ch-lbl { display: none; }

  .dr-main { display: block; position: relative; }
  .dr-scanwrap { position: absolute; inset: 0; }
  .dr-scan { padding: 60px 12px calc(var(--sheet-h, 176px) + 24px); }
  .dr-tools { left: auto; right: 10px; top: 8px; transform: none; }
  .dr-tools button { min-width: 44px; height: 40px; }
  .dr-tools output { min-width: 44px; }

  .dr-panel {
    position: fixed; z-index: 20; left: 0; right: 0; bottom: var(--tab-h, 0px); height: var(--sheet-h, 176px);
    border-left: 0; border-top: 1px solid var(--rule); border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px rgba(22,24,29,.14);
    transition: height 300ms var(--ease);
  }
  .dr-panel.dragging { transition: none; }
  .dr-grip { display: grid; place-items: center; flex: none; width: 100%; height: 24px; touch-action: none; cursor: grab; }
  .dr-grip::before { content: ""; width: 40px; height: 4px; border-radius: 3px; background: var(--rule-strong); }
  .dr-grip:focus-visible { outline-offset: -4px; }
  .dr-ph { padding: 0 16px 10px; touch-action: none; }
  .fg h3 { padding: 14px 16px 6px; }
  .fld { padding: 10px 16px 12px; }
  .dr-src { padding: 14px 16px 0; }
  .dr-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .dr-foot-row .btn { flex: 1; }
  .dr-foot .link { min-height: 40px; }
  .dr-panel[data-snap="peek"] .dr-use-note, .dr-panel[data-snap="peek"] .dr-foot .link { display: none; }

  .dx-bar { gap: 8px; }
  .dx-search { min-width: 0; max-width: none; flex-basis: 100%; }
  .dx-seg { width: 100%; }
  .dx-seg button { flex: 1; height: 36px; }
  .dx-filters { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 44px 14px 16px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .dx-filters::-webkit-scrollbar { display: none; }
  .dx-f { height: 36px; flex: none; white-space: nowrap; }
  .dx-head { display: none; }
  .dx-gh { padding: 10px 12px; }
  .dx-row { grid-template-columns: 84px minmax(0, 1fr) auto; grid-template-areas: "th main main" "th ref d" "th s s"; gap: 2px 12px; padding: 10px 12px; align-items: start; }
  .dx-th { grid-area: th; width: 84px; }
  .dx-crop { --s: .34; }
  .dx-k { display: none; }
  .dx-ref { grid-area: ref; font-size: 12.5px; }
  .dx-main { grid-area: main; }
  .dx-d { grid-area: d; text-align: right; }
  .dx-s { grid-area: s; justify-content: flex-start; }
}
