/* KAIS 계약서 형광펜 — 종이 + 형광펜. 장식은 실물에서 온 것만 쓴다(종이, 괘선, 도장, 형광펜). */
:root {
  color-scheme: light;
  --bg: #F3EFE6;
  --sheet: #FFFDF8;
  --ink: #1B1A17;
  --ink-2: #45413A;
  --ink-3: #777064;
  --rule: #DDD5C6;
  --rule-2: #C7BDAA;
  --stamp: #C4362C;
  --risk: rgba(255, 112, 160, .55);
  --check: rgba(255, 222, 50, .72);
  --duty: rgba(92, 196, 255, .48);
  --right: rgba(140, 226, 88, .55);
  --risk-solid: #FF8DB4;
  --check-solid: #FFE14D;
  --duty-solid: #86D2FF;
  --right-solid: #A6E882;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --serif: 'Noto Serif KR', 'AppleMyungjo', 'Nanum Myeongjo', serif;
  --gut: clamp(16px, 4vw, 40px);
  --max: 1160px;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.7;
  word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img, canvas { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.nw { white-space: nowrap; }
.dot { color: var(--rule-2); padding: 0 .2em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--ink); color: var(--sheet); padding: 8px 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 46px; padding: 0 20px; border-radius: var(--radius);
  border: 1.5px solid var(--ink); font-weight: 650; font-size: 16px; text-decoration: none;
  transition: transform .12s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-ink { background: var(--ink); color: var(--sheet); }
.btn-ink:hover:not(:disabled) { background: #000; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: rgba(27, 26, 23, .05); }
.btn-paper { background: var(--sheet); color: var(--ink); border-color: var(--sheet); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 15px; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 17px; }
.btn-text { background: none; border: 0; padding: 8px 4px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule-2); }
.btn-text:hover { color: var(--ink); text-decoration-color: var(--ink); }
.btn input[type=file], .drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.btn { position: relative; }

/* ── 머리 ── */
.top { position: sticky; top: 0; z-index: 30; background: rgba(243, 239, 230, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.top-in { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); height: 64px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand-k { font-weight: 800; letter-spacing: .06em; font-size: 15px; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 18px; }
.brand-hl { background: linear-gradient(transparent 55%, var(--check) 55% 92%, transparent 92%); padding: 0 .1em; }
.top-nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.top-nav a { text-decoration: none; color: var(--ink-2); }
.top-nav a:hover { color: var(--ink); }
.top-act { display: flex; align-items: center; gap: 12px; }
@media (max-width: 760px) {
  .top-nav { display: none; }
  .top-act { margin-left: auto; }
  .top-in { height: 56px; }
  .brand-k { display: none; }
}

/* ── 형광펜 ── */
mark.hl, .hl {
  color: inherit; background: none; padding: 0 .08em; margin: 0 -.04em;
  background-image: linear-gradient(100deg, transparent .15em, var(--c) .3em, var(--c) calc(100% - .25em), transparent calc(100% - .05em));
  background-repeat: no-repeat; background-size: 100% 78%; background-position: 0 72%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  border-radius: .2em .5em .3em .6em;
}
.hl-risk { --c: var(--risk); }
.hl-check { --c: var(--check); }
.hl-duty { --c: var(--duty); }
.hl-right { --c: var(--right); }
.doc mark.hl { cursor: pointer; transition: background-size .5s cubic-bezier(.3, .7, .2, 1); }
.doc mark.hl:hover, .doc mark.hl.active { background-size: 100% 100%; background-position: 0 50%; }
.doc mark.hl.active { box-shadow: inset 0 -2.5px 0 var(--ink); }
.doc.drawing mark.hl { background-size: 0% 78%; }
.unread, .unread-demo { display: inline-block; min-width: 1.4em; text-align: center; font-family: var(--sans); font-size: .78em; font-weight: 700; color: var(--stamp); border: 1px dashed var(--stamp); border-radius: 3px; line-height: 1.3; margin: 0 .1em; }
.hide-risk .hl-risk, .hide-check .hl-check, .hide-duty .hl-duty, .hide-right .hl-right { background-image: none; cursor: text; }
.hide-risk .note.lv-risk, .hide-check .note.lv-check, .hide-duty .note.lv-duty, .hide-right .note.lv-right { display: none; }

/* 펜 견본 */
.pen { display: block; width: 64px; height: 22px; border-radius: 3px 12px 4px 10px; transform: rotate(-2deg); flex: none; }
.pen-risk { background: var(--risk-solid); }
.pen-check { background: var(--check-solid); }
.pen-duty { background: var(--duty-solid); }
.pen-right { background: var(--right-solid); }

/* ── 종이 ── */
.paper {
  position: relative; background: var(--sheet); border: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .03), 0 18px 40px -24px rgba(60, 45, 20, .28);
}
.doc { font-family: var(--serif); color: #23211D; }
.clause { padding: 14px 0; border-top: 1px solid #EEE8DC; }
.clause:first-child { border-top: 0; }
.clause-text { margin: 0; white-space: pre-wrap; font-size: 16.5px; line-height: 2; }
.clause-page { float: right; font-family: var(--sans); font-size: 12px; color: var(--ink-3); margin-left: 12px; }
.stamp {
  position: absolute; right: 28px; bottom: 22px; width: 54px; height: 54px; border-radius: 50%;
  border: 2.5px solid var(--stamp); color: var(--stamp); font-family: var(--serif); font-weight: 900; font-size: 22px;
  display: grid; place-items: center; transform: rotate(-12deg); opacity: .82;
  box-shadow: inset 0 0 0 3px rgba(196, 54, 44, .12);
}

/* ── 처음 화면 ── */
.hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(40px, 7vw, 96px) var(--gut) clamp(56px, 8vw, 110px);
  display: grid; grid-template-columns: 1.02fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center;
}
.kicker { margin: 0 0 14px; font-size: 14px; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); }
.hero-title {
  margin: 0; font-family: var(--serif); font-weight: 900;
  font-size: clamp(38px, 5vw, 68px); line-height: 1.2; letter-spacing: -.035em; word-spacing: .12em;
}
.mark-draw {
  background-image: linear-gradient(100deg, transparent .1em, var(--check) .25em, var(--check) calc(100% - .2em), transparent);
  background-repeat: no-repeat; background-position: 0 78%; background-size: 0% 46%;
  animation: draw 1.1s .35s cubic-bezier(.6, .1, .2, 1) forwards;
  padding: 0 .05em;
}
@keyframes draw { to { background-size: 100% 46%; } }
.hero-lead { margin: 26px 0 0; font-size: clamp(17px, 1.6vw, 19.5px); color: var(--ink-2); max-width: 30em; line-height: 1.8; }
.hero-lead b { color: var(--ink); font-weight: 700; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-note { margin: 18px 0 0; font-size: 14.5px; color: var(--ink-3); }

.hero-sheet { margin: 0; position: relative; }
.who { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.who-q { font-size: 15px; font-weight: 650; color: var(--ink-2); }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--sheet); }
.seg button { border: 0; background: none; padding: 7px 16px; font-size: 15px; font-weight: 650; color: var(--ink-2); min-height: 38px; }
.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button.on { background: var(--ink); color: var(--sheet); }
.paper-hero { padding: 30px 30px 40px; transform: rotate(.6deg); }
.paper-hero::before { content: ''; position: absolute; inset: 10px 10px auto auto; width: 70px; height: 16px; background: rgba(230, 220, 195, .7); transform: rotate(8deg); }
.paper-title { margin: 0 0 6px; text-align: center; font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: .08em; }
.doc-mini .clause { padding: 10px 0; }
.doc-mini .clause-text { font-size: 15px; line-height: 1.95; }
.doc-mini .clause-page { display: none; }
.hero-cap { margin-top: 14px; min-height: 3.4em; font-size: 15px; color: var(--ink-2); display: flex; gap: 10px; align-items: flex-start; }
.hero-cap .pen { width: 28px; height: 14px; margin-top: 6px; }

.band { padding: clamp(64px, 9vw, 120px) 0; border-top: 1px solid var(--rule); }
.band-tight { padding: clamp(52px, 7vw, 92px) 0; }
.two { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 88px); align-items: start; }
.sec-no { margin: 0 0 12px; font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--stamp); }
.sec-title { margin: 0; font-family: var(--serif); font-weight: 800; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.3; letter-spacing: -.025em; word-spacing: .1em; }
.sec-lead { margin: 20px 0 0; color: var(--ink-2); font-size: 17.5px; }

.compare-src { margin: 0 0 18px; padding: 18px 20px; background: var(--sheet); border-left: 3px solid var(--ink); font-family: var(--serif); font-size: 16.5px; line-height: 1.9; }
.compare-src .u { text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 5px; }
.compare-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare-card { padding: 18px 20px; border: 1px solid var(--rule); background: rgba(255, 253, 248, .55); }
.compare-card p { margin: 0; }
.compare-who { font-size: 14px; font-weight: 700; color: var(--ink-3); margin-bottom: 8px !important; }
.compare-card mark { font-weight: 700; font-size: 17px; }
.compare-why { margin-top: 10px !important; font-size: 15.5px; color: var(--ink-2); }

.pens { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.pens li { display: flex; flex-direction: column; gap: 14px; }
.pens b { display: block; font-size: 18px; }
.pens span:not(.pen) { display: block; color: var(--ink-2); font-size: 15.5px; margin-top: 2px; }
.pens-more { margin: 36px 0 0; padding-top: 22px; border-top: 1px dashed var(--rule-2); color: var(--ink-2); max-width: 46em; }

.steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1.5px solid var(--ink); }
.steps li { padding: 26px 28px 8px 0; }
.steps li + li { padding-left: 28px; border-left: 1px solid var(--rule); }
.step-n { font-family: var(--serif); font-weight: 900; font-size: 40px; line-height: 1; }
.steps h3 { margin: 16px 0 8px; font-size: 20px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 16px; }

.types { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); }
.types li { padding: 14px 4px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; }
.types li:nth-child(odd) { padding-right: 20px; }
.types b { font-size: 16.5px; }
.types span { font-size: 14.5px; color: var(--ink-3); }

.honest { display: grid; gap: 26px; }
.honest h3 { margin: 0 0 6px; font-size: 19px; }
.honest p { margin: 0; color: var(--ink-2); }
.honest .help { padding: 18px 20px; background: var(--sheet); border: 1px solid var(--rule); }

.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 18px; }
.facts li { padding-left: 22px; position: relative; color: var(--ink-2); }
.facts li::before { content: ''; position: absolute; left: 0; top: .72em; width: 10px; height: 2px; background: var(--ink); }
.facts b { color: var(--ink); }

.faq details { border-top: 1px solid var(--rule); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 32px 14px 0; font-weight: 650; font-size: 17.5px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 10px; font-size: 24px; font-weight: 300; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 0 0 16px; color: var(--ink-2); }

.last-cta { background: var(--ink); color: var(--sheet); padding: clamp(64px, 9vw, 110px) 0; }
.last-cta .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.last-cta h2 { margin: 0; font-family: var(--serif); font-weight: 900; font-size: clamp(34px, 5vw, 60px); line-height: 1.2; letter-spacing: -.03em; word-spacing: .12em; }

.foot { border-top: 1px solid var(--rule); padding: 36px 0 48px; font-size: 14px; color: var(--ink-3); }
.foot-in { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-brand { margin: 0; font-weight: 800; color: var(--ink); letter-spacing: .04em; }
.foot-brand span { font-family: var(--serif); letter-spacing: 0; margin-left: 6px; }
.foot-note { margin: 4px 0 0; }
.foot-biz { margin: 0; text-align: right; line-height: 1.8; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-sheet { max-width: 620px; }
  .two { grid-template-columns: 1fr; }
  .pens { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .hero { padding-top: 32px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .paper-hero { padding: 22px 18px 34px; transform: none; }
  .compare-row { grid-template-columns: 1fr; }
  .pens { grid-template-columns: 1fr; gap: 18px; }
  .pens li { flex-direction: row; align-items: center; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 22px 0 18px; border-left: 0; border-bottom: 1px solid var(--rule); }
  .types { grid-template-columns: 1fr; }
  .types li:nth-child(odd) { padding-right: 4px; }
  .foot-biz { text-align: left; }
  .stamp { width: 44px; height: 44px; font-size: 18px; right: 16px; bottom: 14px; }
}

/* ── 검토 화면 ── */
.check-wrap { padding-top: 28px; padding-bottom: 80px; }
.progress { list-style: none; margin: 0 0 32px; padding: 0; display: flex; gap: 0; counter-reset: s; font-size: 14.5px; }
.progress li { counter-increment: s; flex: 1; padding: 10px 0 0; border-top: 3px solid var(--rule); color: var(--ink-3); font-weight: 600; }
.progress li::before { content: counter(s) ' '; font-family: var(--serif); font-weight: 900; margin-right: 4px; }
.progress li.done { border-color: var(--ink-2); color: var(--ink-2); }
.progress li.now { border-color: var(--ink); color: var(--ink); }
.progress li + li { margin-left: 6px; }

.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; margin-bottom: 28px; background: var(--sheet); border: 1px dashed var(--rule-2); flex-wrap: wrap; }
.demo-bar p { margin: 0; font-size: 15.5px; color: var(--ink-2); }

.step-title { margin: 0; font-family: var(--serif); font-weight: 800; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.025em; word-spacing: .1em; line-height: 1.3; }
.step-lead { margin: 10px 0 28px; color: var(--ink-2); }
.step-foot { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 220px; padding: 32px 20px; cursor: pointer;
  background: repeating-linear-gradient(0deg, transparent 0 31px, #EFE9DD 31px 32px), var(--sheet);
  border: 1.5px dashed var(--ink-3); border-radius: var(--radius);
  transition: border-color .15s, background-color .15s;
}
.drop:hover, .drop.over { border-color: var(--ink); border-style: solid; }
.drop.over { background-color: #FFF9E0; }
.drop.busy { pointer-events: none; opacity: .7; }
.drop-icon { width: 44px; height: 54px; border: 1.5px solid var(--ink); border-radius: 2px; position: relative; margin-bottom: 16px; background: var(--sheet); }
.drop-icon::before { content: ''; position: absolute; left: 7px; right: 7px; top: 14px; height: 7px; background: var(--check-solid); transform: rotate(-4deg); }
.drop-icon::after { content: ''; position: absolute; left: 7px; right: 12px; top: 27px; height: 2px; background: var(--rule-2); box-shadow: 0 7px 0 var(--rule-2), 0 14px 0 var(--rule-2); }
.drop-main { font-size: 18px; font-weight: 650; }
.drop-main u { text-underline-offset: 4px; }
.drop-sub { margin-top: 6px; font-size: 14.5px; color: var(--ink-3); }
.drop-alt { margin-top: 12px; display: none; }
@media (hover: none) and (pointer: coarse) { .drop-alt { display: flex; } .drop-alt .btn { flex: 1; } }

.tips { margin-top: 16px; font-size: 15.5px; color: var(--ink-2); }
.tips summary { cursor: pointer; font-weight: 600; }
.tips ul { margin: 8px 0 0; padding-left: 20px; }

.pages { margin-top: 36px; }
.pages-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1.5px solid var(--ink); padding-bottom: 10px; }
.pages-head h2 { margin: 0; font-size: 20px; }
.pages-head p { margin: 0; color: var(--ink-2); font-size: 15px; }
.page-grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.pg { position: relative; display: flex; flex-direction: column; gap: 8px; }
.pg.dragging { opacity: .4; }
.pg.drop-before::before { content: ''; position: absolute; left: -10px; top: 0; bottom: 0; width: 3px; background: var(--ink); }
.pg-img { position: relative; aspect-ratio: 1 / 1.35; background: var(--sheet); border: 1px solid var(--rule); overflow: hidden; cursor: grab; }
.pg-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pg-no { position: absolute; left: 8px; top: 8px; background: var(--ink); color: var(--sheet); font-weight: 700; font-size: 13px; padding: 1px 8px; border-radius: 2px; }
.pg-tag { position: absolute; left: 8px; bottom: 8px; right: 8px; font-size: 12.5px; font-weight: 600; background: rgba(255, 253, 248, .94); padding: 3px 7px; border-radius: 2px; line-height: 1.4; }
.pg-tag.bad { color: var(--stamp); }
.pg-acts { display: flex; gap: 4px; flex-wrap: wrap; }
.pg-acts button { border: 1px solid var(--rule-2); background: var(--sheet); border-radius: 3px; font-size: 13.5px; padding: 4px 9px; min-height: 34px; }
.pg-acts button:hover { border-color: var(--ink); }
.pg-acts .grow { flex: 1; }
.pg-name { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.consent { margin-top: 28px; padding: 16px 18px; background: var(--sheet); border: 1px solid var(--rule); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--ink); flex: none; }
.check-sm { font-size: 14.5px; align-items: center; }
.check-sm input { margin: 0; }

.bar { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .4s ease; }
.read-list { list-style: none; margin: 22px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.read-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 15.5px; }
.read-list img { width: 44px; height: 58px; object-fit: cover; object-position: top; border: 1px solid var(--rule); background: var(--sheet); }
.read-list .rl-name { flex: 1; min-width: 0; }
.read-list .rl-name small { display: block; color: var(--ink-3); font-size: 13.5px; }
.rl-st { font-weight: 650; font-size: 14.5px; white-space: nowrap; }
.rl-st.ok { color: #2E7D32; }
.rl-st.bad { color: var(--stamp); }
.rl-st.run::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 2px solid var(--ink); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.type-pick { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; flex-wrap: wrap; }
.type-pick label { font-weight: 650; font-size: 15px; }
.type-pick select { min-height: 44px; padding: 0 12px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--sheet); font-size: 16px; max-width: 100%; }
.warn { padding: 14px 16px; margin-bottom: 20px; border-left: 3px solid var(--stamp); background: #FBEDEA; font-size: 15.5px; color: #5A1F19; }
.warn p { margin: 0; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.role-card {
  text-align: left; padding: 26px 24px; background: var(--sheet); border: 1.5px solid var(--rule-2); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 8px; min-height: 170px; transition: border-color .15s, transform .15s;
}
.role-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.role-letter { font-family: var(--serif); font-weight: 900; font-size: 15px; color: var(--stamp); }
.role-main { font-family: var(--serif); font-weight: 800; font-size: 26px; line-height: 1.3; }
.role-sub { color: var(--ink-2); font-size: 15.5px; }
.role-go { margin-top: auto; font-weight: 700; font-size: 15px; }
.role-note { margin-top: 16px; font-size: 14.5px; color: var(--ink-3); }
@media (max-width: 640px) { .roles { grid-template-columns: 1fr; } .role-card { min-height: 0; } }

/* ── 결과 ── */
.res-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.res-title h1 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.02em; line-height: 1.3; }
.res-title .kicker { margin-bottom: 6px; }
.res-role { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 650; color: var(--ink-2); }
.res-summary { margin: 20px 0 0; padding: 18px 20px; background: var(--sheet); border-left: 3px solid var(--ink); font-size: 17px; max-width: 54em; }
.res-meta { margin-top: 10px; font-size: 13.5px; color: var(--ink-3); display: flex; gap: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 16px; position: sticky; top: 64px; z-index: 5; padding: 10px 0; background: var(--bg); }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--ink); background: var(--sheet); border-radius: 999px; padding: 5px 14px 5px 10px; font-size: 14.5px; font-weight: 650; min-height: 38px; }
.chip i { width: 18px; height: 11px; border-radius: 2px 6px 2px 5px; display: block; }
.chip b { font-variant-numeric: tabular-nums; }
.chip.off { opacity: .45; border-color: var(--rule-2); }
.chip.off i { background: var(--rule) !important; }

.res-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.tabs { display: flex; gap: 0; margin-bottom: -1px; position: relative; z-index: 1; }
.tabs button { border: 1px solid var(--rule); border-bottom: 0; background: transparent; padding: 8px 16px; font-size: 14.5px; font-weight: 600; color: var(--ink-3); }
.tabs button.on { background: var(--sheet); color: var(--ink); }
.paper-doc { padding: clamp(18px, 3vw, 40px) clamp(18px, 3.4vw, 48px); min-height: 400px; }
.doc-loading { position: absolute; inset: 0; background: rgba(255, 253, 248, .86); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 120px; gap: 12px; font-family: var(--sans); color: var(--ink-2); }
.spin { width: 26px; height: 26px; border: 3px solid var(--ink); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.orig { display: grid; gap: 18px; }
.orig figure { margin: 0; }
.orig figcaption { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.orig img { border: 1px solid var(--rule); }

.res-notes { position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow: auto; overscroll-behavior: contain; padding-right: 4px; }
.notes-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1.5px solid var(--ink); padding-bottom: 8px; }
.notes-head h2 { margin: 0; font-size: 18px; }
.notes-head span { font-size: 14px; color: var(--ink-3); }
.notes { list-style: none; margin: 0; padding: 0; }
.note { padding: 16px 0 16px 14px; border-bottom: 1px solid var(--rule); position: relative; scroll-margin-top: 20px; }
.note::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 2px; background: var(--c); }
.note.lv-risk { --c: var(--risk-solid); }
.note.lv-check { --c: var(--check-solid); }
.note.lv-duty { --c: var(--duty-solid); }
.note.lv-right { --c: var(--right-solid); }
.note.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { background: #FFF6CC; } 100% { background: transparent; } }
.note-lv { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.note h3 { margin: 2px 0 6px; font-size: 17px; line-height: 1.45; }
.note-q { margin: 0 0 8px; font-family: var(--serif); font-size: 14.5px; color: var(--ink-2); line-height: 1.75; }
.note-q::before { content: '“'; } .note-q::after { content: '”'; }
.note-why { margin: 0; font-size: 15.5px; color: var(--ink-2); }
.note-ask { margin: 10px 0 0; padding: 10px 12px; background: #F6F2E8; font-size: 15px; border-radius: 3px; }
.note-ask b { display: block; font-size: 12.5px; color: var(--ink-3); }
.note-law { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.note-law a { font-weight: 650; text-underline-offset: 3px; }
.note-go { margin-top: 8px; background: none; border: 0; padding: 0; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; color: var(--ink-3); }

.res-sec { margin-top: 56px; }
.res-sec h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.res-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1.5px solid var(--ink); padding-bottom: 10px; }
.res-sec > h2 { border-bottom: 1.5px solid var(--ink); padding-bottom: 10px; }
.res-sec-lead { color: var(--ink-2); margin: 12px 0 0; font-size: 15.5px; }
.missing { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 28px; }
.missing li { padding: 16px 0; border-bottom: 1px dashed var(--rule-2); }
.missing b { display: block; font-size: 17px; margin-bottom: 4px; }
.missing p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.missing .none { color: var(--ink-3); }
.asks { margin: 8px 0 0; padding: 0 0 0 1.6em; }
.asks li { padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 16.5px; }
.asks li small { display: block; color: var(--ink-3); font-size: 13.5px; }
.disclaimer { margin: 48px 0 0; font-size: 14.5px; color: var(--ink-3); max-width: 60em; }
.res-actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding-top: 22px; border-top: 1px solid var(--rule); }

@media (max-width: 980px) {
  .res-body { grid-template-columns: 1fr; }
  .res-notes { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 640px) {
  .filters { top: 56px; margin-left: calc(var(--gut) * -1); margin-right: calc(var(--gut) * -1); padding: 10px var(--gut); overflow-x: auto; flex-wrap: nowrap; }
  .chip { flex: none; }
  .paper-doc { margin: 0 calc(var(--gut) * -1); border-left: 0; border-right: 0; }
  .clause-text { font-size: 16.5px; }
  .res-actions .btn { flex: 1 1 100%; }
  .missing { grid-template-columns: 1fr; }
}

/* 기록 */
.hist { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1.5px solid var(--ink); }
.hist li { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.hist .h-main { flex: 1; min-width: 200px; }
.hist .h-main b { display: block; font-size: 17.5px; }
.hist .h-main span { font-size: 14px; color: var(--ink-3); }
.empty { padding: 40px 0; color: var(--ink-2); }

/* ── 아래에서 올라오는 시트(모바일) ── */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-back { position: absolute; inset: 0; background: rgba(27, 26, 23, .35); }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow: auto; background: var(--sheet); border-radius: 12px 12px 0 0; padding: 22px var(--gut) calc(24px + env(safe-area-inset-bottom)); animation: up .22s ease; }
.sheet-card .note { border-bottom: 0; }
.sheet-x { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--ink-3); padding: 8px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

/* ── 모달 ── */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(27, 26, 23, .45); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--sheet); border-radius: 6px; padding: 26px 24px 18px; }
.modal-wide { width: min(880px, 100%); }
.modal-head h2 { margin: 0; font-family: var(--serif); font-size: 24px; }
.modal-head p { margin: 6px 0 16px; color: var(--ink-2); font-size: 15.5px; }
.modal-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.grow { flex: 1; }
.mask-stage { background: #2A2824; display: grid; place-items: center; max-height: 62vh; overflow: auto; touch-action: none; }
.mask-stage canvas { cursor: crosshair; touch-action: none; max-height: 62vh; width: auto; }
.form { display: grid; gap: 10px; }
.form label { font-weight: 650; font-size: 15px; }
.form input { min-height: 48px; padding: 0 14px; border: 1.5px solid var(--ink-3); border-radius: var(--radius); background: #fff; font-size: 17px; }
.form input:focus { border-color: var(--ink); outline: none; }
.form-note { margin: 0; font-size: 14px; color: var(--ink-3); }
.form-msg { min-height: 1.4em; margin: 10px 0 0; font-size: 15px; color: var(--ink-2); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--sheet); padding: 12px 18px; border-radius: 4px; font-size: 15px; opacity: 0; pointer-events: none; transition: .25s ease; z-index: 90; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .mark-draw { background-size: 100% 46%; }
}

/* ── 인쇄 ── */
@media print {
  .top, .foot, .progress, .demo-bar, .filters, .res-actions, .tabs, .note-go, .res-role, .sheet, .toast, #view-intro { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .res-body { grid-template-columns: 1fr; }
  .res-notes { position: static; max-height: none; overflow: visible; }
  .paper { box-shadow: none; border: 0; }
  .paper-doc { padding: 0; }
  mark.hl { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .note { break-inside: avoid; }
}

/* 로그인·회원가입 */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.auth-tabs { display: flex; border-bottom: 1.5px solid var(--ink); margin: -6px 0 14px; }
.auth-tabs button { flex: 1; background: none; border: 0; padding: 10px 0 12px; font-size: 17px; font-weight: 650; color: var(--ink-3); border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.auth-tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.auth-lead { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }
.auth-lead:empty { display: none; }
.form label small { font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.form .btn { margin-top: 6px; }
.form-link { justify-self: center; font-size: 14.5px; }
.agree { margin-top: 4px; padding: 12px 14px; background: #F6F2E8; border-radius: 4px; }
.agree details { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.agree summary { cursor: pointer; font-weight: 600; }
.agree p { margin: 8px 0 0; }
.agree-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; }
.agree-table th, .agree-table td { border: 1px solid var(--rule); padding: 6px 8px; text-align: left; vertical-align: top; }
.agree-table th { width: 30%; background: var(--sheet); font-weight: 650; white-space: nowrap; }
.form-msg.bad { color: var(--stamp); }
.acct { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 10px; font-size: 14.5px; color: var(--ink-3); }
.danger { color: var(--stamp) !important; text-decoration-color: rgba(196,54,44,.4) !important; }
