:root { --brand:#c8102e; --ink:#1d1d1f; --muted:#6b6b70; --line:#e3e3e6; --bg:#f5f5f7; --ok:#1e8e3e; --ag:#1a5fd0; --an:#1e8e3e; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; color:var(--ink); background:var(--bg); }
header { background:#fff; border-bottom:1px solid var(--line); padding:12px 18px; display:flex; align-items:center; gap:12px; position:sticky; top:0; z-index:20; }
header .brand { width:34px; height:34px; border-radius:8px; background:var(--brand); color:#fff; font-weight:800; display:grid; place-items:center; }
header strong { font-size:16px; display:block; line-height:1.2; }
header span { color:var(--muted); font-size:13px; }
header .sp { flex:1; }
main { max-width:680px; margin:0 auto; padding:16px 14px 70px; }
main.wide { max-width:980px; }
.card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:18px; margin-bottom:14px; }
.card h2 { font-size:18px; margin:0 0 6px; }
.step { font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--brand); margin:0 0 10px; }
.hint { color:var(--muted); font-size:14px; margin:4px 0 10px; }
label.f { display:block; font-size:14px; font-weight:600; margin:12px 0 4px; }
label.f small { font-weight:400; color:var(--muted); }
input[type=text], input[type=email], input[type=password] { width:100%; font-size:16px; padding:11px 12px; border:1px solid #cfcfd4; border-radius:10px; background:#fff; color:var(--ink); }
input:focus { outline:2px solid var(--brand); outline-offset:1px; border-color:transparent; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:0 14px; }
@media (max-width:640px) { .grid2 { grid-template-columns:1fr; } }
.check { display:flex; gap:10px; align-items:flex-start; margin-top:12px; font-size:15px; cursor:pointer; }
.check input { width:22px; height:22px; margin-top:1px; accent-color:var(--brand); flex:none; }
button { font:inherit; cursor:pointer; }
.btn { padding:10px 16px; border-radius:10px; border:1px solid #cfcfd4; background:#fff; font-weight:600; color:var(--ink); text-decoration:none; display:inline-flex; align-items:center; gap:6px; }
.btn.sm { padding:6px 10px; font-size:13px; border-radius:8px; }
.btn.danger { color:#b00020; }
.primary { width:100%; padding:16px; border:0; border-radius:12px; background:var(--brand); color:#fff; font-size:17px; font-weight:700; }
.primary:disabled { background:#d9a3ac; cursor:not-allowed; }
.link { background:none; border:0; color:var(--brand); font-weight:600; padding:6px 0; }
.err { color:#b00020; font-size:14px; margin-top:10px; min-height:1em; }
.sigwrap { position:relative; border:2px dashed #c4c4ca; border-radius:12px; background:#fff; touch-action:none; }
.sigwrap canvas { display:block; width:100%; height:190px; border-radius:10px; touch-action:none; }
.sigline { position:absolute; left:18px; right:18px; bottom:40px; border-bottom:1px solid #d5d5da; pointer-events:none; }
.sighint { position:absolute; left:0; right:0; top:42%; text-align:center; color:#b0b0b6; pointer-events:none; font-size:15px; }
.row { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-top:8px; font-size:13px; color:var(--muted); }
.pages { background:#e9e9ec; border-radius:10px; padding:10px; max-height:62vh; overflow-y:auto; }
.pages canvas { display:block; margin:0 auto 10px; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.15); max-width:100%; height:auto !important; }
.doc { border:1px solid var(--line); border-radius:12px; padding:14px; margin-top:12px; }
.doc h3 { margin:0; font-size:16px; }
.prevwrap { position:relative; display:inline-block; cursor:crosshair; margin-top:8px; box-shadow:0 1px 4px rgba(0,0,0,.2); }
.prevwrap canvas { display:block; }
.box { position:absolute; border:2px solid; border-radius:4px; font-size:11px; font-weight:700; padding:1px 4px; pointer-events:none; background:rgba(255,255,255,.55); }
.box.ag { border-color:var(--ag); color:var(--ag); } .box.an { border-color:var(--an); color:var(--an); }
.pill { display:inline-block; font-size:12px; font-weight:700; border-radius:20px; padding:2px 9px; }
.pill.ok { background:#e6f6ea; color:var(--ok); } .pill.open { background:#fff4d6; color:#946200; } .pill.exp { background:#eee; color:#777; } .pill.warn { background:#fde8ea; color:#b00020; }
.seg { display:inline-flex; border:1px solid #cfcfd4; border-radius:9px; overflow:hidden; }
.seg label { padding:5px 10px; font-size:13px; cursor:pointer; }
.seg input { display:none; }
.seg input:checked + span { font-weight:700; }
.seg label:has(input:checked) { background:#f0f0f3; }
table { width:100%; border-collapse:collapse; font-size:14px; }
td, th { text-align:left; padding:9px 6px; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-size:12px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.linkbox { display:flex; gap:8px; margin:10px 0; }
.linkbox input { font-size:14px; }
.done { text-align:center; padding:30px 18px; }
.done .ok { width:64px; height:64px; border-radius:50%; background:#e6f6ea; color:var(--ok); font-size:34px; line-height:64px; margin:0 auto 12px; }
.savedsig { display:flex; align-items:center; gap:14px; border:1px solid var(--line); border-radius:10px; padding:10px; }
.savedsig img { max-height:60px; max-width:220px; }
.spinner { display:inline-block; width:16px; height:16px; border:2px solid #fff; border-right-color:transparent; border-radius:50%; animation:r .7s linear infinite; vertical-align:-3px; }
@keyframes r { to { transform:rotate(360deg); } }
