/* SignPen 대시보드 (/app) — ui.css 토큰 위에 얹는다 */
html, body { height: 100%; }
body { overflow-x: hidden; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#view { flex: 1; outline: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 32px 32px 64px; }
.page-narrow { max-width: 860px; }

/* ── 사이드바 ── */
.side { width: 252px; flex: none; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; padding: 18px 14px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 60; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 4px; }
.side .side-close { display: none; }
.ws-box { position: relative; }
.ws-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; text-align: left; }
.ws-btn:hover { border-color: #cfd4de; }
.ws-btn[disabled] { cursor: default; }
.ws-btn[disabled]:hover { border-color: var(--line); }
.ws-avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13.5px; flex: none; }
.ws-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-sub { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.plan-chip { font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); }
.plan-chip.free { background: var(--line-2); color: var(--muted); }
.dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 80; }
.dropdown.up { top: auto; bottom: calc(100% + 6px); }
.dropdown button, .dropdown a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; text-align: left; font-size: 14px; text-decoration: none; color: var(--ink); }
.dropdown button:hover, .dropdown a:hover { background: var(--bg-2); }
.dropdown .on { font-weight: 700; }
.dropdown .on::after { content: '✓'; margin-left: auto; color: var(--good); }
.dropdown hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }
.dropdown .dd-head { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); }
.new-btn { height: 44px; }
.nav { display: grid; gap: 2px; margin-top: 4px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.nav a .ico { width: 20px; height: 20px; flex: none; opacity: 0.78; }
.gl { display: inline-block; font-style: normal; line-height: 1; font-size: 15px; font-weight: 700; }
.gl-lg { font-size: 22px; font-weight: 500; }
.ico { display: inline-block; flex: none; object-fit: contain; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.active { background: var(--bg-2); color: var(--ink); }
.nav a.active .ico, .nav a:hover .ico { opacity: 1; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.credit-box { display: block; text-decoration: none; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-2); }
.credit-box:hover { border-color: var(--line); }
.credit-box .k { font-size: 12px; color: var(--muted); }
.credit-box .v { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.credit-box .v small { font-size: 12.5px; color: var(--accent); font-weight: 700; margin-left: 6px; }
.credit-box.low .v { color: var(--bad); }
.user-box { position: relative; }
.user-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; }
.user-btn:hover { background: var(--bg); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-2); color: var(--ink-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user-btn .nm { font-weight: 700; font-size: 13.5px; }
.user-btn .em { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }

.topbar { display: none; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 0; background: none; cursor: pointer; color: var(--ink); flex: none; }
.icon-btn:hover { background: var(--bg-2); }
.side-scrim { display: none; }

/* 집중 모드 (문서 작성 마법사) */
body.focus .side, body.focus .topbar, body.focus .side-scrim { display: none !important; }

/* ── 공용 ── */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ph h1 { font-size: 26px; letter-spacing: -0.03em; line-height: 1.25; }
.ph .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.sec-title { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.stack { display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.pill-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #cfd4de; display: inline-block; }
.dot.s-sent, .dot.s-waiting { background: #9db8d8; }
.dot.s-viewed { background: var(--warn); }
.dot.s-signed { background: var(--good); }
.dot.s-declined { background: var(--bad); }
.dot.s-cc { background: transparent; border: 1.5px solid #cfd4de; }
.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row .input { font-family: var(--mono); font-size: 13px; }
pre.code { background: #0f1830; color: #dfe6f5; border-radius: 12px; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; max-width: 100%; }
pre.code .c { color: #7d8bb0; }
.link { color: var(--info); text-decoration: none; font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; }
.card > .table th:first-child, .card > .table td:first-child, .table-wrap .table th:first-child, .table-wrap .table td:first-child { padding-left: 20px; }
.err-list { margin: 8px 0 0 18px; font-size: 13.5px; display: grid; gap: 4px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--bg-2); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.var { font-family: var(--mono); font-size: 11.5px; background: var(--info-soft); color: var(--info); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .tr { width: 38px; height: 22px; border-radius: 999px; background: #cfd4de; position: relative; transition: background 0.15s; flex: none; }
.switch .tr::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.switch input:checked + .tr { background: var(--ink); }
.switch input:checked + .tr::after { transform: translateX(16px); }
.switch input:focus-visible + .tr { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 33, 61, 0.1); }

/* ── 문서함 ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { border: 0; background: none; height: 42px; padding: 0 12px; font-weight: 600; font-size: 14.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.tabs button:hover, .tabs a:hover { color: var(--ink); }
.tabs .on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .n { font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--muted); border-radius: 999px; padding: 1px 7px; }
.tabs .on .n { background: var(--ink); color: #fff; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search .input { padding-left: 14px; height: 40px; font-size: 14px; }
.doc-title { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.doc-sub { font-size: 12.5px; color: var(--muted); }
.env-cards { display: none; }
.env-card { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line-2); text-decoration: none; }
.env-card:last-child { border-bottom: 0; }
.env-card .t { font-weight: 700; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.env-card .t span:first-child { min-width: 0; overflow-wrap: anywhere; }
.env-card .m { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 16px; align-items: center; }
.empty-ill { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; color: var(--ink-2); }

/* ── 마법사 ── */
.wz { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.wz-head { position: sticky; top: 0; z-index: 50; background: var(--card); border-bottom: 1px solid var(--line); height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.wz-title { font-weight: 800; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.steps { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.step { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; font-weight: 700; font-size: 14px; color: var(--faint); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.step:disabled { cursor: default; }
.step i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 12.5px; }
.step.on { color: var(--ink); }
.step.on i { background: var(--ink); border-color: var(--ink); color: #fff; }
.step.done { color: var(--ink-2); }
.step.done i { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.step-sep { width: 24px; height: 1.5px; background: var(--line); }
.wz-actions { display: flex; gap: 8px; align-items: center; }
.wz-body { flex: 1; min-height: 0; }
.wz-pad { max-width: 860px; margin: 0 auto; padding: 32px 24px 120px; }
.wz-foot { position: sticky; bottom: 0; z-index: 40; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.wz-foot .r { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.wz h2 { font-size: 22px; letter-spacing: -0.03em; }
.wz .lead { color: var(--muted); margin-top: 4px; font-size: 14.5px; }

.drop { display: block; margin-top: 20px; border: 2px dashed #cfd4de; border-radius: var(--radius-lg); background: var(--card); padding: 44px 20px; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.drop:hover, .drop.over { border-color: var(--ink-2); background: #fdfcf9; }
.drop .ic { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 14px; }
.drop b { font-size: 17px; display: block; }
.drop .hint { margin-top: 6px; }
.files { display: grid; gap: 8px; margin-top: 16px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.file-row .fi { width: 36px; height: 44px; border-radius: 6px; background: var(--bg-2); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--accent); flex: none; position: relative; overflow: hidden; }
.file-row .nm { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .st { font-size: 12.5px; color: var(--muted); }
.file-row .st.bad { color: var(--bad); }
.file-row .acts { display: flex; gap: 2px; margin-left: auto; flex: none; }
.progress { height: 4px; background: var(--line-2); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--ink); width: 0; transition: width 0.2s; }

.rcp-list { display: grid; gap: 10px; margin-top: 16px; }
.rcp { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; border-left: 4px solid var(--c, var(--line)); }
.rcp-order { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 6px; }
.rcp-order .no { width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; }
.rcp-order .mv { width: 26px; height: 22px; border: 0; background: none; cursor: pointer; color: var(--faint); border-radius: 6px; display: grid; place-items: center; }
.rcp-order .mv:hover:not(:disabled) { background: var(--bg-2); color: var(--ink); }
.rcp-order .mv:disabled { opacity: 0.3; cursor: default; }
.rcp-main { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; min-width: 0; }
.rcp-opts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rcp-opts .select { width: auto; height: 36px; font-size: 13.5px; padding: 0 30px 0 10px; }
.rcp-opts .input { width: 160px; }
.rcp.dragging { opacity: 0.5; }
.rcp.drop-above { box-shadow: 0 -3px 0 var(--accent); }
.handle { cursor: grab; color: var(--faint); }
.opt-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-top: 16px; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.add-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ── 필드 배치 에디터 ── */
.wz:has(.ed) { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.wz-body:has(.ed) { display: flex; flex-direction: column; overflow: hidden; }
.ed { display: grid; grid-template-columns: 252px minmax(0, 1fr) 284px; flex: 1; min-height: 0; }
.ed-left, .ed-right { background: var(--card); overflow-y: auto; padding: 16px 14px; }
.ed-left { border-right: 1px solid var(--line); }
.ed-right { border-left: 1px solid var(--line); }
.ed-h { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; margin: 2px 2px 8px; }
.who { display: grid; gap: 4px; margin-bottom: 18px; }
.who button { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid transparent; background: none; cursor: pointer; text-align: left; font-size: 13.5px; font-weight: 600; min-width: 0; }
.who button:hover { background: var(--bg); }
.who button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, white); }
.who .sw { width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; }
.who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.who .cnt { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.who .cnt.zero { color: var(--bad); }
.palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pal { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: grab; font-size: 13.5px; font-weight: 600; touch-action: none; user-select: none; }
.pal:hover { border-color: var(--c, var(--ink-2)); }
.pal.armed { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); }
.pal:disabled { opacity: 0.4; cursor: not-allowed; }
.pal .ico { width: 18px; height: 18px; }
.ed-tip { margin-top: 16px; font-size: 12.5px; color: var(--muted); line-height: 1.6; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.ed-tip kbd { font-family: var(--mono); font-size: 11px; background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; }
.ed-center { overflow: auto; background: #e9e8e3; padding: 24px; position: relative; }
.ed-center.armed .pg-layer { cursor: crosshair; }
.doc-label { max-width: 820px; margin: 0 auto 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.doc-label:not(:first-child) { margin-top: 28px; }
.pg { position: relative; max-width: 820px; margin: 0 auto 16px; background: #fff; box-shadow: 0 1px 3px rgba(20, 33, 61, 0.12), 0 6px 18px -8px rgba(20, 33, 61, 0.2); }
.pg canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pg .pg-no { position: absolute; right: -2px; bottom: -22px; font-size: 11.5px; color: var(--muted); }
.pg-layer { position: absolute; inset: 0; }
.pg-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 13px; }
.fld { position: absolute; border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border-radius: 4px; cursor: move; touch-action: none; user-select: none; display: flex; align-items: center; justify-content: center; min-width: 8px; min-height: 8px; container-type: size; }
.fld .ft { font-size: clamp(8px, 40cqh, 13px); font-weight: 700; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; pointer-events: none; display: flex; align-items: center; gap: 4px; max-width: 100%; }
.fld .ft .ico { width: 1.25em; height: 1.25em; }
.fld.req::after { content: '*'; position: absolute; right: 3px; top: -1px; color: var(--c); font-weight: 800; font-size: 12px; line-height: 1; }
.fld.prefill { border-style: dashed; }
.fld.prefill .ft { color: var(--ink); font-weight: 600; }
.fld.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); z-index: 5; }
.fld .rz { position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; border-radius: 4px; background: #fff; border: 2px solid var(--c); cursor: nwse-resize; display: none; touch-action: none; }
.fld .x { position: absolute; right: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; border: 2px solid #fff; display: none; place-items: center; cursor: pointer; font-size: 11px; line-height: 1; padding: 0; }
.fld.sel .rz { display: block; }
.fld.sel .x { display: grid; }
.ghost { position: fixed; z-index: 999; pointer-events: none; border: 1.5px dashed var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--c); }
.props .ptype { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 14px; }
.props .ptype .sw { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.props .field + .field { margin-top: 12px; }
.props .input, .props .select { height: 38px; font-size: 14px; }
.props .actions { display: flex; gap: 6px; margin-top: 16px; }
.sum-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.sum-row:last-child { border-bottom: 0; }
.sum-row .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.sum-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-mobilebar { display: none; }

/* 검토 모달 */
.review { display: grid; gap: 12px; font-size: 14px; }
.review .box { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.review .cost { display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: #fff; border-radius: 12px; padding: 14px 16px; font-weight: 700; }
.review .cost small { color: #b9c2d6; font-weight: 500; }

/* ── 상세 ── */
.det { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.det-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.det-head h1 { font-size: 24px; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.det-head .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.det-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rcp-item { padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.rcp-item:last-child { border-bottom: 0; }
.rcp-item .top { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.rcp-item .who2 { display: flex; gap: 10px; align-items: center; min-width: 0; }
.rcp-item .who2 .nm { font-weight: 700; }
.rcp-item .who2 .em { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.rcp-item .times { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 12.5px; color: var(--muted); margin-top: 10px; padding-left: 42px; }
.rcp-item .times b { color: var(--ink-2); font-weight: 600; }
.rcp-item .ra { display: flex; gap: 4px; margin-top: 8px; padding-left: 34px; flex-wrap: wrap; }
.ord { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); font-weight: 800; font-size: 13px; color: var(--ink-2); flex: none; }
.ord.signed { background: var(--good-soft); color: var(--good); }
.ord.declined { background: var(--bad-soft); color: var(--bad); }
.timeline { list-style: none; padding: 6px 18px 14px; }
.timeline li { position: relative; padding: 10px 0 10px 22px; border-left: 1.5px solid var(--line); margin-left: 5px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink-2); }
.timeline li.ok::before { border-color: var(--good); background: var(--good); }
.timeline li.bad::before { border-color: var(--bad); }
.timeline li:last-child { border-left-color: transparent; }
.timeline .tl-l { font-weight: 700; }
.timeline .tl-m { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.chain { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.chain.ok { background: var(--good-soft); color: var(--good); }
.chain.bad { background: var(--bad-soft); color: var(--bad); }
.viewer { background: #e9e8e3; border-radius: var(--radius-lg); padding: 16px; }
.viewer .pg { margin-bottom: 12px; }
.viewer .vfld { position: absolute; border: 1.5px dashed rgba(43, 108, 176, 0.6); background: rgba(43, 108, 176, 0.06); border-radius: 3px; pointer-events: none; }
.hash { font-family: var(--mono); font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }

/* ── 템플릿 ── */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tpl { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.tpl:hover { border-color: #cfd4de; box-shadow: var(--shadow); }
.tpl h3 { font-size: 16px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.tpl .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tpl .foot { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; align-items: center; }
.csv-preview { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.csv-preview .table td, .csv-preview .table th { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
.ok-cell { color: var(--good); font-weight: 700; }
.bad-cell { color: var(--bad); }

/* ── 설정 ── */
.set-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.set-nav { display: grid; gap: 2px; position: sticky; top: 24px; }
.set-nav a { padding: 9px 12px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.set-nav a:hover { background: var(--bg-2); }
.set-nav a.on { background: var(--ink); color: #fff; }
.set-sec { padding: 22px 24px; }
.set-sec + .set-sec { border-top: 1px solid var(--line-2); }
.set-sec h3 { font-size: 16px; letter-spacing: -0.02em; margin-bottom: 4px; }
.set-sec > .hint:first-of-type { margin-bottom: 16px; }
.form-max { max-width: 440px; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type='color'] { width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; background: var(--card); cursor: pointer; flex: none; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan { border: 1.5px solid var(--line); border-radius: 16px; padding: 18px; background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.plan.cur { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20, 33, 61, 0.08); }
.plan .pn { font-weight: 800; letter-spacing: 0.02em; display: flex; justify-content: space-between; align-items: center; }
.plan .pp { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.plan .pp small { font-size: 13px; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; margin: 4px 0 8px; }
.plan ul li::before { content: '✓'; color: var(--good); font-weight: 800; margin-right: 6px; }
.plan .btn { margin-top: auto; }
.packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pack { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; background: var(--card); text-align: left; cursor: pointer; display: grid; gap: 2px; }
.pack:hover:not(:disabled) { border-color: var(--ink); }
.pack:disabled { cursor: not-allowed; opacity: 0.6; }
.pack .pc { font-size: 18px; font-weight: 800; }
.pack .pa { font-size: 13.5px; font-weight: 700; }
.pack .pv { font-size: 12px; color: var(--muted); }
.big-num { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.terms { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-top: 14px; }
.terms li { margin-left: 16px; }
.ev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.secret-box { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.secret-box code { font-family: var(--mono); font-size: 12.5px; flex: 1; min-width: 0; overflow-wrap: anywhere; }

.center-msg { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.center-msg .spin-lg { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }

/* ── 반응형 ── */
@media (max-width: 1180px) {
  .ed { grid-template-columns: 220px minmax(0, 1fr) 250px; }
  .det { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform 0.2s ease, visibility 0.2s; visibility: hidden; }
  .app.side-open .side { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  .app.side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(20, 33, 61, 0.35); z-index: 55; }
  .side .side-close { display: grid; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 40; height: 56px; padding: 0 10px 0 6px; background: rgba(251, 250, 247, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .topbar .logo { margin-right: auto; font-size: 17px; }
  .page { padding: 22px 16px 56px; }
  .plans { grid-template-columns: 1fr; }
  .packs { grid-template-columns: 1fr 1fr; }
  .set-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .set-nav { position: static; display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .set-nav a { white-space: nowrap; }
  .ed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .ed-left { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; overflow-x: auto; overflow-y: hidden; display: flex; gap: 8px; align-items: center; scrollbar-width: none; }
  .ed-left::-webkit-scrollbar { display: none; }
  .ed-left .ed-h, .ed-left .ed-tip { display: none; }
  .ed-left .who { display: flex; margin: 0; flex: none; }
  .ed-left .who button { white-space: nowrap; padding: 6px 10px; }
  .ed-left .who .nm { max-width: 90px; }
  .ed-left .palette { display: flex; flex: none; }
  .ed-left .pal { height: 36px; white-space: nowrap; touch-action: manipulation; cursor: pointer; }
  .ed-center { padding: 12px 10px 90px; }
  .ed-right { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg); max-height: 62vh; transform: translateY(100%); transition: transform 0.2s ease; }
  .ed-right.open { transform: none; }
  .wz-head { height: 56px; padding: 0 8px; gap: 6px; }
  .wz-title { display: none; }
  .step { padding: 6px 4px; font-size: 13px; }
  .step span { display: none; }
  .step.on span { display: inline; }
  .step-sep { width: 12px; }
}
@media (max-width: 720px) {
  .env-table { display: none; }
  .env-cards { display: block; }
  .grid2, .opt-grid, .ev-grid { grid-template-columns: 1fr; }
  .rcp { grid-template-columns: auto 1fr; }
  .rcp > .rm { grid-column: 2; justify-self: end; margin-top: -4px; }
  .rcp-main { grid-template-columns: 1fr; }
  .ph h1 { font-size: 22px; }
  .det-head h1 { font-size: 20px; }
  .kv { grid-template-columns: 96px 1fr; }
  .wz-pad { padding: 22px 16px 120px; }
  .wz-foot { padding: 10px 12px; }
  .wz-foot .hide-sm { display: none; }
  .set-sec { padding: 18px 16px; }
  .rcp-item { padding: 14px; }
  .rcp-item .times, .rcp-item .ra { padding-left: 0; }
  .table td, .table th { padding: 10px; }
  .hide-sm { display: none !important; }
}
@media (max-width: 400px) {
  .wz-actions .btn-text { display: none; }
  .packs { grid-template-columns: 1fr; }
}
.opt-grid > .field + .field, .grid2 > .field + .field { margin-top: 0; }
.form-link { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-decoration: none; }
.form-link:hover { border-color: var(--ink-2); }
.form-link .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--bg-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.form-link .ic img { width: 28px; height: 28px; }
.danger-zone h3 { color: var(--bad); }
.b-test { background: #f3e8ff; color: #7c3aed; }
.qr-box { display: grid; grid-template-columns: 168px 1fr; gap: 18px; align-items: start; }
.qr-box img { width: 168px; height: 168px; border: 1px solid var(--line); border-radius: 12px; image-rendering: pixelated; background: #fff; }
@media (max-width: 520px) { .qr-box { grid-template-columns: 1fr; justify-items: center; } }
.att-row { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.att-row:last-child { border-bottom: 0; }
.plan-note { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
