@font-face { font-family: "Pretendard"; src: url("/fonts/PretendardVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #16191c;
  --ink2: #4a5157;
  --ink3: #868d94;
  --line: #e4e7ea;
  --line2: #d3d8dc;
  --soft: #f5f6f7;
  --accent: #0f9e8e;
  --accent-soft: #eaf8f6;
  --warn: #a85a08;
  --err: #c63030;
  --ok: #1a9e6a;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; color: var(--ink); background: #fff; word-break: keep-all; }
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hint { font-size: 13px; color: var(--ink3); }
.error { font-size: 14px; color: var(--err); }
main > .error { margin-bottom: 16px; padding: 10px 14px; background: #fdf1f1; border-radius: 8px; }

/* 머리 */
.top { border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand img { display: block; }
.brand span { padding-left: 10px; border-left: 1px solid var(--line2); line-height: 1.1; }
.top nav { display: flex; gap: 18px; }
.top nav a { font-size: 14px; color: var(--ink2); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

main { max-width: 1120px; margin: 0 auto; padding: 32px 20px 0; }

/* 파일 올리기 전 */
.start { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; padding-top: 16px; }
h1 { font-size: 26px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.sub { margin-top: 8px; color: var(--ink2); }
.drop { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 20px; border: 1px dashed #b9c0c6; border-radius: 10px; background: var(--soft); cursor: pointer; text-align: center; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-btn { padding: 10px 22px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; }
.drop-title { font-size: 15px; }
.drop-sub { font-size: 13px; color: var(--ink3); }
body.uploading .drop { pointer-events: none; opacity: 0.6; }
.samples { margin-top: 14px; font-size: 13px; color: var(--ink3); }
.samples button { margin-left: 10px; color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; }
.samples button:hover { color: var(--accent); }

.range h2 { font-size: 15px; font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.range dl { display: grid; grid-template-columns: 96px 1fr; font-size: 14px; }
.range dt, .range dd { padding: 11px 0; border-bottom: 1px solid var(--line); }
.range dt { color: var(--ink3); }
.range dd { font-variant-numeric: tabular-nums; }

/* 파일 올린 뒤 */
.filebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.filebar p { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filebar b { font-size: 17px; font-weight: 700; }
.filebar span { margin-left: 10px; font-size: 13px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.filebar button { flex: none; padding: 7px 14px; border: 1px solid var(--line2); border-radius: 8px; font-size: 14px; }
.filebar button:hover { border-color: var(--ink3); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; align-items: start; }
.viewer { height: 440px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); overflow: hidden; }
.viewer canvas { display: block; width: 100%; height: 100%; }

.block { margin-top: 28px; }
.block h2 { font-size: 15px; font-weight: 700; }
.block .hint { margin-top: 2px; }

.orient { margin-top: 10px; border-top: 1px solid var(--line); }
.orient button { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 76px; align-items: center; gap: 10px; width: 100%; padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.orient button::before { content: ""; width: 16px; height: 16px; border: 1.5px solid #aab1b7; border-radius: 50%; }
.orient button[aria-checked="true"] { background: var(--accent-soft); font-weight: 600; }
.orient button[aria-checked="true"]::before { border: 5px solid var(--accent); }
.orient button:hover { background: var(--soft); }
.orient button[aria-checked="true"]:hover { background: var(--accent-soft); }
.orient em { margin-left: 6px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--accent); }
.orient span { font-size: 13px; font-weight: 400; color: var(--ink3); font-variant-numeric: tabular-nums; text-align: right; }

.checks { margin-top: 10px; border-top: 1px solid var(--line); }
.checks li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.checks li::before { content: ""; width: 8px; height: 8px; margin: 7px 4px 0; border-radius: 50%; background: var(--ok); }
.checks li.warn::before { background: #e08a1e; }
.checks small { display: block; font-size: 13px; color: var(--ink3); }

/* 옵션 */
.opts { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; }
.opt { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.opt:last-child { border-bottom: 0; }
.opt-label { padding-top: 8px; font-size: 13px; color: var(--ink2); }
.opt .hint { margin-top: 6px; }
.choice { display: flex; flex-wrap: wrap; gap: 6px; }
.choice label { position: relative; }
.choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice span { display: block; padding: 7px 12px; border: 1px solid var(--line2); border-radius: 8px; font-size: 14px; white-space: nowrap; }
.choice small { margin-left: 6px; font-size: 12px; color: var(--ink3); }
.choice label:hover span { border-color: var(--ink3); }
.choice input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); font-weight: 600; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.stepper { display: inline-flex; width: max-content; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.stepper button { width: 36px; height: 36px; font-size: 16px; color: var(--ink2); }
.stepper button:hover { background: var(--soft); }
.stepper input { width: 60px; height: 36px; border: 0; border-left: 1px solid var(--line2); border-right: 1px solid var(--line2); text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 금액 */
.price { margin-top: 16px; padding: 20px; border-radius: 10px; background: var(--soft); }
.price-busy { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--ink2); }
.spin { width: 14px; height: 14px; border: 2px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#quote-body.stale { opacity: 0.45; }
.price-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.price-head > span { font-size: 14px; font-weight: 600; }
.price-head small { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--ink3); }
.price-head strong { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-head strong span { margin-right: 2px; font-size: 30px; letter-spacing: -0.01em; }
.price-sub { margin-top: 2px; text-align: right; font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.price h3 { margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.rows { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line2); font-size: 13.5px; }
.price h3 + .rows { margin-top: 8px; padding-top: 0; border-top: 0; }
.rows dt { color: var(--ink2); }
.rows dd { text-align: right; font-variant-numeric: tabular-nums; }
.usage { margin-top: 10px; }
.usage-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.usage-key { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.usage-key span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: var(--c); }
.warns { margin-top: 12px; font-size: 13px; color: var(--warn); }
.warns li + li { margin-top: 4px; }
.warns:empty { display: none; }
.actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 18px; }
.actions button { padding: 12px 16px; border-radius: 8px; font-size: 15px; font-weight: 600; }
.actions .primary { background: var(--ink); color: #fff; }
.actions .primary:disabled { background: #c3c9ce; }
.actions #print { border: 1px solid var(--line2); background: #fff; font-weight: 500; }
.actions #print:disabled { color: var(--ink3); }
.price > div > .hint { margin-top: 10px; }

/* 이용 안내 */
.guide { margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line); }
.guide h2 { font-size: 18px; font-weight: 700; }
.guide h2 small { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--ink3); }
.guide dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); margin-top: 12px; max-width: 820px; font-size: 14px; }
.guide dt, .guide dd { padding: 13px 0; border-bottom: 1px solid var(--line); }
.guide dt { font-weight: 600; }
.guide dd { color: var(--ink2); }

/* 문의 */
.inquiry { margin-top: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; }
.inquiry h2 { font-size: 16px; font-weight: 700; }
.inquiry h2 + .hint { margin-top: 4px; }
.inquiry-body > * + * { margin-top: 12px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inquiry h2 + .hint + .inquiry-body { margin-top: 14px; }
.field { display: block; font-size: 13px; color: var(--ink2); }
.field em { margin-left: 4px; font-style: normal; font-size: 12px; color: var(--accent); }
.field input, .field textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid var(--line2); border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink); background: #fff; }
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { padding: 12px 14px; border-radius: 8px; background: var(--soft); }
.consent .check { align-items: flex-start; padding: 4px 0; }
.consent .check input { margin-top: 3px; flex: none; }
.consent .hint { margin: 2px 0 6px 24px; font-size: 12px; }
.consent b { font-weight: 600; color: var(--accent); }
.inquiry .submit { width: 100%; padding: 12px 16px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 600; }
.inquiry .submit:disabled { background: #c3c9ce; }
.sent h2 { color: var(--ok); }
.sent p { margin-top: 6px; }
.sent b { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.contact { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px; margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line); }
.contact h2 { font-size: 18px; font-weight: 700; }
.contact-intro p { margin-top: 8px; font-size: 14px; color: var(--ink2); }
.contact .inquiry { margin-top: 0; max-width: 640px; }

/* 사업자 정보 */
.foot { max-width: 1120px; margin: 56px auto 0; padding: 24px 20px 40px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink3); }
.foot-links { display: flex; gap: 18px; margin-bottom: 12px; font-size: 13px; }
.foot-links a { color: var(--ink2); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.biz { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 2px 32px; margin: 0; }
.biz div { display: flex; gap: 8px; }
.biz dt { flex: none; color: var(--ink3); }
.biz dd { margin: 0; color: var(--ink2); }
.biz a { color: var(--ink2); }
.foot > p { margin-top: 12px; }

/* 정책 문서 */
.doc { max-width: 760px; padding-top: 40px; font-size: 14.5px; line-height: 1.7; }
.doc h1 { font-size: 24px; }
.doc-meta { margin-top: 4px; font-size: 13px; color: var(--ink3); }
.doc h2 { margin-top: 32px; font-size: 16px; font-weight: 700; }
.doc p, .doc ul, .doc table { margin-top: 10px; }
.doc ul { padding-left: 20px; list-style: disc; }
.doc li + li { margin-top: 6px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc th, .doc td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th { background: var(--soft); font-weight: 600; }

/* 단가 조정 */
.lab { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: 340px; padding: 20px; overflow-y: auto; background: #fff; border-right: 1px solid var(--line2); box-shadow: 4px 0 24px rgba(22, 25, 28, 0.08); }
.lab-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.lab h2 { font-size: 16px; font-weight: 700; }
.lab-head button, #lab-reset { font-size: 13px; color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; }
.lab h3 { margin: 22px 0 6px; font-size: 14px; font-weight: 700; }
.lab-group h3 { margin-top: 18px; }
.knob { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin-top: 8px; font-size: 13px; color: var(--ink2); }
.knob output { color: var(--ink); font-variant-numeric: tabular-nums; }
.knob em { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #fff6dd; color: #6a4d00; font-size: 11px; font-style: normal; }
.knob input { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: var(--accent); }
#lab-reset { margin-top: 14px; }
.bench { font-size: 14px; }
.bench b { font-variant-numeric: tabular-nums; }
.bench small { display: block; margin-top: 4px; font-size: 13px; color: var(--ink2); }
.lab > .hint { margin-top: 8px; }
@media (min-width: 1500px) {
  body.lab-open { padding-left: 340px; }
  .lab { box-shadow: none; }
}

@media (max-width: 900px) {
  main { padding-top: 20px; }
  .start { grid-template-columns: 1fr; gap: 32px; padding-top: 0; }
  .cols { grid-template-columns: 1fr; gap: 20px; }
  .left, .right { display: contents; }
  .viewer { order: 1; height: 280px; }
  .opts { order: 2; }
  .price { order: 3; margin-top: 0; }
  .left .block { order: 4; margin-top: 8px; }
  .orient button { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .orient button span:last-child { display: none; }
  .guide { margin-top: 48px; }
  .guide dl { grid-template-columns: 1fr; }
  .guide dt { padding-bottom: 0; border-bottom: 0; }
  .guide dd { padding-top: 2px; }
  .lab { width: min(340px, 88vw); }
  .contact { grid-template-columns: 1fr; gap: 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .biz { grid-template-columns: 1fr; }
}

@media print {
  .top nav, .lab, .viewer, .block, .guide, .contact, .inquiry, .foot, .actions, .filebar button, .price-busy, #quote-body.stale { display: none !important; }
  body { padding: 0 !important; }
  .cols { grid-template-columns: 1fr; }
  .price { background: none; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2s; }
}
