/* 시안 공용 스타일. 값의 근거는 design-notes.md "시각 규칙". 외부 글꼴·CDN 없음. */
@font-face { font-family: 'Pretendard'; font-weight: 400; src: url('../fonts/Pretendard-Regular.otf') format('opentype'); }
@font-face { font-family: 'Pretendard'; font-weight: 500; src: url('../fonts/Pretendard-Medium.otf') format('opentype'); }
@font-face { font-family: 'Pretendard'; font-weight: 600; src: url('../fonts/Pretendard-SemiBold.otf') format('opentype'); }
@font-face { font-family: 'Pretendard'; font-weight: 700; src: url('../fonts/Pretendard-Bold.otf') format('opentype'); }

:root {
  --ink: #15171c; --ink-2: #4a4f59; --ink-3: #868c97; --line: #e2e4e9; --line-2: #cfd3da;
  --bg: #f3f4f6; --paper: #fff; --hover: #f7f8fa;
  --seal: #c4301c;              /* 인주색: 직인·확정 도장에만 */
  --req: #9a4a00; --req-bg: #fff3e0; --req-line: #f0c48a;   /* 견적 요청 */
  --memo: #5c4a00; --memo-bg: #fffbe8; --memo-line: #eadb94; /* 영업 메모 칸 */
  --ok: #1d6b45;
  --r: 6px;
  --shadow: 0 1px 2px rgba(16, 18, 24, .06), 0 2px 8px rgba(16, 18, 24, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Pretendard', system-ui, sans-serif; font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
.num { font-variant-numeric: tabular-nums; }
button, input, textarea, select { font: inherit; color: inherit; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg circle { fill: currentColor; stroke: none; }
svg circle.o { fill: none; stroke: currentColor; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: #d9dde4; color: var(--ink); }
* { scrollbar-width: thin; scrollbar-color: #cfd3da transparent; }

/* 시안 내비 띠 (제품 화면 아님) */
#proto-nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 2px; height: 34px; padding: 0 12px; background: #23262d; color: #c9ccd3; font-size: 12px; }
#proto-nav a { text-decoration: none; padding: 5px 10px; border-radius: 4px; }
#proto-nav a:hover { background: #33373f; color: #fff; }
#proto-nav a.on { background: #fff; color: var(--ink); font-weight: 600; }
#proto-nav .pn-home { font-weight: 600; color: #fff; margin-right: 10px; }
#proto-nav button { margin-left: auto; background: none; border: 1px solid #4a4e57; color: #c9ccd3; border-radius: 4px; padding: 3px 8px; font-size: 12px; cursor: pointer; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--paper); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2b2f37; }
.btn.primary:disabled { background: #b9bdc5; border-color: #b9bdc5; cursor: not-allowed; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: #eceef1; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 46px; padding: 0 18px; font-size: 15px; font-weight: 600; width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 5px; border: 0; background: none; color: var(--ink-3); cursor: pointer; }
.icon-btn:hover { background: #eceef1; color: var(--ink); }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }

/* 딱지 */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tag svg { width: 12px; height: 12px; }
.tag.include { background: #eceef1; color: var(--ink-2); }
.tag.optional { border: 1px dashed var(--ink-3); color: var(--ink-2); }
.tag.choice { border: 1px solid var(--ink-3); color: var(--ink-2); }
.tag.req { background: var(--req-bg); color: var(--req); border: 1px solid var(--req-line); }
.tag.memo { background: var(--memo-bg); color: var(--memo); border: 1px solid var(--memo-line); }
.tag.lockd { background: #eceef1; color: var(--ink-2); }
.tag.ok { background: #e6f2eb; color: var(--ok); }
.tag.sent { background: var(--ink); color: #fff; }

/* 입력 */
.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.input { height: 34px; width: 100%; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; }
textarea.input { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 23, 28, .08); }
.seg { display: inline-flex; padding: 2px; background: #eceef1; border-radius: 7px; }
.seg button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }

/* 스위치 */
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 10px; background: #c9cdd4; transition: background .15s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(16px); }

/* A4 견적서 (회사 양식) */
.paper { background: var(--paper); width: 794px; max-width: 100%; margin: 0 auto; padding: 48px 52px 56px; box-shadow: var(--shadow); border: 1px solid var(--line); font-size: 13px; }
.q-title { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: .5em; margin: 0 0 28px; padding-left: .5em; }
.q-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 20px; }
.q-to .to { font-size: 18px; font-weight: 700; border-bottom: 1.5px solid var(--ink); padding-bottom: 6px; margin-bottom: 8px; }
.q-to dl, .q-sup dl { display: grid; grid-template-columns: 76px 1fr; margin: 0; row-gap: 3px; font-size: 12px; }
.q-to dt, .q-sup dt { color: var(--ink-3); }
.q-to dd, .q-sup dd { margin: 0; }
.q-sup { position: relative; border: 1px solid var(--line-2); padding: 10px 12px; }
.q-sup .seal { position: absolute; right: 12px; top: 10px; width: 44px; height: 44px; border: 2px solid var(--seal); color: var(--seal); border-radius: 4px; display: grid; place-items: center; font-size: 10px; font-weight: 700; line-height: 1.15; text-align: center; transform: rotate(-4deg); opacity: .85; }
.q-amount { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border: 1.5px solid var(--ink); padding: 12px 16px; margin-bottom: 22px; }
.q-amount .lbl { font-size: 12px; color: var(--ink-2); }
.q-amount .kr { font-size: 15px; font-weight: 600; }
.q-amount .big { font-size: 24px; font-weight: 700; }
.q-group { margin-top: 18px; }
.q-group-h { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1.5px solid var(--ink); }
.q-group-h h3 { margin: 0; font-size: 14px; font-weight: 700; }
.q-group-h .sub { margin-left: auto; font-weight: 600; }
.q-group-note { font-size: 12px; color: var(--ink-3); margin: 6px 0 2px; }
.q-table { width: 100%; border-collapse: collapse; }
.q-table th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--ink-3); padding: 6px 6px; border-bottom: 1px solid var(--line); }
.q-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.q-table .r { text-align: right; }
.q-table .nm { font-weight: 600; }
.q-table .ds { color: var(--ink-2); font-size: 12px; }
.q-sum { margin-top: 22px; margin-left: auto; width: 320px; }
.q-sum div { display: flex; justify-content: space-between; padding: 4px 0; }
.q-sum .tot { border-top: 1.5px solid var(--ink); margin-top: 4px; padding-top: 8px; font-size: 16px; font-weight: 700; }
.q-notes { margin-top: 26px; font-size: 11.5px; color: var(--ink-2); }
.q-notes h4 { font-size: 12px; margin: 0 0 4px; color: var(--ink); }
.q-notes ol { margin: 0; padding-left: 16px; }

/* 토스트 */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: 520px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.muted { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 5판: 항목 담기 체크박스. 담긴 항목은 먹색 채움, 안 담긴 항목은 빈 칸(색 대신 모양으로 구분) */
.ck { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid #b9bec7; border-radius: 5px; background: #fff; cursor: pointer; transition: background .12s, border-color .12s, transform .12s; }
.ck:hover { border-color: var(--ink-2); }
.ck:active { transform: scale(.92); }
.ck:checked { background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; border-color: var(--ink); }
.ck:disabled { cursor: not-allowed; opacity: .55; }
.tag.core { border: 1px solid var(--line-2); color: var(--ink-2); background: #fff; }
.tag.crm { border: 1px dashed var(--ink-3); color: var(--ink-2); }
/* 빈 상태: 0원일 때 무엇을 하면 되는지 한 줄과 버튼 하나 */
.empty-state { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 30px 20px 28px; border: 1px dashed var(--line-2); border-radius: 10px; background: #fafbfc; color: var(--ink-2); }
.empty-state svg { width: 30px; height: 30px; stroke: var(--ink-3); stroke-width: 1.3; margin-bottom: 2px; }
.empty-state b { color: var(--ink); font-size: 14.5px; }
.empty-state p { margin: 0 0 8px; font-size: 13px; max-width: 46ch; }
.amt-off { color: var(--ink-3); }

/* 모바일(폭 760px 이하): 시안 내비는 가로로 밀어 보고, 손가락으로 누르는 크기와 16px 입력 글자(iOS 확대 방지)를 맞춘다. 데스크톱 값은 위에서 그대로. */
@media (max-width: 760px) {
  #proto-nav { position: static; overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding: 0 8px; }
  #proto-nav::-webkit-scrollbar { display: none; }
  #proto-nav a, #proto-nav button { flex: none; }
  #proto-nav .pn-home { margin-right: 4px; }
  #proto-nav button { margin-left: 12px; }
  .btn { height: 40px; }
  .btn.sm { height: 36px; }
  .icon-btn { width: 36px; height: 36px; }
  .input { height: 42px; font-size: 16px; }
  textarea.input { font-size: 16px; }
  .seg button { height: 34px; }
  .ck { width: 22px; height: 22px; border-radius: 6px; }
  .ck:checked { background-size: 16px; }
  .link { padding: 8px 0; }
  .paper { padding: 22px 16px 28px; font-size: 12.5px; }
  .q-title { font-size: 22px; letter-spacing: .4em; margin-bottom: 20px; }
  .q-head { grid-template-columns: 1fr; gap: 14px; }
  .q-amount { flex-wrap: wrap; gap: 6px 12px; }
  .q-amount .big { font-size: 22px; }
  .q-sum { width: 100%; }
  #toast { left: 16px; right: 16px; width: auto; max-width: none; text-align: center; transform: translateY(20px); bottom: 16px; }
  #toast.show { transform: none; }
}
