:root {
  color-scheme: light dark;   /* 입력칸도 기기 · 크롬 설정(밝게 · 어둡게)을 따라 (2026-11-02 작업 이력 171) */
  --bg: #f4f5f7; --surface: #fff; --text: #111827; --text-2: #4b5563; --text-3: #9ca3af; --line: #e5e7eb; --line-2: #cfd4dc;
  --accent: #3b5bdb; --accent-hover: #2f4bc4; --accent-soft: #eef2ff; --neg: #dc2626; --neg-soft: #fef2f2;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
}
/* 어두운 화면 — 기기 · 크롬 설정이 어두운 모드일 때의 색 변수 (2026-11-02 작업 이력 171 — 계산기와 같은 값), 직접 쓴 색은 파일 맨 끝 자동 묶음 (npm run dark) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116; --surface: #171b22; --text: #e6e8ec; --text-2: #aeb5c1; --text-3: #7c8491; --line: #2b313c; --line-2: #3b4351;
    --accent: #6382f2; --accent-hover: #5371e0; --accent-soft: #1d2645; --neg: #f87171; --neg-soft: #2c1618;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: radial-gradient(1200px 600px at 50% -10%, #e8edff 0%, var(--bg) 60%); -webkit-font-smoothing: antialiased; }
.wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 40px rgba(17, 24, 39, .08); padding: 28px 28px 24px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.logo { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; font-size: 22px; flex-shrink: 0; }
h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--text-3); word-break: keep-all; }   /* 낱말 가운데에서 줄을 바꾸지 않게 (다시 동의 화면 안내 — 2026-11-19) */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span:first-child { font-size: 12px; font-weight: 600; color: var(--text-2); }
input[type="text"], input[type="password"] { font: inherit; font-size: 16px; width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); background: var(--surface); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pw { position: relative; display: block; }
.pw input { padding-right: 64px; }
.eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
/* 로그인 유지 (2026-10-13 검증 개선-29): 체크 칸을 누르기 쉽게 줄 전체를 라벨로 */
.keep { display: flex; align-items: center; gap: 8px; margin: -2px 0 14px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.keep input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.keep small { color: var(--text-3); font-size: 12px; }
.msg { font-size: 13px; color: var(--neg); background: var(--neg-soft); border: 1px solid #fecaca; border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; }
.msg.ok { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.submit { width: 100%; height: 48px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 4px; }
.submit:hover { background: var(--accent-hover); }
.submit:disabled { opacity: .6; cursor: wait; }
.note { margin: 18px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.6; }
.note b { color: var(--text-2); font-weight: 600; }
.foot { margin-top: 18px; font-size: 11px; color: var(--text-3); }

/* 회원가입 · 비밀번호 찾기 · 재설정 · 약관 (2026-11-17 작업 이력 311) */
.card.wide { max-width: 560px; }
.links { margin: 14px 0 0; display: flex; justify-content: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.links a, .foot a { color: var(--accent); text-decoration: none; font-weight: 600; }
.links a:hover, .foot a:hover { text-decoration: underline; }
.foot a { font-weight: 500; }
.hint { display: block; margin: -6px 0 12px; font-size: 12px; color: var(--text-3); line-height: 1.5; }
.field .hint { margin: 2px 0 0; }
.field > span:first-child small, .sec small { font-weight: 400; color: var(--text-3); margin-left: 4px; }
.sec { margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--text); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row2.zip { grid-template-columns: 150px 1fr; }
@media (max-width: 480px) { .row2, .row2.zip { grid-template-columns: 1fr; } }
input[type="email"], input[type="tel"] { font: inherit; font-size: 16px; width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); background: var(--surface); }
.human { margin: 0 0 12px; min-height: 65px; }
.done { text-align: center; padding: 8px 0; }
.done b { display: block; font-size: 16px; margin-bottom: 6px; }
.done p { margin: 0 0 16px; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
a.submit.link { display: inline-grid; place-items: center; text-decoration: none; }
.doc h1 { margin: 0 0 4px; font-size: 20px; }
.doc .ver { margin: 0 0 18px; font-size: 12px; color: var(--text-3); }
.doc h2 { margin: 20px 0 8px; font-size: 14px; }
.doc p, .doc li { font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.doc ol, .doc ul { padding-left: 20px; margin: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; color: var(--text-2); }
.doc th { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.doc td:first-child { white-space: nowrap; font-weight: 600; color: var(--text); }


/* 회원가입 신청 — 한 화면 좌우 두 칸 (2026-11-19 정본 totalerp docs/design/11-member-signup.md §3.1): 왼쪽 계정 · 본인 정보, 오른쪽 업체 정보 · 약관 동의,
   1366×768 에서 스크롤 없이 [가입 신청] · 900px 아래는 한 칸 · 오류는 칸 이름 옆 · 약관 전문은 창 */
.wrap.su { padding: 16px; justify-content: flex-start; }
@media (min-height: 700px) { .wrap.su { justify-content: center; } }
.su-card { max-width: 1040px; padding: 18px 24px 18px; }
.su-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.su-head .brand { margin-bottom: 0; }
.su-head .logo { width: 38px; height: 38px; font-size: 19px; border-radius: 10px; }
.su-links { margin: 0; display: flex; gap: 6px; font-size: 13px; color: var(--text-3); white-space: nowrap; }
.su-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
.su-links a:hover { text-decoration: underline; }
.su-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.su-col { min-width: 0; }
.su-col + .su-col { border-left: 1px solid var(--line); padding-left: 28px; }
.su .sec { margin: 12px 0 8px; padding-top: 10px; }
.su .sec.first { margin-top: 6px; padding-top: 0; border-top: 0; }
.su .row2 { gap: 0 10px; }
.f { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; min-width: 0; }
.fl { display: flex; align-items: baseline; gap: 6px; min-height: 17px; font-size: 12px; white-space: nowrap; overflow: hidden; }
.fl b { font-weight: 600; color: var(--text-2); }
.fl small { color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.fh { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.fh.ok { color: #15803d; font-weight: 600; }
.ferr { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--neg); overflow: hidden; text-overflow: ellipsis; }
.su input[type="text"], .su input[type="password"], .su input[type="email"], .su input[type="tel"] { height: 38px; border-radius: 8px; padding: 0 11px; }
.su .pw input { padding-right: 58px; }
.su .eye { height: 26px; padding: 0 8px; }
input.bad { border-color: var(--neg); }
input.bad:focus { box-shadow: 0 0 0 3px var(--neg-soft); }
input[readonly] { background: var(--bg); color: var(--text-2); }
.inline { display: flex; gap: 6px; }
.inline input { flex: 1; min-width: 0; }
.side { flex-shrink: 0; height: 38px; padding: 0 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface); color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.side:hover { background: var(--accent-soft); }
.side.solid { background: var(--accent); color: #fff; }
.side:disabled { opacity: .55; cursor: default; }
.pw-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: -2px 0 2px; font-size: 11.5px; color: var(--text-3); }
.pw-rule span { font-weight: 600; color: var(--text-2); }
.pw-rule i { font-style: normal; }
.pw-rule i.ok { color: #15803d; font-weight: 600; }
.code-row[hidden], .su-off[hidden], .su-foot [hidden] { display: none; }
.code-row { display: flex; align-items: center; gap: 6px; margin: -2px 0 8px; padding: 6px 8px; border: 1px dashed var(--line-2); border-radius: 8px; background: var(--accent-soft); }
.code-row input { width: 120px; height: 34px; font-size: 16px; letter-spacing: .12em; text-align: center; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 8px; background: var(--surface); color: var(--text); font-family: inherit; }
.code-row .side { height: 34px; }
.code-info { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.code-info.late { color: var(--neg); font-weight: 600; }
.linkbtn { margin-left: auto; border: 0; background: none; padding: 4px 2px; font: inherit; font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; }
.linkbtn:disabled { color: var(--text-3); cursor: default; }
.su .agree { gap: 0; padding: 4px 12px 8px; margin-bottom: 0; }
.su .check { font-size: 13px; }
.su .check.all { padding: 6px 0 7px; }
.su .check.all small { font-weight: 400; color: var(--text-3); font-size: 11.5px; margin-left: 4px; }
.ag-list { display: flex; flex-direction: column; }
.ag-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px; min-height: 28px; border-bottom: 1px dashed var(--line); }
.ag-row:last-child { border-bottom: 0; }
.ag-row .check { flex: 1; min-width: 0; padding: 4px 0; }
.ag-row.miss .check span { color: var(--neg); }
.ag-row.miss input[type="checkbox"] { outline: 2px solid var(--neg); outline-offset: 1px; }
.tag { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; font-style: normal; font-size: 11px; font-weight: 700; line-height: 17px; vertical-align: 1px; }
.tag.req { color: var(--neg); background: var(--neg-soft); }
.tag.opt { color: var(--text-2); background: var(--bg); border: 1px solid var(--line); }
.view { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: underline; }
.chans { display: flex; gap: 14px; width: 100%; padding: 0 0 5px 26px; font-size: 12.5px; color: var(--text-2); }
.chans label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.chans input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.ag-foot { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 6px 0 0; font-size: 11.5px; color: var(--text-3); }
.ag-foot a { color: var(--accent); font-weight: 600; text-decoration: none; }
.ag-foot a:hover { text-decoration: underline; }
.su-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
/* 계정 확인 — 아이디 바꾸기 (2026-11-24): 왜 바꾸는지 한 판 */
.id-why { margin: 0 0 10px; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.id-why b { color: var(--text); }
.su-foot .human { margin: 0; min-height: 0; }
.su-foot .msg { flex: 1; margin: 0; }
.su-foot .submit { width: 240px; margin: 0 0 0 auto; flex-shrink: 0; }
.su-off { text-align: center; padding: 28px 0 8px; }
.su-off b { display: block; font-size: 17px; margin-bottom: 6px; }
.su-off p { margin: 0 0 16px; font-size: 13.5px; color: var(--text-2); }
.su-off .submit { max-width: 280px; }
.su .done { padding: 28px 0 10px; }
.su .done .submit { max-width: 280px; }
.cs-card { max-width: 640px; }
.cs-pw[hidden], #cs-form[hidden] { display: none; }
.cs-pw { margin-bottom: 6px; }
.cs-pw .su-foot .side { height: 44px; }
.cs-card .brand { margin-bottom: 14px; }
/* 약관 전문 창 */
.doc-dialog { width: min(680px, calc(100vw - 24px)); max-height: min(82vh, 720px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(17, 24, 39, .25); }
.doc-dialog[open] { display: flex; flex-direction: column; }
.doc-dialog::backdrop { background: rgba(17, 24, 39, .45); }
.dd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 15px; }
.dd-head .eye { position: static; transform: none; }
.dd-body { flex: 1; overflow: auto; padding: 6px 18px 14px; }
.dd-body table { margin: 8px 0; }
.dd-body th { white-space: nowrap; }
.dd-foot { padding: 12px 18px; border-top: 1px solid var(--line); }
.dd-foot .submit { height: 42px; margin: 0; }
@media (max-width: 899px) {
  .su-card { padding: 18px 16px; }
  .su-head { flex-direction: column; align-items: flex-start; }
  .su-cols { grid-template-columns: 1fr; }
  .su-col + .su-col { border-left: 0; padding-left: 0; }
  .su-col + .su-col .sec.first { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
  .su-foot { flex-wrap: wrap; }
  .su-foot .msg { flex-basis: 100%; }
  .su-foot .submit { width: 100%; }
  .su input[type="text"], .su input[type="password"], .su input[type="email"], .su input[type="tel"] { height: 44px; }
  .side, .code-row .side { height: 44px; }
  .code-row { flex-wrap: wrap; }
  .code-row input { height: 40px; }
  .fl small { display: none; }
}
@media (max-width: 359px) { .su .row2 { grid-template-columns: 1fr; } .chans { padding-left: 0; } }

/* ===== 어두운 화면 — 자동 (scripts/dark-theme.mjs 가 만듦 · 손으로 고치지 않음 — CSS 의 색을 고치면 npm run dark) ===== */
@media (prefers-color-scheme: dark) {
  body { color: var(--text); background: radial-gradient(1200px 600px at 50% -10%, #191f35 0%, var(--bg) 60%); }
  .card { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.272); }
  .logo { background: var(--accent); color: #ffffff; }
  .brand p { color: var(--text-3); }
  .field > span:first-child { color: var(--text-2); }
  input[type="text"], input[type="password"] { border: 1px solid var(--line-2); color: var(--text); background: var(--surface); }
  input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .eye { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); }
  .keep { color: var(--text-2); }
  .keep input { accent-color: var(--accent); }
  .keep small { color: var(--text-3); }
  .msg { color: var(--neg); background: var(--neg-soft); border: 1px solid #762020; }
  .msg.ok { color: #86ebac; background: #183220; border-color: #2a7645; }
  .submit { border: 0; background: var(--accent); color: #ffffff; }
  .submit:hover { background: var(--accent-hover); }
  .note { color: var(--text-3); }
  .note b { color: var(--text-2); }
  .foot { color: var(--text-3); }
  .links { color: var(--text-3); }
  .links a, .foot a { color: var(--accent); text-decoration: none; }
  .links a:hover, .foot a:hover { text-decoration: underline; }
  .hint { color: var(--text-3); }
  .field > span:first-child small, .sec small { color: var(--text-3); }
  .sec { border-top: 1px solid var(--line); color: var(--text); }
  input[type="email"], input[type="tel"] { border: 1px solid var(--line-2); color: var(--text); background: var(--surface); }
  .done p { color: var(--text-2); }
  a.submit.link { text-decoration: none; }
  .doc .ver { color: var(--text-3); }
  .doc p, .doc li { color: var(--text-2); }
  .doc th, .doc td { border: 1px solid var(--line); color: var(--text-2); }
  .doc th { background: var(--accent-soft); color: var(--text); }
  .doc td:first-child { color: var(--text); }
  .su-links { color: var(--text-3); }
  .su-links a { color: var(--accent); text-decoration: none; }
  .su-links a:hover { text-decoration: underline; }
  .su-col + .su-col { border-left: 1px solid var(--line); }
  .su .sec.first { border-top: 0; }
  .fl b { color: var(--text-2); }
  .fl small { color: var(--text-3); }
  .fh { color: var(--text-3); }
  .fh.ok { color: #86ebac; }
  .ferr { color: var(--neg); }
  input.bad { border-color: var(--neg); }
  input.bad:focus { box-shadow: 0 0 0 3px var(--neg-soft); }
  input[readonly] { background: var(--bg); color: var(--text-2); }
  .side { border: 1px solid var(--accent); background: var(--surface); color: var(--accent); }
  .side:hover { background: var(--accent-soft); }
  .side.solid { background: var(--accent); color: #ffffff; }
  .pw-rule { color: var(--text-3); }
  .pw-rule span { color: var(--text-2); }
  .pw-rule i.ok { color: #86ebac; }
  .code-row { border: 1px dashed var(--line-2); background: var(--accent-soft); }
  .code-row input { border: 1px solid var(--line-2); background: var(--surface); color: var(--text); }
  .code-info { color: var(--text-2); }
  .code-info.late { color: var(--neg); }
  .linkbtn { border: 0; background: none; color: var(--accent); }
  .linkbtn:disabled { color: var(--text-3); }
  .su .check.all small { color: var(--text-3); }
  .ag-row { border-bottom: 1px dashed var(--line); }
  .ag-row:last-child { border-bottom: 0; }
  .ag-row.miss .check span { color: var(--neg); }
  .ag-row.miss input[type="checkbox"] { outline: 2px solid var(--neg); outline-offset: 1px; }
  .tag.req { color: var(--neg); background: var(--neg-soft); }
  .tag.opt { color: var(--text-2); background: var(--bg); border: 1px solid var(--line); }
  .view { border: 0; background: none; color: var(--accent); text-decoration: underline; }
  .chans { color: var(--text-2); }
  .chans input { accent-color: var(--accent); }
  .ag-foot { color: var(--text-3); }
  .ag-foot a { color: var(--accent); text-decoration: none; }
  .ag-foot a:hover { text-decoration: underline; }
  .su-foot { border-top: 1px solid var(--line); }
  .id-why { color: var(--text-2); }
  .id-why b { color: var(--text); }
  .su-off p { color: var(--text-2); }
  .doc-dialog { border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.68); }
  .doc-dialog::backdrop { background: rgba(46, 59, 86, 0.45); }
  .dd-head { border-bottom: 1px solid var(--line); }
  .dd-foot { border-top: 1px solid var(--line); }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  .su-col + .su-col { border-left: 0; }
  .su-col + .su-col .sec.first { border-top: 1px solid var(--line); }
}
/* ===== 어두운 화면 — 자동 끝 ===== */
