:root { --fg: #161616; --bg: #ffffff; --muted: #5a5a5a; --line: #d4d4d4; --soft: #f3f5f7; --accent: #0b5cad; --err: #b00020; }
@media (prefers-color-scheme: dark) {
  :root { --fg: #ececec; --bg: #141414; --muted: #a8a8a8; --line: #3a3a3a; --soft: #1e2226; --accent: #7db8f0; --err: #ff7086; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--fg); background: var(--bg); }
a { color: var(--accent); }
header.top, main, footer { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
header.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; margin: 12px 0; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 24px 0 12px; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; margin: 0 0 8px; }
ul.first { padding-left: 1.2rem; }
ul.first li { margin: 6px 0; }
.small { font-size: 0.9rem; color: var(--muted); }
.offer { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 16px 0; }
@media (max-width: 640px) { .offer { grid-template-columns: 1fr; } }
button, select, input { font: inherit; }
button { padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }
.buy button { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
input[type=text] { padding: 6px 8px; width: 13em; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.drop { border: 2px dashed var(--line); border-radius: 8px; padding: 28px 16px; text-align: center; margin: 16px 0; }
.drop.over { border-color: var(--accent); background: var(--soft); }
.pick { display: inline-block; padding: 8px 14px; border-radius: 6px; background: var(--accent); color: var(--bg); font-weight: 600; cursor: pointer; }
.pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.settings label { display: inline-block; margin: 4px 16px 4px 0; }
#status { min-height: 1.5em; }
.error { color: var(--err); }
section.file { border-top: 1px solid var(--line); margin-top: 16px; }
article.page { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 12px 0; }
article.page img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: #fff; margin: 4px 0 8px; }
article.page.scanned { background: var(--soft); }
.facts { margin: 0; padding-left: 1.2rem; font-size: 0.92rem; }
.actions { margin: 8px 0 0; }
.locked { color: var(--muted); }
footer { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 8px; padding-bottom: 24px; font-size: 0.9rem; color: var(--muted); }
.box { border-left: 4px solid var(--accent); padding: 4px 12px; background: var(--soft); }
#sent { display: none; border-left: 4px solid #3a3; padding: 4px 12px; }
#sent:target { display: block; }
