@font-face { font-family: 'DM Sans'; src: url('/fonts/DMSans-Regular.ttf') format('truetype'); font-weight: 400; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/DMSans-Bold.ttf') format('truetype'); font-weight: 700; }
@font-face { font-family: 'Signature'; src: url('/fonts/MrsSaintDelafield-Regular.ttf') format('truetype'); }
:root { --ground: #E7E5E1; --cell: #DBD8D3; --line: #BFBBB5; --text: #0B0C0E; --muted: #62666B; --accent: #D64A1E; --accent-dark: #B63E19; --ink: #13233F; --ok: #1A7F37; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--text); font: 15px/1.5 'DM Sans', system-ui, sans-serif; padding-bottom: 120px; }
#app { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 28px 0 16px; border-bottom: 1px solid var(--line); }
.lockup { height: 26px; }
.kicker, .label { font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--muted); }
.label { color: var(--accent); margin: 28px 0 4px; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.parties { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.parties li { background: var(--cell); border: 1px solid var(--line); padding: 6px 12px; font-size: 13px; }
.parties li span { color: var(--muted); margin-left: 8px; }
.parties li.signed span { color: var(--ok); }
.parties li.active span { color: var(--accent); }
.card { background: #F1EFEC; border: 1px solid var(--line); padding: 22px; margin: 20px 0; }
.card.ok { border-left: 4px solid var(--ok); }
.card.narrow { max-width: 480px; margin: 48px auto; }
.consent ul { padding-left: 18px; }
.consent li { margin: 6px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
button { font: inherit; font-weight: 700; border: 0; background: var(--text); color: #fff; padding: 10px 18px; cursor: pointer; }
button:disabled { opacity: .4; cursor: not-allowed; }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--text); }
button.link { background: none; color: var(--muted); text-decoration: underline; padding: 10px 4px; font-weight: 400; }
input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); background: #fff; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.check input { width: 18px; height: 18px; }
.error { color: var(--accent-dark); min-height: 1em; margin: 8px 0 0; }
.doc-title { margin: 36px 0 12px; font-size: 16px; }
.page { position: relative; margin: 0 auto 18px; box-shadow: 0 1px 6px rgba(0,0,0,.15); background: #fff; max-width: 100%; }
.page canvas { width: 100%; height: 100%; display: block; }
.field { position: absolute; display: flex; align-items: center; padding: 0 6px; font-size: 12px; border-radius: 2px; }
.field.other { border: 1px dashed var(--line); background: rgba(219,216,211,.25); }
.field.other.done { border-color: var(--ok); }
.field.mine { background: rgba(255, 214, 102, .55); border: 2px solid #E0A800; color: var(--text); font-weight: 700; justify-content: flex-start; animation: pulse 2s ease-in-out infinite; }
.field.mine.applied { background: rgba(255,255,255,.35); border: 1px solid var(--ok); animation: none; }
.field .script { font-family: 'Signature', cursive; font-size: 24px; font-weight: 400; color: var(--ink); white-space: nowrap; overflow: hidden; }
.field .date { font-weight: 400; font-size: 12px; }
.field img { max-height: 100%; max-width: 70%; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(224,168,0,.25); } }
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: #F1EFEC; border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; z-index: 5; }
.bar .check { margin: 0; }
.bar .count { font-weight: 700; }
.bar .error { width: 100%; text-align: center; margin: 0; }
dialog.adopt { border: 1px solid var(--line); background: var(--ground); padding: 22px; width: min(620px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(11,12,14,.45); }
.tabs { display: flex; gap: 0; margin: 10px 0 14px; }
.tabs button { background: transparent; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.panel label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.panel input { width: 100%; }
.preview { font-family: 'Signature', cursive; font-size: 46px; color: var(--ink); padding: 8px 4px; border-bottom: 1px solid var(--line); min-height: 76px; }
.pad { width: 100%; height: 150px; background: #fff; border: 1px solid var(--line); touch-action: none; }
.downloads li { margin: 6px 0; }
.downloads a { color: var(--text); font-weight: 700; }
.note { text-align: center; margin-top: 20vh; }
.loading { margin-top: 30vh; text-align: center; color: var(--muted); }
@media (max-width: 600px) { h1 { font-size: 21px; } .bar { gap: 6px; } .bar button { padding: 8px 12px; } }
