/* ── Detail Page ─────────────────────────────────── */

.detail-page {
  padding-top: 172px;
  padding-bottom: 120px;
  min-height: 100vh;
  background: #fafaf8;
}

.detail-wrap {
  display: grid;
  gap: 16px;
  padding: 24px 0 48px;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sub);
  font-size: 13px;
  font-weight: 800;
}

.detail-breadcrumb a { color: var(--millie-deep); }

.detail-breadcrumb span::before {
  content: ">";
  margin-right: 8px;
  color: var(--muted);
}

/* ── Hero ──────────────────────────────────────────── */

.detail-hero {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding: 36px 36px 32px;
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(31, 26, 22, .04);
}

.detail-gallery {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 196px;
  align-self: start;
}

.detail-cover-frame {
  position: relative;
  width: 100%;
  aspect-ratio: auto;
  border-radius: 12px;
  overflow: visible;
  background: #f3efe6;
  box-shadow: 0 24px 48px rgba(31, 26, 22, .18), 0 4px 12px rgba(31, 26, 22, .08);
}

.cover-badge-rail {
  position: absolute;
  top: 18px;
  left: auto;
  right: -28px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.cover-badge {
  width: 58px;
  height: 58px;
  padding: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .94);
  box-shadow: 0 10px 22px rgba(31, 26, 22, .22);
}

.cover-badge.millie { padding: 0; background: var(--millie-badge, #fff200); color: #403006; }
.cover-badge.paper  { background: #2f745e; color: #fff; }
.cover-badge.audio  { background: #7657c9; color: #fff; }

.cover-badge-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}

.cover-badge-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-badge.millie .cover-badge-icon img {
  padding: 0;
}

.cover-badge-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-cover-frame > img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: inherit;
}

.detail-thumbnails { display: flex; gap: 8px; min-height: 64px; }

.detail-thumbnails,
#thumbnail-list {
  display: none;
}

/* ── Book Spec Card (below cover) ──────────────────── */

.book-spec-card {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 0;
}

#book-spec-card {
  display: none;
}

.book-spec-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  transition: background .15s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-spec-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.book-spec-row:first-child { padding-top: 0; }

.book-spec-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 1px;
}

.book-spec-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.book-spec-value.accent {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--millie-soft);
  color: var(--millie-deep);
  font-size: 12px;
}

.detail-thumb {
  width: 50px;
  aspect-ratio: auto;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #fff;
  box-shadow: 0 6px 14px rgba(31, 26, 22, .10);
  cursor: pointer;
  transition: transform .2s, border-color .2s;
}

.detail-thumb:hover { transform: translateY(-2px); }
.detail-thumb.on    { border-color: var(--millie-deep); }

.detail-thumb img { width: 100%; height: auto; object-fit: contain; display: block; }

/* ── Summary (right column) ────────────────────────── */

.detail-summary { min-width: 0; display: grid; gap: 0; }

.detail-title-row { display: grid; gap: 0; }

.detail-title-row h1 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -.04em;
  word-break: keep-all;
}

.detail-meta-line {
  margin-top: 10px;
  color: var(--sub);
  font-size: 15px;
  font-weight: 700;
}

.detail-spec-line {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.detail-tag-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.format-badges {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

.format-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.format-badge svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.format-badge.paper { background: #e8f4ee; color: #2f6f58; }
.format-badge.ebook { background: #fff200; color: #2a251c; }
.format-badge.audio { background: #eee8ff; color: #6747b7; }
.format-badge.ai    { background: var(--sky-soft); color: #2e61ce; }

/* ── Wishlist button ───────────────────────────────── */

#wish-row {
  flex-shrink: 0;
  margin-top: 0;
}

.btn-wish {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--sub);
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}

.btn-wish:hover {
  border-color: #f5a0b0;
  color: #c73c5e;
}

.btn-wish.wished {
  border-color: #f5a0b0;
  background: #fff0f3;
  color: #c73c5e;
}

.btn-wish.wished svg { fill: #c73c5e; stroke: #c73c5e; }

/* ── Divider ───────────────────────────────────────── */

.detail-divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

/* ── Apply Options ─────────────────────────────────── */

.price-stack { display: grid; gap: 12px; }

.mobile-quick-apply {
  display: none;
}

.mobile-subscription-note {
  display: none;
}

.mobile-quick-option {
  min-width: 0;
  display: grid;
  gap: 0;
  align-items: stretch;
}

.mobile-quick-option p {
  display: none;
}

.apply-option-head { display: grid; gap: 3px; }

.apply-option-head h2 {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.apply-option-head p {
  color: var(--sub);
  font-size: 13px;
  font-weight: 700;
}

.apply-option-list { display: grid; gap: 10px; }

.apply-option-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  background: #fff;
  transition: border-color .25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow .25s cubic-bezier(0.16, 1, 0.3, 1),
              transform .2s cubic-bezier(0.16, 1, 0.3, 1);
}

.apply-option-card .subscription-benefit-badge {
  grid-column: 1 / -1;
}

.apply-option-card:hover {
  border-color: rgba(162, 135, 0, .36);
  box-shadow: 0 8px 24px rgba(162, 135, 0, .08);
  transform: translateY(-1px);
}

.apply-option-card.subscription {
  border-color: rgba(162, 135, 0, .28);
  background: #fffdf1;
}

.apply-option-copy { min-width: 0; display: grid; gap: 5px; }

.apply-option-titleline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apply-option-kicker {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 233, 90, .46);
  color: var(--millie-deep);
  font-size: 11px;
  font-weight: 900;
}

.apply-option-card.paper .apply-option-kicker {
  background: #f0ede7;
  color: #554d45;
}

.apply-option-copy h2 {
  min-width: 0;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.apply-option-copy p {
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.option-separator {
  display: inline-block;
  margin: 0 6px;
  color: rgba(31, 26, 22, .24);
  font-weight: 900;
}

.apply-option-copy em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.completion-row {
  margin-top: 3px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(31, 26, 22, .07);
  background: rgba(255, 255, 255, .72);
}

.completion-row span   { flex-shrink: 0; color: var(--millie-deep); font-size: 11px; font-weight: 900; }
.completion-row strong { color: var(--text); font-size: 11px; font-weight: 900; }
.completion-row em     { color: var(--muted); font-size: 11px; font-style: normal; font-weight: 800; }
.completion-row.paper span { color: #554d45; }

.apply-round-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 2px;
}
.round-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--millie-deep);
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
  white-space: nowrap;
}
.round-period {
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
}

.apply-option-side {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.original-price {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(117, 111, 103, .72);
}

.apply-option-side strong {
  font-size: 22px;
  font-weight: 900;
}

.apply-option-side .btn-primary,
.apply-option-side .btn-line {
  min-width: 160px;
  justify-content: center;
}

/* ── Plan Selector ─────────────────────────────────── */

.plan-selector-wrap {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
}

.mobile-plan-trigger {
  display: none;
}

.millie-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  justify-content: flex-end;
}

.millie-monthly-note {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
}

.mobile-plan-sub {
  font-size: 11.5px !important;
  font-weight: 700;
  color: rgba(31, 26, 22, .72) !important;
  letter-spacing: -0.01em;
}

.plan-tooltip {
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--millie-soft);
  color: var(--millie-deep);
  font-size: 11px;
  font-weight: 800;
  position: relative;
  white-space: nowrap;
}
.plan-tooltip::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 18px;
  border: 6px solid transparent;
  border-top-color: var(--millie-soft);
  border-bottom: 0;
}

.plan-selector-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s;
  text-align: left;
}
.plan-selector-btn:hover,
.plan-selector-btn[aria-expanded="true"] { border-color: var(--millie-deep); }
.plan-selector-btn svg {
  flex-shrink: 0;
  transition: transform .2s;
}
.plan-selector-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.plan-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(31,26,22,.12);
  overflow: hidden;
}
.plan-dropdown[hidden] { display: none; }

.plan-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: #fff;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  transition: background .12s;
}
.plan-option:hover,
.plan-option.active { background: var(--millie-soft); }
.plan-option-name  { font-weight: 800; color: var(--text); flex: 1; }
.plan-option-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  white-space: nowrap;
}
.plan-option-price strong {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}
.plan-option-price em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--sub);
}
.plan-option-discount {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--millie-deep);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

/* ── Plan Option — 수료 기준 ─────────────────────────── */
.plan-option {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.plan-option-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.plan-option-name { flex: 1; }
.plan-completion {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}
.plan-completion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 5px;
}
.plan-completion-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.chip-time { background: #e8f0fe; color: #1a56db; }
.chip-book { background: #f0ebff; color: #6932c9; }
.chip-post { background: #fff3e0; color: #c05e00; }
.plan-completion-note {
  font-size: 10.5px;
  color: var(--sub);
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}
.plan-completion-note strong {
  color: var(--millie-deep);
  font-weight: 800;
}

/* ── Plan Bottom Sheet ─────────────────────────────── */

.plan-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(31,26,22,.45);
  display: flex;
  align-items: flex-end;
}

.plan-sheet {
  width: 100%;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
  max-height: 80vh;
  overflow-y: auto;
}
.plan-sheet.open { transform: translateY(0); }

@media (min-width: 769px) {
  .plan-sheet-overlay {
    align-items: center;
    justify-content: center;
  }
  .plan-sheet {
    width: 420px;
    border-radius: 16px;
    transform: translateY(0) scale(.94);
    opacity: 0;
    transition: opacity .22s ease, transform .22s ease;
    max-height: 80vh;
    padding-bottom: 0;
  }
  .plan-sheet.open {
    transform: scale(1);
    opacity: 1;
  }
}

.plan-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 900;
  position: sticky;
  top: 0;
  background: #fff;
}
.plan-sheet-header button {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--line);
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
}

.plan-sheet .plan-option { padding: 14px 20px; min-height: 52px; }

.plan-sheet-confirm {
  display: block;
  width: calc(100% - 32px);
  margin: 12px 16px 16px;
  text-align: center;
  justify-content: center;
}

/* ── Plan Selector END ─────────────────────────────── */

.apply-quick-btn {
  width: 100%;
  min-height: 86px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border-radius: 22px;
}

.apply-quick-btn > span,
.apply-quick-btn small,
.apply-price-line,
.apply-price-line em,
.apply-price-line strong {
  line-height: 1;
}

.apply-quick-btn > span {
  font-size: 13px;
  font-weight: 900;
}

.apply-quick-btn small {
  color: rgba(31, 26, 22, .58);
  font-size: 10.5px;
  font-weight: 800;
}

.apply-quick-btn.btn-primary small {
  color: rgba(31, 26, 22, .64);
}

.apply-price-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.apply-price-line em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-decoration: line-through;
  text-decoration-thickness: 1.4px;
  text-decoration-color: rgba(117, 111, 103, .72);
}

.apply-price-line strong {
  font-size: 14px;
  font-weight: 900;
}

.bottom-apply-btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title price"
    "desc price";
  align-items: center;
  justify-items: start;
  text-align: left;
  border-radius: 18px;
}

/* ── B2B Info ──────────────────────────────────────── */

.b2b-info-stack { display: grid; gap: 8px; }

.b2b-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.b2b-row:last-child { border-bottom: none; }

.b2b-row span  { color: var(--muted); font-size: 13px; font-weight: 800; }
.b2b-row strong { font-size: 17px; font-weight: 900; }

/* ── Tabs ──────────────────────────────────────────── */

.detail-tabs { padding: 0; overflow: hidden; }

.detail-tablist {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: #fafaf8;
}

.detail-tab {
  flex: 1;
  min-height: 54px;
  padding: 0 16px;
  color: var(--muted);
  border-right: 1px solid var(--line);
  font-size: 14px;
  font-weight: 800;
  transition: color .2s, background .2s;
}

.detail-tab:last-child { border-right: none; }

.detail-tab:hover:not(.on) {
  color: var(--sub);
  background: #fff;
}

.detail-tab.on {
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 -3px 0 var(--millie);
}

.detail-tab-panel { padding: 30px; }

/* ── Tab Content ───────────────────────────────────── */

.tab-content { display: grid; gap: 18px; }

.tab-content h2 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.04em;
}

.tab-content p {
  color: var(--sub);
  font-size: 15px;
  line-height: 1.75;
}

.excerpt-stack { display: grid; gap: 10px; }

.excerpt-block {
  padding: 16px 20px;
  border-left: 4px solid var(--millie);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: #fffdf1;
  color: #4f4100;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.7;
}

.book-detail-facts {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.book-detail-facts h3 {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.book-detail-fact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.book-detail-fact-row {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
}

.book-detail-fact-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}

.book-detail-fact-row strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.author-card {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--line);
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--millie-soft);
  color: #6d5206;
  font-size: 22px;
  font-weight: 900;
}

.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card h3 { font-size: 18px; font-weight: 900; }

.author-books {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.toc-list { display: grid; gap: 10px; }

.toc-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--line);
}

.toc-item strong { display: block; font-size: 15px; font-weight: 900; }

.toc-item ul {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  color: var(--sub);
  font-size: 13px;
}

.toc-item li { list-style: none; }

.review-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.review-filters { display: flex; gap: 8px; }

.review-list { display: grid; gap: 10px; }

.review-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--line);
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.review-source {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: #5e52b4;
  font-size: 11px;
  font-weight: 900;
}

.review-source.platform { background: var(--gold-soft); color: #9c680f; }

.review-stars  { color: var(--gold); font-size: 14px; }
.review-meta   { color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 8px; }

.empty-state {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: #fffdf1;
  border: 1px dashed rgba(162, 135, 0, .28);
  color: var(--sub);
  text-align: center;
  font-weight: 800;
}

.policy-list { display: grid; gap: 10px; }

.policy-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--line);
}

.policy-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 900;
}

/* ── Book Posts ─────────────────────────────────────── */

/* 가로 스크롤이 페이지 전체 레이아웃을 밀지 않도록 섹션 자체에서 클립 */
.book-posts-section {
  overflow: hidden;
}

.book-posts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.book-posts-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 10px 5px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
  flex-shrink: 0;
  white-space: nowrap;
}
.book-posts-more-btn:hover {
  border-color: var(--millie-deep);
  color: var(--millie-deep);
  background: var(--millie-soft);
}

.book-posts-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.bpt-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--sub);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.bpt-btn:hover {
  border-color: var(--millie-deep);
  color: var(--millie-deep);
}
.bpt-btn.active {
  border-color: var(--millie-deep);
  background: var(--millie-soft);
  color: var(--millie-deep);
}

.bpt-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--millie-deep);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.bpt-btn:not(.active) .bpt-count {
  background: var(--sub);
}

/* 포스트 카드 스크롤 (PC: 가로 스크롤, 카드 고정폭) */
.book-posts-scroll {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 12px;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.book-posts-scroll::-webkit-scrollbar {
  height: 4px;
}
.book-posts-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.book-posts-scroll::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
}

.bp-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, box-shadow .2s;
  cursor: pointer;
  /* PC: 4개 살짝 보이는 콤팩트 고정폭 */
  flex: 0 0 230px;
  min-width: 0;
  scroll-snap-align: start;
}
.bp-card:hover {
  border-color: rgba(162, 135, 0, .35);
  box-shadow: 0 6px 20px rgba(31, 26, 22, .08);
}

.bp-source-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.bp-millie {
  background: var(--millie-soft);
  color: var(--millie-deep);
}
.bp-company {
  background: #eef3ff;
  color: #3b5bdb;
}

.bp-title {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -.03em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bp-preview {
  font-size: 13px;
  line-height: 1.55;
  color: var(--sub);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: auto;
}

/* ── Related ───────────────────────────────────────── */

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.related-card {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s;
}

.related-card:hover {
  border-color: rgba(162, 135, 0, .3);
  box-shadow: 0 6px 20px rgba(31, 26, 22, .07);
}

.related-card img {
  width: 80px;
  height: auto;
  border-radius: 7px;
  object-fit: contain;
  box-shadow: 0 8px 16px rgba(31, 26, 22, .12);
}

.related-card h3 { font-size: 16px; line-height: 1.3; font-weight: 900; letter-spacing: -.03em; }
.related-card p  { margin-top: 4px; color: var(--sub); font-size: 12px; }

/* ── Bottom Bar ────────────────────────────────────── */

.detail-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 65;
  padding: 10px 16px;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 32px rgba(31, 26, 22, .08);
  backdrop-filter: blur(16px);
}

.detail-bottom-inner {
  width: min(var(--shell-width), calc(100vw - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.bottom-point {
  display: none;
}

.bottom-point span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}

.bottom-point strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
  font-weight: 900;
}

.bottom-actions {
  display: flex;
  align-items: center;
  flex: 1;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 10px;
}

.bottom-apply-btn {
  flex: 1 1 0;
  max-width: 380px;
  min-width: 260px;
  min-height: 58px;
  padding: 10px 16px;
  column-gap: 16px;
  row-gap: 4px;
}

.bottom-apply-btn span {
  grid-area: title;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.bottom-apply-btn small {
  grid-area: desc;
  color: rgba(109, 101, 93, .68);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.bottom-apply-btn.btn-primary small {
  color: rgba(67, 54, 12, .62);
}

.bottom-apply-btn .apply-price-line {
  grid-area: price;
}

.bottom-apply-btn span,
.bottom-apply-btn strong,
.bottom-apply-btn small {
  line-height: 1;
}

.bottom-apply-btn strong {
  font-size: 14px;
  font-weight: 900;
}

.btn-wish-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--sub);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .2s, color .2s, background .2s;
}

.btn-wish-icon:hover { border-color: #f5a0b0; color: #c73c5e; }

.btn-wish-icon.wished {
  border-color: #f5a0b0;
  background: #fff0f3;
  color: #c73c5e;
}

.btn-wish-icon.wished svg { fill: #c73c5e; }

/* ── Error ─────────────────────────────────────────── */

.detail-error { grid-column: 1 / -1; padding: 60px; text-align: center; }
.detail-error h1 { font-size: 30px; font-weight: 900; }
.detail-error p  { margin-top: 10px; color: var(--sub); }

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 1120px) {
  .detail-hero { grid-template-columns: 260px minmax(0, 1fr); gap: 28px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .detail-page { padding-top: 226px; padding-bottom: 126px; }

  .detail-hero {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
  }

  .detail-gallery {
    display: contents;
    position: static;
  }

  .detail-summary {
    display: contents;
  }

  .detail-title-row {
    order: 5;
  }

  .detail-title-row h1 {
    font-size: 34px;
    line-height: 1.05;
  }

  .detail-meta-line {
    order: 6;
    margin-top: -10px;
  }

  .detail-spec-line {
    order: 7;
    margin-top: -14px;
  }

  .detail-cover-frame {
    order: 1;
    width: min(68vw, 278px);
    margin: 0 auto 4px;
  }

  .detail-thumbnails {
    order: 2;
    justify-content: center;
    min-height: 58px;
  }

  .detail-tag-action-row {
    order: 8;
  }

  .price-stack {
    order: 9;
    width: 100%;
  }

  .mobile-quick-apply {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 12px;
    align-items: stretch;
  }

  .mobile-quick-apply.single {
    grid-template-columns: 1fr;
  }

  .mobile-quick-option {
    width: 100%;
  }

  .mobile-quick-option p {
    height: auto;
  }

  .apply-option-head,
  .apply-option-list {
    display: none;
  }

  .b2b-info-stack {
    display: none;
  }

  .book-spec-card {
    order: 20;
    width: min(100%, 420px);
    margin: 6px auto 0;
  }

  .detail-divider {
    display: none;
  }

  .cover-badge-rail { top: 12px; left: auto; right: -22px; gap: 6px; }
  .cover-badge { width: 48px; height: 48px; padding: 6px; }
  .cover-badge-icon svg { width: 23px; height: 23px; }

  .detail-tag-action-row {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
  }

  .format-badges {
    flex: 1 1 auto;
    gap: 8px;
  }

  .format-badge {
    min-height: 34px;
    padding: 7px 13px;
    font-size: 13px;
  }

  #wish-row {
    flex: 0 0 auto;
  }

  .btn-wish {
    min-height: 36px;
    padding: 7px 14px;
    white-space: nowrap;
  }

  .detail-bottom-bar {
    display: none;
  }

  .detail-bottom-bar.mobile-sticky-on {
    display: block;
    bottom: 96px;
    z-index: 180;
    padding: 8px 16px 6px;
    background: rgba(255, 255, 255, .92);
    border-top: 1px solid rgba(232, 222, 202, .72);
    box-shadow: 0 -10px 26px rgba(31, 26, 22, .08);
  }

  .detail-bottom-bar.mobile-sticky-on .detail-bottom-inner {
    width: calc(100vw - 32px);
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .detail-bottom-bar.mobile-sticky-on .bottom-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .detail-bottom-bar.mobile-sticky-on .bottom-actions > :only-child {
    grid-column: 1 / -1;
  }

  .detail-bottom-bar.mobile-sticky-on .bottom-actions .btn-primary,
  .detail-bottom-bar.mobile-sticky-on .bottom-actions .btn-line {
    width: 100%;
    min-width: 0;
  }

  .detail-bottom-bar.mobile-sticky-on .bottom-apply-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 78px;
    padding-inline: 10px;
    gap: 5px;
    border-radius: 20px;
  }

  .detail-tablist {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
    scrollbar-width: none;
  }
  .detail-tablist::-webkit-scrollbar { display: none; }
  .detail-tab {
    min-width: 0;
    min-height: 56px;
    padding: 0 6px;
    font-size: clamp(11px, 3.1vw, 13px);
    line-height: 1.15;
    white-space: normal;
    word-break: keep-all;
  }

  .review-toolbar { align-items: flex-start; flex-direction: column; }

  /* 포스트 가로 스와이프 — 음수 마진으로 섹션 패딩 돌파, 부모에서 클립 */
  .book-posts-scroll {
    margin-left: -18px;
    margin-right: -18px;
    padding-left: 18px;
    padding-right: 18px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .book-posts-scroll::-webkit-scrollbar { display: none; }
  .bp-card {
    flex: 0 0 76vw;
    min-width: 0;
  }

  /* 추천도서 가로 스와이프 */
  .related-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    margin-left: -18px;
    margin-right: -18px;
    padding-left: 18px;
    padding-right: 18px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .related-grid::-webkit-scrollbar { display: none; }
  .related-card {
    min-width: 72vw;
    flex-shrink: 0;
    scroll-snap-align: start;
    grid-template-columns: 80px minmax(0, 1fr);
    align-items: start;
  }

  .btn-wish-icon { width: 44px; flex-shrink: 0; }

  /* 추천도서 스와이프 오버플로가 페이지 수평 스크롤 유발 방지 */
  .related-section { overflow-x: hidden; }

  /* 관심 버튼 항상 오른쪽 끝 고정 */
  .detail-tag-action-row {
    justify-content: flex-start;
    align-items: flex-start;
  }
  .format-badges {
    flex: 1 1 0;
    min-width: 0;
    gap: 8px;
  }
  #wish-row { flex-shrink: 0; }
}

@media (max-width: 560px) {
  .detail-page    { padding-top: 88px; }
  .detail-tab-panel,
  .related-section { padding: 18px; }
  .detail-cover-frame {
    width: min(68vw, 238px);
  }
  .mobile-quick-apply {
    gap: 8px;
  }
  .mobile-quick-option {
    min-width: 0;
  }
  .mobile-quick-option p {
    display: none;
  }
  .apply-quick-btn {
    width: 100%;
    min-height: 78px;
    padding-inline: 8px;
    gap: 5px;
  }
  .apply-quick-btn > span {
    font-size: 12px;
  }
  .apply-quick-btn small {
    font-size: 9.5px;
  }
  .apply-price-line strong {
    font-size: 13px;
  }
  .apply-price-line em {
    font-size: 10px;
  }
  .book-detail-fact-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .book-detail-fact-row {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: baseline;
  }
  .book-detail-fact-row strong {
    justify-self: end;
    text-align: right;
  }
  .book-spec-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
  }
  .book-spec-value {
    justify-self: end;
    text-align: right;
  }
  .book-spec-value.accent {
    justify-self: end;
  }
  .detail-tag-action-row {
    gap: 8px;
  }
  .format-badge {
    min-height: 32px;
    padding: 6px 11px;
    font-size: 12px;
  }
  .btn-wish {
    padding: 7px 12px;
    font-size: 12px;
  }
  .detail-tab {
    min-height: 54px;
    padding: 0 3px;
    font-size: 11px;
  }
  .apply-option-list  { grid-template-columns: 1fr; }
  .apply-option-card  { grid-template-columns: 1fr; }
  .apply-option-side  { justify-items: stretch; }
  .apply-option-side .btn-primary,
  .apply-option-side .btn-line { width: 100%; min-width: 0; }
  .b2b-row { grid-template-columns: 1fr; gap: 2px; }
  .author-card { grid-template-columns: 1fr; }
  /* related-card는 스와이프 카드라 가로 레이아웃 유지 */
  .related-card { grid-template-columns: 80px minmax(0, 1fr); }
}

/* 구독 혜택 배지 */
.subscription-benefit-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 0;
}
.sub-benefit-active {
  background: #fffdf1;
  border: 1px solid rgba(162, 135, 0, .2);
  color: #4f4100;
}
.sub-benefit-active strong { color: #b87d00; }
.earn-amount {
  font-style: normal;
  font-weight: 900;
  color: #22a06b;
  font-size: 11.5px;
}
.sub-benefit-check {
  font-size: 13px;
  font-weight: 900;
  color: #22a06b;
  flex-shrink: 0;
}
.sub-benefit-expire {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  margin-left: auto;
}
.sub-benefit-upsell {
  background: #f5f5ff;
  border: 1px solid rgba(94, 82, 180, .2);
  color: #5e52b4;
}
.sub-benefit-upsell strong { color: #5e52b4; }
.sub-benefit-link {
  font-size: 11px;
  font-weight: 900;
  color: #5e52b4;
  text-decoration: none;
  margin-left: auto;
  white-space: nowrap;
}
.sub-benefit-link:hover { text-decoration: underline; }

/* 프로토타입 전용 토글 */
.proto-toggle {
  position: fixed;
  bottom: 88px;
  right: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 999px;
  padding: 6px 6px 6px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .14);
  font-size: 12px;
  font-weight: 700;
  color: #888;
}
.proto-toggle-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: none;
  background: #eee;
  color: #666;
  font-weight: 900;
  cursor: pointer;
  font-size: 12px;
  transition: background .15s, color .15s;
}
.proto-toggle-btn.proto-active {
  background: #ffe500;
  color: #4b3806;
}

/* 두 번째 토글은 첫 번째 위에 쌓이도록 */
#proto-optype-toggle { bottom: 140px; }

@media (max-width: 780px) {
  /* fixed 해제 → breadcrumb 행 오른쪽 끝 인라인 배치 */
  .proto-toggle {
    position: static;
    margin-left: auto;
    box-shadow: none;
    background: none;
    border: none;
    padding: 0;
    gap: 4px;
    flex-shrink: 0;
  }
  .proto-toggle .proto-toggle-label { display: none; }
  .proto-toggle .proto-toggle-btn {
    font-size: 11px;
    padding: 4px 10px;
  }
}

/* ── 종이책 신청 시트 ─────────────────────────────── */

.apply-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.apply-sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.apply-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 901;
  background: #fff;
  border-radius: 20px 20px 0 0;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.12);
  pointer-events: none;
}
.apply-sheet.open {
  transform: translateY(0);
  pointer-events: auto;
}
@media (min-width: 768px) {
  .apply-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -44%) scale(0.97);
    width: 480px;
    border-radius: 16px;
    max-height: 82vh;
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease;
  }
  .apply-sheet.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* 프로토 토글 바 */
.apply-proto-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 6px;
  border-bottom: 1px solid #f0f0ec;
  background: #fafaf8;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .apply-proto-bar { border-radius: 16px 16px 0 0; }
}
.apply-proto-label {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: #9b7dd4;
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.02em;
}
.apply-proto-btn {
  font-size: 12px;
  color: #5b45a0;
  background: none;
  border: 1px solid #c9bbec;
  border-radius: 99px;
  padding: 3px 12px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.apply-proto-btn:hover { background: #ede8f8; }

/* 시트 헤더 */
.apply-sheet-head {
  display: flex;
  align-items: center;
  padding: 16px 20px 12px;
  gap: 4px;
  flex-shrink: 0;
  border-bottom: 1px solid #f0f0ec;
}
.apply-sheet-back {
  width: 32px; height: 32px;
  border: none; background: none;
  padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #333; border-radius: 8px;
  margin-right: 2px;
}
.apply-sheet-back:hover { background: #f5f5f0; }
.apply-sheet-back svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.apply-sheet-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin: 0;
}
.apply-sheet-close-x {
  width: 32px; height: 32px;
  border: none; background: none;
  padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #666; border-radius: 8px;
}
.apply-sheet-close-x:hover { background: #f5f5f0; }
.apply-sheet-close-x svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* 시트 바디 (스크롤 영역) */
.apply-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 도서 정보 */
.apply-book-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0ec;
  margin-bottom: 20px;
}
.apply-book-cover {
  width: 56px;
  height: 76px;
  border-radius: 6px;
  background: linear-gradient(145deg, #c8b9e8, #8b6fc8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  white-space: pre-line;
  text-align: center;
  line-height: 1.3;
  flex-shrink: 0;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.15);
  overflow: hidden;
}
.apply-book-cover img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 6px;
}
.millie-sub-cover {
  background: linear-gradient(145deg, #6932c9, #4a1fa0);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.apply-book-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.apply-book-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  line-height: 1.4;
}
.apply-book-author {
  font-size: 12px;
  color: #888;
}
.apply-book-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}
.apply-book-original {
  font-size: 11px;
  color: #aaa;
  text-decoration: line-through;
}
.apply-book-price {
  font-size: 16px;
  font-weight: 800;
  color: #1a1a1a;
}

/* 신청 정보 */
.apply-info-section {
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0ec;
  margin-bottom: 20px;
}
.apply-info-dl { margin: 0; padding: 0; }
.apply-info-row {
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 5px 0;
}
.apply-info-row dt {
  font-size: 12px;
  color: #999;
  font-weight: 500;
  width: 72px;
  flex-shrink: 0;
}
.apply-info-row dd {
  font-size: 13px;
  color: #222;
  font-weight: 500;
  margin: 0;
}

/* 결제 내역 */
.apply-payment-section {
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0ec;
  margin-bottom: 20px;
}
.apply-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.apply-payment-table {
  background: #f8f8f4;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.apply-pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}
.apply-pay-label {
  font-size: 13px;
  color: #555;
}
.apply-pay-value {
  font-size: 13px;
  font-weight: 600;
  color: #222;
}
.apply-pay-deduct .apply-pay-value {
  color: #e05050;
}
.apply-pay-divider {
  height: 1px;
  background: #e8e8e2;
  margin: 6px 0;
}
.apply-pay-result .apply-pay-label,
.apply-pay-result .apply-pay-value {
  font-weight: 700;
  font-size: 14px;
}
.apply-pay-remaining {
  color: #2e7d52 !important;
}
.apply-pay-use-all {
  color: #e05050 !important;
}
.apply-pay-card-val {
  color: #1a6fc4 !important;
}
.apply-pay-card .apply-pay-label {
  color: #1a6fc4;
  font-weight: 600;
}

/* 구독 혜택 적립 행 */
.cashback-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e6f4ec;
  color: #2e7d52;
  font-size: 10.5px;
  font-weight: 900;
  margin-right: 4px;
  letter-spacing: -0.01em;
}
.apply-pay-cashback .apply-pay-label {
  color: #2e7d52;
}
.apply-pay-cashback .apply-pay-value {
  color: #2e7d52 !important;
  font-weight: 800;
}

/* 포인트 유형 배지 (지급 / 적립) */
.ptype-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  margin-right: 3px;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.ptype-badge.ptype-granted {
  background: #e8f0fe;
  color: #1a56db;
}
.ptype-badge.ptype-earned {
  background: #fef3c7;
  color: #92400e;
}

/* 적립포인트 사용 토글 행 */
.apply-earned-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.apply-earned-check {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: #f0f5ff;
  border: 1px solid #c7d9ff;
  color: #1a56db;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.apply-earned-check input[type="checkbox"] {
  width: 12px;
  height: 12px;
  accent-color: #6932c9;
  cursor: pointer;
  margin: 0;
}

/* 적립액 계산 근거 소주석 */
.cashback-basis {
  font-size: 10.5px;
  color: var(--muted, #888);
  font-style: normal;
  font-weight: 600;
  margin-left: 4px;
}

/* 5% 적립 우측: 금액 + 근거 세로 배치 */
.apply-cashback-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.apply-cashback-right .cashback-basis {
  margin-left: 0;
}

/* 적립포인트 직접 입력 */
.apply-earn-input-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 7px;
  padding: 3px 8px;
  transition: border-color 0.15s;
}
.apply-earn-input-wrap:focus-within {
  border-color: #6932c9;
}
.apply-earn-prefix,
.apply-earn-suffix {
  font-size: 13px;
  font-weight: 700;
  color: #e05050;
  flex-shrink: 0;
}
.apply-earn-input {
  width: 70px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: #e05050;
  text-align: right;
  outline: none;
}
.apply-earn-input::placeholder {
  color: #ccc;
  font-weight: 400;
}

/* 부족 안내 뱃지 */
.apply-insufficient-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: #c07000;
  background: #fff8ec;
  border: 1px solid #fddfa0;
  border-radius: 8px;
  padding: 8px 12px;
}
.apply-insufficient-notice svg {
  stroke: #c07000; fill: none; stroke-width: 2;
  stroke-linecap: round; flex-shrink: 0;
}

/* 카드 입력 폼 */
.apply-card-section {
  padding-bottom: 12px;
  margin-bottom: 4px;
}
.apply-card-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.apply-card-row {
  display: flex;
  gap: 10px;
}
.apply-card-row .apply-card-field { flex: 1; }
.apply-card-field--full { width: 100%; }
.apply-card-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  margin-bottom: 5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.apply-card-input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  border: 1.5px solid #e0e0d8;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  color: #222;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.apply-card-input::placeholder { color: #ccc; }
.apply-card-input:focus {
  border-color: #7c5cbf;
  box-shadow: 0 0 0 3px rgba(124,92,191,0.12);
}

/* 상태 표시 제어 */
.apply-sheet.state-sufficient .apply-state-insufficient { display: none; }
.apply-sheet.state-insufficient .apply-state-sufficient { display: none; }

/* 시트 푸터 */
.apply-sheet-footer {
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #f0f0ec;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.apply-footer-summary {
  font-size: 13px;
  color: #555;
  text-align: center;
}
.apply-footer-summary strong { color: #111; font-weight: 700; }
.apply-confirm-btn {
  width: 100%;
  height: 50px;
  background: #4a2e8f;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: -0.01em;
}
.apply-confirm-btn:hover { background: #3d2578; }
.apply-confirm-btn:active { transform: scale(0.98); }
.apply-confirm-btn.state-card { background: #1a6fc4; }
.apply-confirm-btn.state-card:hover { background: #155da8; }
