:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1a1d21;
  --ink-2: #4b5563;
  --ink-3: #9ca3af;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: #eaf1fe;
  --accent-ink: #1d4ed8;
  --green: #059669;
  --green-soft: #e7f6f0;
  --amber: #d97706;
  --amber-soft: #fef3e2;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  letter-spacing: -0.01em;
}

/* ---------- header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.logo { font-size: 19px; font-weight: 800; cursor: pointer; }
.header-sub { font-size: 12.5px; color: var(--ink-3); }

/* ---------- progress ---------- */
.progress-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 18px 20px 0;
}
.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.progress-step {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
  flex: 1;
  text-align: center;
}
.progress-step.active { color: var(--accent-ink); }
.progress-step.done { color: var(--green); }
.progress-bar {
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #4f8df9);
  border-radius: 99px;
  transition: width .4s ease;
}

/* ---------- layout ---------- */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.step-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.step-desc { font-size: 14.5px; color: var(--ink-2); margin-bottom: 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
}

/* ---------- step 1 : home info ---------- */
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.field-row:last-child { border-bottom: none; }
.field-label { font-size: 15.5px; font-weight: 700; }
.field-hint { font-size: 12.5px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }

.pyeong-input {
  display: flex; align-items: center; gap: 8px;
}
.pyeong-input input {
  width: 90px;
  padding: 10px 12px;
  font-size: 17px;
  font-weight: 700;
  text-align: right;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  outline: none;
  font-family: inherit;
}
.pyeong-input input:focus { border-color: var(--accent); }
.pyeong-unit { font-size: 15px; font-weight: 600; color: var(--ink-2); }

.counter { display: flex; align-items: center; gap: 4px; }
.counter button {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
}
.counter button:hover { border-color: var(--accent); color: var(--accent); }
.counter button:disabled { opacity: .35; cursor: default; }
.counter .count { width: 44px; text-align: center; font-size: 17px; font-weight: 800; }

/* ---------- step 2 : space select ---------- */
.space-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.space-card {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.space-card:hover { border-color: #b9cffb; }
.space-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.space-card .space-emoji { font-size: 28px; margin-bottom: 6px; }
.space-card .space-name { font-size: 15px; font-weight: 700; }
.space-card .space-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.space-card.selected .space-sub { color: var(--accent-ink); }

/* ---------- step 3 : work select ---------- */
.space-section { margin-bottom: 22px; }
.space-section-title {
  font-size: 17px; font-weight: 800;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.space-section-title .badge {
  font-size: 11.5px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-ink);
  padding: 3px 9px; border-radius: 99px;
}
.work-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.work-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  position: relative;
}
.work-item:hover { border-color: #b9cffb; }
.work-item.selected { border-color: var(--accent); background: var(--accent-soft); }
.work-check {
  width: 20px; height: 20px; flex: none;
  border: 2px solid var(--line);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
  transition: all .15s;
}
.work-item.selected .work-check { background: var(--accent); border-color: var(--accent); }
.work-name { font-size: 14px; font-weight: 600; flex: 1; }
.work-price-hint { font-size: 11.5px; color: var(--ink-3); display: block; font-weight: 500; }

/* tooltip */
.info-icon {
  width: 19px; height: 19px; flex: none;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-2);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  cursor: help;
  position: relative;
}
.info-icon:hover { background: var(--ink-2); color: #fff; }
.tooltip {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  background: #23272e;
  color: #f3f4f6;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s;
  z-index: 30;
  pointer-events: none;
  text-align: left;
}
.tooltip::after {
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #23272e;
}
.info-icon:hover .tooltip,
.info-icon.open .tooltip { opacity: 1; visibility: visible; }

/* ---------- step 4 : option detail ---------- */
.detail-progress {
  font-size: 13px; font-weight: 700; color: var(--accent-ink);
  background: var(--accent-soft);
  display: inline-block;
  padding: 5px 12px;
  border-radius: 99px;
  margin-bottom: 14px;
}
.option-grid { display: grid; gap: 12px; }
.option-card {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.option-body { padding-right: 26px; }
.option-card:hover { border-color: #b9cffb; }
.option-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.option-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.option-name { font-size: 16px; font-weight: 800; }
.option-tag {
  font-size: 11px; font-weight: 700;
  padding: 2.5px 8px; border-radius: 99px;
}
.tag-recommend { background: var(--green-soft); color: var(--green); }
.tag-popular { background: var(--amber-soft); color: var(--amber); }
.tag-premium { background: #f3e8ff; color: #7c3aed; }
.tag-budget { background: #e0f2fe; color: #0369a1; }
.option-price { font-size: 14.5px; font-weight: 700; color: var(--accent-ink); margin-bottom: 8px; }
.option-desc { font-size: 13.5px; color: var(--ink-2); margin-bottom: 10px; }
.option-points { display: flex; flex-wrap: wrap; gap: 6px; }
.point-chip {
  font-size: 12px; font-weight: 600;
  background: var(--bg);
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: 3.5px 10px;
  border-radius: 99px;
}
.option-card.selected .point-chip { background: #fff; }
.option-radio {
  position: absolute; top: 18px; right: 18px;
  width: 22px; height: 22px;
  border: 2px solid var(--line);
  border-radius: 50%;
  transition: all .15s;
}
.option-card.selected .option-radio {
  border-color: var(--accent);
  border-width: 7px;
}
.skip-link {
  display: block; text-align: center;
  margin-top: 14px;
  font-size: 13.5px; color: var(--ink-3);
  cursor: pointer; text-decoration: underline;
  background: none; border: none; width: 100%;
  font-family: inherit;
}
.skip-link:hover { color: var(--ink-2); }

/* ---------- step 5 : summary ---------- */
.ai-loading {
  text-align: center;
  padding: 70px 20px;
}
.ai-loading .spinner {
  width: 46px; height: 46px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-loading .ai-msg { font-size: 16px; font-weight: 700; }
.ai-loading .ai-sub { font-size: 13px; color: var(--ink-3); margin-top: 6px; }

.summary-hero {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px 24px;
  margin-bottom: 16px;
}
.summary-hero .hero-label { font-size: 13px; opacity: .8; font-weight: 600; }
.summary-hero .hero-price { font-size: 30px; font-weight: 800; margin: 4px 0 2px; }
.summary-hero .hero-sub { font-size: 13.5px; opacity: .85; }
.hero-metrics { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.hero-metric {
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 12px 16px;
  flex: 1;
  min-width: 130px;
}
.hero-metric .m-label { font-size: 12px; opacity: .8; }
.hero-metric .m-value { font-size: 17px; font-weight: 800; margin-top: 2px; }

.summary-section-title { font-size: 18px; font-weight: 800; margin: 26px 0 12px; }
.summary-space { margin-bottom: 14px; }
.summary-space-name { font-size: 15px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.summary-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.summary-row:last-child { border-bottom: none; }
.summary-row .work { color: var(--ink-2); }
.summary-row .opt { font-weight: 700; }
.summary-row .price { font-weight: 700; color: var(--accent-ink); white-space: nowrap; }

/* ---------- 공정표 간트(타임라인) 요약 ---------- */
.gantt { }
.gantt-axis {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--ink-3); font-weight: 700;
  margin-bottom: 10px; padding-bottom: 7px;
  border-bottom: 1px dashed var(--line);
}
.gantt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.gantt-label {
  width: 122px; flex: none;
  font-size: 11.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gantt-track {
  flex: 1; height: 20px;
  background: var(--bg);
  border-radius: 5px; position: relative;
}
.gantt-bar {
  position: absolute; top: 0; height: 100%;
  border-radius: 5px; min-width: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 800;
}
.gantt-day {
  width: 54px; flex: none;
  font-size: 10.5px; color: var(--ink-3); font-weight: 700; text-align: right;
}

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px;
  transform: translateX(-50%) translateY(20px);
  background: #23272e; color: #fff;
  font-size: 13.5px; font-weight: 600;
  padding: 13px 20px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  z-index: 200; opacity: 0;
  transition: opacity .2s, transform .2s;
  max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.schedule-list { position: relative; }
.schedule-item {
  display: flex; gap: 14px;
  padding-bottom: 18px;
  position: relative;
}
.schedule-item::before {
  content: "";
  position: absolute;
  left: 17px; top: 38px; bottom: 0;
  width: 2px;
  background: var(--line);
}
.schedule-item:last-child::before { display: none; }
.schedule-day {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.schedule-body { flex: 1; }
.schedule-name { font-size: 15px; font-weight: 800; }
.schedule-days { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-left: 6px; }
.schedule-works { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.schedule-tip {
  margin-top: 7px;
  font-size: 12.5px;
  background: var(--amber-soft);
  color: #92400e;
  border-radius: 8px;
  padding: 8px 11px;
}
.schedule-tip strong { font-weight: 800; }
.parallel-badge {
  font-size: 11px; font-weight: 800;
  color: var(--accent-ink); background: var(--accent-soft);
  border-radius: 99px; padding: 2px 8px; margin-left: 8px;
  white-space: nowrap;
}
.sc-parallel {
  font-size: 10.5px; font-weight: 800;
  color: var(--accent-ink); background: var(--accent-soft);
  border-radius: 99px; padding: 1.5px 7px; margin-left: 7px;
}

.disclaimer {
  font-size: 12.5px;
  color: var(--ink-3);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 20px;
  line-height: 1.6;
}

/* ---------- ad slot ---------- */
.ad-slot {
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 12px, #f3f4f6 12px, #f3f4f6 24px);
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 26px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 600;
  margin: 20px 0;
}

/* ---------- modal (연관 시공 알림 / 광고) ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(15, 18, 25, .55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 16px;
  max-width: 540px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.modal-desc { font-size: 13.5px; color: var(--ink-2); margin-bottom: 16px; }
.modal-buttons { display: flex; gap: 10px; margin-top: 16px; }

.suggest-row {
  display: flex; gap: 11px; align-items: flex-start;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.suggest-row.checked { border-color: var(--accent); background: var(--accent-soft); }
.suggest-check {
  width: 20px; height: 20px; flex: none;
  margin-top: 1px;
  border: 2px solid var(--line);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
}
.suggest-row.checked .suggest-check { background: var(--accent); border-color: var(--accent); }
.suggest-name { font-size: 14px; font-weight: 700; }
.suggest-name .suggest-space { font-size: 11.5px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 99px; padding: 2px 8px; margin-left: 6px; }
.suggest-row.checked .suggest-name .suggest-space { background: #fff; }
.suggest-price { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }
.suggest-reason { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }
.warn-row {
  background: var(--amber-soft);
  color: #92400e;
  font-size: 12.5px;
  line-height: 1.55;
  border-radius: 10px;
  padding: 10px 13px;
  margin-bottom: 8px;
}

/* ---------- 광고 게이트 ---------- */
.ad-video {
  height: 190px;
  border-radius: 12px;
  background: linear-gradient(120deg, #3b4a63, #2563eb, #7c3aed, #3b4a63);
  background-size: 300% 300%;
  animation: adflow 4s ease infinite;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #fff;
  position: relative;
  margin-bottom: 14px;
}
@keyframes adflow { 0% {background-position: 0 50%;} 50% {background-position: 100% 50%;} 100% {background-position: 0 50%;} }
.ad-video .ad-label {
  position: absolute; top: 10px; left: 10px;
  font-size: 11px; font-weight: 800;
  background: rgba(255,255,255,.25);
  padding: 3px 8px; border-radius: 6px;
}
.ad-video .ad-brand { font-size: 19px; font-weight: 800; }
.ad-video .ad-copy { font-size: 12.5px; opacity: .85; margin-top: 4px; }
.ad-countdown {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}

/* ---------- 카카오 공유 버튼 ---------- */
.btn-kakao {
  background: #fee500;
  color: #191919;
  flex: 1;
}
.btn-kakao:hover { background: #f5d900; }
.share-note { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 10px; }

/* ---------- 공유용 견적서 카드 (캡처 전용) ---------- */
.share-card {
  position: fixed; left: -9999px; top: 0;
  width: 640px;
  background: #fff;
  padding: 32px;
  font-family: inherit;
  color: var(--ink);
}
.share-card .sc-brand { font-size: 16px; font-weight: 800; color: var(--accent-ink); }
.share-card .sc-date { font-size: 12px; color: var(--ink-3); }
.share-card .sc-hero {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  margin: 14px 0 18px;
}
.share-card .sc-hero .sc-label { font-size: 12px; opacity: .85; }
.share-card .sc-hero .sc-price { font-size: 26px; font-weight: 800; margin-top: 2px; }
.share-card .sc-hero .sc-meta { font-size: 12.5px; opacity: .9; margin-top: 6px; }
.share-card .sc-space { font-size: 13.5px; font-weight: 800; margin: 12px 0 4px; }
.share-card .sc-row {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12.5px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.share-card .sc-row .sc-price2 { font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
.share-card .sc-sectiontitle { font-size: 15px; font-weight: 800; margin: 22px 0 12px; padding-top: 18px; border-top: 2px solid var(--line); }
.share-card .sc-step { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.share-card .sc-step-day { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.share-card .sc-step-body { flex: 1; }
.share-card .sc-step-name { font-size: 13px; font-weight: 800; }
.share-card .sc-step-days { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-left: 5px; }
.share-card .sc-step-works { font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }
.share-card .sc-foot { font-size: 10.5px; color: var(--ink-3); margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.6; }

/* ---------- nav buttons ---------- */
.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.btn {
  padding: 15px 22px;
  border-radius: 12px;
  font-size: 15.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  flex: 1;
}
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary:disabled { background: #c7d4ec; cursor: default; }
.btn-ghost {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--ink-3); }

.empty-note {
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
  padding: 30px 0;
}

/* ---------- footer ---------- */
.site-footer {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px;
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  line-height: 1.7;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .work-list { grid-template-columns: 1fr; }
  .header-sub { display: none; }
  .step-title { font-size: 21px; }
  .progress-step { font-size: 10.5px; }
  .tooltip { width: 190px; }
  .summary-hero .hero-price { font-size: 25px; }
  .option-card { padding: 15px; }
  .gantt-label { width: 88px; font-size: 10.5px; }
  .gantt-day { width: 46px; font-size: 9.5px; }
}
