/* 전환 개선 레이어 (2026-11-11). cro-20261111.js·oneteach_cro.py와 한 묶음이다.
   색은 사이트 주 버튼의 오렌지(#ff5100, 계산값으로 확인)와 중립색만 쓴다. 글자는 11px 아래로 내리지 않는다. */
:root{--cro-orange:#ff5100;--cro-ink:#2b2723;--cro-muted:#6b645e;--cro-line:#e4ddd4;--cro-tint:#fff4ee;--cro-ease:cubic-bezier(.2,.7,.2,1)}
.cro-hidden{display:none!important}
.cro-visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}

/* ── 자료 상세 첫 화면: 가격 한 줄 + 실제 제작 페이지 ── */
.imp-page .md-heading .cro-offer,.imp-page .cro-offer{margin:14px 0 0;display:flex;flex-direction:column;gap:2px;color:var(--cro-muted);font-size:15px;line-height:1.6}
.imp-page .md-heading .cro-offer strong,.imp-page .cro-offer strong{font-size:20px;font-weight:800;letter-spacing:-.3px;color:var(--cro-ink);font-variant-numeric:tabular-nums}
/* 한 칸짜리 그리드(minmax(0,1fr))로 감싸 견본 줄의 내용 너비가 바깥 칸을 밀어 넓히지 않게 한다. :has() 없이도 성립한다. */
.cro-hero-samples{margin-top:26px;display:grid;grid-template-columns:minmax(0,1fr)}
.cro-hero-samples ul{list-style:none;margin:0 -8px;padding:8px 8px 12px;display:flex;gap:14px;overflow-x:auto;scroll-snap-type:x proximity;scroll-padding-inline:8px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.cro-samples-more ul{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 40px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 40px),transparent)}
.cro-samples-more ul:focus-within{-webkit-mask-image:none;mask-image:none}
.cro-hero-samples ul::-webkit-scrollbar{display:none}
.cro-hero-samples li{flex:0 0 148px;scroll-snap-align:start}
.cro-hero-samples button{display:block;width:100%;padding:0;border:0;background:none;font:inherit;color:inherit;text-align:left;cursor:zoom-in}
.cro-hero-samples img{display:block;width:100%;height:auto;aspect-ratio:320/453;object-fit:cover;object-position:top;background:#fff;border-radius:8px;box-shadow:0 0 0 1px var(--cro-line),0 6px 16px rgba(43,39,35,.08);transition:transform .22s var(--cro-ease),box-shadow .22s}
.cro-hero-samples button:hover img,.cro-hero-samples button:focus-visible img{transform:translateY(-4px);box-shadow:0 0 0 1px var(--cro-line),0 14px 26px rgba(43,39,35,.15)}
.cro-hero-samples button:focus-visible{outline:2px solid var(--cro-orange);outline-offset:4px;border-radius:10px}
.cro-hero-samples span{display:block;margin-top:9px;font-size:13px;font-weight:650;line-height:1.4;color:#5f5750}
@media (prefers-reduced-motion:no-preference){
  .cro-hero-samples li{animation:cro-rise .5s var(--cro-ease) both}
  .cro-hero-samples li:nth-child(2){animation-delay:.05s}.cro-hero-samples li:nth-child(3){animation-delay:.1s}
  .cro-hero-samples li:nth-child(4){animation-delay:.15s}.cro-hero-samples li:nth-child(5){animation-delay:.2s}
}
@keyframes cro-rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@media(max-width:760px){
  .imp-page .cro-offer strong{font-size:18px}
  .cro-hero-samples{margin-top:18px}
  .cro-hero-samples li{flex-basis:124px}
  /* 견본 줄이 '실제 자료 보기' 역할을 하므로 좁은 화면에서는 보조 버튼을 접는다. */
  .imp-page .md-heading:has(+ .cro-hero-samples) .md-hero-actions .im-btn:not(.im-primary){display:none}
}

/* ── 구성별 금액 ── */
.cro-tiers{display:grid;gap:8px;margin:20px 0 16px}
.cro-tiers[hidden]{display:none}
.cro-tiers button{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:10px;min-height:54px;padding:9px 14px;border:1.5px solid var(--cro-line);border-radius:12px;background:#fff;font:inherit;line-height:1.4;color:var(--cro-ink);text-align:left;cursor:pointer;transition:border-color .18s,background .18s,box-shadow .18s}
.cro-tiers button:hover{border-color:#d2c7ba}
.cro-tiers button:disabled{cursor:default;opacity:.6}
.cro-tiers b{font-size:14px;font-weight:800;min-width:40px}
.cro-tiers span{font-size:14px;color:#5f5750}
.cro-tiers em{font-style:normal;font-size:15px;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap;text-align:right}
.cro-tiers button[aria-pressed=true]{border-color:var(--cro-orange);background:var(--cro-tint);box-shadow:0 0 0 3px rgba(255,81,0,.12)}
.cro-tiers button:focus-visible{outline:2px solid var(--cro-orange);outline-offset:2px}
.cro-tiers .cro-tier-welcome em::after{content:"첫 구매가";display:block;font-size:11px;font-weight:650;color:#b0441c}
.cro-tiers-textbook{margin:0 0 4px}
/* 좁은 화면: 이름과 금액을 한 줄에, 설명은 그 아래 한 줄에 둔다(설명이 세 줄로 쪼개지지 않게). */
@media(max-width:380px){
  .cro-tiers-textbook button{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"name amount" "desc desc";row-gap:2px}
  .cro-tiers-textbook b{grid-area:name}.cro-tiers-textbook em{grid-area:amount}.cro-tiers-textbook span{grid-area:desc}
}
/* 금액을 다시 받는 동안에도 줄은 자리를 지키고 금액만 흐려진다. */
.cro-tiers em{transition:opacity .12s}
.cro-tiers-loading em,.cro-tiers em.cro-tier-wait{opacity:.4}
.cro-tiers-note{margin:2px 0 0;font-size:13px;line-height:1.6;color:var(--cro-muted);white-space:pre-line}
.cro-tiers-note[hidden]{display:none}

/* ── 예상 금액 ── */
.md-price .cro-price-label{display:block;font-size:13px;font-weight:650;color:var(--cro-muted)}
.md-price strong[data-cro-estimate]{font-size:28px;line-height:1.25;margin:2px 0;font-variant-numeric:tabular-nums}
.md-price .cro-price-sub{display:block;font-size:13px;font-weight:650;color:#b0441c}
.md-price.cro-price-loading strong[data-cro-estimate],.md-price.cro-price-loading .cro-price-sub,.md-price.cro-price-loading .cro-price-benefit{opacity:.45;transition:opacity .12s}

/* ── 결제 수단 ── */
.cro-pay{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.cro-pay[hidden]{display:none}
.cro-pay-label{flex:1 0 100%;font-size:13px;font-weight:650;color:#34465e}
.cro-pay button{flex:1 1 auto;min-height:46px;padding:8px 12px;border:1.5px solid #dfe5ec;border-radius:10px;background:#fff;font:inherit;font-size:14px;font-weight:700;line-height:1.3;color:var(--cro-ink);cursor:pointer;white-space:nowrap;transition:border-color .18s,background .18s}
.cro-pay button[aria-pressed=true]{border-color:var(--cro-orange);background:var(--cro-tint);color:#b0441c}
.cro-pay button:focus-visible{outline:2px solid var(--cro-orange);outline-offset:2px}

/* ── 하단 고정 바 ── */
.cro-bar{position:fixed;left:0;right:0;bottom:0;z-index:79;padding:10px 16px calc(10px + env(safe-area-inset-bottom));background:rgba(255,255,255,.97);box-shadow:0 -8px 28px rgba(43,39,35,.12);font-family:"Pretendard Variable",Pretendard,"Apple SD Gothic Neo",sans-serif;word-break:keep-all}
.cro-bar[hidden]{display:none}
@media (prefers-reduced-motion:no-preference){.cro-bar{animation:cro-bar-in .28s var(--cro-ease)}}
@keyframes cro-bar-in{from{transform:translateY(100%)}to{transform:none}}
.cro-bar-inner{max-width:1120px;margin:0 auto;display:flex;align-items:center;gap:14px}
.imp-page .cro-bar-inner{max-width:1200px}.cs-page .cro-bar-inner{max-width:1056px}
.cro-bar-text{margin:0;flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.35}
/* 이름(위 줄)은 길면 말줄임, 금액(아래 줄)은 자르지 않는다. */
.cro-bar-text b{font-size:13px;font-weight:650;color:#5f5750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cro-bar-text span{font-size:18px;font-weight:800;color:var(--cro-ink);font-variant-numeric:tabular-nums;white-space:nowrap}
.cro-bar-text span:empty{display:none}
.cro-bar-btn{flex:0 0 auto;min-height:50px;padding:0 22px;border:0;border-radius:12px;background:var(--cro-orange);color:#fff;font:inherit;font-size:16px;font-weight:800;white-space:nowrap;cursor:pointer;transition:transform .15s var(--cro-ease),filter .15s}
.cro-bar-btn:hover{filter:brightness(.95)}
.cro-bar-btn:active{transform:scale(.98)}
.cro-bar-btn:disabled{opacity:.55;cursor:default}
.cro-bar-btn:focus-visible{outline:2px solid var(--cro-ink);outline-offset:2px}
body.cro-bar-on{padding-bottom:calc(72px + env(safe-area-inset-bottom))!important}
body.cro-bar-on .csw-launch{bottom:calc(84px + env(safe-area-inset-bottom))!important}
body.cro-bar-on .csw-teaser{bottom:calc(156px + env(safe-area-inset-bottom))!important}
/* 떠 있는 토스트(오류 안내)는 바 위에 보인다. 숨은 토스트(.on 없음)는 올리지 않는다 — 투명한 채 바 자리에 걸쳐 버튼 클릭을 가로챈다.
   키보드로 옮긴 초점이 바 뒤에 가려지지 않게 스크롤 여백을 둔다. */
body.cro-bar-on .toast.on{bottom:calc(84px + env(safe-area-inset-bottom))}
body.cro-bar-on .toast:not(.on){pointer-events:none}
html.cro-bar-on{scroll-padding-bottom:calc(84px + env(safe-area-inset-bottom))}
/* 낮은 화면(가로로 든 휴대폰): 바를 한 줄로 낮춘다. */
@media (max-height:480px){
  .cro-bar{padding-block:6px}.cro-bar-btn{min-height:44px}.cro-bar-text b{display:none}
  body.cro-bar-on{padding-bottom:calc(58px + env(safe-area-inset-bottom))!important}
  body.cro-bar-on .csw-launch{bottom:calc(66px + env(safe-area-inset-bottom))!important}
  body.cro-bar-on .toast.on{bottom:calc(66px + env(safe-area-inset-bottom))}
}
/* 문의 창이 열려 있으면 런처와 함께 올린다(런처가 창 뒤로 들어가지 않게). */
@media(min-width:421px) and (min-height:481px){body.cro-bar-on .csw-panel{bottom:154px;max-height:calc(100dvh - 184px)}}
/* PDF 제작 상태 패널(화면 아래 고정)이 떠 있는 동안에는 바를 접고 패널용 아래 여백을 그대로 둔다. */
.ot-generation-active .cro-bar{display:none}
.ot-generation-active body.cro-bar-on{padding-bottom:calc(var(--ot-generation-height,110px) + 36px)!important}
/* 바에서 '결제 정보 확인'을 누르면 결제 버튼이 화면 아래쪽에 오도록 맞춘다. */
[data-direct-maker] [data-md-make]{scroll-margin-bottom:20px}
@media(min-width:761px){.cro-bar{padding-inline:32px}.cro-bar-text{flex-direction:row;align-items:baseline;gap:12px}.cro-bar-text b{font-size:15px}.cro-bar-btn{min-width:220px}}
@media(max-width:380px){.cro-bar{padding-inline:14px}.cro-bar-inner{gap:10px}.cro-bar-btn{padding:0 14px;font-size:15px}.cro-bar-text span{font-size:17px}}
@media(max-width:340px){.cro-bar-btn{padding:0 12px;font-size:14px}.cro-bar-text span{font-size:16px}}

/* ── 구성 묶음 이름표 · 혜택 알림 쿠폰(자료 상세) ── */
.cro-tiers-label{margin:0 0 2px;font-size:14px;font-weight:700;color:#34465e}
.md-price .cro-price-benefit{display:block;margin-top:6px;font-size:13px;font-weight:650;color:var(--cro-muted)}
.md-price .cro-price-benefit[hidden]{display:none}
.cro-benefit{display:flex;gap:10px;align-items:flex-start;margin:14px 0 16px;padding:14px;border-radius:12px;background:var(--cro-tint);cursor:pointer}
.cro-benefit[hidden]{display:none}
.cro-benefit input{flex:0 0 auto;width:20px;height:20px;margin:2px 0 0;accent-color:var(--cro-orange)}
.cro-benefit strong{display:block;font-size:15px;font-weight:800;line-height:1.45;color:var(--cro-ink)}
.cro-benefit i{font-style:normal}
.cro-benefit small{display:block;margin-top:4px;font-size:12px;line-height:1.65;color:#6b5a4e}
.cro-benefit-applied{margin:6px 0 0;font-size:13px;font-weight:700;line-height:1.6;color:#b0441c;white-space:pre-line}
.cro-benefit-applied[hidden]{display:none}
.cro-benefit input:disabled{opacity:.5}

/* ── 결제창을 닫은 뒤: 주문이 열려 있는 동안 구성 변경을 막는다 ── */
.cro-hold{margin:0 0 12px;padding:12px 14px;border-radius:10px;background:#f6f2ec;font-size:13px;line-height:1.65;color:var(--cro-ink);white-space:pre-line}
.cro-hold[hidden]{display:none}
@media (prefers-reduced-motion:no-preference){.cro-hold-pulse{animation:cro-hold-pulse .7s var(--cro-ease)}}
@keyframes cro-hold-pulse{0%{background:var(--cro-tint);box-shadow:0 0 0 3px rgba(255,81,0,.18)}100%{background:#f6f2ec;box-shadow:0 0 0 0 rgba(255,81,0,0)}}
.cro-hold-on .md-types label,.cro-hold-on .md-item,.cro-hold-on .md-unit-check,.cro-hold-on .md-selection-actions label,.cro-hold-on [data-md-clear]{opacity:.5;cursor:not-allowed}

/* ── 교과서 상세 첫 화면 ── */
.cro-hero-samples-note{margin:4px 0 0;font-size:13px;line-height:1.5;color:var(--cro-muted)}
.ix-detail-grid .cro-hero-samples{margin:20px 0 6px}
@media(max-width:760px){
  /* 실제 지면이 첫 화면에 오도록 좁은 화면에서는 장식 표지를 접는다. */
  .ix-detail-grid:has(.cro-hero-samples) .ix-detail-cover{display:none}
  /* 표지 칸(175px)이 빠진 자리에 본문이 갇히지 않게 한 칸으로 편다(기존 규칙은 599px 이하에서만 한 칸이다). */
  .ix-detail-grid:has(.cro-hero-samples){grid-template-columns:minmax(0,1fr)}
}

/* 교과서 구매 버튼에 합계가 붙으면 아주 좁은 화면에서는 두 줄로 넘긴다(글자가 버튼 밖으로 나가지 않게). */
/* 기존 규칙(.tb-selection-submit .im-btn의 nowrap)보다 뒤에 오도록 같은 무게의 선택자를 쓴다. */
@media(max-width:360px){.tb-selection-submit [data-textbook-submit]{white-space:normal;text-align:center;height:auto;padding-inline:14px}}

/* ── 단원 안내: 지면 먼저, 미리보기 창 안 버튼 ── */
.cs-body .cro-facts-after{margin:0 0 36px}
.cro-viewer-cta{flex-shrink:0;display:flex;align-items:center;gap:14px;padding:10px 14px calc(10px + env(safe-area-inset-bottom));background:#fff;box-shadow:0 -6px 18px rgba(0,0,0,.08)}
.cro-viewer-cta p{margin:0;flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.35}
.cro-viewer-cta b{font-size:13px;font-weight:650;color:#5f5750}
.cro-viewer-cta b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cro-viewer-cta span{font-size:16px;font-weight:800;color:var(--cro-ink);white-space:nowrap}
.cro-viewer-cta a{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 20px;border-radius:12px;background:var(--cro-orange);color:#fff;font-size:15px;font-weight:800;text-decoration:none;white-space:nowrap}
.cro-viewer-cta a:focus-visible{outline:3px solid var(--cro-ink);outline-offset:2px}
/* 가로로 든 휴대폰: 지면 자리를 남기려고 버튼만 한 줄로 둔다. */
@media (max-height:480px){.cro-viewer-cta{padding:6px 12px}.cro-viewer-cta p{display:none}.cro-viewer-cta a{flex:1;min-height:44px}}

/* ── 가입·로그인: 전환 탭 ── */
.cro-auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin:0 0 22px;padding:4px;border-radius:12px;background:#f3efe9}
.cro-auth-tabs a,.cro-auth-tabs span{display:flex;align-items:center;justify-content:center;min-height:44px;border-radius:9px;font-size:15px;font-weight:700;color:#6b645e;text-decoration:none;white-space:nowrap}
.cro-auth-tabs [aria-current=page]{background:#fff;color:var(--cro-ink);box-shadow:0 1px 4px rgba(43,39,35,.12)}
.cro-auth-tabs a:focus-visible{outline:2px solid var(--cro-ink);outline-offset:2px}
.ot-social-logins .cro-auth-first{margin:10px 0 2px;font-size:14px;font-weight:650;color:var(--cro-ink)}

/* ── 홈: 단건 가격 줄 ── */
.cro-singles{margin:0 0 28px}
.cro-singles-label{margin:0 0 10px;font-size:14px;font-weight:700;color:var(--muted,#6b645e)}
.cro-singles ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.cro-singles li{display:flex}
.cro-singles a{flex:1;display:flex;flex-direction:column;gap:2px;min-height:76px;padding:14px 16px;border-radius:14px;background:#fff;box-shadow:inset 0 0 0 1px var(--line,#e7e2db);color:var(--ink,#141210);text-decoration:none;transition:background .18s,transform .18s var(--cro-ease)}
.cro-singles a:hover{background:var(--pen-soft,#fff0e8);transform:translateY(-2px)}
.cro-singles a:focus-visible{outline:2px solid var(--cro-orange);outline-offset:2px}
.cro-singles b{font-size:14px;font-weight:650;color:var(--muted,#6b645e)}
.cro-singles span{font-size:15px;color:var(--ink-2,#38332f)}
.cro-singles strong{font-size:19px;font-weight:800;color:var(--ink,#141210);font-variant-numeric:tabular-nums}
@media(max-width:860px){.cro-singles ul{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:360px){.cro-singles a{padding:12px}}
@media (prefers-reduced-motion:reduce){.cro-singles a{transition:none}.cro-singles a:hover{transform:none}}
