:root {
  --navy: #12213b;
  --navy-2: #1a2e4f;
  --blue: #1f64f0;
  --blue-dark: #174fc0;
  --ink: #172033;
  --muted: #5c687b;
  --subtle: #798498;
  --line: #dce2ea;
  --line-strong: #c8d0dc;
  --surface: #ffffff;
  --soft: #f5f7fa;
  --green: #087a57;
  --green-soft: #e8f6f1;
  --amber: #8a5300;
  --amber-soft: #fff3dd;
  --red: #b3263a;
  --red-soft: #fcecef;
  --shadow: 0 18px 45px rgba(18, 33, 59, .09);
  --radius: 12px;
  font-family: Pretendard, "Segoe UI", "Malgun Gothic", Arial, sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--soft); }
body { min-height: 100vh; margin: 0; background: var(--soft); color: var(--ink); font-size: 14px; }
button, input, textarea, select { font: inherit; }
button, a, summary, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(31, 100, 240, .28); outline-offset: 3px; }
input:focus-visible { outline-offset: 1px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; transform: translateY(-160%); border-radius: 7px; padding: 10px 14px; background: #fff; color: var(--navy); font-weight: 800; box-shadow: var(--shadow); }
.skip-link:focus { transform: translateY(0); }

.brand-lockup { display: inline-flex; align-items: baseline; color: var(--ink); font-size: 23px; font-weight: 400; letter-spacing: -.055em; }
.brand-lockup .brand-zone { margin-left: 4px; color: var(--blue); font-weight: 850; }
.brand-lockup small { margin-left: 9px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: 0; }
.brand-lockup--light { color: #fff; }
.brand-lockup--light small { color: #b3bfd1; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; padding: 10px 17px; cursor: pointer; font-size: 14px; font-weight: 750; transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .68; transform: none; }
.button--primary { background: var(--blue); color: #fff; box-shadow: 0 7px 18px rgba(31, 100, 240, .18); }
.button--primary:hover { background: var(--blue-dark); }
.button--secondary { border-color: var(--line); background: #fff; color: var(--ink); box-shadow: none; }
.button--secondary:hover { border-color: var(--line-strong); background: var(--soft); }
.button--wide { width: 100%; }
.button--large { min-height: 50px; padding: 13px 20px; }
.text-button { min-height: 36px; border: 0; padding: 0; background: transparent; color: #c1cad8; cursor: pointer; font-size: 12px; font-weight: 700; }
.text-danger { color: var(--red); }
.muted-copy { color: var(--muted); font-size: 12px; }

/* Operator workspace */
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 212px minmax(0, 1fr); }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 212px; display: flex; flex-direction: column; padding: 28px 18px 20px; background: var(--navy); color: #fff; }
.admin-nav { display: grid; gap: 5px; margin-top: 48px; }
.admin-nav__item { min-height: 44px; display: flex; align-items: center; border-radius: 8px; padding: 0 13px; color: #bac5d6; font-size: 14px; font-weight: 700; transition: background .16s ease, color .16s ease, transform .16s ease; }
.admin-nav__item:hover { color: #fff; transform: translateX(2px); }
.admin-nav__item.is-active { background: #fff; color: var(--navy); }
.sidebar-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; }
.sidebar-user { display: grid; gap: 3px; min-width: 0; }
.sidebar-user span { color: #91a0b7; font-size: 11px; }
.sidebar-user strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; }
.sidebar-scrim { position: fixed; inset: 0; z-index: 25; border: 0; background: rgba(10, 19, 34, .48); }
.admin-main { grid-column: 2; min-width: 0; }
.admin-topbar { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 32px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.admin-topbar > strong { font-size: 14px; }
.operator-chip { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; }
.mobile-menu { display: none; min-height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; background: #fff; font-size: 12px; font-weight: 750; }
.admin-content { width: min(100%, 1400px); margin: 0 auto; padding: 34px; }
.admin-content > * { animation: surface-in .28s ease both; }
.admin-content > *:nth-child(2) { animation-delay: .035s; }
.admin-content > *:nth-child(3) { animation-delay: .07s; }
@keyframes surface-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading--compact { margin-bottom: 20px; }
.page-heading h1 { margin: 0; color: var(--navy); font-size: clamp(27px, 3vw, 36px); letter-spacing: -.045em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.page-heading p strong { color: var(--ink); }
.back-link { display: inline-flex; margin-bottom: 11px; color: var(--muted); font-size: 12px; font-weight: 750; }
.back-link::before { content: "←"; margin-right: 6px; }

.status-tabs { display: flex; align-items: stretch; margin-bottom: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab { position: relative; display: flex; min-width: max-content; align-items: center; gap: 8px; padding: 12px 18px; color: var(--muted); font-size: 13px; font-weight: 700; transition: color .16s ease, background .16s ease; }
.status-tab:hover { color: var(--ink); background: rgba(255,255,255,.5); }
.status-tab strong { display: grid; min-width: 23px; height: 23px; place-items: center; border-radius: 99px; background: #e8ecf2; color: #526071; font-size: 11px; }
.status-tab.is-active { color: var(--blue); }
.status-tab.is-active::after { content: ""; position: absolute; inset: auto 14px -1px; height: 2px; background: var(--blue); }
.status-tab.is-active strong { background: #e8f0ff; color: var(--blue-dark); }

.work-surface { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.surface-toolbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 16px 20px; }
.surface-toolbar h2, .detail-section h2, .side-section h2 { margin: 0; color: var(--navy); font-size: 16px; letter-spacing: -.02em; }
.surface-toolbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.search-form { display: flex; min-width: min(410px, 100%); border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.search-form:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,100,240,.10); }
.search-form input { min-width: 0; flex: 1; border: 0; padding: 10px 12px; color: var(--ink); outline: 0; }
.search-form a { align-self: center; padding: 8px; color: var(--muted); font-size: 12px; }
.search-form button { border: 0; border-left: 1px solid var(--line); padding: 0 15px; background: var(--soft); cursor: pointer; font-size: 12px; font-weight: 800; }
.table-scroll { overflow-x: auto; }
.contracts-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.contracts-table th { padding: 12px 18px; background: #fafbfc; color: #667286; text-align: left; font-size: 11px; font-weight: 750; }
.contracts-table td { padding: 15px 18px; border-top: 1px solid #e9edf3; vertical-align: middle; }
.contracts-table tbody tr { transition: background .15s ease; }
.contracts-table tbody tr:hover { background: #f8faff; }
.contracts-table td:first-child { min-width: 270px; }
.contract-cell { display: grid; gap: 4px; }
.contract-cell strong { color: var(--navy); font-size: 14px; }
.contract-cell span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.contracts-table code { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.contracts-table time { min-width: max-content; display: block; color: var(--muted); font-size: 12px; }
.contracts-table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.status, .delivery-state { display: inline-flex; width: max-content; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; background: #edf0f4; color: #4f5b6c; font-size: 11px; font-weight: 800; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--signed, .delivery-state--sent { background: var(--green-soft); color: var(--green); }
.status--sent { background: #e9f0ff; color: #1757c5; }
.status--viewed { background: var(--amber-soft); color: var(--amber); }
.status--canceled, .status--expired, .delivery-state--failed { background: var(--red-soft); color: var(--red); }
.delivery-state--preview, .delivery-state--ready { background: #edf0f4; color: #536074; }
.empty-state { display: grid; place-items: center; padding: 70px 20px; text-align: center; }
.empty-state h3 { margin: 0 0 7px; color: var(--navy); font-size: 18px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

/* Forms and contract builder */
.form-error { margin: 16px 0; border: 1px solid #efb8c1; border-radius: 8px; padding: 13px 15px; background: #fff0f2; color: #922436; font-size: 13px; font-weight: 700; }
.form-error--page { max-width: 100%; margin: 0 0 18px; }
.field-label { display: grid; gap: 7px; color: #344157; font-size: 12px; font-weight: 750; }
.field-label em, .gender-field em, .signature-block em, .risk-check em { color: var(--blue); font-style: normal; }
.field-label > span { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.45; }
.field-label input, .danger-zone input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
.field-label input:hover { border-color: var(--line-strong); }
.field-label input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,100,240,.09); outline: 0; }
.field-label input[readonly] { background: #f4f6f8; color: #3f4b5f; }
.contract-builder { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.builder-main { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.form-section { padding: 27px 28px 30px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section > header { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; }
.form-section > header > span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #eaf1ff; color: var(--blue-dark); font-size: 11px; font-weight: 850; }
.form-section h2 { margin: 1px 0 0; color: var(--navy); font-size: 18px; }
.form-section header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; gap: 17px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-span-2 { grid-column: span 2; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.choice-item, .identity-item { position: relative; }
.choice-item input, .identity-item input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-item > span, .identity-item > span { display: grid; gap: 4px; min-height: 70px; align-content: center; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.choice-item b, .identity-item b { font-size: 13px; }
.choice-item small, .identity-item small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.choice-item input:checked + span, .identity-item input:checked + span { border-color: var(--blue); background: #f3f7ff; box-shadow: inset 0 0 0 1px var(--blue); }
.choice-item input:focus-visible + span, .identity-item input:focus-visible + span { outline: 3px solid rgba(31,100,240,.25); outline-offset: 2px; }
.single-method { display: grid; gap: 4px; border: 1px solid #cbd8ef; border-radius: 9px; padding: 14px; background: #f4f7fd; }
.single-method strong { color: var(--navy); font-size: 13px; }
.single-method span, .method-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.method-note { margin: 13px 0 0; }
.identity-options { display: grid; gap: 8px; margin: 18px 0 0; border: 0; padding: 0; }
.identity-options legend { margin-bottom: 9px; color: #344157; font-size: 12px; font-weight: 750; }
.builder-aside { position: sticky; top: 84px; display: grid; gap: 12px; }
.live-summary { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; }
.live-summary header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.live-summary header span { color: var(--muted); font-size: 12px; }
.live-summary header strong { color: var(--blue-dark); font-size: 12px; }
.live-summary dl { margin: 7px 0 0; }
.live-summary dl div { display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid #edf0f4; }
.live-summary dt { color: var(--muted); font-size: 11px; }
.live-summary dd { overflow-wrap: anywhere; margin: 0; color: #344157; text-align: right; font-size: 12px; font-weight: 700; line-height: 1.45; }
.live-summary > p { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.confirm-dialog { width: min(calc(100% - 32px), 540px); max-height: calc(100vh - 40px); border: 0; border-radius: 15px; padding: 0; background: transparent; box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: rgba(10, 19, 34, .55); backdrop-filter: blur(3px); }
.confirm-dialog[open] { animation: dialog-in .2s ease both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.confirm-dialog__surface { padding: 25px; background: #fff; }
.confirm-dialog header > span { color: var(--blue); font-size: 11px; font-weight: 800; }
.confirm-dialog h2 { margin: 7px 0 7px; color: var(--navy); font-size: 23px; letter-spacing: -.035em; }
.confirm-dialog header p { margin: 0; color: var(--muted); font-size: 12px; }
.confirm-dialog dl { margin: 21px 0; border-top: 1px solid var(--line); }
.confirm-dialog dl div { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.confirm-dialog dt { color: var(--muted); font-size: 12px; }
.confirm-dialog dd { margin: 0; text-align: right; font-size: 13px; font-weight: 700; line-height: 1.45; }
.confirm-dialog__actions { display: grid; grid-template-columns: 1fr 1.7fr; gap: 9px; }

/* Contract detail */
.detail-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.detail-title-line { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.detail-title-line > span:last-child:not(.status) { color: var(--muted); font-size: 12px; }
.detail-hero h1 { margin: 0; color: var(--navy); font-size: clamp(25px, 3vw, 35px); letter-spacing: -.045em; }
.detail-hero p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-actions form { margin: 0; }
.notice-banner { margin-bottom: 14px; border-left: 3px solid var(--blue); padding: 13px 15px; background: #edf3ff; color: #244778; font-size: 13px; font-weight: 700; }
.delivery-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin-bottom: 14px; }
.delivery-result { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: #fff; }
.delivery-result span { color: var(--muted); font-size: 11px; }
.delivery-result strong { grid-column: 2; grid-row: 1; font-size: 12px; }
.delivery-result small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; line-height: 1.4; }
.delivery-result--sent strong { color: var(--green); }
.delivery-result--failed { border-color: #edbec6; background: #fff7f8; }
.delivery-result--failed strong { color: var(--red); }
.delivery-result--preview strong, .delivery-result--ready strong { color: var(--amber); }
.secure-link-panel { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; margin-bottom: 18px; border-radius: var(--radius); padding: 17px 19px; background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.secure-link-panel span, .secure-link-panel strong { display: block; }
.secure-link-panel span { color: #a8b6ca; font-size: 11px; }
.secure-link-panel strong { margin-top: 4px; font-size: 13px; }
.copy-row { display: flex; min-width: 0; }
.copy-row input { min-width: 0; flex: 1; border: 0; border-radius: 7px 0 0 7px; padding: 11px; background: #fff; color: var(--ink); font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.copy-row button { min-width: 92px; border: 0; border-radius: 0 7px 7px 0; padding: 0 13px; background: var(--blue); color: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.detail-primary, .detail-secondary { display: grid; gap: 15px; }
.detail-section, .side-section { border: 1px solid var(--line); border-radius: var(--radius); padding: 21px; background: #fff; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.section-heading a { color: var(--blue-dark); font-size: 12px; font-weight: 750; }
.detail-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.detail-facts div { min-height: 74px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 14px; }
.detail-facts .fact-wide { grid-column: span 2; }
.detail-facts dt { color: var(--muted); font-size: 11px; }
.detail-facts dd { margin: 7px 0 0; font-size: 13px; font-weight: 700; line-height: 1.45; }
.detail-facts .fact-amount dd { color: var(--navy); font-size: 16px; }
.audit-proof { border-radius: 99px; padding: 5px 8px; background: var(--red-soft); color: var(--red); font-size: 12px; font-weight: 800; }
.audit-proof.is-ok { background: var(--green-soft); color: var(--green); }
.timeline { position: relative; display: grid; }
.timeline::before { content: ""; position: absolute; top: 7px; bottom: 9px; left: 5px; width: 1px; background: var(--line); }
.timeline article { position: relative; display: grid; grid-template-columns: 11px 1fr; gap: 12px; padding: 0 0 17px; }
.timeline article:last-child { padding-bottom: 0; }
.timeline article > i { z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.timeline article > div { display: grid; gap: 3px; }
.timeline strong { font-size: 12px; }
.timeline span { color: var(--muted); font-size: 11px; }
.next-action { border-top: 3px solid var(--blue); }
.next-action > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.next-action h2 { margin: 7px 0 6px; font-size: 18px; line-height: 1.35; }
.next-action > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.next-action--signed { border-top-color: var(--green); }
.next-action--expired, .next-action--canceled { border-top-color: var(--red); }
.next-action dl { margin: 17px 0 0; border-top: 1px solid var(--line); }
.next-action dl div { display: flex; justify-content: space-between; gap: 8px; padding-top: 9px; }
.next-action dt, .next-action dd { margin: 0; font-size: 11px; }
.next-action dt { color: var(--muted); }
.next-action dd { font-weight: 700; }
.disclosure-section { padding: 0; overflow: hidden; }
.disclosure-section > summary { display: flex; min-height: 50px; align-items: center; justify-content: space-between; padding: 0 17px; cursor: pointer; color: var(--navy); font-size: 13px; font-weight: 750; list-style: none; }
.disclosure-section > summary::-webkit-details-marker { display: none; }
.disclosure-section > summary::after { content: "+"; color: var(--muted); font-size: 19px; font-weight: 400; }
.disclosure-section[open] > summary { border-bottom: 1px solid var(--line); }
.disclosure-section[open] > summary::after { content: "−"; }
.disclosure-section > summary span { display: grid; min-width: 24px; height: 24px; place-items: center; border-radius: 99px; background: #edf0f4; color: var(--muted); font-size: 11px; }
.delivery-list, .technical-facts { display: grid; gap: 0; margin: 0; padding: 14px 17px 17px; }
.delivery-list > div { display: grid; gap: 3px; border-bottom: 1px solid var(--line); padding: 9px 0; }
.delivery-list > div:last-child { border-bottom: 0; }
.delivery-list strong { font-size: 11px; }
.delivery-list span, .delivery-list small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.technical-facts div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; padding: 8px 0; }
.technical-facts dt { color: var(--muted); font-size: 11px; }
.technical-facts dd { overflow-wrap: anywhere; margin: 0; font-size: 11px; font-weight: 700; }
.danger-zone > p { margin: 14px 17px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.danger-zone form { display: grid; gap: 10px; padding: 14px 17px 17px; }
.danger-button { min-height: 42px; border: 1px solid #d998a3; border-radius: 8px; background: #fff; color: var(--red); cursor: pointer; font-size: 12px; font-weight: 800; }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: var(--navy); }
.login-shell { width: min(100%, 430px); border-radius: 16px; background: #fff; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.24); }
.login-brand { display: flex; align-items: center; justify-content: space-between; padding: 23px 25px; background: var(--navy-2); color: #fff; }
.login-brand > span { color: #aebbcf; font-size: 12px; font-weight: 700; }
.login-form { padding: 31px 30px 27px; }
.login-form h1 { margin: 0; color: var(--navy); font-size: 29px; letter-spacing: -.045em; }
.form-lead { margin: 8px 0 24px; color: var(--muted); font-size: 13px; }
.login-form .field-label { margin-bottom: 15px; }
.login-form .button { margin-top: 4px; }
.login-foot { margin: 0; border-top: 1px solid var(--line); padding: 14px; color: var(--muted); text-align: center; font-size: 11px; }

/* Customer signing */
.sign-body { min-height: 100vh; background: #eef1f5; }
.sign-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 max(18px, calc((100vw - 740px) / 2)); background: var(--navy); color: #fff; }
.sign-header .brand-lockup { color: #fff; font-size: 21px; }
.sign-header .brand-lockup small { color: #a9b7ca; }
.sign-recipient { display: grid; gap: 2px; text-align: right; }
.sign-recipient strong { font-size: 12px; }
.sign-recipient span { color: #aebbcf; font-size: 11px; }
.sign-main { width: min(100%, 740px); margin: 0 auto; padding: 22px 16px 50px; }
.sign-progress-wrap { margin-bottom: 13px; }
.sign-progress-copy { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.sign-progress-copy strong { color: var(--ink); }
.sign-progress { height: 4px; border-radius: 99px; background: #d3dae4; overflow: hidden; }
.sign-progress i { display: block; width: 33.333%; height: 100%; border-radius: inherit; background: var(--blue); transition: width .3s cubic-bezier(.2,.8,.2,1); }
#sign-contract-form { border: 1px solid #d8dee8; border-radius: 15px; background: #fff; box-shadow: 0 20px 55px rgba(18,33,59,.08); overflow: hidden; }
.sign-step { padding: clamp(25px, 5vw, 40px); animation: step-in .28s ease both; }
@keyframes step-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.step-heading { margin-bottom: 24px; }
.step-heading > span { color: var(--blue-dark); font-size: 11px; font-weight: 800; }
.step-heading h1 { max-width: 600px; margin: 7px 0 8px; color: var(--navy); font-size: clamp(25px, 5vw, 35px); letter-spacing: -.05em; line-height: 1.18; }
.step-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.fraud-alert { display: grid; gap: 6px; border-left: 4px solid #ef4056; border-radius: 9px; padding: 17px 18px; background: #161d29; color: #fff; }
.fraud-alert strong { font-size: 14px; }
.fraud-alert span { color: #c7ced9; font-size: 12px; line-height: 1.55; }
.fraud-list { display: grid; margin: 16px 0; border-top: 1px solid var(--line); padding: 0; list-style: none; }
.fraud-list li { position: relative; border-bottom: 1px solid var(--line); padding: 13px 10px 13px 25px; font-size: 13px; line-height: 1.5; }
.fraud-list li::before { content: ""; position: absolute; left: 8px; top: 20px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.risk-check { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0 0 12px; border: 0; padding: 0; }
.risk-check legend { grid-column: 1 / -1; margin-bottom: 8px; color: #344157; font-size: 13px; font-weight: 750; }
.risk-check label { position: relative; }
.risk-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.risk-check label > span { display: grid; min-height: 72px; align-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; cursor: pointer; }
.risk-check b { font-size: 13px; }
.risk-check small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.risk-check input:checked + span { border-color: var(--blue); background: #f3f7ff; box-shadow: inset 0 0 0 1px var(--blue); }
.risk-check label:last-child input:checked + span { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.risk-check input:focus-visible + span { outline: 3px solid rgba(31,100,240,.25); outline-offset: 2px; }
.risk-stop { display: grid; gap: 4px; margin: 0 0 12px; border: 1px solid #e5a5af; border-radius: 9px; padding: 14px; background: #fff3f5; color: #8d2032; }
.risk-stop strong { font-size: 13px; }
.risk-stop span { font-size: 12px; line-height: 1.5; }
.risk-stop a { text-decoration: underline; font-weight: 750; }
.consent-row { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 11px; align-items: start; border: 1px solid var(--line); border-radius: 10px; padding: 15px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.consent-row:has(input:checked) { border-color: var(--blue); background: #f4f7ff; }
.consent-row input { appearance: none; width: 21px; height: 21px; margin: 0; border: 1.5px solid #9faabc; border-radius: 5px; background: #fff; cursor: pointer; }
.consent-row input:checked { border-color: var(--blue); background: var(--blue); }
.consent-row input:checked::after { content: ""; display: block; width: 8px; height: 4px; margin: 5px 0 0 4px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.consent-row b, .consent-row small { display: block; }
.consent-row b { font-size: 13px; line-height: 1.45; }
.consent-row small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.consent-row--dark { border-color: var(--navy); background: var(--navy); color: #fff; }
.consent-row--dark:has(input:checked) { border-color: #4d86fa; background: var(--navy-2); }
.consent-row--dark small { color: #bec9d8; }
.sign-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 14px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.sign-facts div { min-height: 77px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px; }
.sign-facts dt { color: var(--muted); font-size: 11px; }
.sign-facts dd { margin: 7px 0 0; color: var(--navy); font-size: 14px; font-weight: 750; line-height: 1.45; }
.correction-note { display: grid; gap: 3px; margin-bottom: 14px; border-left: 3px solid var(--amber); padding: 11px 13px; background: #fff8eb; }
.correction-note strong { font-size: 12px; }
.correction-note span { color: #67532f; font-size: 12px; line-height: 1.5; }
.correction-note a { text-decoration: underline; font-weight: 750; }
.legal-disclosure { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.legal-disclosure > summary { display: flex; min-height: 60px; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 15px; background: #fafbfc; cursor: pointer; list-style: none; }
.legal-disclosure > summary::-webkit-details-marker { display: none; }
.legal-disclosure > summary::after { content: "자세히"; color: var(--blue-dark); font-size: 11px; font-weight: 800; }
.legal-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.legal-disclosure[open] > summary::after { content: "접기"; }
.legal-disclosure summary span { display: grid; gap: 3px; }
.legal-disclosure summary strong { font-size: 13px; }
.legal-disclosure summary small { color: var(--muted); font-size: 11px; }
.legal-disclosure__body, .terms-content { padding: 17px; }
.legal-disclosure__body > p { margin: 0 0 12px; color: #4f5c70; font-size: 12px; line-height: 1.65; }
.legal-disclosure__body dl { margin: 0; border-top: 1px solid var(--line); }
.legal-disclosure__body dl div { display: grid; grid-template-columns: 105px 1fr; gap: 10px; border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 12px; }
.legal-disclosure__body dt { color: var(--muted); }
.legal-disclosure__body dd { margin: 0; font-weight: 650; line-height: 1.45; }
.legal-disclosure__body ul { margin: 0; padding-left: 19px; color: #4e5a6d; font-size: 12px; line-height: 1.7; }
.process-note { margin-top: 13px !important; border-radius: 7px; padding: 10px; background: #f1f4f8; color: #536075 !important; }
.legal-disclosure--compact { margin-top: 12px; }
.compact-contract-summary { display: grid; grid-template-columns: 1fr auto; gap: 4px 15px; margin-bottom: 13px; border-radius: 9px; padding: 14px 15px; background: var(--navy); color: #fff; }
.compact-contract-summary span { font-size: 13px; font-weight: 700; }
.compact-contract-summary strong { grid-row: span 2; align-self: center; font-size: 17px; }
.compact-contract-summary small { color: #bdc7d6; font-size: 11px; }
.terms-content { max-height: 360px; overflow-y: auto; }
.terms-content article { margin-bottom: 20px; }
.terms-content article:last-child { margin-bottom: 0; }
.terms-content h2 { margin: 0 0 8px; color: var(--navy); font-size: 13px; }
.terms-content p { margin: 0 0 7px; color: #4d596c; font-size: 12px; line-height: 1.65; }
.signer-fields { display: grid; grid-template-columns: 1.2fr 1fr .8fr; gap: 12px; margin: 18px 0; }
.gender-field { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; min-width: 0; margin: 0; border: 0; padding: 0; }
.gender-field legend { grid-column: span 2; margin-bottom: 7px; color: #344157; font-size: 12px; font-weight: 750; }
.gender-field label { display: flex; min-height: 46px; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; }
.gender-field label:has(input:checked) { border-color: var(--blue); background: #f2f6ff; color: var(--blue-dark); }
.signature-block { margin: 17px 0; border: 1px solid var(--line); border-radius: 10px; padding: 15px; }
.signature-block.has-error { border-color: var(--red); background: #fffafb; }
.signature-block > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.signature-block h2 { margin: 0; color: var(--navy); font-size: 14px; }
.signature-block > div > span { display: flex; gap: 6px; }
.signature-block button { min-height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; background: #fff; color: var(--blue-dark); cursor: pointer; font-size: 11px; font-weight: 750; }
#signature-canvas { display: block; width: 100%; height: 175px; border: 1px dashed #9ca8ba; border-radius: 8px; background: #fbfcfe; cursor: crosshair; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.signature-block > p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.signature-block .field-error { color: var(--red); font-weight: 700; }
.consent-row--final { margin-top: 13px; }
.document-download-link { display: block; min-height: 44px; margin-top: 8px; padding: 13px; color: var(--blue-dark); text-align: center; font-size: 12px; font-weight: 750; }
.sign-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding: 13px clamp(18px, 5vw, 40px); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.sign-footer .button { min-width: 120px; }
.sign-legal { max-width: 650px; margin: 15px auto 0; color: #5d687a; text-align: center; font-size: 11px; line-height: 1.55; }
.sign-legal a { color: var(--blue-dark); text-decoration: underline; font-weight: 700; }

.completion-shell, .unavailable-shell { width: min(calc(100% - 32px), 560px); min-height: 500px; display: grid; justify-items: center; align-content: center; margin: 45px auto; border: 1px solid var(--line); border-radius: 18px; padding: 40px; background: #fff; text-align: center; box-shadow: var(--shadow); }
.complete-mark { display: grid; min-width: 70px; height: 70px; place-items: center; margin-bottom: 20px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 850; animation: complete-pop .45s cubic-bezier(.2,.9,.2,1.15) both; }
@keyframes complete-pop { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: scale(1); } }
.completion-shell h1, .unavailable-shell h1 { margin: 0 0 8px; color: var(--navy); font-size: clamp(27px, 5vw, 37px); letter-spacing: -.05em; }
.completion-shell > p, .unavailable-shell > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.completion-shell dl { width: 100%; margin: 25px 0; border-top: 1px solid var(--line); }
.completion-shell dl div { display: grid; grid-template-columns: 95px 1fr; gap: 10px; border-bottom: 1px solid var(--line); padding: 11px 0; text-align: left; }
.completion-shell dt { color: var(--muted); font-size: 12px; }
.completion-shell dd { margin: 0; font-size: 12px; font-weight: 750; line-height: 1.45; }
.completion-shell > small, .unavailable-shell > small { margin: 13px 0 25px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.error-code { display: block; margin: 22px 0 10px; color: var(--blue); font-family: ui-monospace, monospace; font-size: 34px; font-weight: 850; }

@media (max-width: 1080px) {
  .contract-builder { grid-template-columns: 1fr; }
  .builder-aside { position: static; grid-template-columns: minmax(0, 1fr) 260px; align-items: end; }
  .live-summary { grid-row: span 2; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 285px; }
}

@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 188px minmax(0,1fr); }
  .admin-sidebar { width: 188px; }
  .admin-content { padding: 28px 22px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-secondary { grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; }
  .next-action { grid-row: span 2; }
}

@media (max-width: 760px) {
  body.menu-open { overflow: hidden; }
  .admin-layout { display: block; }
  .admin-sidebar { width: min(82vw, 290px); transform: translateX(-103%); transition: transform .22s ease; }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-main { min-height: 100vh; }
  .admin-topbar { height: 60px; padding: 0 15px; }
  .mobile-menu { display: inline-flex; align-items: center; }
  .admin-topbar > strong { margin-right: auto; margin-left: 11px; }
  .operator-chip { width: 30px; height: 30px; }
  .admin-content { padding: 22px 14px 36px; }
  .page-heading, .detail-hero { flex-direction: column; align-items: stretch; }
  .page-heading { margin-bottom: 19px; }
  .page-heading .button { width: 100%; }
  .status-tab { padding: 11px 13px; }
  .surface-toolbar { align-items: stretch; flex-direction: column; }
  .search-form { min-width: 100%; }
  .contracts-table, .contracts-table tbody, .contracts-table tr, .contracts-table td { display: block; width: 100%; }
  .contracts-table thead { display: none; }
  .contracts-table tr { border-bottom: 1px solid var(--line); padding: 13px 15px; }
  .contracts-table tr:last-child { border-bottom: 0; }
  .contracts-table td { display: grid; grid-template-columns: 88px 1fr; align-items: center; border: 0; padding: 6px 0; }
  .contracts-table td:first-child { min-width: 0; display: block; padding-bottom: 10px; }
  .contracts-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 11px; }
  .contracts-table td small { margin: 3px 0 0 88px; }
  .form-grid--2, .choice-grid { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: auto; }
  .form-section { padding: 23px 18px 25px; }
  .builder-aside { display: grid; grid-template-columns: 1fr; }
  .live-summary { grid-row: auto; }
  .confirm-dialog__surface { padding: 21px; }
  .confirm-dialog__actions { grid-template-columns: 1fr; }
  .detail-actions .button, .detail-actions form { flex: 1; }
  .detail-actions form .button { width: 100%; }
  .secure-link-panel { grid-template-columns: 1fr; }
  .detail-facts { grid-template-columns: 1fr; }
  .detail-facts .fact-wide { grid-column: auto; }
  .detail-secondary { grid-template-columns: 1fr; }
  .next-action { grid-row: auto; }
  .login-page { padding: 15px; }
  .login-form { padding: 27px 22px 23px; }
  .sign-header { min-height: 64px; padding: 0 16px; }
  .sign-header .brand-lockup small { display: none; }
  .sign-recipient span { display: none; }
  .sign-main { padding: 17px 10px 38px; }
  #sign-contract-form { border-radius: 12px; }
  .sign-step { padding: 25px 18px; }
  .risk-check, .sign-facts, .signer-fields { grid-template-columns: 1fr; }
  .legal-disclosure__body dl div { grid-template-columns: 88px 1fr; }
  .gender-field { min-height: 70px; }
  .signature-block > div { align-items: flex-start; flex-direction: column; }
  .signature-block > div > span { width: 100%; }
  .signature-block button { flex: 1; }
  .sign-footer { padding: 11px 13px max(11px, env(safe-area-inset-bottom)); }
  .sign-footer .button { flex: 1; min-width: 0; }
  .completion-shell, .unavailable-shell { min-height: calc(100vh - 32px); margin: 16px auto; border-radius: 14px; padding: 30px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* PASS identity verification */
.identity-badge { display: flex; flex-direction: column; gap: 2px; margin: 0 0 16px; border: 1px solid #bfe3c8; border-radius: 10px; padding: 12px 16px; background: #f0faf2; }
.identity-badge b { color: #176b33; font-size: 13.5px; }
.identity-badge span { color: #3c5a46; font-size: 12px; }
