/* Scan: a light box on a desk. The photo sits on a dark mat with bright corner dots joined by a thin cyan frame;
   finished pages are lined up like prints, numbered. */
:root { --page: #eceff1; --card: #ffffff; --ink: #121619; --soft: #56616a; --line: #d2d8dc; --field: #e3e8eb; --act: #0b5d73; --on-act: #ffffff; --stop: #b3261e; --mark: #19c3e6; --wide: 720px; color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --page: #111416; --card: #1a1e21; --ink: #e9eef1; --soft: #9eabb4; --line: #2b3237; --field: #111416; --act: #7fd0e6; --on-act: #062731; --stop: #ff8a80; color-scheme: dark; }
}
.file { position: relative; display: inline-flex; align-items: center; border-radius: 999px; min-height: 48px; padding: 0 22px; font-weight: 700; background: var(--act); color: var(--on-act); cursor: pointer; }
.file.quiet-file { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.file input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.file:focus-within { outline: 3px solid var(--act); outline-offset: 2px; }
.stage { position: relative; background: #1d2124; border-radius: 8px; padding: 14px; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; }
.stage svg { position: absolute; overflow: visible; pointer-events: none; }
#poly { fill: rgb(25 195 230 / .12); stroke: var(--mark); stroke-width: 2; }
.dot { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 0; padding: 0; min-height: 0; background: transparent; cursor: grab; touch-action: none; }
.dot::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--mark); box-shadow: 0 0 0 3px #fff, 0 1px 6px rgb(0 0 0 / .6); }
.dot:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 14px; counter-reset: p; }
.pages li { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 8px; display: grid; gap: 6px; counter-increment: p; position: relative; }
.pages li::before { content: counter(p); position: absolute; top: 4px; left: 4px; background: var(--ink); color: var(--card); font-size: 12px; font-weight: 700; border-radius: 4px; padding: 1px 6px; }
.pages canvas { width: 100%; height: auto; display: block; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .15); }
.pages .tools { display: flex; gap: 4px; flex-wrap: wrap; } .pages .tools button { flex: 1; padding: 0 6px; }
