/* 전자서명·계약서·TM 페이지 전용 (홈페이지 style.css 와 따로) — 금융 앱처럼 깔끔하게, 모바일 375px 우선 */
:root {
  --primary: #0b141d; --primary-d: #1f2c39; --primary-l: #e4e6e9; --accent: #9a7f50; --accent-l: #d9c49c;
  --text: #191f28; --sub: #4e5968; --muted: #8b95a1; --faint: #b0b8c1;
  --bg: #fff; --field: #f2f4f6; --field-h: #e5e8eb; --line: #e5e8eb;
  --ok: #3f6b52; --err: #f04452;
  --ease: cubic-bezier(.2, .7, .1, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; letter-spacing: -.01em;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 머리 — 작고 조용하게 */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 56px; padding: env(safe-area-inset-top) 20px 0; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.logo { display: flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .06em; font-size: 14px; }
.logo-sub { font-weight: 500; letter-spacing: 0; color: var(--muted); }
.mark { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-l); }
.top-title { font-size: 13px; color: var(--muted); }

.wrap { max-width: 560px; margin: 0 auto; padding: 4px 24px 140px; }

/* 진행 막대 — 글자는 화면 낭독기에만 */
.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; list-style: none; margin: 0 0 32px; padding: 0; }
.steps li { height: 4px; border-radius: 2px; background: var(--field); font-size: 0; overflow: hidden; transition: background .4s; }
.steps li.done { background: var(--primary); }
.steps li.on { background: var(--accent); }

/* 단계 — 카드 없이 흰 바탕에 큰 제목 */
.step { animation: rise .45s var(--ease); }
/* transform 을 쓰면 안의 position:fixed 버튼이 화면 아래에 붙지 않아서 투명도만 바꾼다 */
@keyframes rise { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .step { animation: none; } }
.step h1 { font-size: 26px; font-weight: 700; line-height: 1.38; letter-spacing: -.03em; margin: 0 0 10px; outline: none; }
.lead { color: var(--sub); margin: 0 0 32px; font-size: 16px; }
.lead a { color: var(--accent); font-weight: 600; text-decoration: none; }
.hint { color: var(--muted); font-size: 14px; margin: 10px 0; }
.hint strong { color: var(--sub); font-weight: 600; }
.err { color: var(--err); font-weight: 500; font-size: 14px; margin: 12px 0 0; }
.err:empty { margin: 0; }

/* 입력 — 회색 칸, 누르면 파란 테두리 */
label { display: block; font-weight: 500; font-size: 14px; color: var(--sub); margin: 0 0 24px; }
input:not([type=checkbox]), select {
  display: block; width: 100%; margin-top: 8px; padding: 0 16px; height: 56px; font: inherit; font-size: 17px; font-weight: 500; color: var(--text);
  background: var(--field); border: 2px solid transparent; border-radius: 14px; transition: border-color .2s, background .2s;
  -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238b95a1' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; background-size: 12px; padding-right: 44px; }
input:not([type=checkbox]):focus, select:focus { outline: none; border-color: var(--accent); background-color: #fff; }
input::placeholder { color: var(--faint); font-weight: 400; }
input[readonly] { color: var(--muted); }
.timer { float: right; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 버튼 — 크고 둥글게. 모바일에선 주 버튼이 화면 아래에 붙는다 */
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; padding: 0 20px; margin-top: 12px;
  font: inherit; font-weight: 600; font-size: 17px; text-decoration: none; letter-spacing: -.01em;
  color: #fff; background: var(--primary); border: 0; border-radius: 16px; cursor: pointer;
  transition: background .2s, transform .15s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--primary-d); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { background: var(--primary-l); color: #a6adb4; cursor: not-allowed; }
.btn[aria-busy=true] { opacity: .6; }
.btn.ghost { color: var(--sub); background: var(--field); }
.btn.ghost:hover { background: var(--field-h); }
.row { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
@media (max-width: 719px) {
  .step .btn:not(.ghost) {
    position: fixed; z-index: 4; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: auto; margin: 0;
    box-shadow: 0 -24px 24px 8px #fff;   /* 아래 내용이 버튼 뒤로 자연스럽게 사라지게 */
  }
  .row { grid-template-columns: 1fr; }
}

/* 계약서 */
.contract-box {
  height: 56vh; min-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 4px 20px; font-size: 14.5px; line-height: 1.75; color: var(--sub); background: #f9fafb; border-radius: 16px;
}
.contract-end { text-align: center; color: var(--accent); font-weight: 600; padding: 16px 0 24px; }
.doc-ver { font-size: 12px; color: var(--faint); word-break: break-all; margin: 12px 0 0; }
#read-hint { color: var(--accent); font-weight: 500; }

.doc h1, .contract-box h1 { font-size: 20px; font-weight: 700; color: var(--text); margin: 22px 0 16px; }
.doc h2, .contract-box h2 { font-size: 16px; font-weight: 700; color: var(--text); margin: 1.8em 0 .4em; }
.doc h3, .contract-box h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.doc ol, .doc ul, .contract-box ol, .contract-box ul { padding-left: 1.3em; }
.doc li, .contract-box li { margin: .2em 0; }
.doc hr, .contract-box hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.table { overflow-x: auto; margin: 10px 0; }
.table table { border-collapse: collapse; min-width: 100%; font-size: 13px; line-height: 1.55; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.table th { font-weight: 600; color: var(--muted); white-space: nowrap; }

/* 동의 — 동그란 체크 */
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 16px; color: var(--text); margin: 0; padding: 12px 0; cursor: pointer; }
.check input {
  flex: none; width: 24px; height: 24px; margin: 0; -webkit-appearance: none; appearance: none; cursor: pointer; border-radius: 50%;
  background: var(--field-h) no-repeat center / 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: background-color .2s;
}
.check input:checked { background-color: var(--primary); }
.check.all { font-weight: 700; font-size: 17px; padding: 18px 18px; margin-bottom: 8px; background: var(--field); border-radius: 16px; }
.check.all input { width: 28px; height: 28px; background-color: #d1d6db; background-size: 14px; }
.check.all input:checked { background-color: var(--primary); }
.consents { list-style: none; margin: 0 0 8px; padding: 0 4px; }
.consents .check { font-size: 15px; color: var(--sub); }
.consents em { font-style: normal; font-weight: 600; margin-right: 4px; }
.consents em::before { content: "["; } .consents em::after { content: "]"; }
.consents em.req { color: var(--accent); }
.consents em.opt { color: var(--muted); }

/* 서명 */
.summary { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0 0 28px; padding: 20px; background: var(--field); border-radius: 16px; font-size: 15px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; text-align: right; }
.pad-wrap { position: relative; }
.pad { display: block; width: 100%; height: 220px; background: var(--field); border-radius: 16px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.pad-guide { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 18px; font-weight: 500; pointer-events: none; }
.pad-wrap.inked .pad-guide { display: none; }

/* 완료 */
.step[data-step="6"] { padding-top: 12vh; text-align: center; }
.step[data-step="6"] h1::before {
  content: ""; display: block; width: 72px; height: 72px; margin: 0 auto 24px; border-radius: 50%; background: var(--primary) no-repeat center / 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' fill='none' stroke='%23d9c49c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  animation: pop .5s var(--ease);
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* 계약서 단독 페이지 */
.doc-page { background: #fff; }
.doc { max-width: 720px; margin: 0 auto; padding: 16px 24px 56px; font-size: 15px; line-height: 1.8; color: var(--sub); }
.doc-meta { font-size: 12px; color: var(--faint); word-break: break-all; padding: 12px 16px; background: #f9fafb; border-radius: 12px; }

/* TM 진행 보기 (tm.html) */
.link-btn { font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 6px 0; }
.wrap.tm { max-width: 720px; padding-top: 24px; }
.tm .step .btn:not(.ghost) { position: static; box-shadow: none; margin-top: 12px; }
.tm-list { list-style: none; margin: 8px 0 0; padding: 0; }
.tm-row { padding: 20px; margin: 0 0 12px; background: #f9fafb; border-radius: 18px; }
.tm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 16px; }
.tm-head strong { font-weight: 700; }
.tm-head span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.tm-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; list-style: none; margin: 14px 0 10px; padding: 0; }
.tm-bar li { font-size: 11px; text-align: center; color: var(--faint); padding-top: 8px; position: relative; }
.tm-bar li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 2px; background: var(--field-h); }
.tm-bar li.done { color: var(--sub); }
.tm-bar li.done::before { background: var(--primary); }
.tm-bar li.live::before { background: var(--accent); }
.tm-bar li.live { color: var(--accent); font-weight: 700; }
.tm-bar li.stop { color: var(--err); font-weight: 700; }
.tm-bar li.stop::before { background: var(--err); }
.tm-label { margin: 0; font-size: 15px; font-weight: 700; }
.tm-row.live .tm-label { color: var(--accent); }
.tm-row.stop .tm-label { color: var(--err); }
.tm-row.live .tm-label::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .tm-row.live .tm-label::before, .step[data-step="6"] h1::before { animation: none; } }

@media (min-width: 720px) {
  .wrap { padding: 32px 24px 64px; }
  .step h1 { font-size: 30px; }
  .row { grid-template-columns: 1fr 2fr; }
}

/* 관리자 서명 기록 (admin.html) */
.search { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 0 0 8px; }
.search input { margin: 0 !important; }
.search .btn { margin: 0; width: auto; height: 56px; padding: 0 22px; }
.rec-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 14px 0; font-size: 14px; }
.rec-dl dt { color: var(--muted); }
.rec-dl dd { margin: 0; color: var(--text); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acct { font-variant-numeric: tabular-nums; }
.acct.shown { font-weight: 700; background: #fff6e0; padding: 0 6px; border-radius: 6px; }
.chip { font: inherit; font-size: 12px; font-weight: 600; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.chip:hover { border-color: var(--primary); }
.doc-link { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.sub-h { font-size: 16px; font-weight: 700; margin: 36px 0 8px; }
.audit { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); }
.audit li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.rec .tm-head { flex-wrap: wrap; }
.rec .tm-head strong { white-space: nowrap; }
.export { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin: 8px 0 0; }
.export label { margin: 0; }
.export .btn { margin: 0; width: auto; height: 56px; padding: 0 22px; }

/* 관리자 — 탭과 회원 표 */
.tabs { display: flex; gap: 4px; margin: 8px 0 24px; padding: 4px; background: var(--field); border-radius: 14px; }
.tabs button { flex: 1; height: 44px; font: inherit; font-weight: 600; font-size: 15px; color: var(--muted); background: none; border: 0; border-radius: 10px; cursor: pointer; }
.tabs button[aria-selected=true] { color: var(--text); background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 16px; }
.stat { padding: 14px 16px; background: var(--field); border-radius: 14px; }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat strong { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.filters .chip { padding: 6px 12px; font-size: 13px; }
.chip.on { color: #fff; background: var(--primary); border-color: var(--primary); }
.mq { margin: 0 0 12px !important; }
.mtable-wrap { overflow-x: auto; }
.mtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.mtable th { position: sticky; top: 0; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); background: #fff; white-space: nowrap; }
.mtable td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.mtable td.nm .name-btn { display: block; }
.mtable td.nm small { display: block; font-size: 11px; color: var(--muted); }
.mtable td small { color: var(--muted); font-size: 12px; }
.mtable tr.st-ended td { color: var(--faint); }
.mtable tr.st-paused td.nm .name-btn::after { content: " · 보류"; color: var(--accent); font-weight: 500; font-size: 12px; }
.mtable select.st, .mtable input.memo { height: 36px; margin: 0; padding: 0 10px; font-size: 14px; border-radius: 10px; }
.mtable select.st { width: 84px; padding-right: 28px; background-position: right 10px center; }
.mtable input.memo { min-width: 160px; }
.tag { display: inline-block; padding: 1px 8px; font-size: 12px; font-weight: 700; border-radius: 999px; }
.tag.ok { color: var(--ok); background: #e9f1ec; }
.tag.warn { color: #b25a00; background: #fff1de; }
.tag.mute { color: var(--muted); background: var(--field); }
/* 좁은 화면: 표를 카드로 */
@media (max-width: 719px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .mtable thead { display: none; }
  .mtable, .mtable tbody, .mtable tr, .mtable td { display: block; }
  .mtable tr { padding: 14px 16px; margin: 0 0 10px; background: #f9fafb; border-radius: 16px; }
  .mtable td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; white-space: normal; }
  .mtable td::before { content: attr(data-k); color: var(--muted); font-size: 12px; flex: none; }
  .mtable td.nm { display: block; padding-bottom: 8px; font-size: 16px; }
  .mtable td.nm::before { content: none; }
  .mtable input.memo { min-width: 0; flex: 1; }
}
.wrap.admin { max-width: 1080px; }

/* 회원 실적 */
.stats { grid-template-columns: repeat(3, 1fr); }
.stat small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.mtable td.num { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.mtable td.num small { font-weight: 400; }
.mtable td.num.hot { color: var(--accent); font-weight: 800; }
.mtable th:nth-child(6), .mtable th:nth-child(7) { text-align: right; }
.mtable td.code { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }
.name-btn { font: inherit; font-weight: 700; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.name-btn:hover { text-decoration-color: var(--accent); }
dialog#dlg { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 48px); padding: 24px; border: 0; border-radius: 20px; box-shadow: 0 24px 64px rgba(0, 0, 0, .2); }
dialog#dlg::backdrop { background: rgba(11, 20, 29, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dlg-head h2 { margin: 0; font-size: 20px; }
.sub-h small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.sale-form { display: grid; grid-template-columns: 150px 1fr 96px; gap: 8px; margin: 0 0 8px; }
.sale-form input, .sale-form select { margin: 0 !important; height: 44px; font-size: 15px; border-radius: 10px; }
.sale-form #s-memo { grid-column: 1 / 3; }
.sale-form .btn { margin: 0; height: 44px; font-size: 15px; position: static !important; box-shadow: none !important; width: auto; }
.mtable.sales td { white-space: normal; }
.mtable tr.sale-canceled td { color: var(--faint); text-decoration: line-through; }
.mtable tr.sale-done td:nth-child(2) { font-weight: 700; }
@media (max-width: 719px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .sale-form { grid-template-columns: 1fr 1fr; }
  .sale-form #s-product, .sale-form #s-memo { grid-column: 1 / 3; }
  dialog#dlg { padding: 18px; }
}

/* 파트너 내 정보 (me.html) */
.me-code { display: inline-block; margin: 0 0 12px; padding: 4px 12px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--accent); background: #f6f1e7; border-radius: 999px; }
#me .summary dd { text-align: right; }
#me .doc-btn { position: static !important; box-shadow: none !important; }

/* 파트너 자료실 (library.html) */
.wrap.lib { max-width: 880px; padding-top: 24px; }
.lib-h { font-size: 26px; font-weight: 700; margin: 0 0 8px; }
.notice { margin: 0 0 16px; padding: 12px 16px; font-size: 14px; font-weight: 600; color: #8a5a00; background: #fff6e0; border-radius: 12px; }
.notice.small { margin: 8px 0 0; padding: 8px 12px; font-size: 13px; }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lib-card { display: flex; flex-direction: column; padding: 18px; background: #f9fafb; border-radius: 18px; }
.lib-title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; }
.lib-meta { margin: 6px 0 0; font-size: 13px; color: var(--sub); }
.lib-date { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.lib-preview { margin: 12px 0 0; }
.lib-thumb { display: block; width: 100%; max-height: 220px; object-fit: contain; background: #fff; border-radius: 12px; }
.lib-actions { margin-top: auto; padding-top: 12px; }
.btn.lib-btn { height: 44px; margin: 0; font-size: 15px; border-radius: 12px; position: static !important; box-shadow: none !important; }
.lib-preview .btn.lib-btn { margin: 0; }
.lib-older { margin-top: 12px; font-size: 13px; color: var(--sub); }
.lib-older summary { cursor: pointer; font-weight: 600; }
.lib-older ul { list-style: none; margin: 8px 0 0; padding: 0; }
.lib-older li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.lib-older .btn.lib-btn { width: auto; height: 32px; padding: 0 12px; font-size: 13px; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); background: #f9fafb; border-radius: 18px; }
.me-lib { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; margin: 8px 0 0; color: var(--text); text-decoration: none; background: #f9fafb; border-radius: 16px; font-weight: 600; }
.me-lib span { color: var(--muted); font-weight: 500; font-size: 14px; }

/* 관리자 자료실 */
.lib-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; padding: 18px; margin: 0 0 8px; background: #f9fafb; border-radius: 16px; }
.lib-form label { margin: 0 0 12px; }
.lib-form .wide { grid-column: 1 / 3; }
.lib-form input, .lib-form select { height: 44px; font-size: 15px; border-radius: 10px; }
.lib-form input[type=file] { padding: 10px; height: auto; }
.lib-form .btn { align-self: end; margin: 0 0 12px; height: 44px; position: static !important; box-shadow: none !important; }
.lib-admin, .lib-admin ul { list-style: none; margin: 0; padding: 0; }
.lib-group { margin: 0 0 12px; padding: 4px 16px; border: 1px solid var(--line); border-radius: 16px; }
.lib-row { padding: 12px 0; }
.lib-row + .lib-row { border-top: 1px dashed var(--line); }
.lib-row.old { opacity: .7; }
.lib-row-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.lib-link { font-weight: 700; color: var(--text); }
.lib-row-head small { color: var(--muted); }
.lib-fields { display: grid; grid-template-columns: 2fr 1.2fr 1.2fr .7fr 1fr; gap: 8px; margin: 10px 0; }
.lib-field { margin: 0; font-size: 11px; }
.lib-field input, .lib-field select { height: 36px; margin-top: 2px; padding: 0 10px; font-size: 14px; border-radius: 8px; }
.lib-row-actions { display: flex; gap: 6px; }
.chip.danger { color: var(--err); }
.lib-log { margin-top: 6px; }
@media (max-width: 719px) {
  .lib-form { grid-template-columns: 1fr; }
  .lib-form .wide { grid-column: auto; }
  .lib-fields { grid-template-columns: 1fr 1fr; }
}

/* 상담 요청 목록 (TM·관리자 공용, inquiries.js) */
.inq-box { margin-top: 36px; }
.inq-head { display: flex; justify-content: space-between; align-items: center; }
.inq-head .sub-h { margin: 0; }
.inq-list { list-style: none; margin: 0; padding: 0; }
.inq { padding: 16px 18px; margin: 0 0 10px; background: #f9fafb; border-radius: 16px; border-left: 4px solid var(--accent); }
.inq.st-contacted { border-left-color: var(--primary); }
.inq.st-done, .inq.st-dropped { border-left-color: var(--field-h); }
.inq.st-done .inq-top strong, .inq.st-dropped .inq-top strong { color: var(--muted); }
.inq-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: baseline; }
.inq-top .tel { color: inherit; font-variant-numeric: tabular-nums; }
.inq-when { font-size: 13px; color: var(--muted); }
.inq-meta { margin: 4px 0 10px; font-size: 14px; color: var(--sub); }
.inq-meta small { color: var(--muted); }
.inq-ctl { display: grid; grid-template-columns: 120px 1fr; gap: 8px; }
.inq-ctl select, .inq-ctl input { height: 40px; margin: 0; padding: 0 12px; font-size: 14px; border-radius: 10px; }
@media (max-width: 719px) { .inq-ctl { grid-template-columns: 1fr; } }
.tabs { flex-wrap: wrap; }
.tabs button { min-width: 0; }
#tab-inquiries .inq-box, #tab-inquiries > div { margin-top: 0; }
/* /me 로그인 아래 「회원가입」 — 위촉 계약 서명(/sign)으로. 서명하면 계정·파트너 코드가 자동으로 생긴다 */
.join { display: block; margin: 28px 0 0; padding: 18px 20px; font-size: 15px; color: var(--sub); text-decoration: none; background: #f9fafb; border-radius: 16px; }
.join strong { color: var(--text); font-weight: 700; }

/* 회원가입 (join.html) */
.inline { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.inline input { margin-top: 8px; }
.btn.small { width: auto; height: 56px; margin: 0; padding: 0 16px; font-size: 15px; position: static !important; box-shadow: none !important; }
.agree-box { margin: 8px 0 16px; padding: 8px 16px; background: #f9fafb; border-radius: 16px; }
.agree-box .hint { margin: 0 0 8px 36px; font-size: 13px; }
.agree-box em { font-style: normal; font-weight: 700; margin-right: 4px; }
.agree-box em.req { color: var(--accent); } .agree-box em.opt { color: var(--muted); }
.member-cta { margin: 20px 0 0; padding: 20px; background: #fff8eb; border-radius: 16px; }
.member-cta p { margin: 0 0 12px; color: var(--sub); }
.member-cta .btn { position: static !important; box-shadow: none !important; margin: 0; }

/* 로고: BRAND + 전원 O + N (2026-11-27) */
.logo { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; color: inherit; }
.wm { font-family: Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif; font-weight: 900; font-size: 21px; letter-spacing: -.015em; line-height: 1; white-space: nowrap; }
.wm-o { display: inline-block; height: .8865em; width: auto; vertical-align: -.01em; margin: 0 .03em 0 .035em; }   /* 고리 = 글자 O 높이(Pretendard 900) */
.wm-n { font-weight: inherit; color: #5a3bff; }
.nav.dark .wm-n { color: #9479ff; }
.nav.dark .wm-o { filter: brightness(1.25); }
.logo .logo-sub { font-size: 11px; font-weight: 600; letter-spacing: .24em; color: inherit; opacity: .55; }

/* 고객 상담 신청 (/apply) */
.rules { margin: -16px 0 28px; padding: 14px 16px; font-size: 14px; line-height: 1.6; color: var(--sub); background: #f6f1e7; border-radius: 14px; }
.products { margin: 0 0 24px; padding: 0; border: 0; }
.products legend { padding: 0; margin-bottom: 8px; font-weight: 500; font-size: 14px; color: var(--sub); }
.prod { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; padding: 14px 16px; background: var(--field); border: 2px solid transparent; border-radius: 14px; cursor: pointer; color: var(--text); font-size: 16px; }
.prod input[type=radio] { -webkit-appearance: radio; appearance: auto; width: 20px; height: 20px; margin: 0; padding: 0; border: 0; background: none; accent-color: var(--primary); flex: none; }
.prod b { display: block; font-weight: 600; }
.prod small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.prod:has(input:checked) { border-color: var(--accent); background: #fff; }
.agree-box .check span { font-size: 14px; line-height: 1.5; }
/* 파트너 내 정보: 내 고객 상담 링크·신청 */
.share-box { margin: 0 0 24px; padding: 16px; background: #f9fafb; border-radius: 16px; }
.share-box .url { display: block; margin: 6px 0 12px; font-size: 14px; color: var(--sub); word-break: break-all; }
.share-row { display: flex; gap: 8px; }
.share-row .btn { height: 48px; font-size: 15px; }
.lead-list { list-style: none; margin: 0; padding: 0; }
.lead-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.lead-list small { color: var(--muted); }
.cf-box { margin: 0 0 16px; min-height: 65px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hint-inline { font-weight: 400; color: var(--muted); font-size: 13px; }
.link-btn.forgot { display: block; margin: 16px 0 8px; padding: 0; background: none; border: 0; color: var(--sub); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.link-btn.forgot strong { color: var(--accent); }
#f-reset .btn[type=submit] { position: static !important; box-shadow: none !important; width: 100%; margin-top: 8px; }
.withdraw { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
.withdraw summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.withdraw form { margin-top: 16px; }
.btn.danger { position: static !important; box-shadow: none !important; background: #c0392b; }
.btn.danger:hover:not(:disabled) { background: #a93226; }
