:root {
  --ink: #0d0d0f; --muted: #5f6368; --line: #e3e3e6; --bg: #f5f5f4; --card: #fff; --accent: #0d0d0f;
  --ok: #1f7a3d; --warn: #9a6400; --err: #b42318; --sig: #0b1b4a;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .in { max-width: 1040px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 16px; }
.top img { height: 24px; display: block; }
.top .tag { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; border-left: 1px solid var(--line); padding-left: 16px; }
.top .sp { flex: 1; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 16px 80px; }
.narrow { max-width: 820px; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 22px; margin-bottom: 18px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 5px; }
.hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cfcfd4; border-radius: 7px; background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(13,13,15,.08); }
textarea { min-height: 64px; resize: vertical; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 7px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: #cfcfd4; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; margin: 10px 0; }
.check input { margin-top: 4px; width: 16px; height: 16px; flex: none; }
.msg { padding: 10px 14px; border-radius: 7px; font-size: 14px; margin: 12px 0; }
.msg.err { background: #fdecea; color: var(--err); }
.msg.ok { background: #e8f5ec; color: var(--ok); }
.msg.warn { background: #fff4e0; color: var(--warn); }
.hide { display: none !important; }

/* agreement */
.doc { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 44px 52px; max-height: 62vh; overflow: auto;
  font-family: "Times New Roman", Times, serif; font-size: 15.5px; line-height: 1.6; text-align: justify; }
.doc h1 { font-size: 18px; text-align: center; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 20px; font-family: inherit; }
.doc h2 { font-size: 16px; margin: 22px 0 8px; font-family: inherit; }
.doc p { margin: 0 0 10px; }
.doc ol { list-style: none; counter-reset: a; padding-left: 40px; margin: 0 0 12px; }
.doc ol li { counter-increment: a; position: relative; margin-bottom: 6px; }
.doc ol li::before { content: "(" counter(a, lower-alpha) ")"; position: absolute; left: -26px; }
@media (max-width: 640px) { .doc { padding: 22px 18px; font-size: 15px; } }
.progress { height: 3px; background: var(--line); border-radius: 2px; margin: 8px 0 0; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }

/* signature pad */
.pad-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.pad-tabs button { border: 1px solid #cfcfd4; background: #fff; border-radius: 6px; padding: 5px 14px; font-size: 13px; cursor: pointer; }
.pad-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pad-box { position: relative; border: 1px dashed #b9b9c0; border-radius: 8px; background: #fcfcfb; height: 170px; }
.pad-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.pad-type { position: absolute; left: 12px; right: 90px; top: 10px; width: auto !important; font-size: 14px !important; padding: 6px 10px !important; z-index: 2; }
.pad-line { position: absolute; left: 22px; right: 22px; bottom: 38px; border-bottom: 1px solid #9a9aa2; pointer-events: none; }
.pad-line span { position: absolute; left: -2px; bottom: 2px; color: #9a9aa2; font-size: 18px; }
.pad-clear { position: absolute; right: 10px; top: 10px; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; z-index: 2; }

/* admin table */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td .muted, .muted { color: var(--muted); font-size: 13px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill.sent { background: #fff4e0; color: var(--warn); }
.pill.completed { background: #e8f5ec; color: var(--ok); }
.pill.voided, .pill.signing { background: #eee; color: #555; }
.tablewrap { overflow-x: auto; }
.events { font-size: 13px; margin: 8px 0 0; padding-left: 18px; color: #333; }
code { font-size: 12px; word-break: break-all; }
.done { text-align: center; padding: 40px 22px; }
.done .tick { width: 56px; height: 56px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 28px; margin: 0 auto 16px; }
.drop { border: 2px dashed #b9b9c0; border-radius: 10px; padding: 40px 20px; text-align: center; background: #fff; cursor: pointer; }
.drop.over { border-color: var(--ink); }
