:root {
  color-scheme: light;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #172c43;
  background: #edf2f7;
  --navy: #102b4a;
  --blue: #175691;
  --ink: #172c43;
  --muted: #425870;
  --border: #c7d5e3;
  --surface: #fff;
  --accent: #f4c752;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; }
.shell { width: min(69rem, calc(100% - 3.5rem)); margin-inline: auto; }
.top { background: var(--surface); border-top: .25rem solid var(--blue); }
.masthead { min-height: 4.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-size: 1.15rem; font-weight: 750; letter-spacing: -.025em; }
.mark { width: 2.5rem; height: 2.5rem; border-radius: .3rem; background: var(--navy); position: relative; flex: none; }
.mark::before { content: ""; position: absolute; inset: .5rem .65rem; border: 2px solid #fff; border-radius: .13rem; }
.mark::after { content: ""; position: absolute; inset: .95rem .97rem; border-block: 1px solid #fff; }
.top a { color: var(--blue); font-size: .92rem; font-weight: 650; line-height: 1.3; text-align: right; text-underline-offset: .24em; }
main { flex: 1; padding-bottom: clamp(2rem, 5vw, 4rem); }
.intro {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(2.3rem, 4.5vw, 3.65rem) 0 clamp(3.9rem, 7vw, 5.1rem);
  background: linear-gradient(110deg, var(--navy) 39%, #16466e 100%);
  color: #fff;
}
.intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 48%;
  background: repeating-linear-gradient(128deg, transparent 0 3.75rem, rgb(163 203 237 / .15) 3.75rem calc(3.75rem + 1px));
  mask-image: linear-gradient(to right, transparent, black 65%);
}
h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.05rem, 5vw, 3.9rem);
  font-weight: 750;
  line-height: 1.07;
  letter-spacing: -.045em;
  text-wrap: balance;
}
h1::before { content: ""; display: block; width: 2.5rem; height: .23rem; margin-bottom: .85rem; background: var(--accent); }
.intro p { max-width: 34rem; margin: .95rem 0 0; color: #dbeaf8; font-size: clamp(1rem, 2vw, 1.125rem); }
.workspace { position: relative; margin-top: -1.85rem; }
#form, .card { border: 1px solid var(--border); border-radius: .65rem; background: var(--surface); }
#form { box-shadow: 0 .7rem 2rem rgb(29 55 88 / .075); }
.fields { display: grid; grid-template-columns: 1fr 1fr; }
.fields > .card { border: 0; border-radius: 0; background: transparent; }
.fields > .card + .card { border-inline-start: 1px solid var(--border); }
.card { min-width: 0; padding: clamp(1.15rem, 3vw, 1.75rem); }
h2 { margin: 0; font-size: 1.28rem; color: var(--navy); line-height: 1.25; letter-spacing: -.025em; }
.card p { margin: .35rem 0 1rem; color: var(--muted); }
.dropzone {
  min-height: 11.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: 1rem;
  border: 1px dashed #7d98b5;
  border-radius: .38rem;
  background: #f4f8fc;
  text-align: center;
}
.dropzone[data-over] { background: #e3f0fc; border-color: var(--blue); }
.document-icon { width: 1.45rem; height: 1.7rem; border: 2px solid var(--blue); border-radius: .2rem; position: relative; }
.document-icon::after { content: ""; position: absolute; inset: .33rem .24rem; border-block: 1px solid var(--blue); }
#pdf { display: block; width: min(100%, 20rem); min-height: 2.85rem; font: inherit; color: var(--muted); cursor: pointer; }
#pdf::file-selector-button {
  min-height: 2.85rem;
  border: 1px solid #6486a6;
  border-radius: .35rem;
  padding: .45rem .7rem;
  margin-inline-end: .5rem;
  background: var(--surface);
  color: var(--blue);
  font: inherit;
  font-weight: 680;
  cursor: pointer;
}
#pdf:hover:not(:disabled)::file-selector-button { background: #e7f0fa; }
#pdf:disabled, #pdf:disabled::file-selector-button { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.drag-hint, #dropped-file { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
@media (hover: none) { .drag-hint { display: none; } }
textarea { display: block; border: 1px solid #879db5; border-radius: .38rem; padding: .65rem .8rem; width: 100%; min-height: 9rem; resize: vertical; font: inherit; color: inherit; }
textarea::placeholder { color: #52677e; }
.name-count:not(:empty) { display: block; margin-top: .4rem; color: var(--blue); font-size: .875rem; font-weight: 650; }
.remember { margin-top: .52rem; display: flex; align-items: center; gap: .6rem; min-height: 1.9rem; font-size: .92rem; color: var(--muted); cursor: pointer; }
.remember input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--blue); flex: none; }
.rf-field { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.rf-field label { display: block; margin-bottom: .35rem; font-weight: 680; color: var(--navy); }
#rf { display: block; width: min(100%, 16rem); min-height: 5.5rem; padding: .45rem .65rem; border: 1px solid #879db5; border-radius: .38rem; color: inherit; font: inherit; font-variant-numeric: tabular-nums; white-space: pre; overflow-x: auto; }
#rf[aria-invalid="true"] { border-color: #862b1b; }
.rf-field small { display: block; margin-top: .35rem; color: var(--muted); font-size: .88rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; padding: .9rem clamp(1.15rem, 3vw, 1.75rem); border-top: 1px solid #dbe5ef; background: #f8fbfe; border-radius: 0 0 .65rem .65rem; }
button { font: inherit; font-weight: 680; min-height: 2.75rem; border: 1px solid transparent; border-radius: .35rem; padding: .56rem 1.15rem; color: #fff; background: var(--blue); cursor: pointer; }
button:hover:not(:disabled) { background: var(--navy); }
button:disabled { opacity: .65; cursor: wait; }
.privacy { margin: 0; color: var(--muted); font-size: .9rem; }
#status { margin: .7rem clamp(1.15rem, 3vw, 1.75rem); }
#status[data-error] { color: #862b1b; }
progress { display: block; width: calc(100% - 2 * clamp(1.15rem, 3vw, 1.75rem)); margin: 0 auto .9rem; accent-color: var(--blue); }
.results { margin-top: 1.2rem; }
.card .warning { background: #fff5da; padding: .7rem .85rem; border-radius: .35rem; color: #664310; }
.match { padding: .85rem 0; border-top: 1px solid var(--border); }
.match h3 { font-size: 1rem; margin: 0 0 .45rem; overflow-wrap: anywhere; }
.pages { display: flex; flex-wrap: wrap; gap: .4rem; }
.pages button { font-size: .92rem; min-height: 2.5rem; padding: .32rem .66rem; color: var(--blue); background: #eaf3fc; border-color: #c4d9ed; }
.pages button:hover:not(:disabled) { background: #d9eafa; }
details { border-top: 1px solid var(--border); padding-top: .75rem; }
summary { cursor: pointer; }
.site-footer { border-top: 1px solid #d3dfeb; background: #e5edf5; color: #38516d; padding: .95rem 0; font-size: .875rem; }
.site-footer p { margin: 0; }
.visually-hidden { width: 1px; height: 1px; overflow: hidden; white-space: nowrap; clip-path: inset(50%); position: absolute; }
@media (max-width: 42rem) {
  .shell { width: calc(100% - 2rem); }
  .masthead { min-height: 4rem; }
  .brand { font-size: 1rem; gap: .5rem; }
  .mark { width: 2.15rem; height: 2.15rem; }
  .mark::before { inset: .36rem .48rem; }
  .mark::after { inset: .8rem .78rem; }
  .top a { font-size: .875rem; }
  .fields { grid-template-columns: 1fr; }
  .fields > .card + .card { border-inline-start: 0; border-top: 1px solid var(--border); }
  .dropzone { min-height: 8.5rem; padding: .75rem; }
  .actions { align-items: stretch; flex-direction: column; }
}
.viewer {
  width: min(64rem, calc(100% - 1rem));
  max-width: none;
  max-height: calc(100dvh - 1rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: .8rem;
  color: var(--ink);
  background: white;
  overflow: hidden;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgb(12 29 51 / .72); }
.viewer-header, .viewer-footer { padding: .75rem 1rem; }
.viewer-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.viewer-header p { margin: .2rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
.viewer-header button { padding: .4rem .75rem; }
.viewer-footer a { color: var(--blue); text-underline-offset: .2em; font-size: .9rem; }
#viewer-status { margin: 0; padding: .4rem 1rem; }
.viewer-scroll { overflow: auto; overscroll-behavior: contain; background: #e5edf5; padding: .75rem; }
.viewer-scroll:focus-visible { outline-offset: -4px; }
.pdf-paper { position: relative; isolation: isolate; background: white; margin-inline: auto; }
.pdf-paper canvas { display: block; width: 100%; height: 100%; }
.pdf-paper .textLayer {
  position: absolute;
  inset: 0;
  overflow: clip;
  line-height: 1;
  text-align: initial;
  text-size-adjust: none;
  -webkit-text-size-adjust: none;
  --min-font-size: 1;
  --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
  --min-font-size-inv: calc(1 / var(--min-font-size));
}
.pdf-paper .textLayer :is(span, br) {
  color: transparent;
  position: absolute;
  white-space: pre;
  transform-origin: 0 0;
}
.pdf-paper .textLayer > :not(.markedContent), .pdf-paper .textLayer .markedContent span:not(.markedContent) {
  --font-height: 0;
  --scale-x: 1;
  --rotate: 0deg;
  font-size: calc(var(--text-scale-factor) * var(--font-height));
  transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
}
.pdf-paper .textLayer .markedContent { display: contents; }
.pdf-highlights { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; }
.pdf-highlight { position: absolute; background: #ffd83d; border-radius: 2px; }
