/* ═══════════════════════════════════════════════════
   COUPON MARKET — NOLJAMAP 2026
   Clean single-pass stylesheet (no layered overrides)
════════════════════════════════════════════════════ */

/* ─────────────────────────────────────
   1. VARIABLES
───────────────────────────────────── */
.cm-wrap {
  --cm-red:     #e33846;
  --cm-teal:    #0f8b7d;
  --cm-gold:    #d9901f;
  --cm-blue:    #2c7be5;
  --cm-orange:  #e85d04;
  --cm-ink:     #16191d;
  --cm-muted:   #737b88;
  --cm-line:    rgba(0, 0, 0, .10);
  --cm-surface: #ffffff;
  --cm-surf2:   #f4f5f7;
  --cm-canvas:  #f1f2f4;
  color: var(--cm-ink);
}

.io-black-mode .cm-wrap {
  --cm-ink:     rgba(255, 255, 255, .92);
  --cm-muted:   rgba(255, 255, 255, .54);
  --cm-line:    rgba(255, 255, 255, .10);
  --cm-surface: #242628;
  --cm-surf2:   rgba(255, 255, 255, .06);
  --cm-canvas:  #17191b;
}

/* ─────────────────────────────────────
   2. BASE
───────────────────────────────────── */
.cm-wrap {
  width: min(1280px, calc(100% - 32px));
  margin: 28px auto 80px;
}

/* ─────────────────────────────────────
   3. HERO
───────────────────────────────────── */
.cm-market-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 310px);
  gap: 20px;
  padding: 36px;
  border: 1px solid var(--cm-line);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(118deg, rgba(227, 56, 70, .14), transparent 38%),
    radial-gradient(circle at 90% 16%, rgba(15, 139, 125, .14), transparent 28%),
    var(--cm-surface);
}
.cm-market-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(118deg, transparent 0 60%, rgba(255,255,255,.06) 60% 61%, transparent 61%);
}
.cm-hero-copy, .cm-hero-wallet { position: relative; z-index: 1; }

.cm-hero-copy p {
  margin: 0 0 8px;
  color: var(--cm-gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}
.cm-hero-copy h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.4vw, 52px);
  line-height: 1.04;
  letter-spacing: -.01em;
}
.cm-hero-copy span {
  display: block;
  max-width: 520px;
  color: var(--cm-muted);
  font-size: 14px;
  line-height: 1.65;
}
.cm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.cm-hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 20px;
  border: 1px solid var(--cm-line);
  border-radius: 999px;
  background: var(--cm-surface);
  color: var(--cm-ink);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  transition: opacity .15s;
}
.cm-hero-btn:hover { opacity: .82; }
.cm-hero-btn.is-primary { border-color: var(--cm-red); background: var(--cm-red); color: #fff; }

.cm-hero-wallet {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 178px;
  padding: 20px;
  border: 1px solid var(--cm-line);
  border-radius: 14px;
  background: var(--cm-surf2);
}
.cm-hero-wallet small { color: var(--cm-muted); font-size: 11px; font-weight: 900; letter-spacing: .06em; }
.cm-hero-wallet strong { display: block; margin: 8px 0 4px; color: var(--cm-red); font-size: 30px; line-height: 1; }
.cm-hero-wallet div { display: grid; gap: 5px; margin: 6px 0 14px; }
.cm-hero-wallet span { color: var(--cm-muted); font-size: 12px; }
.cm-hero-wallet a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 999px;
  background: var(--cm-ink);
  color: var(--cm-surface);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

/* ─────────────────────────────────────
   4. STATS ROW
───────────────────────────────────── */
.cm-benefit-command {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 18px;
}
.cm-command-copy, .cm-command-stat {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--cm-line);
  border-radius: 14px;
  background: var(--cm-surface);
}
.cm-command-copy b { display: block; font-size: 14px; }
.cm-command-copy span { display: block; margin-top: 6px; color: var(--cm-muted); font-size: 13px; line-height: 1.45; }
.cm-command-stat span { display: block; color: var(--cm-muted); font-size: 11px; font-weight: 900; }
.cm-command-stat strong { display: block; margin-top: 8px; color: var(--cm-red); font-size: 24px; line-height: 1; }
.cm-command-stat em { margin-left: 2px; color: var(--cm-muted); font-size: 13px; font-style: normal; }

/* ─────────────────────────────────────
   5. NAVIGATION TABS
───────────────────────────────────── */
.cm-tabs {
  display: flex;
  overflow-x: auto;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--cm-line);
  scrollbar-width: none;
}
.cm-tabs::-webkit-scrollbar { display: none; }
.cm-tabs a {
  flex: 0 0 auto;
  padding: 10px 16px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--cm-muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.cm-tabs a.is-active { border-color: var(--cm-red); color: var(--cm-red); }

/* ─────────────────────────────────────
   6. FILTER TABS
───────────────────────────────────── */
.cm-filter-tabs {
  display: flex;
  overflow-x: auto;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--cm-line);
  scrollbar-width: none;
}
.cm-filter-tabs::-webkit-scrollbar { display: none; }
.cm-filter-tabs a {
  flex: 0 0 auto;
  padding: 9px 14px 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--cm-muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.cm-filter-tabs a.is-active { border-color: var(--cm-gold); color: #7a3e00; }
.io-black-mode .cm-wrap .cm-filter-tabs a.is-active { color: var(--cm-gold); }

/* ─────────────────────────────────────
   7. REGION FILTER
───────────────────────────────────── */
.cm-region-filter {
  display: flex;
  gap: 8px;
  margin: -6px 0 18px;
  padding: 4px 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.cm-region-filter::-webkit-scrollbar { display: none; }
.cm-region-filter a,
.cm-region-filter button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--cm-line);
  border-radius: 999px;
  background: var(--cm-surface);
  color: var(--cm-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s;
}
.cm-region-filter a.is-active,
.cm-region-filter a:hover,
.cm-region-filter button:hover {
  border-color: var(--cm-red);
  background: var(--cm-red);
  color: #fff;
}

/* ─────────────────────────────────────
   8. SECTION
───────────────────────────────────── */
.cm-section {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--cm-line);
  border-radius: 16px;
  background: var(--cm-surface);
}
.cm-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}
.cm-section-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.cm-section-head p { margin: 0; color: var(--cm-muted); font-size: 13px; }

/* ─────────────────────────────────────
   9. GRID — PC 5열
───────────────────────────────────── */
.cm-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

/* ─────────────────────────────────────
   10. COUPON CARD — 수직 상품카드 (PC)
───────────────────────────────────── */
.cm-card-trigger { display: none; } /* PC에서 숨김 */

.cm-card-expand {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.cm-coupon-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--cm-line);
  border-radius: 12px;
  background: var(--cm-surface);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cm-coupon-card:hover {
  transform: translateY(-3px);
  border-color: rgba(227, 56, 70, .36);
  box-shadow: 0 10px 24px rgba(22, 25, 29, .09);
}

/* 이미지 영역 */
.cm-coupon-thumb {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: linear-gradient(135deg, #fff8ed, #edf8f6);
  text-decoration: none;
}
.cm-coupon-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cm-thumb-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--cm-red);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  padding: 8px;
}

/* 카드 바디 */
.cm-coupon-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 11px 11px;
}
.cm-shop-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 4px;
}
.cm-shop-profile {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--cm-muted);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  overflow: hidden;
}
.cm-shop-profile img {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--cm-line);
}
.cm-shop-profile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-shop-profile:hover { color: var(--cm-red); }
.cm-shop-name small { flex: 0 0 auto; color: var(--cm-teal); font-size: 10px; font-weight: 900; }

.cm-coupon-body h3 {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cm-coupon-body h3 a { color: inherit; text-decoration: none; }

.cm-benefit {
  color: var(--cm-red);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
  padding-top: 6px;
}
.cm-meta span {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--cm-surf2);
  color: var(--cm-muted);
  font-size: 10px;
  font-weight: 800;
}
.cm-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 7px;
}
.cm-card-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .14s;
}
.cm-card-action:hover { opacity: .80; }
.cm-card-shop { background: var(--cm-surf2); color: var(--cm-muted); }
.cm-card-buy  { background: var(--cm-red); color: #fff; }

/* ─────────────────────────────────────
   11. BADGES
───────────────────────────────────── */
.cm-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  line-height: 1.4;
  white-space: nowrap;
}
.cm-badge--hot   { background: linear-gradient(135deg, #ff6b35, #e33846); }
.cm-badge--vip   { background: linear-gradient(135deg, #c47f00, #d9901f); }
.cm-badge--time  { background: #e85d04; }
.cm-badge--point { background: #2c7be5; }
.cm-badge--free  { background: #0f8b7d; }

/* 배지를 absolute 아닌 곳에서 쓸 때 (트리거, 상세페이지 등) */
.cm-badge-static,
.cm-card-trigger .cm-badge {
  position: static;
  display: inline-block;
}

/* ─────────────────────────────────────
   12. TIMER PILL
───────────────────────────────────── */
.cm-timer-pill {
  color: #c2410c !important;
  background: #fff4e6 !important;
  animation: cmPulse 1.4s ease-in-out infinite;
}
@keyframes cmPulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 2px rgba(194, 65, 12, .22); }
}

/* ─────────────────────────────────────
   13. DETAIL PAGE
───────────────────────────────────── */
.cm-detail {
  display: grid;
  grid-template-columns: minmax(260px, 42%) 1fr;
  gap: 28px;
  padding: 28px;
  border: 1px solid var(--cm-line);
  border-radius: 18px;
  background: var(--cm-surface);
}

.cm-detail-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #fff8ed, #edf8f6);
  color: var(--cm-red);
}
.cm-detail-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cm-detail-visual strong { font-size: 30px; font-weight: 900; }

/* 비주얼 하단 오버레이 */
.cm-detail-visual-foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.cm-detail-body { display: flex; flex-direction: column; min-height: 0; }

.cm-owner-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: fit-content;
  margin-bottom: 12px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--cm-line);
  border-radius: 999px;
  background: var(--cm-surf2);
  color: var(--cm-ink);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}
.cm-owner-link img { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.cm-owner-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-owner-link em { flex: 0 0 auto; color: var(--cm-red); font-style: normal; }
.cm-owner-link:hover { border-color: rgba(227,56,70,.36); color: var(--cm-red); }
.cm-owner-link-detail { margin-bottom: 12px; }

.cm-detail-body h1 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.cm-detail-benefit {
  margin: 0 0 18px;
  color: var(--cm-red);
  font-size: 24px;
  font-weight: 900;
}

/* 핵심 정보 칩 그리드 */
.cm-detail-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.cm-detail-chip {
  padding: 12px 14px;
  border: 1px solid var(--cm-line);
  border-radius: 12px;
  background: var(--cm-surf2);
}
.cm-detail-chip span {
  display: block;
  color: var(--cm-muted);
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 4px;
}
.cm-detail-chip b {
  display: block;
  font-size: 14px;
  font-weight: 900;
}
.cm-detail-chip--alert { border-color: rgba(232,93,4,.3); background: #fff4e6; }
.cm-detail-chip--alert b { color: #c2410c; }

.cm-detail-list {
  display: grid;
  gap: 0;
  margin: 0 0 16px;
}
.cm-detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--cm-line);
}
.cm-detail-list dt { color: var(--cm-muted); font-size: 13px; }
.cm-detail-list dd { margin: 0; font-weight: 800; font-size: 13px; text-align: right; }

.cm-desc {
  margin: 0 0 16px;
  color: var(--cm-muted);
  font-size: 14px;
  line-height: 1.7;
}
.cm-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}
.cm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--cm-line);
  border-radius: 10px;
  background: var(--cm-surface);
  color: var(--cm-ink);
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .14s;
}
.cm-btn:hover { opacity: .82; }
.cm-btn-primary { border-color: var(--cm-red); background: var(--cm-red); color: #fff; }
.cm-btn-ghost { border-color: rgba(227,56,70,.3); color: var(--cm-red); }

/* ─────────────────────────────────────
   14. MY COUPONS / ACCOUNT
───────────────────────────────────── */
.cm-account-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cm-account-head h2 { margin: 0; font-size: 22px; }
.cm-account-head a { color: var(--cm-red); font-weight: 900; text-decoration: none; }

.cm-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.cm-summary div {
  padding: 15px;
  border: 1px solid var(--cm-line);
  border-radius: 12px;
  background: var(--cm-surface);
}
.cm-summary span { display: block; color: var(--cm-muted); font-size: 11px; font-weight: 900; }
.cm-summary strong { display: block; margin-top: 6px; font-size: 22px; font-weight: 900; }

.cm-account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.cm-panel {
  padding: 18px;
  border: 1px solid var(--cm-line);
  border-radius: 14px;
  background: var(--cm-surface);
}
.cm-panel h3 { margin: 0 0 12px; font-size: 17px; }

.cm-wallet-row, .cm-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--cm-line);
}
.cm-wallet-row span, .cm-order-row span, .cm-muted { color: var(--cm-muted); font-size: 12px; }
.cm-wallet-row a { color: var(--cm-red); font-weight: 900; text-decoration: none; }

.cm-wallet-list { display: grid; gap: 12px; }
.cm-wallet-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--cm-line);
  border-radius: 14px;
  background: var(--cm-surface);
}
.cm-wallet-card h2 { margin: 6px 0; font-size: 20px; }
.cm-wallet-card span {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(227,56,70,.1);
  color: var(--cm-red);
  font-size: 11px;
  font-weight: 900;
}
.cm-wallet-card.is-expired { opacity: .7; }
.cm-wallet-card.is-expired .cm-qr,
.cm-wallet-card.is-used .cm-qr { filter: grayscale(1); opacity: .6; }

.cm-qr { display: grid; gap: 10px; justify-items: center; }
.cm-qr img {
  width: 136px;
  height: 136px;
  border: 8px solid var(--cm-surface);
  box-shadow: 0 8px 20px rgba(22,25,29,.12);
}
.cm-qr code {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--cm-surf2);
  color: var(--cm-ink);
  font-weight: 900;
}
.cm-qr-help { color: var(--cm-teal) !important; background: rgba(15,139,125,.1) !important; }

/* ─────────────────────────────────────
   15. POINTS PAGE
───────────────────────────────────── */
.cm-point-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
  padding: 26px;
  border: 1px solid var(--cm-line);
  border-radius: 16px;
  background: var(--cm-surface);
}
.cm-point-hero p { margin: 0 0 6px; color: var(--cm-gold); font-size: 11px; font-weight: 900; }
.cm-point-hero h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.01em; }
.cm-point-hero strong { color: var(--cm-red); font-size: 32px; font-weight: 900; white-space: nowrap; }

.cm-point-balance {
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--cm-line);
  border-radius: 14px;
  background: var(--cm-surface);
}
.cm-point-balance span { display: block; color: var(--cm-muted); font-size: 12px; }
.cm-point-balance strong { display: block; margin-top: 8px; font-size: 32px; font-weight: 900; }

.cm-package-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.cm-package {
  padding: 20px;
  border: 1px solid var(--cm-line);
  border-radius: 14px;
  background: var(--cm-surface);
  cursor: pointer;
  transition: transform .16s, border-color .16s;
}
.cm-package:hover { transform: translateY(-2px); border-color: rgba(227,56,70,.4); }
.cm-package span, .cm-package b, .cm-package small { display: block; }
.cm-package span { font-size: 22px; font-weight: 900; }
.cm-package b { margin-top: 8px; color: var(--cm-red); font-size: 13px; }
.cm-package small { margin-top: 4px; color: var(--cm-muted); font-size: 11px; }

.cm-point-panels { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 0 0 16px; }
.cm-point-panel, .cm-point-links a, .cm-wallet-strip a {
  display: block;
  padding: 16px;
  border: 1px solid var(--cm-line);
  border-radius: 14px;
  background: var(--cm-surface);
  color: var(--cm-ink);
  text-decoration: none;
  transition: transform .16s, border-color .16s;
}
.cm-point-panel:hover, .cm-point-links a:hover, .cm-wallet-strip a:hover {
  transform: translateY(-2px);
  border-color: rgba(227,56,70,.36);
}
.cm-point-panel span, .cm-point-links span, .cm-wallet-strip span {
  display: block;
  color: var(--cm-muted);
  font-size: 11px;
  font-weight: 900;
}
.cm-point-panel strong, .cm-point-links strong, .cm-wallet-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--cm-red);
  font-size: 20px;
  font-weight: 900;
}
.cm-point-panel em, .cm-wallet-strip em {
  display: block;
  margin-top: 4px;
  color: var(--cm-muted);
  font-size: 11px;
  font-style: normal;
}
.cm-point-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 16px; }
.cm-wallet-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 14px 0 16px; }

/* ─────────────────────────────────────
   16. ORDERS PAGE
───────────────────────────────────── */
.cm-order-table { display: grid; gap: 6px; }
.cm-order-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--cm-line);
  border-radius: 12px;
  background: var(--cm-surface);
}
.cm-order-line em { font-style: normal; color: var(--cm-red); font-weight: 900; }
.cm-order-line b  { color: #16a34a; }

/* ─────────────────────────────────────
   17. SCAN PAGE
───────────────────────────────────── */
.cm-scan-wrap { max-width: 720px; }
.cm-scan-panel {
  padding: 28px;
  border: 1px solid var(--cm-line);
  border-radius: 16px;
  background: var(--cm-surface);
  box-shadow: 0 16px 40px rgba(22,25,29,.08);
}
.cm-scan-kicker { color: var(--cm-teal); font-size: 12px; font-weight: 900; }
.cm-scan-panel h1 { margin: 8px 0 10px; font-size: 28px; letter-spacing: -.01em; }
.cm-scan-status {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15,139,125,.12);
  color: var(--cm-teal);
  font-weight: 900;
}
.cm-scan-status.is-used,
.cm-scan-status.is-cancelled,
.cm-scan-status.is-expired { background: rgba(227,56,70,.1); color: var(--cm-red); }
.cm-scan-warning { margin-top: 16px; padding: 14px; border-radius: 10px; background: #fff8ed; color: #9b4b00; font-weight: 800; }
.cm-scan-confirm { width: 100%; margin-top: 16px; }

/* ─────────────────────────────────────
   18. UTILITIES
───────────────────────────────────── */
.cm-empty {
  padding: 40px;
  border: 1px solid var(--cm-line);
  border-radius: 14px;
  background: var(--cm-surface);
  color: var(--cm-muted);
  text-align: center;
}
.cm-status-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cm-status-tabs::-webkit-scrollbar { display: none; }
.cm-status-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--cm-line);
  border-radius: 999px;
  background: var(--cm-surf2);
  color: var(--cm-muted);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}
.cm-status-tabs a.is-active { background: var(--cm-red); border-color: var(--cm-red); color: #fff; }

.cm-user-menu-section {
  border-top: 1px solid rgba(0,0,0,.08);
  margin-top: 10px !important;
  padding-top: 12px !important;
}

/* ─────────────────────────────────────
   19. 모바일 아코디언 (≤768px)
───────────────────────────────────── */
@media (max-width: 768px) {
  /* 그리드 → 아코디언 리스트로 전환 */
  .cm-grid {
    display: block;
    border: 1px solid var(--cm-line);
    border-radius: 14px;
    overflow: hidden;
  }
  .cm-coupon-card {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--cm-line);
    transition: none;
  }
  .cm-coupon-card:last-child { border-bottom: none; }
  .cm-coupon-card:hover { transform: none; box-shadow: none; }

  /* 트리거 표시 */
  .cm-card-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    background: var(--cm-surface);
    border: none;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s;
  }
  .cm-card-trigger:active { background: var(--cm-surf2); }

  /* 트리거 썸네일 */
  .cm-card-tthumb {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #fff8ed, #edf8f6);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .cm-card-tthumb img { width: 100%; height: 100%; object-fit: cover; }
  .cm-card-tthumb span {
    color: var(--cm-red);
    font-size: 9px;
    font-weight: 900;
    text-align: center;
    padding: 2px;
    line-height: 1.2;
  }

  /* 트리거 텍스트 정보 */
  .cm-card-tinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .cm-card-tshop {
    color: var(--cm-muted);
    font-size: 10px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cm-card-ttitle {
    color: var(--cm-ink);
    font-size: 13px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 트리거 오른쪽 메타 */
  .cm-card-tmeta {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
  .cm-card-tprice { color: var(--cm-red); font-size: 12px; font-weight: 900; }

  /* 화살표 */
  .cm-card-chevron {
    flex: 0 0 auto;
    color: var(--cm-muted);
    display: flex;
    align-items: center;
    transition: transform .22s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .cm-coupon-card.is-open .cm-card-chevron { transform: rotate(180deg); }

  /* 접힘 영역 */
  .cm-card-expand {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .cm-coupon-card.is-open .cm-card-expand { max-height: 640px; }

  /* 펼쳐졌을 때 이미지 */
  .cm-coupon-thumb {
    display: block;
    aspect-ratio: 16 / 7;
    border-radius: 0;
  }

  /* 펼쳐졌을 때 바디 */
  .cm-coupon-body {
    padding: 14px 16px 16px;
  }
  .cm-coupon-body h3 { font-size: 15px; margin: 0 0 5px; }
  .cm-benefit { font-size: 17px; }
  .cm-meta { gap: 5px; }
  .cm-meta span { font-size: 11px; padding: 3px 8px; }
  .cm-card-actions {
    gap: 8px;
    margin-top: 12px;
  }
  .cm-card-action {
    min-height: 42px;
    font-size: 13px;
    border-radius: 10px;
  }
}

/* ─────────────────────────────────────
   20. RESPONSIVE — 1024~1280px (4열)
───────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1100px) {
  .cm-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cm-benefit-command { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1101px) and (max-width: 1280px) {
  .cm-grid { grid-template-columns: repeat(4, 1fr); gap: 11px; }
}

/* ─────────────────────────────────────
   21. RESPONSIVE — PC 일반 (<900px)
───────────────────────────────────── */
@media (max-width: 900px) {
  .cm-market-hero { grid-template-columns: 1fr; }
  .cm-hero-wallet { min-height: 0; }
  .cm-benefit-command { grid-template-columns: 1fr 1fr; }
  .cm-detail { grid-template-columns: 1fr; }
  .cm-detail-visual { min-height: 240px; }
  .cm-summary { grid-template-columns: repeat(2,1fr); }
  .cm-package-grid { grid-template-columns: repeat(2,1fr); }
  .cm-point-panels { grid-template-columns: 1fr 1fr; }
  .cm-account-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────
   22. RESPONSIVE — 모바일 (<768px) 일반
───────────────────────────────────── */
@media (max-width: 768px) {
  .cm-wrap { width: min(100%, calc(100vw - 20px)); margin-top: 12px; margin-bottom: 90px; }

  .cm-market-hero { display: block; padding: 20px; border-radius: 14px; }
  .cm-hero-copy h1 { font-size: 26px; }
  .cm-hero-wallet { margin-top: 14px; min-height: 0; }
  .cm-hero-wallet a { margin-top: 10px; }
  .cm-benefit-command { grid-template-columns: 1fr; gap: 8px; }

  .cm-tabs { margin: 10px -10px 14px; padding: 0 10px; }
  .cm-filter-tabs { margin-left: -10px; margin-right: -10px; padding-left: 10px; }
  .cm-region-filter { margin: -4px -10px 14px; padding: 4px 10px 8px; }

  .cm-section { padding: 12px; margin-top: 12px; }
  .cm-section-head h2 { font-size: 17px; }
  .cm-section-head p { display: none; }

  /* 상세페이지 모바일 */
  .cm-detail {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }
  .cm-detail-visual { min-height: 210px; border-radius: 14px; margin-bottom: 16px; }
  .cm-detail-body { padding-bottom: 96px; /* 고정 하단 액션바 여백 */ }
  .cm-detail-body h1 { font-size: 22px; }
  .cm-detail-benefit { font-size: 20px; margin-bottom: 14px; }
  .cm-detail-chips { grid-template-columns: repeat(2,1fr); gap: 7px; }
  .cm-detail-chip { padding: 10px 12px; }
  .cm-detail-chip b { font-size: 13px; }

  /* 하단 고정 액션바 */
  .cm-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 12px);
    background: var(--cm-surface);
    border-top: 1px solid var(--cm-line);
    box-shadow: 0 -6px 20px rgba(22,25,29,.12);
    margin: 0;
    gap: 10px;
  }
  .cm-actions .cm-btn {
    flex: 1;
    min-height: 48px;
    font-size: 15px;
    border-radius: 12px;
  }

  /* My 페이지 */
  .cm-summary { grid-template-columns: 1fr 1fr; }
  .cm-account-grid { grid-template-columns: 1fr; }
  .cm-wallet-card { display: block; }
  .cm-package-grid { grid-template-columns: 1fr 1fr; }
  .cm-point-panels { grid-template-columns: 1fr; }
  .cm-point-links { grid-template-columns: 1fr; }
  .cm-wallet-strip { grid-template-columns: 1fr; }
  .cm-point-hero { display: block; padding: 20px; }
  .cm-point-hero strong { display: block; margin-top: 10px; font-size: 28px; }

  .cm-scan-panel { padding: 20px; }
  .cm-scan-panel h1 { font-size: 24px; }

  .cm-order-line { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ─────────────────────────────────────
   23. SEARCH BAR
───────────────────────────────────── */
.cm-search-bar {
  margin: 0 0 14px;
}
.cm-search-inner {
  display: flex;
  align-items: center;
  gap: 0;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--cm-line);
  border-radius: 12px;
  background: var(--cm-surface);
  transition: border-color .18s;
}
.cm-search-inner:focus-within {
  border-color: var(--cm-red);
  box-shadow: 0 0 0 3px rgba(227,56,70,.10);
}
.cm-search-icon {
  flex: 0 0 auto;
  color: var(--cm-muted);
  margin-right: 8px;
}
.cm-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--cm-ink);
  font-size: 14px;
  line-height: 1;
  outline: none;
  padding: 0;
}
.cm-search-input::placeholder { color: var(--cm-muted); }
/* WebKit 기본 X 버튼 숨김 */
.cm-search-input::-webkit-search-cancel-button { display: none; }

.cm-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cm-surf2);
  color: var(--cm-muted);
  font-size: 11px;
  text-decoration: none;
  flex-shrink: 0;
  margin: 0 6px 0 4px;
  transition: background .14s;
}
.cm-search-clear:hover { background: var(--cm-line); }

.cm-search-btn {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 16px;
  margin-left: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--cm-red);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: opacity .14s;
}
.cm-search-btn:hover { opacity: .84; }

@media (max-width: 768px) {
  .cm-search-inner { height: 42px; border-radius: 10px; padding: 0 12px; }
  .cm-search-input { font-size: 15px; }
  .cm-search-btn { min-height: 30px; padding: 0 12px; font-size: 12px; }
}
