/* ===== 핸드폰 컨설팅 프로그램 — CSS ===== */

:root {
  --theme: #6D28D9;        /* 딥 퍼플 */
  --theme-light: #EDE9FE;
  --accent: #D4540F;       /* 에르메스 오렌지 */
  --accent-light: #FEF3EC;
  --primary: #6D28D9;
  --skt:  #CC0000;
  --kt:   #CC0000;
  --lgu:  #A50034;
  --mvno: #5C35A0;
  --bg:   #F7F6FB;
  --card: #FFFFFF;
  --text: #1A1A2E;
  --sub:  #64748B;
  --muted:#94A3B8;
  --border:#E2E8F0;
  --green: #16A34A;
  --red:   #DC2626;
  --orange:#D4540F;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,.07);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.10);
  --r: 14px;
  --r-sm: 9px;
  --nav-h: 62px;
  --hdr-h: 54px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
               'Noto Sans KR', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* ===== HEADER ===== */
.app-header {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--hdr-h);
  background: var(--theme);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 4px 20px rgba(109,40,217,.28);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-title { font-size: .75rem; opacity: .75; line-height: 1.3; }
.header-title strong { display: block; font-size: .95rem; font-weight: 700; opacity: 1; letter-spacing: -.02em; }
.header-date { font-size: .72rem; opacity: .7; text-align: right; }

/* 통신사 선택 버튼 */
.carrier-btns {
  display: flex; gap: 3px;
  background: rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 3px;
}
.carrier-btn {
  padding: 4px 10px; border-radius: 7px;
  border: none;
  background: transparent; color: rgba(255,255,255,.75);
  font-size: .72rem; font-weight: 600; cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.carrier-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 6px rgba(212,84,15,.45);
  font-weight: 700;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  border-top: 1px solid var(--border);
  z-index: 200;
  box-shadow: 0 -1px 0 var(--border);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: .63rem; font-weight: 500;
  padding: 6px 0;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s;
  position: relative;
}
.nav-item .nav-icon { font-size: 1.25rem; line-height: 1; }
.nav-item.active { color: var(--theme); }
.nav-item.active::after {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 2px;
  background: var(--theme);
  border-radius: 0 0 2px 2px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-top: var(--hdr-h);
  margin-bottom: var(--nav-h);
  padding: 12px 12px 20px;
}

/* ===== TAB PANELS ===== */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: .82rem; font-weight: 700; color: var(--text);
  letter-spacing: -.01em;
}
.card-body { padding: 14px 16px; }

/* ===== 구매 유형 탭 — iOS 세그먼트 스타일 ===== */
.type-tabs {
  display: flex;
  padding: 10px 12px;
  gap: 0;
  background: #F1F0F7;
  margin: 10px 12px;
  border-radius: 10px;
}
.type-tab {
  flex: 1; padding: 7px 0;
  border: none;
  border-radius: 7px;
  background: transparent; color: var(--sub);
  font-size: .8rem; font-weight: 500; cursor: pointer;
  transition: all .18s;
  -webkit-tap-highlight-color: transparent;
}
.type-tab.active {
  background: #fff;
  color: var(--theme);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04);
}

/* ===== FORM ELEMENTS ===== */
.select-wrap { position: relative; padding: 0 16px 14px; }
.select-input, .text-input, .num-input, .textarea-input {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: #FAFBFC; color: var(--text);
  font-size: .88rem; font-family: inherit;
  appearance: none; -webkit-appearance: none;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.select-input:focus, .text-input:focus, .num-input:focus, .textarea-input:focus {
  border-color: var(--theme);
  box-shadow: 0 0 0 3px rgba(109,40,217,.10);
  background: #fff;
}
.select-wrap::after {
  content: '▾'; position: absolute; right: 26px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; font-size: .72rem;
}
.num-input { text-align: right; }
.textarea-input { resize: vertical; min-height: 72px; }

/* ===== 행 레이아웃 ===== */
.row { display: flex; align-items: center; padding: 8px 16px; }
.row + .row { border-top: 1px solid #F1F5F9; }
.row.divider { border-top: 1px solid var(--border); margin-top: 2px; padding-top: 10px; }
.row-label { flex: 1; font-size: .82rem; color: var(--sub); font-weight: 500; }
.row-value { font-size: .88rem; font-weight: 600; color: var(--text); text-align: right; }
.row-value.red { color: var(--red); }
.row-value.blue { color: var(--theme); }
.row-value.green { color: var(--green); }
.row-value.large { font-size: 1.05rem; font-weight: 800; }
.row-input { display: flex; align-items: center; gap: 8px; }
.row-unit { font-size: .75rem; color: var(--muted); white-space: nowrap; }

/* ===== 할인유형 선택 — 세그먼트 스타일 ===== */
.discount-toggle {
  display: flex; gap: 0; padding: 10px 16px 6px;
  background: #F1F0F7;
  margin: 0 12px 2px;
  border-radius: 10px;
}
.discount-btn {
  flex: 1; padding: 7px 0;
  border: none; border-radius: 7px;
  background: transparent; color: var(--sub);
  font-size: .78rem; font-weight: 500; cursor: pointer;
  transition: all .18s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.discount-btn.active {
  background: #fff;
  color: var(--theme);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/* ===== 부가서비스 목록 ===== */
.service-row {
  display: flex; align-items: center;
  padding: 9px 16px;
  border-top: 1px solid #F1F5F9;
}
.service-name { flex: 1; font-size: .83rem; color: var(--text); }
.service-fee { font-size: .82rem; font-weight: 600; color: var(--sub); margin-right: 10px; }
.service-del {
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: #FEE2E2; color: var(--red);
  font-size: .85rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  opacity: .8;
}
.btn-add-service {
  width: 100%; padding: 10px;
  background: none; border: none; color: var(--theme);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  opacity: .85;
}
.empty-service {
  padding: 14px 16px;
  color: var(--muted); font-size: .8rem; text-align: center;
}

/* ===== 최종 금액 카드 ===== */
.result-card {
  border: 1.5px solid var(--accent);
  box-shadow: 0 4px 20px rgba(212,84,15,.10);
}
.result-card .card-header {
  background: var(--accent);
  border-bottom: none;
}
.result-card .card-title { color: #fff; font-size: .82rem; }
.result-amount {
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.result-row {
  display: flex; justify-content: space-between; align-items: flex-end;
}
.result-label { font-size: .78rem; color: var(--sub); font-weight: 500; }
.result-label span { display: block; font-size: .68rem; color: var(--muted); margin-top: 2px; }
.result-val {
  font-size: 1.45rem; font-weight: 800; color: var(--accent);
  letter-spacing: -.03em;
}
.result-val.ongoing {
  color: var(--theme); font-size: 1.25rem;
  letter-spacing: -.03em;
}
.result-val small { font-size: .72rem; font-weight: 500; color: var(--sub); }
.result-divider { height: 1px; background: var(--border); }

/* ===== 버튼 ===== */
.btn-primary {
  width: 100%; padding: 13px;
  background: var(--theme); color: #fff;
  border: none; border-radius: var(--r-sm);
  font-size: .92rem; font-weight: 700; cursor: pointer;
  letter-spacing: -.01em;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .15s, transform .1s;
}
.btn-primary:active { opacity: .88; transform: scale(.99); }
.btn-secondary {
  flex: 1; padding: 13px;
  background: #fff; color: var(--sub);
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-size: .88rem; font-weight: 600; cursor: pointer;
  letter-spacing: -.01em;
  -webkit-tap-highlight-color: transparent;
}
.action-row { display: flex; gap: 8px; padding: 4px 0 8px; }
.action-row .btn-primary { flex: 2; width: auto; }

/* ===== DB 탭 ===== */
.db-toolbar {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 0 8px;
}
.carrier-filter { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.filter-btn {
  padding: 5px 12px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fff; color: var(--sub);
  font-size: .73rem; font-weight: 600; cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: all .15s;
}
.filter-btn.active {
  background: var(--theme);
  border-color: var(--theme);
  color: #fff;
}
.btn-new {
  padding: 6px 14px; border-radius: 8px;
  background: var(--theme); color: #fff;
  border: none; font-size: .77rem; font-weight: 700; cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -.01em;
}
.db-list { display: flex; flex-direction: column; gap: 8px; }
.db-item {
  background: var(--card); border-radius: var(--r-sm);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 13px 16px;
  display: flex; align-items: center; gap: 10px;
}
.db-item-info { flex: 1; min-width: 0; }
.db-item-name { font-size: .88rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.db-item-sub { font-size: .73rem; color: var(--sub); margin-top: 3px; line-height: 1.5; }
.db-item-ott { font-size: .71rem; color: var(--theme); font-weight: 600; margin-top: 3px; opacity: .85; }
.db-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-edit, .btn-del {
  padding: 5px 10px; border-radius: 6px;
  border: none; font-size: .72rem; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-edit { background: var(--theme-light); color: var(--theme); }
.btn-del  { background: #FEE2E2; color: var(--red); }

/* ===== 설정 탭 ===== */
.settings-section { padding: 10px 0; }
.settings-label {
  font-size: .72rem; color: var(--muted); font-weight: 700;
  padding: 4px 16px 6px; text-transform: uppercase; letter-spacing: .06em;
}
.settings-row {
  display: flex; align-items: center; padding: 11px 16px;
  border-top: 1px solid #F1F5F9; gap: 10px;
}
.settings-row label { flex: 1; font-size: .85rem; color: var(--text); font-weight: 500; }
.settings-row .text-input, .settings-row .num-input {
  width: 140px; flex-shrink: 0;
}
.rate-unit { font-size: .78rem; color: var(--sub); white-space: nowrap; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 300;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal-overlay.open { display: block; }
.modal {
  display: none; position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: #fff; border-radius: 20px 20px 0 0;
  z-index: 400; padding: 0 0 env(safe-area-inset-bottom, 16px);
  box-shadow: 0 -4px 30px rgba(0,0,0,.14);
  max-height: 90vh; overflow-y: auto;
}
.modal.open { display: block; }
.modal-handle {
  width: 32px; height: 3px; border-radius: 2px;
  background: var(--border); margin: 10px auto 6px;
}
.modal-title {
  font-size: .98rem; font-weight: 800; text-align: center;
  padding: 6px 20px 14px; letter-spacing: -.02em; color: var(--text);
}
.modal-form { padding: 0 16px; }
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: .75rem; font-weight: 700;
  color: var(--sub); margin-bottom: 5px; letter-spacing: .01em;
}
.modal-actions { display: flex; gap: 8px; padding: 14px 16px 8px; }
.modal-actions .btn-primary { flex: 2; width: auto; padding: 12px; }
.modal-actions .btn-secondary { flex: 1; padding: 12px; }

/* 서비스 선택 모달 */
.service-select-list { padding: 0 16px 16px; }
.service-select-item {
  display: flex; align-items: center; padding: 11px 0;
  border-bottom: 1px solid #F1F5F9; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.service-select-item:last-child { border-bottom: none; }
.service-select-name { flex: 1; font-size: .88rem; color: var(--text); font-weight: 500; }
.service-select-fee { font-size: .84rem; font-weight: 600; color: var(--sub); margin-right: 10px; }
.service-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .7rem; flex-shrink: 0;
}
.service-check.checked { background: var(--theme); border-color: var(--theme); }

/* ===== 단말기 칩 ===== */
.device-chip {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  background: var(--theme-light); color: var(--theme);
  font-size: .7rem; font-weight: 700; margin-right: 4px; margin-top: 4px;
  letter-spacing: -.01em;
}
.price-highlight { font-size: 1rem; font-weight: 800; color: var(--text); }

/* ===== 기기 상세 (색상 + 스펙) ===== */
.device-detail-inner {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px;
}
.device-photo-wrap {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.device-photo-img {
  width: 100%; max-width: 100%; height: auto; max-height: 560px;
  border-radius: 12px; cursor: zoom-in; transition: opacity .15s;
  display: block; object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}
.device-photo-img:hover { opacity: .88; }

/* ── 아이폰 전용: 세로형 포트레이트 컨테이너 (Galaxy S26 Ultra 동일 수준) ── */
.apple-photo-wrap {
  width: 100%;
  max-width: 420px;
  height: 560px;
  overflow: hidden;
  border-radius: 16px;
  margin: 0 auto;
  flex-shrink: 0;
}
.apple-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(1.05);
  border-radius: 0;
  max-width: none;
  max-height: none;
  transform: none;
  cursor: zoom-in;
  transition: opacity .15s;
}
.apple-photo-img:hover {
  opacity: .88;
}
/* 라이트박스: 고해상도 원본 그대로 표시 */
#imgLightboxImg.apple-lightbox-img {
  transform: none;
}

.device-photo-zoom-hint {
  font-size: .62rem; color: var(--muted); letter-spacing: .01em;
}
.device-photo-placeholder {
  width: 100%; max-width: 320px; height: 220px;
  display: flex; align-items: center; justify-content: center;
  background: #F7F8FC; border-radius: 10px; border: 1px dashed var(--border);
}
.device-detail-info { width: 100%; min-width: 0; }

/* Color Picker */
.color-picker-wrap { margin-bottom: 9px; }
.color-label-row   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.color-label-txt   { font-size: .7rem; font-weight: 700; color: var(--sub); letter-spacing: .01em; }
.color-name-txt    { font-size: .72rem; color: var(--theme); font-weight: 600; }
.color-swatches    { display: flex; flex-wrap: wrap; gap: 6px; }
.color-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--sw, #888);
  border: 2px solid transparent; cursor: pointer; outline: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
  transition: transform .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.color-swatch:hover  { transform: scale(1.18); }
.color-swatch.active {
  border-color: var(--theme);
  box-shadow: 0 0 0 2px rgba(109,40,217,.22), inset 0 0 0 1px rgba(0,0,0,.15);
  transform: scale(1.1);
}

/* Device Specs */
.device-specs-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 3px 10px;
  font-size: .72rem; padding-top: 2px;
}
.spec-lbl { color: var(--sub); font-weight: 600; white-space: nowrap; }
.spec-val { color: var(--text); line-height: 1.35; }

/* ===== 요금제 상세 정보 (우측 패널) ===== */
.plan-info-body { padding: 10px 14px 12px; }
.plan-info-rows { display: flex; flex-direction: column; gap: 7px; }
.plan-info-row  { display: flex; align-items: flex-start; gap: 8px; font-size: .8rem; }
.plan-info-icon { flex-shrink: 0; width: 18px; text-align: center; font-size: .85rem; }
.plan-info-label {
  flex-shrink: 0; width: 80px;
  font-size: .72rem; font-weight: 700; color: var(--sub);
}
.plan-info-val  { flex: 1; color: var(--text); font-size: .78rem; line-height: 1.4; }
.plan-features       { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border); }
.plan-features-title { font-size: .7rem; font-weight: 700; color: var(--sub); letter-spacing: .02em; margin-bottom: 5px; }
.plan-feature-item   { font-size: .75rem; color: var(--sub); line-height: 1.5; padding: 1px 0; }

/* ===== PRINT ===== */
#print-area { display: none; }

@media print {
  body { background: #fff; max-width: none; margin: 0; }
  .app-header, .bottom-nav, .main-content, .modal, .modal-overlay { display: none !important; }
  #print-area { display: block !important; }
}

/* ===== 반응형 — 소형 데스크탑 ===== */
@media (min-width: 481px) and (max-width: 767px) {
  body { box-shadow: 0 0 60px rgba(0,0,0,.08); max-width: 480px; }
  .app-header, .bottom-nav { max-width: 480px; }
}

/* ===== 태블릿 (768px~) ===== */
@media (min-width: 768px) {
  :root {
    --hdr-h: 60px;
    --nav-h: 68px;
  }

  body { max-width: 1280px; font-size: 16px; }
  .app-header, .bottom-nav { max-width: 1280px; }
  .main-content { padding: 18px 28px 24px; }

  .header-title strong { font-size: 1.05rem; }
  .carrier-btn { padding: 5px 13px; font-size: .75rem; }
  .nav-item .nav-icon { font-size: 1.45rem; }
  .nav-item { font-size: .68rem; }

  /* 컨설팅 2단 */
  .consulting-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }
  .consulting-right {
    position: sticky;
    top: calc(var(--hdr-h) + 16px);
  }

  .card-title { font-size: .88rem; }
  .row-label { font-size: .85rem; }
  .row-value { font-size: .92rem; }
  .result-val { font-size: 1.55rem; }

  .db-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  #customerList {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-items: start;
  }

  .settings-row .text-input, .settings-row .num-input { width: 200px; }

  .modal {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 18px;
    max-width: 520px;
    max-height: 85vh;
  }
}

/* ===== 데스크탑·iPad 가로 (1024px~) ===== */
@media (min-width: 1024px) {
  .consulting-layout { grid-template-columns: 3fr 2fr; gap: 20px; }
  .db-list { grid-template-columns: repeat(3, 1fr); }
  #customerList { grid-template-columns: repeat(3, 1fr); }
  .card-body { padding: 16px 20px; }
  .row { padding: 9px 20px; }
  .select-wrap { padding: 0 20px 14px; }
  .device-photo-wrap { width: 100%; }
  .device-photo-img  { width: 100%; max-width: 360px; height: auto; max-height: 400px; }
  .device-photo-placeholder { width: 100%; max-width: 320px; height: 220px; }
}

/* ===== 스크롤바 ===== */
::-webkit-scrollbar { width: 0; height: 0; }

/* ===== 유틸 ===== */
.mt-4 { margin-top: 4px; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); font-size: .78rem; }
.carrier-badge {
  display: inline-block; padding: 2px 7px; border-radius: 6px;
  font-size: .68rem; font-weight: 700; color: #fff;
  background: var(--theme);
  letter-spacing: .01em;
}
.badge-skt  { background: var(--skt); }
.badge-kt   { background: var(--kt); }
.badge-lgu  { background: var(--lgu); }
.badge-mvno { background: var(--mvno); }

.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--muted); font-size: .88rem;
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 10px; display: block; }


/* =============================================================
   ===== v2 트렌디 보강 + 손님 디스플레이 모드 =====
   - 기존 룩을 유지하면서 디테일만 모더나이즈
   - 768px+ 태블릿에서 결과/사진을 확대해 손님이 잘 보이게
   ============================================================= */

/* 헤더 미세 그라디언트 + 더 부드러운 그림자 */
.app-header {
  background: linear-gradient(135deg, #6D28D9 0%, #5B21B6 60%, #4C1D95 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 6px 22px rgba(76,29,149,.32);
}

/* 태블릿(768+)에서 결과 카드를 시각적으로 강조 */
@media (min-width: 768px) {
  .result-card {
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(212,84,15,.16), 0 2px 6px rgba(212,84,15,.08);
  }
  .result-card .card-header {
    padding: 14px 20px;
    background: linear-gradient(135deg, #D4540F 0%, #B8420A 100%);
  }
  .result-card .card-title { font-size: 1rem; }
  .result-amount { padding: 22px; gap: 16px; }
  .result-row { align-items: baseline; }
  .result-label { font-size: .92rem; }
  .result-label span { font-size: .76rem; }
  .result-val { font-size: 2rem; letter-spacing: -.035em; }
  .result-val.ongoing { font-size: 1.7rem; }
  .result-val small { font-size: .85rem; }

  /* 단말기 사진을 손님 시야에서 시원하게 — 768+ */
  .device-photo-img {
    max-width: 100%;
    max-height: 720px;
    border-radius: 16px;
    image-rendering: -webkit-optimize-contrast;
  }
  .apple-photo-wrap { width: 100%; max-width: 540px; height: 720px; border-radius: 18px; }
  .device-photo-placeholder { max-width: 100%; height: 380px; }

  /* 카드 라운드 살짝 키워 모던 톤 */
  .card { border-radius: 18px; }
  .card-header { padding: 14px 20px; }
}

/* 1024+ 데스크탑/iPad 가로: 결과·사진 더 시원하게 */
@media (min-width: 1024px) {
  .result-val { font-size: 2.3rem; }
  .result-val.ongoing { font-size: 1.9rem; }
  .device-photo-img { max-height: 880px; }
  .apple-photo-wrap { width: 100%; max-width: 640px; height: 860px; }
}

/* 액션 버튼 영역에 [손님 화면] 추가됨 — 강조 스타일 */
.btn-display {
  flex: 1;
  padding: 13px;
  background: linear-gradient(135deg, #1A1A2E 0%, #2D2D44 100%);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -.01em;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 14px rgba(26,26,46,.28);
  transition: transform .1s, box-shadow .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-display:active { transform: scale(.98); }
.btn-display:hover { box-shadow: 0 6px 20px rgba(26,26,46,.36); }
.btn-display .btn-icon { font-size: 1.05rem; }


/* =============================================================
   손님 디스플레이 모드 (풀스크린 — 태블릿을 손님에게 보여줄 때)
   ============================================================= */
.cd-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: linear-gradient(135deg, #0F0F1E 0%, #1A1A2E 50%, #2D1B69 100%);
  color: #fff;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
}
.cd-overlay.show { display: flex; }

/* 닫기 버튼 (우측 상단) */
.cd-close {
  position: absolute;
  top: 18px; right: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.cd-close:hover { background: rgba(255,255,255,.22); }

/* 매장 로고 / 매장명 (좌측 상단) */
.cd-shop {
  position: absolute;
  top: 22px; left: 28px;
  z-index: 5;
}
.cd-shop-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
}
.cd-shop-tag {
  display: block;
  margin-top: 2px;
  font-size: .72rem;
  color: rgba(255,255,255,.55);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* 메인 영역: 좌측 단말기 사진 + 우측 가격 */
.cd-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 80px 60px 40px;
  align-items: center;
  min-height: 0;
}

@media (max-width: 900px) {
  .cd-main {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 70px 28px 28px;
  }
}

/* 좌측 단말기 디스플레이 */
.cd-device-area {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  position: relative;
}
.cd-device-img {
  width: 100%;
  max-width: 480px;
  max-height: 60vh;
  object-fit: contain;
  filter: drop-shadow(0 30px 60px rgba(109,40,217,.45));
}
.cd-device-placeholder {
  width: 280px; height: 380px;
  border-radius: 24px;
  background: rgba(255,255,255,.05);
  border: 1px dashed rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.35);
  font-size: .88rem;
}
.cd-device-name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.03em;
  text-align: center;
}
.cd-device-color {
  font-size: 1rem;
  color: rgba(255,255,255,.7);
  letter-spacing: .01em;
}

/* 우측 가격/요금 정보 */
.cd-info-area {
  display: flex; flex-direction: column;
  gap: 22px;
}

.cd-carrier-badge {
  display: inline-flex;
  align-items: center; gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 100px;
  font-size: .85rem;
  font-weight: 700;
  width: fit-content;
  backdrop-filter: blur(10px);
}
.cd-carrier-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}

.cd-plan-line {
  font-size: 1.1rem;
  color: rgba(255,255,255,.85);
  letter-spacing: -.01em;
  font-weight: 500;
}

/* 합계 (가장 큰 강조) */
.cd-total {
  margin-top: 4px;
  padding: 28px 32px;
  background: linear-gradient(135deg, rgba(212,84,15,.18) 0%, rgba(212,84,15,.06) 100%);
  border: 1px solid rgba(212,84,15,.4);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(212,84,15,.18);
}
.cd-total-label {
  font-size: .9rem;
  color: rgba(255,255,255,.7);
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 6px;
}
.cd-total-amount {
  font-size: 4.5rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.05em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.cd-total-amount small {
  font-size: 1.6rem;
  font-weight: 700;
  color: rgba(255,255,255,.7);
}
.cd-total-sub {
  margin-top: 10px;
  font-size: .85rem;
  color: rgba(255,255,255,.6);
}

/* 분할 정보 (단말기/요금/부가) */
.cd-breakdown {
  display: flex; flex-direction: column;
  gap: 0;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  padding: 4px 0;
}
.cd-bd-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px;
  font-size: 1rem;
}
.cd-bd-row + .cd-bd-row {
  border-top: 1px solid rgba(255,255,255,.06);
}
.cd-bd-label { color: rgba(255,255,255,.65); font-weight: 500; }
.cd-bd-value { color: #fff; font-weight: 700; letter-spacing: -.01em; }

/* 빈 상태 (기기·요금제 미선택 시) */
.cd-empty {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  color: rgba(255,255,255,.55);
  text-align: center;
  padding: 40px;
}
.cd-empty-icon { font-size: 3.5rem; opacity: .6; }
.cd-empty-text { font-size: 1.05rem; }

/* 모바일에서 가격 글자 살짝 줄임 */
@media (max-width: 600px) {
  .cd-device-name { font-size: 1.5rem; }
  .cd-total-amount { font-size: 3rem; }
  .cd-total-amount small { font-size: 1.2rem; }
  .cd-shop { top: 16px; left: 18px; }
  .cd-close { top: 14px; right: 16px; }
}


/* =============================================================
   ===== Step 2: 견적 / 계약 분리 + 팔로업 + 정확성 =====
   ============================================================= */

/* 액션 버튼 row — 견적/계약 분리 */
.save-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.btn-quote, .btn-contract {
  flex: 1;
  padding: 14px 12px;
  border: none;
  border-radius: var(--r-sm);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s, box-shadow .15s;
}
.btn-quote {
  background: #fff;
  color: var(--theme);
  border: 1.5px solid var(--theme);
}
.btn-quote:hover {
  background: var(--theme-light);
}
.btn-quote .btn-icon { font-size: 1.05rem; }
.btn-quote small {
  font-size: .68rem;
  color: var(--muted);
  font-weight: 500;
}

.btn-contract {
  background: linear-gradient(135deg, var(--accent) 0%, #B8420A 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(212,84,15,.32);
}
.btn-contract:hover {
  box-shadow: 0 6px 20px rgba(212,84,15,.4);
}
.btn-contract:active {
  transform: scale(.98);
}
.btn-contract .btn-icon { font-size: 1.05rem; }
.btn-contract small {
  font-size: .68rem;
  color: rgba(255,255,255,.78);
  font-weight: 500;
}

/* 고객 탭 — 상태 필터 */
.cust-filter-row {
  display: flex;
  gap: 6px;
  padding: 12px 0 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cust-filter {
  padding: 8px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--sub);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
  transition: all .15s;
}
.cust-filter:hover {
  border-color: var(--theme);
  color: var(--theme);
}
.cust-filter.active {
  background: var(--theme);
  border-color: var(--theme);
  color: #fff;
  box-shadow: 0 4px 12px rgba(109,40,217,.24);
}
.cust-filter-quote.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(212,84,15,.28);
}
.cust-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: rgba(0,0,0,.08);
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 800;
}
.cust-filter.active .cust-filter-count {
  background: rgba(255,255,255,.25);
  color: #fff;
}

/* 고객 카드 — 상태 배지 */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.status-badge.status-quote {
  background: #FEF3EC;
  color: var(--accent);
  border: 1px solid #FDE2C9;
}
.status-badge.status-contract {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.followup-meta {
  margin-top: 6px;
  padding: 7px 10px;
  background: linear-gradient(135deg, #FEF3EC 0%, #FFF8F0 100%);
  border: 1px solid #FDE2C9;
  border-radius: 8px;
  font-size: .72rem;
  color: #9A3412;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.followup-days { font-weight: 800; }
.followup-action {
  padding: 5px 11px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.followup-action:hover { background: #B8420A; }

/* 데이터 갱신일 배지 (단말기/요금제 카드) */
.last-updated {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .68rem;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: .01em;
}
.last-updated.fresh   { color: var(--green); }
.last-updated.normal  { color: var(--sub); }
.last-updated.stale   { color: #D97706; }
.last-updated.danger  { color: var(--red); font-weight: 700; }
.last-updated::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* 손님 화면 — 요금제 상세 + 유지기간 강화 */
.cd-plan-detail {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cd-plan-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cd-plan-title-icon { font-size: 1.15rem; }
.cd-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
.cd-plan-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cd-plan-item-label {
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.cd-plan-item-value {
  font-size: .95rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: -.01em;
}
.cd-plan-features {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.cd-plan-feature {
  font-size: .82rem;
  color: rgba(255,255,255,.78);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.cd-plan-feature::before {
  content: '✓';
  color: #34D399;
  font-weight: 800;
  flex-shrink: 0;
}

/* 손님 화면 — 유지 기간 안내 */
.cd-terms {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 14px 18px;
}
.cd-terms-title {
  font-size: .72rem;
  color: rgba(255,255,255,.55);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.cd-term-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: .82rem;
}
.cd-term-row + .cd-term-row {
  border-top: 1px solid rgba(255,255,255,.06);
}
.cd-term-label { color: rgba(255,255,255,.7); }
.cd-term-label strong {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: rgba(255,255,255,.08);
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
}
.cd-term-value { color: #fff; font-weight: 700; letter-spacing: -.01em; }

/* 손님 화면 하단 기준일 안내 */
.cd-disclaimer {
  margin-top: 18px;
  padding: 10px 14px;
  background: rgba(255,255,255,.04);
  border-left: 3px solid rgba(255,255,255,.18);
  border-radius: 4px;
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  line-height: 1.6;
  letter-spacing: .01em;
}
.cd-disclaimer strong {
  color: rgba(255,255,255,.75);
}


/* =============================================================
   손님 견적서 인쇄 버튼 (손님 화면 우측 상단)
   ============================================================= */
.cd-print {
  position: absolute;
  top: 18px;
  right: 80px;
  height: 44px;
  padding: 0 18px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--accent) 0%, #B8420A 100%);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(212,84,15,.4);
  z-index: 10;
  transition: transform .1s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.cd-print:hover {
  box-shadow: 0 8px 26px rgba(212,84,15,.5);
}
.cd-print:active {
  transform: scale(.98);
}
@media (max-width: 600px) {
  .cd-print {
    right: 64px;
    height: 38px;
    padding: 0 12px;
    font-size: .8rem;
  }
}


/* =============================================================
   손님용 견적서 인쇄 양식 (.cs-quote)
   - 흰 배경 / 검정 글자 / 매장 정보 헤더 / 손님 친화적 레이아웃
   - 인쇄할 때만 보이게 (#cs-print-area에 들어감)
   ============================================================= */
#cs-print-area {
  display: none;
}

@media print {
  /* 인쇄 시: 본 앱의 모든 UI 숨김, 견적서만 보이게 */
  body { background: #fff; max-width: none; margin: 0; }
  .app-header, .bottom-nav, .main-content, .modal, .modal-overlay,
  .cd-overlay, #imgLightbox, #print-area { display: none !important; }
  #cs-print-area { display: block !important; }
}

.cs-quote {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
               'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color: #1A1A2E;
  background: #fff;
  padding: 24px 28px;
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: -.01em;
}
.cs-quote * { box-sizing: border-box; }

/* 헤더 — 매장명 + 견적일자 */
.cs-q-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 14px;
  border-bottom: 3px solid #1A1A2E;
  margin-bottom: 20px;
}
.cs-q-shop {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.03em;
  color: #1A1A2E;
}
.cs-q-shop-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #64748B;
  letter-spacing: .04em;
  margin-top: 2px;
  text-transform: uppercase;
}
.cs-q-meta {
  text-align: right;
  font-size: 11px;
  color: #64748B;
  line-height: 1.7;
}
.cs-q-meta strong {
  color: #1A1A2E;
}

/* 견적서 제목 */
.cs-q-title {
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.04em;
  margin: 8px 0 18px;
  color: #1A1A2E;
}

/* 고객 정보 박스 */
.cs-q-customer {
  background: #F7F6FB;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
  font-size: 12.5px;
}
.cs-q-cust-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.cs-q-cust-label {
  width: 60px;
  flex-shrink: 0;
  color: #64748B;
  font-size: 11.5px;
  font-weight: 600;
}
.cs-q-cust-val {
  color: #1A1A2E;
  font-weight: 600;
  letter-spacing: -.01em;
}

/* 메인 그리드 — 좌측: 단말기 / 우측: 가격 */
.cs-q-main {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  margin-bottom: 18px;
}
.cs-q-device {
  text-align: center;
}
.cs-q-device-img {
  width: 100%;
  max-width: 200px;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  margin-bottom: 8px;
}
.cs-q-device-placeholder {
  width: 100%;
  height: 200px;
  background: #F1F5F9;
  border: 1px dashed #CBD5E1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  font-size: 12px;
}
.cs-q-device-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 2px;
}
.cs-q-device-color {
  font-size: 12px;
  color: #64748B;
}
.cs-q-device-carrier {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  background: #1A1A2E;
  color: #fff;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* 우측 가격 영역 */
.cs-q-price {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cs-q-total-box {
  background: linear-gradient(135deg, #FEF3EC 0%, #FFF8F0 100%);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 14px 18px;
}
.cs-q-total-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #9A3412;
  letter-spacing: .02em;
  margin-bottom: 4px;
}
.cs-q-total-amount {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -.04em;
  line-height: 1;
}
.cs-q-total-amount small {
  font-size: 14px;
  font-weight: 700;
  color: #B8420A;
  margin-left: 4px;
}
.cs-q-total-sub {
  margin-top: 5px;
  font-size: 10.5px;
  color: #9A3412;
}

.cs-q-breakdown {
  display: flex;
  flex-direction: column;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
}
.cs-q-bd-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 12px;
}
.cs-q-bd-row + .cs-q-bd-row {
  border-top: 1px solid #F1F5F9;
}
.cs-q-bd-label { color: #475569; font-weight: 500; }
.cs-q-bd-value { color: #1A1A2E; font-weight: 700; letter-spacing: -.01em; }

/* 섹션 제목 */
.cs-q-section {
  font-size: 13px;
  font-weight: 800;
  color: #1A1A2E;
  margin: 18px 0 8px;
  padding-left: 10px;
  border-left: 4px solid var(--theme);
  letter-spacing: -.01em;
}

/* 요금제 상세 표 */
.cs-q-plan-box {
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
}
.cs-q-plan-name {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
}
.cs-q-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
  margin-bottom: 8px;
}
.cs-q-plan-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.cs-q-plan-item-label {
  width: 70px;
  flex-shrink: 0;
  color: #64748B;
  font-size: 11px;
  font-weight: 600;
}
.cs-q-plan-item-value {
  color: #1A1A2E;
  font-weight: 600;
}
.cs-q-plan-features {
  padding-top: 8px;
  border-top: 1px dashed #E2E8F0;
}
.cs-q-plan-feature {
  font-size: 11.5px;
  color: #475569;
  padding: 1px 0;
}
.cs-q-plan-feature::before {
  content: '✓';
  color: var(--green);
  font-weight: 800;
  margin-right: 4px;
}

/* 유지기간 안내 */
.cs-q-terms {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 11.5px;
}
.cs-q-term-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}
.cs-q-term-row + .cs-q-term-row {
  border-top: 1px solid #FCE7B0;
}
.cs-q-term-label { color: #92400E; }
.cs-q-term-value { color: #1A1A2E; font-weight: 700; }

/* 푸터 — 안내문 + 매장 연락처 */
.cs-q-footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748B;
  line-height: 1.7;
}
.cs-q-shop-contact {
  text-align: right;
}
.cs-q-shop-contact strong {
  display: block;
  color: #1A1A2E;
  font-size: 12px;
  margin-bottom: 2px;
}
.cs-q-notice {
  font-size: 10.5px;
  color: #94A3B8;
  margin-top: 14px;
  padding: 10px 14px;
  background: #F7F6FB;
  border-radius: 8px;
  line-height: 1.7;
}
.cs-q-notice strong {
  color: #475569;
}


/* 단골 관리 — 재구매 권유 배지 (고객 카드) */
.repurchase-meta {
  margin-top: 6px;
  padding: 7px 10px;
  background: linear-gradient(135deg, #DCFCE7 0%, #F0FDF4 100%);
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  font-size: .72rem;
  color: #15803D;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.repurchase-days { font-weight: 800; }
.repurchase-action {
  padding: 5px 11px;
  background: #15803D;
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.repurchase-action:hover { background: #166534; }

/* =============================================================
   지점(Branch) 토글 — 헤더 우측
   ============================================================= */
.branch-toggle {
  display: flex;
  gap: 3px;
  background: rgba(0,0,0,.18);
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}
.branch-btn {
  padding: 4px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.75);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.branch-btn.active {
  background: #fff;
  color: var(--theme);
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.branch-btn-add {
  padding: 4px 8px;
  border-radius: 7px;
  border: none;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.85);
  font-size: .8rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.branch-btn-add:hover { background: rgba(255,255,255,.22); }

/* =============================================================
   재고 표시 (단말기 카드 / 단말기 모달)
   ============================================================= */
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .01em;
  margin-top: 4px;
}
.stock-badge.in-stock  { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; }
.stock-badge.low-stock { background: #FEF3EC; color: #9A3412; border: 1px solid #FDE2C9; }
.stock-badge.no-stock  { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

.stock-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #F7F6FB;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: .78rem;
}
.stock-item-imei {
  flex: 1;
  font-family: Menlo, Monaco, monospace;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-item-color {
  font-size: .72rem;
  color: var(--sub);
  padding: 2px 8px;
  background: #fff;
  border-radius: 100px;
  border: 1px solid var(--border);
}
.stock-item-status {
  font-size: .68rem;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: .01em;
}
.stock-item-status.s-in_stock { background: #DCFCE7; color: #15803D; }
.stock-item-status.s-reserved { background: #FEF3EC; color: #9A3412; }
.stock-item-status.s-sold     { background: #E5E7EB; color: #6B7280; }

.stock-item-del {
  background: none;
  border: none;
  color: var(--red);
  font-size: .9rem;
  cursor: pointer;
  padding: 2px 6px;
  -webkit-tap-highlight-color: transparent;
}

/* 지점 카드 (설정 탭) */
.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.shop-item:last-child { border-bottom: none; }
.shop-item-info {
  flex: 1;
  min-width: 0;
}
.shop-item-name {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.shop-item-meta {
  font-size: .72rem;
  color: var(--sub);
  margin-top: 2px;
}
.shop-current-badge {
  display: inline-block;
  padding: 1px 7px;
  background: var(--theme);
  color: #fff;
  border-radius: 100px;
  font-size: .65rem;
  font-weight: 700;
  margin-left: 6px;
  letter-spacing: .02em;
}

/* 생일 임박 알림 */
.birthday-meta {
  margin-top: 6px;
  padding: 6px 10px;
  background: #FCE7F3;
  border: 1px solid #FBCFE8;
  border-radius: 8px;
  font-size: .72rem;
  color: #9D174D;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

