:root {
  --paper: #f6f4ef;
  --card: #ffffff;
  --ink: #1b2520;
  --muted: #5f6b65;
  --line: #dfe3df;
  --brand: #1b4436;
  --brand-ink: #ffffff;
  --brand-soft: #e6efe9;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --bad: #9b2c2c;
  --bad-soft: #fbe9e7;
  --good: #1f6b45;
  --good-soft: #e3f3ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.06), 0 8px 24px rgba(20, 30, 25, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111614; --card: #19201d; --ink: #e8ece9; --muted: #9aa6a0; --line: #2b3531;
    --brand: #7cc4a4; --brand-ink: #0d1612; --brand-soft: #1f2d27;
    --warn: #e8b562; --warn-soft: #2e2617; --bad: #f19b92; --bad-soft: #2f1c1a; --good: #8fd3ad; --good-soft: #17291f;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 120px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 18px; }
.mark { font-weight: 700; letter-spacing: 0.08em; color: var(--brand); font-size: 15px; }
.mark small { font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 8px; }
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin: 0 0 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.people { list-style: none; padding: 0; margin: 10px 0 0; }
.people li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.people li:first-child { border-top: none; }
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 12px; padding: 13px 18px; min-height: 48px;
  font: inherit; font-weight: 650; cursor: pointer; background: var(--brand); color: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--line); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.linkbtn { background: none; border: none; color: var(--muted); text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; padding: 8px 0; }
label { font-weight: 600; font-size: 14.5px; display: block; margin: 0 0 6px; }
input[type=text], input[type=tel], input[type=password], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 46px;
}
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.step { display: flex; gap: 10px; align-items: center; margin: 18px 0 10px; font-weight: 700; font-size: 15px; }
.step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 13px; }
.pad-wrap { position: relative; border: 1.5px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; }
.pad-wrap canvas { display: block; width: 100%; height: 180px; border-radius: 12px; }
.pad-hint { position: absolute; inset: auto 0 12px; text-align: center; color: #9aa39e; font-size: 13px; pointer-events: none; }
.pad-line { position: absolute; left: 24px; right: 24px; bottom: 40px; border-bottom: 1px solid #e3e6e3; pointer-events: none; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.tabs button { border: none; background: transparent; font: inherit; font-size: 14px; padding: 8px 14px; cursor: pointer; color: var(--muted); }
.tabs button[aria-pressed=true] { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.otp { letter-spacing: 0.4em; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14.5px; margin: 10px 0; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.good { background: var(--good-soft); color: var(--good); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.info { background: var(--brand-soft); color: var(--brand); }
.viewer { display: grid; gap: 10px; }
.viewer .pg { background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; min-height: 200px; }
.viewer canvas { display: block; width: 100%; height: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.dock .inner { max-width: 760px; margin: 0 auto; }
.hide { display: none !important; }
.drop { border: 1.5px dashed var(--line); border-radius: 12px; padding: 26px 16px; text-align: center; cursor: pointer; background: var(--card); }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 9px 6px; border-top: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--muted); font-weight: 600; font-size: 12.5px; border-top: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.signer-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 10px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: s .8s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
