@font-face {
  font-family: 'Pretendard Variable';
  src: url('../assets/fonts/PretendardVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* 베뉴 파트너 — 베뉴 브랜드(에메랄드 #0f8854) 기반, 모바일 우선 */
:root {
  --brand: #0f8854;
  --brand-ink: #0a5e3a;
  --brand-soft: #e3f3ea;
  --bg: #FFFEFB;
  --card: #ffffff;
  --ink: #241F1B;
  --muted: #7D736B;
  --line: rgba(47,40,34,.11);
  --red: #e5484d; --red-soft: #fde8e8;
  --amber: #c27c00; --amber-soft: #fff3d6;
  --blue: #3b6fd8; --blue-soft: #e6eefc;
  --green: #0f8854; --green-soft: #e3f3ea;
  --gray: #6b716e; --gray-soft: #eeedea;
  --bride: #c2477a; --bride-soft: #fbe9f1;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111312; --card: #1b1e1c; --ink: #eceeed; --muted: #9aa19d; --line: #2c302e;
    --brand-soft: #143a28; --red-soft: #3a1c1d; --amber-soft: #3a2d10; --blue-soft: #1a2640; --green-soft: #143a28; --gray-soft: #262927; --bride-soft: #3a1d2a;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #111312; --card: #1b1e1c; --ink: #eceeed; --muted: #9aa19d; --line: #2c302e;
  --brand-soft: #143a28; --red-soft: #3a1c1d; --amber-soft: #3a2d10; --blue-soft: #1a2640; --green-soft: #143a28; --gray-soft: #262927; --bride-soft: #3a1d2a;
  --shadow: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  letter-spacing: -0.01em; word-break: keep-all; overflow-wrap: anywhere;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; margin-top: 18px; margin-bottom: 6px; }
p { margin: 0; }
a { color: var(--brand); }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.center { text-align: center; }
.pad { padding: 12px 4px; }
.pre { white-space: pre-wrap; }
.grow { flex: 1; min-width: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.error { color: var(--red); font-size: 13px; min-height: 1em; }

#app { min-height: 100vh; max-width: 720px; margin: 0 auto; }
#app.has-tabs { padding-bottom: calc(68px + var(--safe-bottom)); }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); }
.boot img { border-radius: 16px; }

/* 상단바 */
.demo-bar { background: var(--amber-soft); color: var(--amber); font-size: 12px; text-align: center; padding: calc(4px + var(--safe-top)) 12px 4px; }
.demo-bar + .topbar { padding-top: 8px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--safe-top)) 12px 8px; min-height: 52px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar.preview { background: var(--bride-soft); }
.top-actions { display: flex; gap: 6px; align-items: center; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin: 0 6px; flex: none; }

main.view { padding: 14px 16px 24px; }
main.view.bare { padding: 0; }

/* 하단 탭 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom);
}
.tabbar a {
  flex: 1; max-width: 144px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px;
  text-decoration: none; color: var(--muted); font-size: 11px; position: relative;
}
.tabbar a.on { color: var(--brand); font-weight: 650; }
.tabbar .dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 레이아웃 */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-gap { display: flex; gap: 8px; align-items: center; }
.row-gap.wrap { flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card > h2 { margin-bottom: 10px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.primary.danger, .sheet .btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.link { border: 0; background: none; color: var(--brand); padding: 0 4px; min-height: 32px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; font-size: 18px; cursor: pointer; flex: none; }
.icon-btn.small { width: 32px; height: 32px; font-size: 14px; }
.icon-btn:active { background: var(--gray-soft); }

/* 폼 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field .hint, .hint { font-size: 12px; color: var(--muted); }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; border: 1px solid var(--line); background: var(--card);
  border-radius: 12px; padding: 11px 12px; min-height: 44px; outline: none; font-size: 16px; /* iOS 확대 방지 */
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search { border-radius: 999px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--brand); }

/* 리스트 */
.list { display: flex; flex-direction: column; }
.list.card { padding: 4px 14px; }
.list-row, .act-row, .req-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--line); padding: 12px 0; cursor: pointer; min-height: 56px;
}
.list > :last-child { border-bottom: 0; }
.list-row > div:first-child:not(.avatar) { flex: 1; min-width: 0; }
.list-row.danger { color: var(--red); }
.list-row .chev { color: var(--muted); font-size: 20px; margin-left: auto; }
.list-row strong, .req-row strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-row img, .req-row .thumb-empty { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; background: var(--gray-soft); }
.act-row { align-items: flex-start; }
.act-row.unread .act-text { font-weight: 650; }
.act-ico { width: 28px; text-align: center; flex: none; }
.act-text { flex: 1; min-width: 0; font-size: 14px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.avatar.sm { width: 38px; height: 38px; font-size: 14px; }
.dday { font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 3px 9px; flex: none; }
.dday.big { font-size: 15px; padding: 6px 12px; }
.empty { text-align: center; padding: 32px 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; }

.badge { font-size: 11.5px; font-weight: 650; border-radius: 999px; padding: 3px 9px; white-space: nowrap; flex: none; }
.tone-red { color: var(--red); background: var(--red-soft); }
.tone-amber { color: var(--amber); background: var(--amber-soft); }
.tone-blue { color: var(--blue); background: var(--blue-soft); }
.tone-green { color: var(--green); background: var(--green-soft); }
.tone-gray { color: var(--gray); background: var(--gray-soft); }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .cnt { margin-left: 4px; opacity: .6; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--gray-soft); border-radius: 12px; padding: 3px; }
.seg a { text-align: center; padding: 9px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* 홈 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { border: 0; border-radius: var(--radius); padding: 14px 12px; text-align: left; display: flex; flex-direction: column; cursor: pointer; }
.stat b { font-size: 26px; line-height: 1.1; }
.stat span { font-size: 12.5px; font-weight: 600; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-btn { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.tip { background: var(--brand-soft); border-color: transparent; }
.tip p { margin-top: 4px; }

/* 홈 · 업종별 사용 예시 */
.industry-examples { overflow: hidden; }
.industry-examples .sec-head { align-items: flex-start; }
.industry-examples .sec-head p { margin: 4px 0 0; }
.industry-example-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(265px, 82%); gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; }
.industry-example-card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, var(--card), var(--gray-soft)); }
.industry-example-head { display: flex; align-items: center; gap: 10px; }
.industry-example-head p { margin: 2px 0 0; color: var(--muted); }
.industry-example-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 13px; background: var(--brand-soft); font-size: 23px; }
.industry-example-flow { display: grid; gap: 8px; }
.industry-example-flow p { margin: 0; padding: 9px 10px; border-radius: 11px; background: var(--card); font-size: 12.5px; line-height: 1.45; }
.industry-example-flow b, .industry-example-flow span { display: block; }
.industry-example-flow b { margin-bottom: 2px; color: var(--brand-ink); font-size: 11px; }
.industry-example-card .btn { align-self: flex-start; }

/* 로그인 */
.login, .onboard { padding: calc(40px + var(--safe-top)) 24px 32px; display: flex; flex-direction: column; gap: 20px; max-width: 440px; margin: 0 auto; }
.login-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login-logo { width: 76px; height: 76px; border-radius: 20px; }
.login-hero h1 { font-size: 26px; }
.login-hero p { color: var(--muted); }
.or { text-align: center; color: var(--muted); font-size: 12px; }
.profile { display: flex; gap: 12px; align-items: center; }

/* 고객 */
.client-head { display: flex; flex-direction: column; gap: 12px; }
.invite { background: var(--brand-soft); border-color: transparent; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.invite .code { font: 700 26px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .18em; color: var(--brand-ink); background: var(--card); padding: 10px 14px; border-radius: 12px; }

/* 계약서 */
.form .card { display: flex; flex-direction: column; gap: 10px; }
.item-row { display: grid; grid-template-columns: 1fr 56px 108px 32px; gap: 6px; align-items: center; }
.item-row input { padding: 9px 8px; }
.items-edit, .terms-edit { display: flex; flex-direction: column; gap: 8px; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--line); padding-top: 10px; }
.term-row { display: grid; grid-template-columns: 22px 1fr 32px; gap: 6px; align-items: start; }
.term-n { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 11px; }
.sticky-actions {
  position: sticky; bottom: calc(68px + var(--safe-bottom)); display: grid; grid-template-columns: auto auto 1fr; gap: 8px;
  background: linear-gradient(transparent, var(--bg) 30%); padding: 16px 0 4px; z-index: 5;
}
.doc-wrap { padding: 18px 16px; }
.doc { font-size: 14px; }
.doc-sample { position: relative; padding: 12px; border: 1px dashed rgba(176, 104, 46, .42); border-radius: 14px; background: rgba(217, 138, 0, .055); }
.contract-sample-banner { display: flex; flex-direction: column; gap: 2px; margin: -2px -2px 14px; padding: 10px 12px; border-radius: 10px; background: rgba(217, 138, 0, .16); color: #704416; }
.contract-sample-banner strong { font-size: 13px; letter-spacing: .02em; }
.contract-sample-banner span { font-size: 11.5px; opacity: .78; }
.contract-guide-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border: 1px dashed rgba(15, 136, 84, .38); border-radius: 16px; background: rgba(15, 136, 84, .075); }
.contract-guide-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.contract-guide-copy h2 { font-size: 15px; margin: 0; }
.contract-guide-copy p { margin: 0; color: var(--muted); }
.contract-guide-label { align-self: flex-start; padding: 3px 8px; border-radius: 999px; background: rgba(15, 136, 84, .14); color: var(--brand-ink); font-size: 11px; font-weight: 700; }
.contract-guide-card .btn { flex: none; }
.doc-title { font-size: 20px; text-align: center; }
.doc-sub { text-align: center; color: var(--muted); font-size: 11.5px; margin: 4px 0 6px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc .kv th { text-align: left; font-weight: 500; color: var(--muted); width: 32%; padding: 5px 0; vertical-align: top; }
.doc .kv td { padding: 5px 0; }
.doc .items th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 6px 0; }
.doc .items td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.doc .items th:nth-child(n+2), .doc .items td.r { text-align: right; white-space: nowrap; padding-left: 8px; }
.doc .money { margin-top: 8px; background: var(--gray-soft); border-radius: 12px; }
.doc .money th, .doc .money td { padding: 6px 12px; }
.doc .terms { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.notice { background: var(--blue-soft); color: var(--ink); border-radius: 12px; padding: 12px; margin-top: 16px; }
.notice.warn { background: var(--amber-soft); margin-top: 0; }
.notice strong { color: var(--blue); }
.sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.sigbox { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 120px; }
.sigbox img { height: 56px; object-fit: contain; background: #fff; border-radius: 6px; }
.sig-empty { height: 56px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.history { margin-top: 8px; font-size: 13px; }
.history summary { cursor: pointer; color: var(--amber); font-weight: 600; }
.hist { border-left: 3px solid var(--amber-soft); padding: 6px 10px; margin-top: 6px; }
.diff { list-style: none; padding: 0; margin: 4px 0 0; font-size: 13px; }
.diff .del { color: var(--red); text-decoration: line-through; }
.diff .add { color: var(--green); }
.status-strip { display: flex; flex-direction: column; gap: 10px; }
.status-strip .badge, .status-box .badge { align-self: flex-start; }
.tl { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.tl li { text-align: center; font-size: 11px; color: var(--muted); position: relative; padding-top: 16px; }
.tl li::before { content: ''; position: absolute; top: 4px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--line); }
.tl li::after { content: ''; position: absolute; top: 8px; left: calc(50% + 7px); right: calc(-50% + 7px); height: 2px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl li.done { color: var(--ink); }
.tl li.done::before, .tl li.done::after { background: var(--brand); }
.tl em { display: block; font-style: normal; font-size: 10px; color: var(--muted); }
.evidence summary { cursor: pointer; font-weight: 600; }
.evidence p { margin-top: 8px; }

/* 서명 */
.sig { display: flex; flex-direction: column; gap: 6px; }
.sig-canvas { width: 100%; height: 170px; border: 1.5px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; }
.sig-foot { display: flex; justify-content: space-between; align-items: center; }

/* 요청·가이드 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); overflow: hidden; padding: 0; text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.tile.is-new { outline: 2px solid var(--red); }
.tile img, .tile .thumb-empty { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--gray-soft); }
.tile-body { padding: 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.tile-body strong { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.upload { display: block; cursor: pointer; }
.upload-preview { border: 2px dashed var(--line); border-radius: var(--radius); min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--card); overflow: hidden; }
.upload-preview span { font-size: 36px; }
.upload-preview img { max-height: 380px; object-fit: contain; }

.board-head { display: flex; gap: 10px; align-items: flex-start; }
.board-head h2 { font-size: 18px; }
.toolbar { display: flex; gap: 4px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; position: sticky; top: calc(60px + var(--safe-top)); z-index: 6; overflow-x: auto; }
.tool { border: 0; background: none; border-radius: 10px; padding: 4px 10px; display: flex; flex-direction: column; align-items: center; cursor: pointer; min-width: 48px; }
.tool span { font-size: 17px; line-height: 1.2; }
.tool small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.tool.on { background: var(--brand-soft); }
.tool.on small { color: var(--brand-ink); font-weight: 650; }
.toolbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 4px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--card); background: var(--c); box-shadow: 0 0 0 1px var(--line); cursor: pointer; flex: none; margin: 0 2px; }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }

.anno { position: relative; overflow: hidden; border-radius: var(--radius); background: #e9e6e0; touch-action: none; user-select: none; -webkit-user-select: none; border: 1px solid var(--line); }
.anno[data-tool="pin"], .anno[data-tool="box"], .anno[data-tool="arrow"] { cursor: crosshair; }
.anno.zoomed[data-tool="pan"] { cursor: grab; }
.anno-stage { position: relative; transform-origin: 0 0; will-change: transform; }
.anno-stage img { width: 100%; height: auto; pointer-events: none; }
.anno-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.anno-pins { position: absolute; inset: 0; --inv: 1; }
.pin {
  position: absolute; transform: translate(-50%, -50%) scale(var(--inv)); width: 28px; height: 28px; border-radius: 50%;
  background: var(--c); color: #fff; border: 2.5px solid #fff; font-size: 13px; font-weight: 750; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer; padding: 0;
}
.pin.is-pin { transform: translate(-50%, calc(-100% - 8px)) scale(var(--inv)); transform-origin: 50% calc(100% + 8px); }
.pin.is-pin::after { content: ''; position: absolute; left: 50%; bottom: -11px; margin-left: -6px; border: 6px solid transparent; border-top: 8px solid #fff; }
.pin.is-pin::before { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -4px; border: 4px solid transparent; border-top: 6px solid var(--c); z-index: 1; }
.pin.sel { outline: 3px solid color-mix(in srgb, var(--c) 40%, transparent); outline-offset: 2px; }
.pin.by-bride { border-color: #ffe3ef; }
.anno-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.anno-zoom .icon-btn { background: rgba(255,255,255,.92); color: #222; box-shadow: 0 1px 4px rgba(0,0,0,.2); width: 36px; height: 36px; }
.anno-zoom .icon-btn.small { font-size: 11px; font-weight: 700; }

.status-box { display: flex; flex-direction: column; gap: 8px; }
.marks { display: flex; flex-direction: column; gap: 8px; }
.mark-item { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mark-item.open { border-color: var(--brand); }
.mark-head { display: flex; gap: 10px; align-items: flex-start; width: 100%; background: none; border: 0; padding: 10px; text-align: left; cursor: pointer; }
.num { width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; font-size: 12.5px; font-weight: 750; display: grid; place-items: center; flex: none; }
.crop { border-radius: 10px; background-repeat: no-repeat; background-color: var(--gray-soft); flex: none; border: 1px solid var(--line); }
.who { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; display: inline-block; margin-bottom: 2px; }
.who.v { background: var(--brand-soft); color: var(--brand-ink); }
.who.b { background: var(--bride-soft); color: var(--bride); }
.mark-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }

.thread { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 86%; border-radius: 16px; padding: 8px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.bubble .who { background: none; padding: 0; margin: 0; }
.bubble time { font-size: 10.5px; color: var(--muted); align-self: flex-end; }
.bubble.v { align-self: flex-end; background: var(--brand-soft); border-bottom-right-radius: 4px; }
.bubble.v .who { color: var(--brand-ink); }
.bubble.b { align-self: flex-start; background: var(--bride-soft); border-bottom-left-radius: 4px; }
.bubble.b .who { color: var(--bride); }
.bubble.intro { max-width: 100%; }
.sys { font-size: 12px; color: var(--muted); text-align: center; }
.composer { display: flex; gap: 6px; align-items: flex-end; }
.composer .btn { white-space: nowrap; flex: none; min-height: 40px; }
.composer textarea { min-height: 40px; padding: 9px 12px; border-radius: 20px; }

/* 신부 화면 미리보기 */
.bride-frame { border: 2px solid var(--bride-soft); border-radius: 22px; overflow: hidden; background: var(--bg); }
.bride-bar { background: var(--bride-soft); color: var(--bride); font-size: 13px; font-weight: 650; padding: 8px 14px; }
.bride-body { padding: 14px; }
.vendor-chip { display: flex; gap: 10px; align-items: center; }
.bride-marks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.bride-marks li { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: 14px; padding: 10px; border: 1px solid var(--line); cursor: pointer; }
.bride-marks .bubble { margin-top: 6px; }

/* 시트 / 토스트 */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0; padding: 8px 18px calc(18px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; animation: up .2s ease; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); align-self: center; margin-bottom: 4px; }
.sheet h3 { margin: 0; font-size: 17px; }
.sheet-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.sheet-actions:has(> :nth-child(3)) { grid-auto-flow: row; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }
#toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translate(-50%, 20px); z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  main.view { padding: 20px 24px 32px; }
  .tabbar a { font-size: 12px; }
}

/* PDF(인쇄) — 계약서 본문만 */
@media print {
  .topbar, .tabbar, .demo-bar, .actions, .status-strip, .evidence, .notice.warn, #toast { display: none !important; }
  body, .card { background: #fff !important; color: #000 !important; box-shadow: none !important; border: 0 !important; }
  #app.has-tabs { padding: 0; }
  .history[open], .history { display: block; }
  .doc-sample { border-color:#b98a5d !important; background:#fff8ef !important; }
  .contract-sample-banner { background:#f5e6d2 !important; color:#5a3714 !important; }
}

/* 소셜 로그인 — 두 플랫폼 공통 */
.social-login { margin-bottom: 18px; }
.social-google { background: #fff; color: #222; border: 1px solid #b7b7b7; min-height: 48px; }
.social-apple { background: #111; color: #fff; min-height: 48px; }
.social-login .btn:disabled { opacity: .55; }

/* 베뉴 네이티브 화면의 서체·색·12px 곡률을 파트너 화면에도 적용. */
.topbar { padding-right:20px; padding-left:16px; min-height:60px; }
.topbar h1 { font-size:18px; font-weight:700; letter-spacing:-.025em; }
main.view { padding:20px 20px 28px; }
.stack { gap:16px; }
.btn { font-weight:600; letter-spacing:-.01em; }
.btn.primary { min-height:48px; }
input, textarea, select { font-family:inherit; letter-spacing:-.01em; }
select { appearance:none; -webkit-appearance:none; min-height:48px; padding-right:36px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237D736B' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; }
.field .label { color:var(--ink); font-size:13px; font-weight:600; }
.form .field { gap:8px; }
.guide-form { gap:24px; }
.guide-form .guide-hint { margin-top:-14px; line-height:1.7; font-size:13px; }
.guide-form .upload { border:1px solid var(--line); background:var(--card); border-radius:16px; }
.guide-form .upload-preview { border:0; min-height:152px; gap:8px; }
.guide-form .upload-preview .guide-photo-icon { width:32px; height:32px; object-fit:contain; border-radius:0; margin:0 auto 4px; }
.guide-form .upload-preview p:first-of-type { font-size:15px; font-weight:600; color:var(--ink); }
.guide-form .upload-preview .tiny { font-size:12px; line-height:1.6; }
.guide-form textarea { min-height:116px; }
.tile { box-shadow:none; border:1px solid var(--line); border-radius:14px; }
.tile-body { padding:14px; }
.tile-body strong { font-size:15px; line-height:1.5; font-weight:650; }
.tabbar { background:var(--bg); }
.tabbar a { font-size:10px; font-weight:500; padding-top:10px; padding-bottom:8px; }
.tabbar a.on { font-weight:650; }
.shared-intro { padding:4px 0; }
.shared-intro h2 { font-size:20px; font-weight:700; margin-bottom:8px; }
.shared-intro p { line-height:1.7; }
@media(max-width:360px) { main.view { padding:18px 16px 24px; } .row2 { gap:8px; } }
@media(max-width:520px) { .contract-guide-card { align-items:stretch; flex-direction:column; } .contract-guide-card .btn { width:100%; } }

/* Global guidance: logical spacing and wrapping support narrow and RTL layouts. */
.language-picker{max-width:26rem;width:100%;margin-inline:auto}.language-picker select{width:100%;min-height:44px}
.help-step{padding:20px}.help-step h2{font-size:1.15rem;margin-block:8px}.help-step p,.guide-example{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}.help-page li{margin-block:10px}.help-page .card{padding:20px}.step-number{display:inline-flex;border:1px solid currentColor;border-radius:50%;width:30px;height:30px;align-items:center;justify-content:center;color:var(--green,#0f8854)}
.tabbar span{overflow-wrap:anywhere;hyphens:auto}.tabbar a{min-width:0}.btn{white-space:normal;overflow-wrap:anywhere}html[dir=rtl] .field,html[dir=rtl] .list-row{text-align:right}html[dir=rtl] .chev{transform:rotate(180deg)}input[type=email],input[type=password],input[type=tel]{direction:ltr}
