:root {
  --ink: #101827;
  --muted: #667085;
  --bg: #f3f5f2;
  --paper: #ffffff;
  --line: #dfe4dc;
  --blue: #345ef5;
  --blue-soft: #eef2ff;
  --lime: #c9f56a;
  --shadow: 0 20px 60px rgba(16, 24, 39, 0.09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif;
}
body.modal-open { overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(52, 94, 245, 0.25);
  outline-offset: 2px;
}
.shell { min-height: 100vh; }

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}
.brand { display: flex; gap: 11px; align-items: center; }
.mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px 12px 12px 3px;
  background: var(--ink);
  color: var(--lime);
  font-weight: 950;
}
.brand strong { display: block; }
.brand small { color: var(--muted); }
.ghost, .primary {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 850;
}
.ghost { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.primary { border: 0; background: var(--blue); color: #fff; }

.home {
  width: min(1240px, calc(100% - 32px));
  margin: auto;
  padding: 72px 0;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 70px;
  align-items: center;
}
.hero h1 {
  margin: 18px 0;
  font-size: clamp(46px, 6vw, 82px);
  line-height: 1;
  letter-spacing: -0.065em;
}
.hero h1 em { color: var(--blue); font-style: normal; }
.hero p { max-width: 520px; color: var(--muted); line-height: 1.8; }
.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.13em;
}
.launch {
  padding: 26px;
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow);
}
.launch h2 { margin: 4px 0 22px; }
.launch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.launch-card {
  min-height: 160px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #f8f9f6;
  text-align: left;
}
.launch-card:first-child { grid-column: 1 / -1; background: var(--ink); color: #fff; }
.launch-card strong { display: block; margin: 30px 0 8px; font-size: 27px; }
.launch-card span { color: var(--muted); font-size: 13px; }
.launch-card:first-child span { color: #c7d0df; }

.main { min-width: 0; }
.consult-main, .simple-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 72px;
}
.consult-main { display: grid; gap: 20px; }
.selector-panel, .workspace-section {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #f9faf7;
}
.selector-panel { padding: clamp(20px, 3vw, 32px); }
.selector-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 22px;
}
.selector-intro h1 { margin: 7px 0 0; font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.05em; }
.selector-intro p { margin: 0; color: var(--muted); }
.selector-status { display: grid; justify-items: end; gap: 8px; text-align: right; }
.sync-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: #eef1ec; color: var(--muted); font-size: 12px; font-weight: 900; }
.sync-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #98a29a; }
.sync-badge.live { background: #eff8e5; color: #3d6e19; }
.sync-badge.live::before { background: #72b735; }
.sync-badge.syncing::before { background: var(--blue); }
.picker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.picker-card {
  position: relative;
  min-height: 128px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.picker-card:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: 0 12px 30px rgba(52, 94, 245, 0.1); }
.picker-label {
  position: absolute;
  top: 18px;
  left: 20px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}
.picker-card strong { display: block; margin-top: 20px; font-size: 20px; }
.picker-card small { display: block; margin-top: 7px; color: var(--muted); }
.change-chip {
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.workspace-section { padding: clamp(20px, 3vw, 32px); }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 24px;
}
.page-head h1 { margin: 0; font-size: clamp(27px, 3vw, 40px); letter-spacing: -0.045em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.panel { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.panel h3 { margin: 0 0 18px; }
.condition-layout { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 14px; }
.field-title { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 850; }
.field-title.spaced { margin-top: 22px; }
.segments { display: flex; gap: 7px; }
.segments button {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 850;
}
.segments button.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.condition-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.condition-summary div { display: grid; gap: 4px; }
.condition-summary span { color: var(--muted); font-size: 12px; }
.condition-summary b { font-size: 17px; }
.inline-fields, .discount-fields { display: grid; gap: 10px; }
.inline-fields { grid-template-columns: 1fr 1fr; }
.discount-fields { grid-template-columns: repeat(3, 1fr); }
.field { display: grid; gap: 7px; margin: 0 0 14px; color: var(--muted); font-size: 13px; font-weight: 800; }
.field input, .field select, .search {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
}

.quote-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-left: 6px solid var(--lime);
  border-radius: 4px 16px 16px 4px;
  background: var(--ink);
  color: #fff;
}
.quote-title span { display: block; color: var(--lime); font-size: 12px; font-weight: 900; letter-spacing: 0.08em; }
.quote-title strong { display: block; margin-top: 5px; font-size: 25px; }
.quote-title time { color: #c7d0df; font-size: 13px; }
.quote-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.quote-meta > div, .quote-meta > .field {
  min-height: 76px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}
.quote-meta > div { display: grid; align-content: center; gap: 6px; }
.quote-meta span { color: var(--muted); font-size: 12px; font-weight: 800; }
.quote-meta strong { font-size: 15px; }
.quote-meta .field input { height: 38px; }
.result { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.total { grid-column: 1 / -1; background: var(--ink); color: #fff; }
.total .big { color: var(--lime); font-size: clamp(38px, 6vw, 68px); font-weight: 950; }
.breakdown { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.notice { margin-top: 16px; padding: 13px; border-radius: 12px; background: #fff8df; color: #6e5520; font-size: 13px; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.result-empty { display: grid; gap: 8px; border: 1px dashed #cdd3ca; border-radius: 18px; background: #fff; }
.result-empty strong { color: var(--ink); font-size: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 39, 0.68);
  backdrop-filter: blur(8px);
}
.modal.hidden { display: none; }
.modal-card {
  width: min(1040px, 100%);
  max-height: min(88vh, 860px);
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.28);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
}
.modal-head h2 { margin: 4px 0 0; font-size: 28px; }
.modal-close { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #f0f2ed; color: var(--ink); font-size: 27px; }
.picker-tools { padding: 0 24px 16px; }
.picker-tools .search { height: 50px; border-radius: 14px; }
.picker-body { max-height: calc(min(88vh, 860px) - 138px); overflow: auto; padding: 2px 24px 28px; }
.picker-device-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.product {
  min-height: 184px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.product:hover, .product.selected, .plan:hover, .plan.selected { border-color: var(--blue); background: #f6f8ff; }
.device-visual {
  position: relative;
  width: 70px;
  height: 108px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #f1f3ef;
}
.device-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.no-device-visual {
  border: 1px dashed #c7ccc5;
  background: linear-gradient(145deg, #f6f7f4, #e9ece6);
  color: #747d73;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}
.product h3 { margin: 4px 0; font-size: 15px; }
.product p, .product small { margin: 0; color: var(--muted); }
.product .spec-line { margin-top: 7px; color: #879087; font-size: 11px; line-height: 1.45; }
.price { display: block; margin-top: 11px; color: var(--ink) !important; font-weight: 900; }
.plans { display: grid; gap: 8px; }
.plan {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.plan strong { font-size: 16px; }
.plan span { color: var(--muted); font-size: 13px; }
.money { color: var(--blue) !important; font-size: 19px !important; font-weight: 950; }

@media (max-width: 850px) {
  .home { grid-template-columns: 1fr; padding: 40px 0; }
  .selector-intro { align-items: start; flex-direction: column; gap: 8px; }
  .selector-status { justify-items: start; text-align: left; }
  .picker-grid, .condition-layout { grid-template-columns: 1fr; }
  .discount-fields { grid-template-columns: 1fr 1fr 1fr; }
  .quote-meta { grid-template-columns: 1fr 1fr; }
  .result { grid-template-columns: 1fr; }
  .total { grid-column: 1; }
  .picker-device-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .bar { padding: 0 12px; }
  .brand small { display: none; }
  .home, .consult-main, .simple-main { width: calc(100% - 20px); }
  .home { gap: 28px; }
  .launch { padding: 14px; }
  .launch-grid { grid-template-columns: 1fr; }
  .launch-card:first-child { grid-column: 1; }
  .consult-main { padding-top: 12px; gap: 12px; }
  .selector-panel, .workspace-section { padding: 16px; border-radius: 19px; }
  .picker-card { min-height: 116px; padding: 17px; }
  .picker-card strong { font-size: 17px; }
  .inline-fields, .discount-fields, .quote-meta { grid-template-columns: 1fr; }
  .segments { flex-wrap: wrap; }
  .segments button { min-width: calc(50% - 4px); }
  .quote-title { align-items: start; }
  .quote-title strong { font-size: 20px; }
  .actions { flex-wrap: wrap; }
  .actions button { flex: 1; }
  .modal { padding: 8px; align-items: end; }
  .modal-card { max-height: 92vh; border-radius: 22px 22px 12px 12px; }
  .modal-head { padding: 18px 16px 12px; }
  .picker-tools { padding: 0 16px 12px; }
  .picker-body { max-height: calc(92vh - 128px); padding: 2px 16px 20px; }
  .picker-device-grid { grid-template-columns: 1fr; }
}

@page { size: A4 portrait; margin: 14mm; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
  .bar, .selector-panel, .conditions-section, .quote-output > .page-head, .quote-output > .actions, .modal { display: none !important; }
  .consult-main { display: block; width: 100%; padding: 0; }
  .workspace-section.quote-output { display: block; border: 0; border-radius: 0; padding: 0; background: #fff; }
  .quote-title { margin: 0 0 10mm; border-radius: 0; }
  .quote-meta { grid-template-columns: repeat(4, 1fr); gap: 3mm; }
  .quote-meta > div, .quote-meta > .field { min-height: 19mm; padding: 3mm; }
  .quote-meta input { border: 0 !important; padding: 0 !important; }
  .result { grid-template-columns: 1fr 1fr; gap: 4mm; }
  .panel { break-inside: avoid; border-color: #c8ccd3; box-shadow: none; }
  .total { grid-column: 1 / -1; }
  .total .big { font-size: 40px; }
  .notice { break-inside: avoid; margin-top: 5mm; }
  .shell { min-height: 0; }
}