@font-face { font-family: "SungSans"; src: url("/static/fonts/SungSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "SungSans"; src: url("/static/fonts/SungSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #17202e; --sub: #5b6575; --mute: #8a93a3; --line: #e3e7ee; --bg: #f5f7fa; --card: #fff;
  --navy: #1f3a5f; --navy-2: #2c5282; --green: #1f7a5c; --green-bg: #e6f4ee; --amber: #9a5b00; --amber-bg: #fff4dc;
  --red: #b42318; --red-bg: #fde8e6; --blue-bg: #e8f0fb; --violet: #5b3fa8; --violet-bg: #efeafb;
  --r: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "SungSans", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55;
  word-break: keep-all; -webkit-font-smoothing: antialiased; }
a { color: var(--navy-2); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
.boot { padding: 60px; text-align: center; color: var(--sub); }
[hidden] { display: none !important; }

/* buttons & fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; padding: 9px 15px; cursor: pointer; font-weight: 700; font-size: 14px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: #c5ccd8; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; padding: 12px 22px; font-size: 15px; }
.btn.primary:hover { background: var(--navy-2); }
.btn.primary:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--sub); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--red); }
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 5px; }
label.f > small, .help { display: block; color: var(--sub); font-size: 12.5px; margin-top: 4px; }
input[type=text], input[type=password], input[type=tel], input[type=email], input[type=url], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; border: 1px solid #cfd5df; border-radius: 9px; padding: 9px 11px; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(44, 82, 130, .14); }
textarea { resize: vertical; min-height: 90px; }
.row { display: flex; gap: 12px; align-items: flex-start; }
.row > * { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.muted { color: var(--sub); }
.tiny { font-size: 12.5px; }
.right { margin-left: auto; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

/* landing */
.landing { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.landing .hero { background: linear-gradient(160deg, #1f3a5f 0%, #23476f 55%, #1d5a62 100%); color: #fff; padding: 64px 64px 48px; display: flex; flex-direction: column; }
.landing .brandmark { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.landing .brandmark img { width: 34px; height: 34px; }
.landing .hero h1 { font-size: 36px; margin: 70px 0 14px; letter-spacing: -.5px; }
.landing .hero p.lead { font-size: 17px; opacity: .9; max-width: 520px; }
.landing .flow { margin-top: 38px; display: grid; gap: 12px; max-width: 520px; }
.landing .flow div { display: flex; gap: 14px; align-items: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px; padding: 12px 16px; }
.landing .flow b { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--navy); display: grid; place-items: center; flex: none; font-size: 14px; }
.landing .hero .foot { margin-top: auto; padding-top: 30px; font-size: 13px; opacity: .7; }
.landing .login { display: flex; align-items: center; justify-content: center; padding: 40px; }
.landing form { width: 100%; max-width: 360px; }
.landing form h2 { font-size: 24px; margin-bottom: 6px; }
.landing form .muted { margin-bottom: 26px; }
.landing form .btn.primary { width: 100%; margin-top: 6px; }
.err { color: var(--red); background: var(--red-bg); border-radius: 9px; padding: 9px 12px; font-size: 14px; margin-bottom: 12px; }

/* shell */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 24px; }
.top .logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; text-decoration: none; color: var(--ink); }
.top .logo img { width: 28px; height: 28px; }
.top nav { display: flex; gap: 4px; }
.top nav a { text-decoration: none; color: var(--sub); padding: 7px 12px; border-radius: 8px; font-weight: 700; font-size: 14px; }
.top nav a.on, .top nav a:hover { background: var(--bg); color: var(--ink); }
.top .who { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--sub); }
.top select { width: auto; max-width: 210px; padding: 6px 10px; font-size: 13.5px; }
main { max-width: 1180px; margin: 0 auto; padding: 26px 24px 80px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 16px; margin-bottom: 4px; }
.card .lead { color: var(--sub); margin: 0 0 16px; font-size: 14px; }
.pagehead { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.pagehead h1 { font-size: 23px; }

/* status chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.draft { background: #eef1f5; color: #4a5568; }
.chip.wet { background: var(--violet-bg); color: var(--violet); }
.chip.signed { background: var(--blue-bg); color: var(--navy-2); }
.chip.sent { background: var(--amber-bg); color: var(--amber); }
.chip.delivered { background: var(--green-bg); color: var(--green); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: #eef1f5; color: var(--sub); }
.tag.ai { background: var(--blue-bg); color: var(--navy-2); }
.tag.link { background: var(--green-bg); color: var(--green); }
.tag.user { background: #f1eee6; color: #6b5a2e; }
.tag.test { background: var(--amber-bg); color: var(--amber); }

/* dashboard */
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--sub); }
.filters button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.filters button i { font-style: normal; opacity: .7; margin-left: 4px; }
table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
table.list th { text-align: left; font-size: 12.5px; color: var(--sub); font-weight: 700; padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); }
table.list td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #fafbfd; }
.empty { text-align: center; padding: 56px 20px; color: var(--sub); }
.empty b { display: block; font-size: 17px; color: var(--ink); margin-bottom: 6px; }
.stepmini { display: inline-flex; gap: 3px; vertical-align: middle; }
.stepmini i { width: 14px; height: 5px; border-radius: 3px; background: #dfe4ec; }
.stepmini i.on { background: var(--navy-2); }

/* wizard */
.wiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wiz-head h1 { font-size: 20px; }
.saved { font-size: 12.5px; color: var(--mute); }
.progress { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 12px; margin-bottom: 18px; box-shadow: var(--shadow); }
.progress .bar { height: 6px; border-radius: 3px; background: #e7ebf1; overflow: hidden; margin-bottom: 12px; }
.progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-2), var(--green)); border-radius: 3px; transition: width .3s; }
.progress ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.progress li { font-size: 12.5px; color: var(--mute); display: flex; gap: 6px; align-items: center; cursor: default; }
.progress li b { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #cfd5df; display: grid; place-items: center; font-size: 11.5px; flex: none; background: #fff; }
.progress li.done { color: var(--sub); cursor: pointer; }
.progress li.done b { background: var(--green); border-color: var(--green); color: #fff; }
.progress li.cur { color: var(--ink); font-weight: 700; }
.progress li.cur b { border-color: var(--navy); background: var(--navy); color: #fff; }
.wiz-body { display: grid; grid-template-columns: 1fr; gap: 16px; }
.wiz-foot { position: sticky; bottom: 0; background: rgba(245, 247, 250, .94); backdrop-filter: blur(6px); border-top: 1px solid var(--line);
  margin: 22px -24px 0; padding: 14px 24px; display: flex; align-items: center; gap: 12px; }
.wiz-foot .hint { color: var(--sub); font-size: 13.5px; }
.wiz-foot .btn.primary { margin-left: auto; min-width: 180px; }
.steptitle { font-size: 19px; margin-bottom: 4px; }
.stepsub { color: var(--sub); margin: 0 0 18px; }

/* uploads */
.drop { border: 2px dashed #c8d0dc; border-radius: var(--r); padding: 22px; text-align: center; color: var(--sub); background: #fbfcfd; cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--navy-2); background: var(--blue-bg); color: var(--navy); }
.drop b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 3px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumb { width: 132px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; position: relative; font-size: 12px; }
.thumb img { width: 100%; height: 150px; object-fit: contain; object-position: top; display: block; background: #f1f3f6; }
.thumb .pdf { height: 150px; display: grid; place-items: center; background: #f1f3f6; color: var(--sub); font-weight: 700; }
.thumb .nm { padding: 5px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--sub); }
.thumb .x { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(23, 32, 46, .7); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.linkrow { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.linkrow .tag { flex: none; }
.ok-line { color: var(--green); font-weight: 700; font-size: 13.5px; }
.warn-line { color: var(--amber); font-weight: 700; font-size: 13.5px; }

/* extraction */
.shot { display: grid; grid-template-columns: 260px 1fr; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.shot + .shot { margin-top: 14px; }
.shot .img { position: sticky; top: 76px; align-self: start; }
.shot .img img { width: 100%; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
.cmt { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fcfcfd; }
.cmt + .cmt { margin-top: 10px; }
.cmt .hd { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 700; }
.cmt label.f { margin-bottom: 10px; }
.cmt label.f > span { display: flex; gap: 6px; align-items: center; }
.cmt .raw { font-size: 12.5px; color: var(--amber); margin-top: 3px; }
.field-missing input, .field-missing textarea { border-color: #e7a29b; background: #fff8f7; }
.notice { border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-bottom: 14px; }
.notice.info { background: var(--blue-bg); color: #1e3a66; }
.notice.warn { background: var(--amber-bg); color: #6f4300; }
.notice.ok { background: var(--green-bg); color: #145c44; }
.notice.bad { background: var(--red-bg); color: #8a1b12; }

/* choice cards */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.choice { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; background: #fff; display: flex; gap: 10px; align-items: flex-start; }
.choice input { margin-top: 4px; accent-color: var(--navy); }
.choice b { display: block; font-size: 14.5px; }
.choice small { color: var(--sub); font-size: 12.5px; display: block; margin-top: 2px; }
.choice.on { border-color: var(--navy-2); background: #f6f9fe; }

/* preview & problems */
.split { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.preview { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: var(--r); background: #fff; box-shadow: var(--shadow); }
.problems { list-style: none; padding: 0; margin: 0; }
.problems li { padding: 8px 10px; border-radius: 8px; background: var(--red-bg); color: #8a1b12; font-size: 13.5px; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.problems li a { margin-left: auto; font-weight: 700; color: #8a1b12; white-space: nowrap; cursor: pointer; }
.doctabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.doctabs button { border: 1px solid var(--line); background: #fff; padding: 7px 13px; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 13.5px; display: flex; gap: 7px; align-items: center; }
.doctabs button.on { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }

/* facts & sign */
.fact { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; cursor: pointer; }
.fact input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--green); flex: none; }
.fact.on { border-color: #a7d7c3; background: #f4fbf8; }
.fact .ev { margin-left: auto; color: var(--navy-2); font-size: 12.5px; white-space: nowrap; font-weight: 700; }
.qrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qrow:last-child { border-bottom: 0; }
.qrow .q { flex: 1; }
.qrow .q small { display: block; color: var(--sub); font-size: 12.5px; }
.seg { display: inline-flex; border: 1px solid #cfd5df; border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 14px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--sub); }
.seg button + button { border-left: 1px solid #cfd5df; }
.seg button.on { background: var(--navy); color: #fff; }
.pad { border: 1.5px dashed #b9c2cf; border-radius: 12px; background: #fff; touch-action: none; width: 100%; height: 190px; display: block; cursor: crosshair; }
.signprev { max-height: 90px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }

/* send */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--sub); }
.kv dd { margin: 0; }
pre.code { background: #0f1724; color: #d6e2f5; border-radius: 10px; padding: 14px; overflow: auto; font-size: 12px; max-height: 360px; margin: 0; }
.cost { display: flex; gap: 10px; flex-wrap: wrap; }
.cost div { background: var(--bg); border-radius: 10px; padding: 10px 14px; min-width: 120px; }
.cost b { display: block; font-size: 18px; }
.cost span { font-size: 12px; color: var(--sub); }

/* tracking */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.timeline li:last-child { border-bottom: 0; }
.statusline { display: flex; gap: 0; margin: 6px 0 16px; }
.statusline div { flex: 1; text-align: center; font-size: 12.5px; color: var(--mute); position: relative; padding-top: 22px; }
.statusline div::before { content: ""; position: absolute; top: 6px; left: 50%; width: 12px; height: 12px; border-radius: 50%; background: #dfe4ec; transform: translateX(-50%); z-index: 1; }
.statusline div::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: #dfe4ec; }
.statusline div:first-child::after { display: none; }
.statusline div.on { color: var(--ink); font-weight: 700; }
.statusline div.on::before, .statusline div.on::after { background: var(--green); }

/* settings */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--sub); font-weight: 700; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--navy); }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 700; }
.switch input { width: 40px; height: 22px; appearance: none; background: #cfd5df; border-radius: 11px; position: relative; cursor: pointer; transition: .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { left: 21px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #17202e; color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 99; font-size: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .2); max-width: 90vw; }
.toast.bad { background: var(--red); }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 36, .45); z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.modal h3 { margin-bottom: 12px; }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.zoom { position: fixed; inset: 0; background: rgba(15, 23, 36, .85); z-index: 60; display: grid; place-items: center; cursor: zoom-out; padding: 20px; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 8px; }

@media (max-width: 900px) {
  .landing { grid-template-columns: 1fr; }
  .landing .hero { padding: 36px 26px; }
  .landing .hero h1 { margin-top: 30px; font-size: 28px; }
  .split, .shot { grid-template-columns: 1fr; }
  .shot .img { position: static; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .progress ol { grid-template-columns: repeat(7, 1fr); }
  .progress li span { display: none; }
  .top nav a { padding: 6px 8px; }
}
details.ppfold > summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline; }
details.ppfold > summary::-webkit-details-marker { display: none; }
details.ppfold > summary::before { content: "▸"; color: var(--sub); }
details.ppfold[open] > summary::before { content: "▾"; }
details.ppfold[open] > summary { margin-bottom: 12px; }

/* 도장 (brand seal) */
.sealbox { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sealrow { display: flex; gap: 14px; align-items: center; margin-top: 10px; }
.sealrow small { color: var(--sub); font-size: 12.5px; display: block; margin-top: 2px; }
.sealprev { flex: none; width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center;
  background: repeating-conic-gradient(#f1f3f7 0 25%, #fff 0 50%) 0 0 / 12px 12px; }
.sealprev.big { width: 96px; height: 96px; }
.sealprev.empty { color: var(--sub); font-size: 12px; }
.sealprev img { max-width: 86%; max-height: 86%; }
.sealdemo { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 34px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 15px; }
.sealdemo .sealmark { position: relative; display: inline-block; width: 40px; text-align: center; }
.sealdemo .sealmark img { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; object-fit: contain; transform: translate(-50%, -50%); mix-blend-mode: multiply; }
