:root {
  --bg: #f4f7fb; --card: #fff; --ink: #14213d; --muted: #566783; --line: #e1e8f2;
  --blue: #1a56db; --blue-d: #1442ad; --navy: #0d2150;
  --ok: #166534; --ok-bg: #e8f6ec; --warn: #9a4a00; --warn-bg: #fff3e0; --bad: #b91c1c; --bad-bg: #fde8e8; --info-bg: #eaf1ff;
  --radius: 16px; --shadow: 0 6px 24px rgba(13, 33, 80, .08);
}
* { box-sizing: border-box; }
html { font-size: 17px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; line-height: 1.6; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { margin: 0; line-height: 1.3; }
a { color: var(--blue); }

header.top { background: linear-gradient(120deg, var(--navy), #1b3f94); color: #fff; padding: 16px 32px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo { width: 50px; height: 50px; border-radius: 14px; background: var(--blue); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.brand h1 { font-size: 1.7rem; letter-spacing: -.5px; }
.brand p { margin: 0; color: #cfe0ff; font-size: .95rem; }
.privacy { margin-left: auto; max-width: 430px; font-size: .84rem; color: #d7e5ff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; padding: 8px 12px; }

main { display: grid; grid-template-columns: minmax(340px, 480px) 1fr; gap: 24px; max-width: 1360px; margin: 24px auto; padding: 0 24px; align-items: start; }
@media (max-width: 960px) { main { grid-template-columns: 1fr; padding: 0 16px; } header.top { padding: 14px 16px; } .privacy { margin-left: 0; } }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.card h2 { font-size: 1.15rem; margin-bottom: 12px; }
.card h3 { font-size: .86rem; letter-spacing: .4px; color: var(--muted); margin: 18px 0 8px; }
.input { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; } /* 키 입력·챗봇 칸을 펼쳐도 패널 안에서 스크롤되어 끝까지 닿는다 */
@media (max-width: 960px) { .input { position: static; max-height: none; overflow: visible; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; min-height: 40px; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip small { color: var(--muted); margin-left: 4px; }
.chip.scam { border-color: #f0b4b4; }

.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tab { border: 0; background: #eef3fa; padding: 8px 14px; border-radius: 10px 10px 0 0; font: inherit; font-size: .9rem; cursor: pointer; }
.tab.on { background: var(--info-bg); color: var(--blue-d); font-weight: 700; }
textarea { width: 100%; min-height: 250px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: .98rem; line-height: 1.7; resize: vertical; background: #fbfdff; color: var(--ink); }
textarea:focus, input:focus, select:focus, button:focus-visible, summary:focus-visible { outline: 3px solid #b9d0ff; outline-offset: 1px; }
.drop { display: grid; place-items: center; min-height: 160px; border: 2px dashed #b7c7e6; border-radius: 12px; background: #fbfdff; cursor: pointer; text-align: center; padding: 16px; color: var(--muted); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 4px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; color: var(--ink); margin: 14px 0 4px; }
label.check input { margin-top: 5px; }
input[type=text], input[type=password], input:not([type]), select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fbfdff; color: var(--ink); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
details { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.pill { font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.pill.off { background: #eef3fa; color: var(--muted); } .pill.on { background: var(--ok-bg); color: var(--ok); }
.note { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }
.actions { display: flex; gap: 10px; margin-top: 16px; }
button.primary { flex: 1; background: var(--blue); color: #fff; border: 0; border-radius: 12px; padding: 14px 20px; font: inherit; font-size: 1.1rem; font-weight: 800; cursor: pointer; min-height: 52px; }
button.primary:hover { background: var(--blue-d); }
button.primary:disabled { background: #8aa5dd; cursor: progress; }
button.ghost { background: #eef3fa; border: 0; border-radius: 12px; padding: 12px 16px; font: inherit; cursor: pointer; color: var(--ink); min-height: 44px; }
button.ghost:hover { background: #e1eaf7; }
.today { font-size: .8rem; color: var(--muted); margin: 10px 0 0; }

.empty { text-align: center; color: var(--muted); padding: 56px 20px; }
.empty h2 { color: var(--ink); margin: 14px 0 8px; font-size: 1.3rem; }

/* 결과 */
.head-card { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.head-card .txt { flex: 1; min-width: 260px; }
.doc-type { display: inline-block; font-size: .8rem; font-weight: 700; color: var(--blue-d); background: var(--info-bg); padding: 3px 10px; border-radius: 999px; }
.one-line { font-size: 1.25rem; font-weight: 800; margin: 8px 0 4px; }
.verdict { padding: 10px 14px; border-radius: 12px; font-weight: 700; min-width: 190px; text-align: center; }
.verdict small { display: block; font-weight: 500; opacity: .85; }
.verdict.low { background: var(--ok-bg); color: var(--ok); } .verdict.medium { background: var(--warn-bg); color: var(--warn); } .verdict.high { background: var(--bad-bg); color: var(--bad); }

.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.step { font-size: .8rem; padding: 5px 11px; border-radius: 999px; background: #eef3fa; color: var(--muted); }
.step.done { background: var(--ok-bg); color: var(--ok); font-weight: 700; } .step.skip { background: #f3f4f6; color: #8a94a6; text-decoration: line-through; } .step.fail { background: var(--bad-bg); color: var(--bad); font-weight: 700; }

.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.todo li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.todo li.warn { border-color: #f1b25d; background: #fffaf2; }
.todo input[type=checkbox] { width: 22px; height: 22px; margin-top: 3px; }
.todo .task { font-weight: 700; }
.todo .ev { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.due { text-align: right; font-weight: 800; white-space: nowrap; }
.due small { display: block; font-weight: 600; color: var(--muted); }
.dday { display: inline-block; padding: 2px 9px; border-radius: 8px; font-size: .8rem; font-weight: 800; background: var(--info-bg); color: var(--blue-d); }
.dday.soon { background: var(--warn-bg); color: var(--warn); } .dday.past { background: #eee; color: #666; } .dday.today { background: var(--bad-bg); color: var(--bad); }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-right: 6px; vertical-align: middle; }
.tag.local { background: #eef3fa; color: var(--muted); } .tag.ai { background: #efe9ff; color: #5b34c9; } .tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.bad { background: var(--bad-bg); color: var(--bad); }

.money { display: grid; gap: 8px; }
.money .m { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; align-items: center; }
.money .amt { font-size: 1.15rem; font-weight: 800; }
.money .amt.recv { color: var(--ok); }
.acct { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: #f8fafe; border-radius: 12px; border: 1px dashed #b7c7e6; font-family: Consolas, monospace; }
.callout { padding: 10px 14px; border-radius: 12px; font-size: .92rem; margin-top: 8px; }
.callout.ok { background: var(--ok-bg); color: var(--ok); } .callout.warn { background: var(--warn-bg); color: var(--warn); } .callout.bad { background: var(--bad-bg); color: var(--bad); } .callout.info { background: var(--info-bg); color: var(--blue-d); }
ul.plain { margin: 0; padding-left: 20px; } ul.plain li { margin: 4px 0; }
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.terms div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: .9rem; } .terms b { color: var(--blue-d); }
.src { white-space: pre-wrap; background: #fbfdff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: .95rem; line-height: 1.9; }
.src .t { border-bottom: 2px dotted var(--blue); cursor: help; }
.src mark { color: inherit; border-radius: 4px; padding: 0 2px; font-weight: 700; background: none; }
.src mark.d { background: #ffe9b8; } .src mark.d.deadline { background: #ffc9c9; }
.src mark.a { background: #cfeeff; }
.legend { font-size: .78rem; color: var(--muted); margin-bottom: 6px; } .legend span { padding: 0 6px; border-radius: 4px; margin-right: 8px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btns button, .btns a { background: var(--blue); color: #fff; border: 0; border-radius: 12px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; min-height: 46px; }
.btns button.sec { background: #eef3fa; color: var(--ink); }
pre.draft { white-space: pre-wrap; background: #f8fafe; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font: inherit; margin: 8px 0 0; }
.checks a { display: inline-block; margin: 4px 10px 0 0; padding: 6px 12px; border-radius: 10px; background: #eef3fa; text-decoration: none; font-weight: 700; }
.err { padding: 12px 14px; border-radius: 12px; background: var(--bad-bg); color: var(--bad); margin-bottom: 14px; }
footer { max-width: 1360px; margin: 6px auto 36px; padding: 0 24px; color: var(--muted); font-size: .82rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111c3a; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .9rem; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.on { opacity: 1; }

.manual { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.manual h3.mh { margin: 8px 0 6px; font-size: .95rem; color: var(--ink); text-transform: none; letter-spacing: 0; }
.manual ol { padding-left: 20px; } .manual textarea { min-height: 100px; font: 13px/1.5 Consolas, monospace; }
.manual .actions { margin-top: 8px; }

.maskwords { width: 100%; margin: 4px 0 8px; }
.manual ol.steps { padding-left: 22px; margin: 6px 0; } .manual ol.steps li { margin: 4px 0; } .manual .hint { color: var(--muted, #667); font-size: .85em; } .manual .small { font-size: .82rem; }

.recrow { margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .recrow .small { font-size: .8rem; }
