/* =========================================================
   3분 자동견적 페이지 (estimate.css)
   ========================================================= */
.est-section { padding-top: clamp(24px, 4vw, 48px); }
.est-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(24px, 3vw, 44px); align-items: start; }
.est-main { min-width: 0; }
.est-form { display: grid; gap: 22px; }

/* ---------- steps ---------- */
.est-step { border: 1px solid var(--line); border-radius: var(--radius-l); padding: clamp(20px, 3vw, 32px); margin: 0; background: #fff; min-width: 0; }
.est-step-head { display: flex; gap: 14px; align-items: flex-start; padding: 0; margin-bottom: 22px; width: 100%; }
legend.est-step-head { float: left; }
legend.est-step-head + * { clear: both; }
.est-step-no { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: -0.02em; }
.est-step-head b { display: block; font-size: var(--fs-xl); letter-spacing: -0.02em; line-height: 1.3; }
.est-step-head small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; font-weight: 500; }

.est-field { display: grid; gap: 10px; margin-bottom: 22px; min-width: 0; }
.est-field:last-child { margin-bottom: 0; }
.est-label { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.est-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.est-grid-2 .est-field { margin-bottom: 22px; }
.est-type-note { margin: 0; color: var(--accent-2); }
.est-py-out { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }

/* range */
.est-range { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; margin: 0; --fill: 36.7%; }
.est-range::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--ink) 0, var(--ink) var(--fill), var(--line) var(--fill), var(--line) 100%); }
.est-range::-moz-range-track { height: 8px; border-radius: 999px; background: var(--line); }
.est-range::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--ink); }
.est-range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); margin-top: -10px; box-shadow: var(--shadow-s); cursor: grab; }
.est-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); cursor: grab; }
.est-range:focus-visible { outline: none; }
.est-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(181,89,43,.3); }
.est-range-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-2); margin-top: -6px; }
.est-py-chips .opt { min-height: 38px; }

/* option buttons with price hint */
.est-step .opt[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.est-opt { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding: 8px 14px; text-align: left; line-height: 1.3; min-height: 50px; }
.est-opt small { font-size: 12px; font-weight: 500; color: var(--muted); }
.est-opt[aria-pressed="true"] small { color: #d8dbe0; }
.est-opt[data-multi] span::before { content: "+ "; color: var(--muted-2); }
.est-opt[data-multi][aria-pressed="true"] span::before { content: "✓ "; color: #f0c3a6; }

/* ---------- lineups ---------- */
.est-lineups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.est-lu { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px 16px 18px; border-radius: var(--radius); border: 1.5px solid var(--line-2); background: #fff; text-align: left; transition: border-color .15s, background .15s, box-shadow .15s; }
.est-lu:hover { border-color: var(--ink); }
.est-lu-en { font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--accent); }
.est-lu b { font-size: 19px; letter-spacing: -0.02em; }
.est-lu small { font-size: 13px; color: var(--muted); line-height: 1.45; }
.est-lu .badge { position: absolute; right: 12px; top: 12px; }
.est-lu[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.est-lu[aria-pressed="true"] small { color: #c9ccd2; }
.est-lu[aria-pressed="true"] .est-lu-en { color: #f0c3a6; }
.est-lu-price { margin-top: 6px; font-size: 13.5px; font-weight: 800; color: var(--accent-2); letter-spacing: -0.01em; }
.est-lu-price:empty { display: none; }
.est-lu[aria-pressed="true"] .est-lu-price { color: #f3c3a3; }
.est-opt small + small { color: var(--ink-3); font-weight: 650; }
.est-opt[aria-pressed="true"] small + small { color: #fff; }
.est-c-list li.is-cur .est-c-label { color: var(--ink); font-weight: 800; }
.est-c-list li.is-cur .est-c-track i { background: #a8875a; }

/* ---------- process cards ---------- */
.est-items { display: grid; gap: 12px; }
.est-item { border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); transition: border-color .15s, background .15s; }
.est-item.is-on { border-color: var(--ink); background: #fff; }
.est-item-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.est-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; border: 0; background: transparent; padding: 0; text-align: left; }
.est-check { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2); background: #fff; display: grid; place-items: center; transition: .15s; }
.est-toggle[aria-pressed="true"] .est-check { background: var(--accent); border-color: var(--accent); }
.est-toggle[aria-pressed="true"] .est-check::after { content: ""; width: 7px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.est-item-title { min-width: 0; }
.est-item-title b { display: block; font-size: 17px; letter-spacing: -0.02em; }
.est-item-title small { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }
.est-item-price { flex: none; font-weight: 800; font-size: 16px; letter-spacing: -0.02em; text-align: right; white-space: nowrap; }
.est-item-price .muted { font-weight: 600; font-size: 14px; }
.est-item-body { padding: 4px 16px 18px 56px; display: grid; gap: 16px; }
.est-item-body[hidden] { display: none; }
.est-ctl { display: grid; gap: 8px; }
.est-ctl-label { font-size: 13.5px; font-weight: 700; color: var(--ink-3); }
.est-stepper { display: inline-flex; align-items: center; gap: 0; border: 1.5px solid var(--line-2); border-radius: 12px; overflow: hidden; width: max-content; background: #fff; }
.est-stepper button { width: 46px; height: 44px; border: 0; background: #fff; font-size: 22px; font-weight: 600; color: var(--ink); }
.est-stepper button:hover:not([disabled]) { background: var(--stone); }
.est-stepper button[disabled] { color: var(--muted-2); cursor: not-allowed; }
.est-stepper output { min-width: 64px; text-align: center; font-weight: 800; font-size: 17px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); line-height: 44px; }
.est-stepper output small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }

/* ---------- result ---------- */
.est-result { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius-l); padding: clamp(20px, 3vw, 32px); background: #fff; scroll-margin-top: calc(var(--header-h) + 12px); }
.est-result-head { margin-bottom: 18px; }
.est-total-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 22px 24px; border-radius: var(--radius); background: var(--ink); color: #fff; }
.est-total-label { margin: 0 0 4px; color: #c9ccd2; font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.est-total-label .chip { height: 24px; font-size: 11.5px; color: #e5e7eb; border-color: #4a505a; }
.est-total { margin: 0; font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.est-total-sub { margin: 6px 0 0; color: #c9ccd2; font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; }
.est-total-sub span:empty { display: none; }
.est-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.est-actions .btn { min-height: 42px; font-size: 14px; padding: 0 14px; }
.est-actions .btn--primary, .est-actions .est-act-wide { grid-column: 1 / -1; }
.est-actions .btn--primary { background: var(--accent); }
.est-actions .btn--primary:hover { background: var(--accent-2); }
.est-actions .btn--line { border-color: #5a606a; color: #fff; }
.est-actions .btn--line:hover { background: #fff; color: var(--ink); }

.est-h3 { font-size: 19px; margin: 32px 0 12px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.est-h3 small { font-size: 13px; color: var(--muted); font-weight: 600; }
.est-tbl { min-width: 600px; }
.est-tbl th[scope="row"] { font-weight: 700; color: var(--ink); background: transparent; font-size: 15px; white-space: nowrap; }
.est-tbl td { color: var(--ink-3); font-size: 14px; }
.est-tbl td.num { color: var(--ink); font-weight: 700; }
.est-tbl tfoot th, .est-tbl tfoot th[scope="row"], .est-tbl tfoot td { background: var(--paper); font-weight: 800; color: var(--ink); font-size: 15px; border-top: 1px solid var(--line-2); }
.est-bar-col { width: 24%; min-width: 120px; }
.est-rbar { display: block; position: relative; height: 10px; border-radius: 999px; background: var(--stone); }
.est-rbar b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px 0 0 999px; background: #d9cdb9; }
.est-rbar i { position: absolute; top: 0; bottom: 0; border-radius: 0 999px 999px 0; background: var(--ink); }
.est-row--common th, .est-row--adj th { color: var(--ink-3) !important; font-weight: 600 !important; }
.est-row--common .est-rbar i { background: var(--muted-2); }
.est-row--adj .est-rbar i { background: var(--accent); }

/* gantt */
.est-gantt-list { list-style: none; display: grid; gap: 8px; }
.est-gantt-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 96px; gap: 12px; align-items: center; font-size: 14px; }
.est-g-label { font-weight: 650; white-space: nowrap; }
.est-g-label b { color: var(--accent); font-size: 12px; margin-right: 2px; }
.est-g-track { position: relative; height: 14px; border-radius: 4px; background: var(--stone); }
.est-g-track i { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, var(--ink-2), var(--ink)); }
.est-g-days { font-weight: 700; text-align: right; line-height: 1.2; }
.est-g-days small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.est-gantt + .hint, .est-compare + .hint { margin-top: 12px; }

/* compare */
.est-verdict { margin: 0 0 12px; font-size: 15px; }
.est-c-list { list-style: none; display: grid; gap: 8px; }
.est-c-list li { display: grid; grid-template-columns: 190px minmax(0, 1fr) 170px; gap: 12px; align-items: center; font-size: 14px; }
.est-c-label { font-weight: 600; color: var(--ink-3); }
.est-c-track { position: relative; height: 12px; border-radius: 999px; background: var(--stone); }
.est-c-track i { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: #cdb894; }
.est-c-track i.is-open { background: linear-gradient(90deg, #cdb894, rgba(205,184,148,0)); }
.est-c-val { text-align: right; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.est-c-list li.is-mine .est-c-label, .est-c-list li.is-mine .est-c-val { color: var(--accent-2); font-weight: 800; }
.est-c-list li.is-mine .est-c-track i { background: var(--accent); }
.est-disclaimer { margin-top: 28px; line-height: 1.7; }
.est-disclaimer strong { margin-right: 6px; color: var(--accent-2); }

/* tips & cta */
.est-tips { margin-top: 40px; }
.est-tips h2 { font-size: var(--fs-h3); }
.est-tip-list { list-style: none; counter-reset: tip; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.est-tip-list li { counter-increment: tip; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--paper); }
.est-tip-list li::before { content: "TIP " counter(tip); display: block; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--accent); margin-bottom: 6px; }
.est-tip-list b { font-size: 16.5px; }
.est-tip-list p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.est-cta { margin-top: 32px; }

/* ---------- aside summary (desktop) ---------- */
.est-aside { position: sticky; top: calc(var(--header-h) + 20px); }
.est-sum { border: 1px solid var(--line); border-radius: var(--radius-l); padding: 24px; background: #fff; box-shadow: var(--shadow); }
.est-sum .eyebrow { margin-bottom: 8px; }
.est-sum-meta { margin: 0 0 14px; font-weight: 700; color: var(--ink-3); font-size: 14px; }
.est-sum-label { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.est-sum-label small { font-size: 12px; }
.est-sum-total { margin: 2px 0 2px; font-size: 27px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.25; }
.est-sum-sub { margin: 0; font-size: 13.5px; color: var(--muted); }
.est-sum-list { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 7px; max-height: 260px; overflow: auto; }
.est-sum-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.est-sum-list li span { color: var(--ink-3); }
.est-sum-list li b { white-space: nowrap; font-weight: 700; }
.est-sum-extra span, .est-sum-extra b { color: var(--muted) !important; font-weight: 500 !important; }
.est-sum-days { display: flex; justify-content: space-between; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: 14px; }
.est-sum-days span { color: var(--muted); }
.est-sum-actions { display: grid; gap: 8px; margin-top: 18px; }
.est-sum-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.est-sum-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- mobile bottom bar ---------- */
.est-bar { display: none; }
.est-print { display: none; }

@media (max-width: 1100px) {
  .est-layout { grid-template-columns: minmax(0, 1fr) 310px; }
  .est-lineups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .est-c-list li { grid-template-columns: 150px minmax(0, 1fr) 150px; }
}
@media (max-width: 960px) {
  .est-layout { grid-template-columns: 1fr; }
  .est-aside { display: none; }
  .est-bar { display: flex; position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 84; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: rgba(22,24,29,.97); color: #fff; box-shadow: 0 -6px 20px rgba(22,24,29,.15); transition: transform .25s var(--ease), opacity .25s; }
  .est-bar.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
  .est-bar-txt { min-width: 0; line-height: 1.2; }
  .est-bar-txt small { display: block; font-size: 11.5px; color: #b9bcc2; }
  .est-bar-txt b { display: block; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .est-bar .btn--primary { background: var(--accent); flex: none; }
  .page-estimate { padding-bottom: calc(var(--tabbar-h) + 64px + env(safe-area-inset-bottom)); }
  .page-estimate .fab { bottom: calc(var(--tabbar-h) + 78px + env(safe-area-inset-bottom)); }
  .est-tip-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .est-step { padding: 18px 16px; border-radius: var(--radius); }
  .est-grid-2 { grid-template-columns: 1fr; }
  .est-lineups { gap: 8px; }
  .est-lu { padding: 12px 12px 14px; }
  .est-lu b { font-size: 17px; }
  .est-lu .badge { right: 8px; top: 8px; }
  .est-item-head { padding: 12px; align-items: flex-start; }
  .est-item-title small { display: none; }
  .est-item-price { font-size: 14px; padding-top: 3px; }
  .est-item-body { padding: 2px 12px 16px 12px; }
  .est-opt { min-height: 46px; padding: 6px 12px; }
  .est-total-card { grid-template-columns: 1fr; padding: 20px; }
  .est-result { padding: 18px 14px; }
  .est-gantt-list li { grid-template-columns: 82px minmax(0, 1fr) 64px; gap: 8px; font-size: 13px; }
  .est-c-list li { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .est-c-list .est-c-track { grid-column: 1 / -1; grid-row: 2; }
  .est-c-label { font-size: 13px; }
  .est-c-val { font-size: 13px; }
  table.tbl.est-tbl { min-width: 0; display: block; }
  .est-tbl tbody, .est-tbl tfoot { display: block; }
  .est-tbl thead { display: none; }
  .est-tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .est-tbl th, .est-tbl td { padding: 0; border: 0; }
  .est-tbl td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-size: 13px; }
  .est-tbl td.num { grid-row: 1; grid-column: 2; font-size: 14px; }
  .est-tbl tfoot td.num { font-size: 15px; }
  .est-tbl td[colspan] { grid-column: 1 / -1; }
  .est-tbl .est-bar-col { grid-column: 1 / -1; width: auto; min-width: 0; padding-top: 6px; }
  .est-tbl tfoot tr { background: var(--paper); }
  .est-tbl th[scope="row"] { white-space: normal; }
  .est-tbl tfoot td:last-child { display: none; }
}

/* ---------- print ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  main > * { display: none !important; }
  main > #estPrint { display: block !important; }
  .est-bar, .modal, .toast, .skip-link { display: none !important; }
  body.page-estimate { padding: 0 !important; background: #fff; color: #111; font-size: 11pt; }
  .est-print { font-size: 10.5pt; line-height: 1.55; color: #111; }
  .ep-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; padding-bottom: 10px; border-bottom: 2px solid #111; }
  .ep-brand { display: block; font-size: 18pt; letter-spacing: -0.02em; }
  .ep-head span { font-size: 9.5pt; color: #444; }
  .ep-contact { text-align: right; font-size: 9pt; color: #333; line-height: 1.5; }
  .ep-title { font-size: 16pt; margin: 18px 0 2px; }
  .ep-title small { font-size: 10pt; font-weight: 500; color: #555; }
  .ep-date { margin: 0 0 12px; color: #555; font-size: 9.5pt; }
  .ep-tbl { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 10pt; }
  .ep-tbl th, .ep-tbl td { border: 1px solid #bbb; padding: 6px 8px; text-align: left; vertical-align: top; }
  .ep-tbl th { background: #f1efeb; width: 18%; white-space: nowrap; }
  .ep-lines thead th { width: auto; }
  .ep-lines th:first-child, .ep-lines td:first-child { width: 22%; }
  .ep-lines td:nth-child(2), .ep-lines thead th:nth-child(2) { width: 50%; }
  .ep-tbl .num { text-align: right; white-space: nowrap; }
  .ep-tbl tfoot th, .ep-tbl tfoot td { background: #f1efeb; font-size: 11pt; }
  .ep-days { margin: 10px 0 2px; }
  .ep-phases { margin: 0 0 10px; font-size: 9pt; color: #444; }
  .ep-note { margin-top: 14px; padding: 10px 12px; border: 1px solid #bbb; font-size: 9pt; color: #333; }
  .ep-link { font-size: 8pt; color: #666; word-break: break-all; }
}
@media (max-width: 640px) { .est-lu-price { font-size: 12.5px; } }
