/* 약조 sign.yakjo.kr — 공통 스타일
   레이아웃: 휴대폰 한 손 기준(서명 화면), 관리자는 넓은 화면에서 2단. 계약서 본문은 명조, 화면 글자는 고딕. */
:root {
  --bg: #F3F5F8; --surface: #FFFFFF; --paper: #FFFFFF; --ink: #131A2B; --muted: #5A6377; --line: #DCE1E9;
  --navy: #1E3A6B; --navy-soft: #E6ECF6; --ok: #0D8566; --ok-soft: #E2F4EE; --warn: #A8550B; --warn-soft: #FBEEDF;
  --bad: #B42318; --bad-soft: #FDECEA;
  --font-ui: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-doc: "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  --font-num: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1220; --surface: #151C2D; --paper: #1A2235; --ink: #E7ECF5; --muted: #99A3B8; --line: #2A3349;
    --navy: #8FB0EA; --navy-soft: #1E2B47; --ok: #3DC9A0; --ok-soft: #12332C; --warn: #E8A15A; --warn-soft: #3A2817;
    --bad: #F2867B; --bad-soft: #3A1A18; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font-ui); -webkit-text-size-adjust: 100%; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-left)) 56px max(16px, env(safe-area-inset-right)); }
.narrow { max-width: 560px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand b { font-size: 21px; color: var(--navy); letter-spacing: -0.01em; }
.brand span { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
h1 { font-size: 22px; line-height: 1.35; margin: 0 0 6px; text-wrap: balance; }
h2 { font-size: 17px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
label.f > span b { color: var(--bad); font-weight: 600; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 15px; color: var(--ink);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--navy); background: var(--navy); color: var(--surface);
  border-radius: 9px; padding: 11px 16px; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.draft { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill.sent { background: var(--warn-soft); color: var(--warn); }
.pill.signed { background: var(--ok-soft); color: var(--ok); }
.pill.expired, .pill.canceled { background: var(--bad-soft); color: var(--bad); }
.pill.test { background: var(--warn-soft); color: var(--warn); }
.banner { border-radius: var(--r); padding: 12px 14px; font-size: 14px; }
.banner.test { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.msg { min-height: 1.2em; font-size: 14px; }
.msg.bad { color: var(--bad); } .msg.ok { color: var(--ok); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr.click { cursor: pointer; } table.list tr.click:hover td { background: var(--bg); }
.scroll-x { overflow-x: auto; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.hash { font-family: var(--font-num); font-size: 12px; overflow-wrap: anywhere; color: var(--muted); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--ink); border-color: var(--navy); }
.doc { font-family: var(--font-doc); font-size: 14.5px; line-height: 1.8; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 20px 18px; }
.doc h3 { font-family: var(--font-doc); font-size: 15px; margin: 16px 0 4px; }
.doc p { margin: 0 0 4px; }
.steps { display: flex; gap: 6px; margin: 10px 0 16px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--navy); } .steps i.done { background: var(--ok); }
.pad { width: 100%; height: 190px; border: 1.5px dashed var(--muted); border-radius: 10px; background: var(--paper); touch-action: none; display: block; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--navy); flex: 0 0 auto; }
.code-in { font-family: var(--font-num); font-size: 24px; letter-spacing: .4em; text-align: center; }
.sticky-act { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(760px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(10, 15, 30, .45); }
dialog .dhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
dialog .dbody { padding: 18px; display: flex; flex-direction: column; gap: 16px; max-height: 75vh; overflow: auto; }
textarea.copy { min-height: 190px; font-size: 13px; line-height: 1.5; }
.drop { border: 1.5px dashed var(--muted); border-radius: 12px; padding: 28px 16px; text-align: center; background: var(--surface); cursor: pointer; }
.drop.over { border-color: var(--navy); background: var(--navy-soft); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
