/* ── 모바일 최적화 오버레이 ──
   landing.css(EN·ko)와 static/ja·th의 인라인 CSS 뒤에 로드한다 — 4개 언어 공용.
   가로 스크롤 원인 2가지를 근본 해소:
     ① table.sweep(성과표) 고정 폭 ~445px  ② 툴팁 ::after 가 visibility:hidden 이어도
        스크롤 영역에 기여해 가장자리 용어 옆으로 화면 밖까지 뻗음  */

/* ── 툴팁: 터치·좁은 화면은 앵커 대신 화면 하단 고정 토스트(뷰포트 밖으로 못 나감) ── */
@media (hover: none), (max-width: 720px) {
  .term { -webkit-tap-highlight-color: transparent; }
  .term::before { display: none; }
  .term::after {
    position: fixed;
    left: 16px; right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    top: auto;
    width: auto; max-width: 480px; margin: 0 auto;
    transform: translateY(8px);
    font-size: 14px; line-height: 1.6;
    padding: 12px 15px; border-radius: 6px;
    z-index: 90;
  }
  .term:hover::after, .term:focus::after { transform: translateY(0); }
}

@media (max-width: 900px) {
  html {
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
    scroll-padding-top: 60px; /* sticky 헤더에 가려지지 않게 앵커 점프 */
    overflow-x: hidden;       /* 안전망 — 뷰포트로 전파되므로 sticky 헤더 영향 없음 */
  }
  body { overflow-wrap: break-word; }
  img, video, svg { max-width: 100%; }

  /* 헤더: 데스크톱 메뉴는 숨겨져 있어 로그인 진입점이 없었다 → 로그인만 노출 */
  nav.main { display: flex; gap: 0; }
  nav.main a { display: none; }
  nav.main a[href="/login"] { display: inline-block; padding: 12px 8px; font-size: 12px; }
}

@media (max-width: 720px) {
  /* 상단 바: 발행 표기 숨기고 언어 링크 터치 영역 확보 */
  .topbar .wrap { flex-wrap: wrap; gap: 2px 14px; padding-top: 6px; padding-bottom: 6px; }
  .topbar .issue { font-size: 10.5px; letter-spacing: 0.05em; }
  .tr-right { gap: 0; }
  .tr-right > .num { display: none; }
  .langs { gap: 2px; margin-left: -8px; }
  .langs a, .langs .on { padding: 8px; }
  .langs .on { box-shadow: none; text-decoration: underline; text-underline-offset: 4px; }

  .mast .wrap { gap: 6px; height: 56px; }
  .wordmark { font-size: 20px; flex: none; }
  .mast .btn { padding: 9px 14px; font-size: 12px; }

  .hero .wrap { gap: 32px; padding-top: 36px; padding-bottom: 40px; }
  h1 { font-size: clamp(34px, 10.5vw, 46px); margin: 14px 0 20px; }
  .hero-sub { font-size: 17.5px; margin-bottom: 26px; }
  .hero-meta { gap: 6px 16px; margin-top: 24px; }
  .btn { padding: 12px 20px; }

  .film .wrap { padding-top: 24px; padding-bottom: 28px; }
  .film-fig figcaption { padding: 9px 12px; }

  .sc-row { gap: 12px; padding: 12px 14px; }
  .sc-row .k { white-space: normal; padding-top: 3px; font-size: 10.5px; letter-spacing: 0.06em; }
  .sc-row .v { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
  .signal-card .sc-head { padding: 10px 14px; }
  .sc-foot { padding: 10px 14px; }

  .sec-head { gap: 12px; padding-top: 16px; }
  .sec-head h2 { min-width: 0; font-size: clamp(22px, 6.4vw, 28px); }
  .sec-body { padding-bottom: 44px; }
  .lede { font-size: 17.5px; margin-bottom: 28px; }

  .factor-cell, .out-cell { padding: 18px 16px 16px; }
  .factor-cell .fname, .out-cell .fname { font-size: 19px; }

  .growth-fig, .equity-fig { margin: 22px 0; padding: 16px 14px 14px; }
  .growth-fig figcaption, .equity-fig figcaption { letter-spacing: 0.06em; line-height: 1.6; }
  .gf-hero { font-size: 23px; }
  .gf-v { font-size: 26px; }
  .equity-fig table { width: 100%; }
  .equity-fig td { padding-right: 12px; }

  /* 성과표(원인 ①): 폭 445px → 320px 화면까지 줄어들도록 압축, 선택 배지는 다음 줄로 */
  .sweep caption { font-size: 10px; letter-spacing: 0.08em; padding-bottom: 8px; }
  .sweep th { font-size: 9.5px; letter-spacing: 0.04em; padding: 10px 6px; }
  .sweep td { padding: 11px 6px; font-size: 14px; line-height: 1.4; }
  .sweep td.v { font-size: 12px; }
  .sweep td.name { overflow-wrap: anywhere; }
  .sweep th:first-child, .sweep td:first-child { padding-left: 10px; }
  .sweep th:last-child, .sweep td:last-child { padding-right: 10px; }
  .pick-tag { display: block; width: fit-content; margin: 5px 0 0; padding: 1px 5px; font-size: 9px; }
  .tbl-note { font-size: 13px; }

  .ledger-row .item { font-size: 15px; }
  .ledger-row > div { font-size: 14.5px; }
  .ledger-foot { padding: 12px 16px; }

  .clause { grid-template-columns: 36px 1fr; gap: 8px; padding: 18px 0; }
  .clause h3 { font-size: 19px; }
  .clause p { font-size: 15.5px; }

  .price-flex { gap: 14px; }
  .price-big { font-size: clamp(30px, 9vw, 40px); }
  .price-note, .early-list li { font-size: 15.5px; }

  details.qa summary { font-size: 17px; padding: 14px 0; gap: 14px; }
  details.qa .a { font-size: 15.5px; }

  .closing .wrap { padding-top: 40px; padding-bottom: 44px; }
  .closing h2 { margin-bottom: 24px; }

  footer .wrap { padding-top: 28px; padding-bottom: 32px; }
  .fineprint { font-size: 12px; padding-left: 12px; margin-bottom: 24px; }
  .foot-links { gap: 6px 18px; flex-wrap: wrap; }
}

/* ── §02 자산 곡선: 데스크톱용(가로 1120)·모바일용(가로 480, 글자 크게) SVG 중 하나만 표시 ──
   900px 이하(폰·태블릿 세로)에서 모바일판. 두 SVG 모두 marketing/tools/render_equity_chart.py 가 만든다(모바일판은 --add-mobile 또는 CSV 재생성) */
.equity-fig .eq-m { display: none; }
@media (max-width: 900px) {
  .equity-fig .eq-d { display: none; }
  .equity-fig .eq-m { display: block; max-width: 460px; margin: 0 auto; }
  /* 터치는 :hover 가 불안정 → 점을 탭(:focus)하면 값 툴팁 */
  .eq-m .eq-pt { outline: none; -webkit-tap-highlight-color: transparent; }
  .eq-pt:focus .eq-tip, .eq-pt:focus .eq-ring { opacity: 1; }
}

@media (max-width: 480px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  /* CTA 버튼: 한 줄 전폭(엄지 터치) */
  .cta-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .cta-row .btn { width: 100%; }
  .cta-row .label { text-align: center; line-height: 1.6; }
}

/* ── 데스크톱: 오른쪽 끝 용어의 툴팁이 화면 밖으로 뻗어 가로 스크롤(24~37px)을 만들던 문제 ──
   성과표 마지막 열(샤프) 제목의 툴팁은 가운데 대신 오른쪽 끝에 맞춘다. */
@media (hover: hover) and (min-width: 721px) {
  table.sweep th:last-child .term::after { left: auto; right: 0; transform: translateY(4px); }
  table.sweep th:last-child .term:hover::after,
  table.sweep th:last-child .term:focus::after { transform: translateY(0); }
}
/* 안전장치: 다른 가장자리 요소가 넘쳐도 가로 스크롤은 만들지 않는다(clip은 sticky 헤더를 깨지 않음) */
html { overflow-x: clip; }
