/* Approved presentation changes only: payment scripts and payloads are unchanged. */
html body.pricing-page .btn { min-height:40px; border-radius:var(--radius-control,8px); white-space:nowrap; }
html[data-device-class="phone"] body.pricing-page .btn { min-height:44px; }
html body.pricing-page .btn.primary { background:var(--action-primary-bg,#2563eb); color:var(--action-primary-fg,#fff); border-color:var(--action-primary-bg,#2563eb); }
html body.pricing-page .product-actions { gap:8px; }
html body.pricing-page .product-actions .btn { min-height:40px; border-radius:8px; }
html[data-device-class="phone"] body.pricing-page .product-actions .btn { min-height:44px; }
html body.pricing-page .product-card,html body.pricing-page .panel { border-radius:var(--radius-card,12px); }
html body.pricing-page .details-dialog { border-radius:var(--radius-dialog,16px); }
html body.pricing-page .details-head { min-height:56px; padding:5px 16px; align-items:center; gap:8px; }
html body.pricing-page #productDetailsModal .details-head { border-radius:16px 16px 0 0; }
html body.pricing-page .details-close { width:40px; min-width:40px; min-height:40px; padding:0; flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; }
html[data-device-class="phone"] body.pricing-page .details-close { width:44px; min-width:44px; min-height:44px; }
html body.pricing-page .details-body { padding:16px; }
html body.pricing-page .payment-consent-actions,html body.pricing-page .refund-actions { gap:8px; }
html[data-device-class="phone"] body.pricing-page .payment-consent-actions { flex-direction:row; align-items:stretch; }
html[data-device-class="phone"] body.pricing-page .payment-consent-actions .btn { min-height:48px; flex:1 1 0; min-width:0; white-space:normal; word-break:keep-all; }
html body.pricing-page #subscriptionManagement { padding-bottom:20px; }
html body.pricing-page #subscriptionPlanActions { position:static; min-height:0; margin-top:16px; display:flex; flex-wrap:wrap; gap:8px; }
html body.pricing-page #subscriptionPlanActions p { flex:1 0 100%; }
html body.pricing-page #subscriptionCancel { color:var(--danger,#b42318) !important; border-color:var(--danger,#b42318) !important; }
html[data-theme="dark"] body.pricing-page #subscriptionCancel { color:var(--work-red,#fda4af) !important; border-color:var(--work-red,#fda4af) !important; }
html body.pricing-page #subscriptionCancelSheet { inset:0; margin:auto; width:min(560px,calc(100vw - 32px)); height:fit-content; border-radius:16px; padding:24px; }
html[data-device-class="phone"] body.pricing-page #subscriptionCancelSheet { inset:auto 0 var(--app-bottom-reserved,0px); margin:0 auto; width:100%; border-radius:16px 16px 0 0; padding:16px 16px max(16px,env(safe-area-inset-bottom,0px)); }
html body.pricing-page .subscription-sheet-actions { gap:8px; }
html[data-device-class="phone"] body.pricing-page .subscription-sheet-actions .btn { min-height:48px; flex:1 1 0; }
html body.pricing-page #subscriptionConfirm { background:var(--action-danger-bg,#b91c1c) !important; border-color:var(--action-danger-bg,#b91c1c) !important; color:#fff !important; }
html body.pricing-page #orderHistory td:nth-child(1),html body.pricing-page #orderHistory td:nth-child(3) { white-space:nowrap; }

/* #450-43: 모바일 웹 /pricing(≤640px) — 첫 화면에 상품 3개와 구매 버튼을 모두 보인다.
   상품 설명·이용 기준은 카드의 '자세히'로 접고(내용은 그대로), 소개·선택 기준·공통 기능은 카드 아래로 옮기며,
   내 구독 관리는 상태 한 줄로 줄이고 상세는 펼친다. 가격·상품·결제 스크립트와 데스크톱·태블릿 배치는 바꾸지 않는다.
   body[data-pricing-view="web"](웹 구매 화면에만 붙음)로 한정되어 앱 스토어 구매 화면(_native_iap_pricing)은 영향이 없다. */
html body.pricing-page .product-more,
html body.pricing-page .subscription-toggle,
html body.pricing-page .pricing-intro-mobile { display:none; }

/* Web products share a card surface; the subscription is identified by its border and badge. */
html body.pricing-page[data-pricing-view="web"] .product-card.featured {
    background:var(--paper,#fff) !important;
    border-color:var(--accent,#1565c0) !important;
}
html body.pricing-page[data-pricing-view="web"] .product-card.featured .product-heading {
    background:transparent !important;
    color:inherit;
}
html body.pricing-page[data-pricing-view="web"] .product-card.featured .price { color:var(--work-ink); }
html body.pricing-page[data-pricing-view="web"] .product-card.featured .badge { color:var(--accent,#1565c0); }
html body.pricing-page[data-pricing-view="web"] .product-label-row .product-index { order:1; }
/* Override the shared badge inset for pricing labels inside the web shell. */
html body.pricing-page[data-pricing-view="web"] #appMainFrame #appContentRegion .product-label-row .badge {
    margin-inline:0;
    padding-inline:0 !important;
    border-inline-width:0 !important;
}

@media (max-width:640px) {
  html body.pricing-page[data-pricing-view="web"] .page { padding:6px 12px 32px; }
  html body.pricing-page[data-pricing-view="web"] .topbar { gap:4px; margin-bottom:6px; }
  html body.pricing-page[data-pricing-view="web"] .brand h1 { font-size:1.15rem; line-height:1.3; }
  html body.pricing-page[data-pricing-view="web"] .brand > span { display:none; }
  html body.pricing-page[data-pricing-view="web"] .nav { width:100%; flex-wrap:nowrap; gap:8px; }
  html body.pricing-page[data-pricing-view="web"] .nav .btn { flex:1 1 0; min-width:0; display:inline-flex; align-items:center; justify-content:center; padding:6px 8px; text-align:center; }

  /* 내 구독 관리: 제목+상태 한 줄 요약, 상세(현재 상품·다음 결제일·해지 등)는 '자세히'로 펼친다. */
  html body.pricing-page[data-pricing-view="web"] #subscriptionManagement { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:8px; align-items:center; margin-bottom:6px; padding:4px 8px 4px 14px; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionManagement .section-title { grid-column:1; grid-row:1; margin:0; font-size:.95rem; line-height:1.35; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionMessage { grid-column:1; grid-row:2; margin:0; color:var(--muted); font-size:.84rem; line-height:1.4; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionToggle { grid-column:2; grid-row:1 / span 2; display:inline-flex; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionManagement:not(:has(#subscriptionDetails:not([hidden]),#subscriptionStoreLinks:not([hidden]),#subscriptionCancel:not([hidden]),#subscriptionPlanActions > :not([hidden]))) #subscriptionToggle { display:none; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionManagement > :is(#subscriptionDetails,#subscriptionStoreLinks,#subscriptionCancel,#subscriptionPlanActions,#subscriptionRetry) { grid-column:1 / -1; justify-self:start; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionManagement:not(.is-open) > :is(#subscriptionDetails,#subscriptionStoreLinks,#subscriptionCancel,#subscriptionPlanActions) { display:none; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionDetails { margin:8px 0 0; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionDetails dd { margin-bottom:6px; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionCancel, html body.pricing-page[data-pricing-view="web"] #subscriptionRetry { margin-top:8px; }

  /* 상품 패널: 상태 줄 → 상품 카드 → 공통 기능 → 소개·선택 기준(카드 아래). 소개 문구는 보이는 순서만 바꾼다. */
  html body.pricing-page[data-pricing-view="web"] .product-panel { display:flex; flex-direction:column; gap:8px; overflow:visible; border:0; background:transparent !important; }
  html body.pricing-page[data-pricing-view="web"] .pricing-sheet-head { display:contents; }
  html body.pricing-page[data-pricing-view="web"] .pricing-sheet-head > div:first-child { order:4; padding:4px 0 0; }
  html body.pricing-page[data-pricing-view="web"] .pricing-sheet-head .section-title { font-size:1.1rem; line-height:1.3; }
  html body.pricing-page[data-pricing-view="web"] .pricing-intro-mobile { display:block; margin:6px 0 0; }
  html body.pricing-page[data-pricing-view="web"] .selection-notes { order:5; margin:0; }
  html body.pricing-page[data-pricing-view="web"] .product-panel .payment-status { order:1; margin:0; min-height:0; padding:5px 10px; font-size:.82rem; line-height:1.4; }
  html body.pricing-page[data-pricing-view="web"] .product-grid { order:2; margin:0 !important; padding:0; gap:6px; border:0; }
  html body.pricing-page[data-pricing-view="web"] .common-features { order:3; margin:0; padding:12px; gap:8px; border-radius:var(--radius-card,12px); }

  /* 상품 카드: 이름·가격·한 줄 핵심·구매 버튼만 보이고, 설명(.product-offer)과 이용 기준(.product-meta)은 '자세히'. */
  html body.pricing-page[data-pricing-view="web"] .product-card { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"head head" "act more" "offer offer" "meta meta"; gap:0 6px; padding:6px 12px 8px; background:var(--paper,#fff) !important; }
  html body.pricing-page[data-pricing-view="web"] .product-heading { grid-area:head; display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"label label" "title orig" "chips price"; align-items:center; column-gap:8px; row-gap:2px; min-height:0; padding:0 0 5px !important; border:0; }
  html body.pricing-page[data-pricing-view="web"] .product-label-row { grid-area:label; gap:8px; }
  html body.pricing-page[data-pricing-view="web"] .product-index { display:none; }
  html body.pricing-page[data-pricing-view="web"] .badge { padding:1px 0; line-height:1.25; }
  html body.pricing-page[data-pricing-view="web"] .discount-line { padding:3px 8px; line-height:1.3; }
  html body.pricing-page[data-pricing-view="web"] .product-title { grid-area:title; max-width:none; font-size:1rem; line-height:1.3; }
  html body.pricing-page[data-pricing-view="web"] .product-price-block { display:contents; }
  html body.pricing-page[data-pricing-view="web"] .price-original { grid-area:orig; justify-self:end; line-height:1.2; }
  html body.pricing-page[data-pricing-view="web"] .price { grid-area:price; justify-self:end; font-size:1.3rem; line-height:1.15; }
  html body.pricing-page[data-pricing-view="web"] .price ~ .discount-line { grid-area:chips; justify-self:start; }
  html body.pricing-page[data-pricing-view="web"] .discount-line + .discount-line { grid-area:auto; grid-column:1 / -1; grid-row:4; justify-self:start; }
  html body.pricing-page[data-pricing-view="web"] .product-actions { grid-area:act; padding:0; border:0; background:transparent; }
  html body.pricing-page[data-pricing-view="web"] .product-actions::before { display:none; }
  html body.pricing-page[data-pricing-view="web"] .product-more { grid-area:more; display:inline-flex; align-items:center; justify-content:center; gap:7px; min-width:64px; min-height:44px; margin:0; padding:0 12px; border:1px solid #cfc8bb; border-radius:var(--radius-control,8px); background:transparent; color:var(--accent,#1565c0); font:inherit; font-size:.85rem; font-weight:800; cursor:pointer; }
  html body.pricing-page[data-pricing-view="web"] .product-more::after { content:""; width:6px; height:6px; margin-top:-3px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); transition:transform .15s; }
  html body.pricing-page[data-pricing-view="web"] .product-more[aria-expanded="true"]::after { margin-top:3px; transform:rotate(-135deg); }
  html body.pricing-page[data-pricing-view="web"] .product-card:not(.is-open) .product-offer, html body.pricing-page[data-pricing-view="web"] .product-card:not(.is-open) .product-meta { display:none; }
  html body.pricing-page[data-pricing-view="web"] .product-offer { grid-area:offer; margin-top:8px; padding:8px 0 2px; border:0; border-top:1px solid var(--line,#ddd5c8); }
  html body.pricing-page[data-pricing-view="web"] .product-meta { grid-area:meta; padding:6px 0 2px; border:0; }
  html body.pricing-page[data-pricing-view="web"] .product-meta::before { display:block; }
  html[data-theme="dark"] body.pricing-page[data-pricing-view="web"] .product-more { color:#9ec5ff; border-color:rgba(158,197,255,.45); }
  /* 어두운 화면 규칙(dark_theme.css)은 구매 영역 배경을 !important로 칠하므로 같은 방식으로 카드 바탕과 맞춘다. */
  html[data-theme="dark"] body.pricing-page[data-pricing-view="web"] .product-actions { background:transparent !important; }
}
@media (max-width:640px) {
  /* Match the existing safe-area cover and the two shared menu rows. */
  html body.pricing-page[data-pricing-view="web"]:not(.mobile-shell-embed) #appMenuRegion {
    isolation:isolate;
  }
  html body.pricing-page[data-pricing-view="web"]:not(.mobile-shell-embed) #appMenuRegion,
  html body.pricing-page[data-pricing-view="web"]:not(.mobile-shell-embed) #appMenuRegion > header,
  html body.pricing-page[data-pricing-view="web"]:not(.mobile-shell-embed) #appMenuRegion .header-title {
    background:var(--status-bar-surface) !important;
    opacity:1;
    filter:none !important;
    -webkit-backdrop-filter:none !important;
    backdrop-filter:none !important;
  }
  html body.pricing-page[data-pricing-view="web"]:not(.mobile-shell-embed) #appMenuRegion .header-title::after { content:none; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionToggle, html body.pricing-page[data-pricing-view="web"] .product-more { -webkit-tap-highlight-color:transparent; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionToggle { min-width:64px; min-height:44px; padding:0 12px; align-items:center; justify-content:center; gap:7px; border:1px solid var(--line,#d7dde8); border-radius:var(--radius-control,8px); background:transparent; color:var(--accent,#1565c0); font:inherit; font-size:.85rem; font-weight:800; cursor:pointer; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionToggle::after { content:""; width:6px; height:6px; margin-top:-3px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); transition:transform .15s; }
  html body.pricing-page[data-pricing-view="web"] #subscriptionToggle[aria-expanded="true"]::after { margin-top:3px; transform:rotate(-135deg); }
  html[data-theme="dark"] body.pricing-page[data-pricing-view="web"] #subscriptionToggle { color:#9ec5ff; border-color:rgba(158,197,255,.45); }
}

/* Payment events use one semantic table, presented as cards on phones. */
html body.pricing-page #orderHistory { max-width:100%; overflow-x:auto; }
html body.pricing-page #orderHistory .history-table { table-layout:auto; margin-top:16px; }
html body.pricing-page #orderHistory th { white-space:nowrap; }
html body.pricing-page #orderHistory td { vertical-align:top; padding:16px 8px; }
html body.pricing-page #orderHistory .history-product { min-width:12em; word-break:keep-all; overflow-wrap:break-word; overflow-wrap:anywhere; }
html body.pricing-page #orderHistory .history-date { color:var(--muted,#596579); font-size:.8rem; }
html body.pricing-page #orderHistory .history-amount { font-weight:700; }
html body.pricing-page #orderHistory .history-amount .muted { margin-top:4px; font-size:.8rem; font-weight:400; }
html body.pricing-page #orderHistory .history-badge { display:inline-flex; align-items:center; padding:4px 8px; border:1px solid var(--line,#dce3ed); border-radius:8px; background:var(--paper,#fff); white-space:nowrap; font-size:.8rem; line-height:1.5; }
html body.pricing-page #orderHistory .history-badge.ok { color:var(--ok,#137568); background:#f1fbf9; border-color:#99d5cf; }
html body.pricing-page #orderHistory .history-badge.err { color:var(--danger,#b42318); background:#fff5f5; border-color:#f4b8b2; }
@media (max-width:767px) {
    html body.pricing-page #orderHistory .history-table { display:block; }
    html body.pricing-page #orderHistory .history-table thead { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
    html body.pricing-page #orderHistory .history-table tbody { display:grid; gap:8px; }
    html body.pricing-page #orderHistory .history-table tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:16px; border:1px solid var(--line,#dce3ed); border-radius:12px; background:var(--paper,#fff); }
    html body.pricing-page #orderHistory .history-table td { display:block; min-width:0; padding:0; border:0; }
    html body.pricing-page #orderHistory .history-product { grid-area:1/1/2/3; font-weight:700; font-size:1rem; line-height:1.5; }
    html body.pricing-page #orderHistory .history-amount { grid-area:2/1; align-self:center; }
    html body.pricing-page #orderHistory .history-state { grid-area:2/2; align-self:start; }
    html body.pricing-page #orderHistory .history-date { grid-area:3/1/4/3; white-space:normal; word-break:keep-all; }
    html body.pricing-page #orderHistory .history-actions { grid-column:1/-1; }
    html body.pricing-page #orderHistory .history-actions:empty { display:none; }
    html body.pricing-page #orderHistory .refund-btn { width:100%; margin:0; }
}

html body.pricing-page #orderHistory .history-date-label { display:none; }
@media(max-width:767px) { html body.pricing-page #orderHistory .history-date-label { display:inline; } }
html[data-theme="dark"] body.pricing-page #orderHistory .history-badge.ok { color:#99f6e4; background:#113b35; border-color:#286f61; }
html[data-theme="dark"] body.pricing-page #orderHistory .history-badge.err { color:#fecaca; background:#451a20; border-color:#88424a; }

/* #450-57: four readable comparison columns, with actions allowed to wrap.
   Phone summaries/details and store-managed purchase surfaces retain their flow. */
@media (min-width:641px) {
  html body.pricing-page[data-pricing-view="web"] .product-grid { gap:16px; margin-top:16px; padding-block:16px; }
  html body.pricing-page[data-pricing-view="web"] .product-label-row { gap:8px; }
  html body.pricing-page[data-pricing-view="web"] .product-card {
    grid-template-columns:minmax(160px,1fr) minmax(180px,1.1fr) minmax(180px,1fr) minmax(192px,1fr);
    align-items:stretch;
  }
  html body.pricing-page[data-pricing-view="web"] :is(.product-heading,.product-offer,.product-meta,.product-actions) { padding:16px; gap:8px; }
  html body.pricing-page[data-pricing-view="web"] .product-title { max-width:none; }
  html body.pricing-page[data-pricing-view="web"] .product-meta { word-break:keep-all; overflow-wrap:break-word; }
}
html body.pricing-page[data-pricing-view="web"] .product-actions .pay-btn { width:100%; min-width:0; padding:12px 8px; white-space:normal; word-break:keep-all; line-height:1.5; }
@media (min-width:641px) and (max-width:1100px) {
  html body.pricing-page[data-pricing-view="web"] .product-card { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  html body.pricing-page[data-pricing-view="web"] .product-heading { border-bottom:1px solid var(--line,#ddd5c8); }
  html body.pricing-page[data-pricing-view="web"] .product-offer { border-right:0; border-bottom:1px solid var(--line,#ddd5c8); }
  html body.pricing-page[data-pricing-view="web"] .product-actions { border-left:0; }
}

/* #450-111: retain the production text palette without changing payment UI. */
html[data-theme="dark"] body.pricing-page { --color-text:#e7eef8; }
/* #450-113: restore pricing surfaces without changing shared page tokens. */
html[data-theme="dark"] body.pricing-page {
    --color-bg:#0b1220; --color-surface:#151f30;
    --color-border:rgba(143, 160, 181, 0.24);
    --color-text-secondary:#bdc9d8; --color-text-muted:#8fa0b5;
}
