/* ============================================================
   모바일 반응형
   ------------------------------------------------------------
   디자이너 마크업을 수정하지 않는다. CSS 만 덧붙여 좁은 화면에서
   읽고 조작할 수 있게 만든다.

   왜 별도 파일인가
   --------------
   디자이너 CSS 를 직접 고치면 원본과 비교가 어려워지고, 나중에 디자인이
   갱신될 때 충돌한다. 이 파일만 빼면 원래 데스크톱 레이아웃으로 완전히 돌아간다.

   기존 브레이크포인트
   ----------------
   디자이너 CSS 에는 1100px 이 최소였다 — 태블릿까지만 고려된 것이다.
   휴대폰(360~430px)에서는 데스크톱 레이아웃이 그대로 축소돼 글자를 읽을 수 없었다.
   (viewport 를 width=1280 으로 고정해 둔 것이 원인)

   설계 원칙
   --------
   1) 24열 그리드를 1열로 접는다. 위젯을 숨기지 않는다 — 정보가 사라지면
      휴대폰 사용자는 다른 앱을 쓴다.
   2) 사이드바를 서랍(drawer)으로 바꾼다. 56px 을 상시 점유하면 좁은 화면에서
      본문이 너무 좁아진다.
   3) 터치 대상을 최소 32px 로 키운다. 손가락으로 누를 수 없으면 기능이 없는 것과 같다.
   4) 표는 가로 스크롤을 허용한다. 열을 숨기면 어느 열이 사라졌는지 알 수 없다.
   ============================================================ */

/* ---------------------------------------------------------------
   태블릿 이하 (1024px)
   --------------------------------------------------------------- */
@media (max-width: 1024px) {
  /*
     ★★★ 여기서 열 수를 12 로 바꾸던 규칙을 **뺐다**(2026-09-27). 격자가 96열로 바뀐 뒤에도
       남아 있던 옛 규칙이다. 위젯은 96열 좌표(gridColumn "81 / span 16")로 놓이므로 12열
       격자에서는 나머지 84열이 **암시적 열(auto)** 로 생겨 폭 배분이 무너졌다 —
       901~1024px 에서 주문 패널이 134px(가격 칸 20px · 수량 칸 4px)이 되어 입력할 수 없었다.
     ★ 열 정의는 widgets.css 한 곳(96열 · 오른쪽 16열 하한)을 따른다.
  */
}

/* ---------------------------------------------------------------
   휴대폰 (768px 이하)
   --------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    /* 헤더를 낮춰 본문 공간을 확보한다. */
    --header-h: 48px;
    --grid-gap: 6px;
  }

  /* --- 전체 골격: 사이드바를 흐름에서 빼고 서랍으로 --- */
  .app-shell {
    grid-template-columns: 1fr;
    /* 시뮬레이션 띠 + 헤더 + 본문 */
    grid-template-rows: auto var(--header-h) 1fr;
    /* 세로 스크롤을 허용한다. 고정 높이면 내용이 잘린다. */
    height: 100dvh;
  }

  /*
     ★★★ **두 셸 × 두 사이드바 = 네 조합인데 두 개만 처리하고 있었다.**

       이 저장소에는 셸이 둘(`.app-shell`, `.page-shell`), 사이드바가 둘
       (`.app-sidebar`, `.app-sidebar-v2`) 있다. 그런데 규칙이 대각선으로만 있었다:

         .app-shell  > .app-sidebar      ✔ 처리됨
         .app-shell  > .app-sidebar-v2   ✘ 빠짐   ← /trade 가 이 조합이다
         .page-shell > .app-sidebar-v2   ✔ 처리됨
         .page-shell > .app-sidebar      ✘ 빠짐

       그래서 `/trade` 는 모바일에서 사이드바가 흐름에 남았다. 실측(390×844):

         .app-main        grid-column: 1 / -1  →  box 0,143  **123**x701
         .app-sidebar-v2  grid-column: auto    →  box 123,143 **267**x701

       그리드는 1열로 접혔지만 사이드바가 **암시적 열**을 차지해, 본문이 123px 만
       쓰고 사이드바가 차트 위에 겹쳐 그려졌다. 결과: **조작요소 39개가 가려져
       누를 수 없었다** — 차트 툴바(지표·비교·템플릿) 전체와 그리기 도구 전부.

     ★ 서랍 기구는 이미 있었다(`.qt-drawer-toggle` "Open navigation menu" 가 모바일에
       보이고 `data-qt-drawer` 를 토글한다). 빠진 것은 선택자 하나였다.

     ★ 네 조합을 모두 적는다. 셸이나 사이드바를 하나 더 만들면 또 빠질 것이므로
       아래 `[VIS-OCC]` e2e 가 가려짐 0 을 요구한다.
  */
  .app-shell > .app-sidebar,
  .app-shell > .app-sidebar-v2,
  .page-shell > .app-sidebar,
  .page-shell > .app-sidebar-v2 {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    /*
       ★★★★ (2026-10-17) 서랍은 **헤더보다 위**에 있어야 한다 — 230 > 헤더 220

         예전 값은 200 이었고, 아래 5단계 규칙이 좁은 화면의 `.app-header` 를
         `position: sticky; z-index: 220` 으로 올렸다. 그래서 서랍을 열어도 **헤더가 서랍
         위에 남았다.** 390px 에서 헤더는 거래소 선택(`.ex-seg`)까지 줄바꿈해 **127px** 가
         되는데, 서랍의 첫 링크들(Trade·Markets·Portfolio, y≈131)이 정확히 그 밑에 깔렸다.
         실측(`elementFromPoint`): 4개 중 3개가 `.seg.ex-seg` 에 가로막혔다 — **휴대폰
         고객은 서랍에서 그 세 곳을 누를 수 없었다.**

       ★ 시험으로는 "가끔 실패" 로만 보였다(`[U0-6]` "element is not stable" → 가로챔).
         정상 속도에서는 헤더가 다 그려지기 전에 클릭돼 우연히 통과했고, CPU 를 4배
         늦추면 매번 실패했다. 플레이크가 아니라 **늦게 드러나는 결함**이었다.

       ★ 닫혀 있을 때는 영향이 없다 — 화면 밖(`translateX(-100%)`)이고 아래 규칙이
         `pointer-events: none` 을 준다.
    */
    z-index: 230;
    /* 기본은 숨김. 열기 버튼이 data 속성으로 토글한다. */
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: 0 0 24px rgb(0 0 0 / 45%);
    overflow-y: auto;
    /*
       ★★ 폭을 `!important` 로 못박는다. `/trade` 의 사이드바는 접힌 레일
         (`.is-collapsed`, 실측 폭 267px→레일)이라 자체 폭 규칙이 더 구체적이다.
         서랍으로 띄우는 동안에는 메뉴를 읽을 수 있어야 하므로 240px 를 강제한다.
    */
    width: 240px !important;
    max-width: 86vw;
  }

  html[data-qt-drawer='open'] .app-shell > .app-sidebar,
  html[data-qt-drawer='open'] .app-shell > .app-sidebar-v2,
  html[data-qt-drawer='open'] .page-shell > .app-sidebar,
  html[data-qt-drawer='open'] .page-shell > .app-sidebar-v2 {
    transform: translateX(0);
  }

  /*
     ★ 닫힌 서랍이 **조작요소를 가리지 않게** 한다.

       `transform: translateX(-100%)` 로 화면 밖에 있어도 요소는 살아 있다.
       그 자체로 겹침 판정(elementFromPoint)에는 걸리지 않지만, 화면 왼쪽 경계에
       걸친 요소를 가로챌 수 있다. 닫혔을 때는 포인터를 아예 받지 않는다.
  */
  html:not([data-qt-drawer='open']) .app-shell > .app-sidebar,
  html:not([data-qt-drawer='open']) .app-shell > .app-sidebar-v2,
  html:not([data-qt-drawer='open']) .page-shell > .app-sidebar,
  html:not([data-qt-drawer='open']) .page-shell > .app-sidebar-v2 {
    pointer-events: none;
  }

  html[data-qt-drawer='open'] .app-shell::after,
  html[data-qt-drawer='open'] .page-shell::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgb(0 0 0 / 45%);
  }

  .app-shell > .app-main {
    grid-column: 1 / -1;
  }

  /*
     ★★ `.page-shell` 도 같은 처리를 해야 한다.

       `.app-shell` 만 1열로 접었고 `.page-shell` 은 빠져 있었다. 그래서
       거래 화면이 아닌 화면들(/order-history, /markets, /portfolio …)에서
       **본문이 170px 밖에 못 썼다**(390px 화면에서 사이드바 220px 이 열을
       그대로 차지). 그 결과 제목 옆 버튼(Filter · Export CSV · 기간 버튼 …)이
       화면 밖으로 밀려나 누를 수 없었다.

       실측: `.page-shell` grid-template-columns = "220px 170px",
             `.page-main` left=220 width=170

     ★ 사이드바는 `.app-sidebar-v2` 라는 다른 클래스를 쓴다(app-shell 쪽은
       `.app-sidebar`). 그래서 위 규칙에 걸리지 않았다.
  */
  .page-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100dvh - var(--header-h));
    overflow: visible;
  }

  /*
     ★ 사이드바·막 규칙은 위에서 **네 조합을 한 번에** 처리한다.
       여기에 따로 두면 한쪽만 고치는 일이 또 생긴다(실제로 그래서 `/trade` 가 빠졌다).
  */

  /* 본문이 전체 폭을 쓴다. */
  .page-shell > .page-main {
    grid-column: 1 / -1;
    min-width: 0;
  }

  /* --- 시뮬레이션 띠: 두 줄로 접히게 --- */
  .sim-stripe {
    flex-wrap: wrap;
    height: auto;
    min-height: 22px;
    padding: 3px 8px;
    font-size: var(--fs-2xs);
    line-height: 1.4;
  }

  /* 세션 정보는 좁은 화면에서 가치가 낮다. 접어서 공간을 준다. */
  .sim-stripe__right {
    display: none;
  }

  /* --- 헤더: 넘치는 항목을 가로 스크롤로 --- */
  .app-header {
    gap: 6px;
    padding: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    /* 스크롤바가 높이를 먹지 않게 한다. */
    scrollbar-width: none;
  }
  .app-header::-webkit-scrollbar { display: none; }

  /*
     ★★ 헤더의 주 메뉴를 모바일에서 숨긴다.

       390px 에서 헤더 실제 폭이 1134px 이었다. 가로 스크롤로 처리해 뒀지만
       스크롤바를 숨겨서 **사용자가 스크롤할 수 있다는 것을 알 수 없었다.**
       실측: 버튼 16개 중 화면 안에 5개, 나머지 11개(시장·트레이드·AI·포트폴리오·
       분석·알림·테마·언어·레이아웃·입금·계정)가 화면 밖.

     ★ `.app-nav` 5개(시장·트레이드·AI·포트폴리오·분석)는 **사이드바 서랍에
       전부 있다**(실측 확인). 같은 기능이 두 곳에 있고 한쪽이 닿지 않으므로,
       닿는 쪽(서랍)을 남기고 헤더에서는 접는다. 기능이 사라지는 것이 아니다.

     ★ 서랍 토글(☰)이 헤더 맨 왼쪽에 항상 보이므로 진입 수단은 유지된다.
  */
  .app-header .app-nav {
    display: none;
  }

  .app-header__right {
    gap: 4px;
    flex: 0 0 auto;
  }

  /*
     ★ 우측 도구는 숨기지 않는다.

       테마 전환·언어 선택은 **설정 화면에 없다**(실측 확인 — /settings 에는
       이메일·비밀번호·로그아웃만 있다). 헤더에서 숨기면 접근 수단이 아예
       사라진다. 그래서 남겨 두고, 대신 아래에서 "더 있다" 는 단서를 준다.
  */

  /*
     가로 스크롤 단서.

     ★★ 스크롤바를 숨긴 채로 내용이 넘치면 사용자는 넘친다는 사실을 모른다.
       오른쪽 끝에 페이드를 깔아 "이 방향에 더 있다" 를 보여준다.

     ★ `position: sticky` 로 헤더 안에 두면 스크롤해도 오른쪽에 붙어 있다.
       `pointer-events: none` — 페이드가 버튼 클릭을 가로채면 안 된다.
  */
  .app-header::after {
    content: '';
    position: sticky;
    right: 0;
    flex: 0 0 auto;
    align-self: stretch;
    width: 18px;
    margin-left: -18px;
    background: linear-gradient(
      to right,
      transparent,
      var(--color-bg-elevated, rgba(10, 14, 20, 0.92))
    );
    pointer-events: none;
  }

  /*
     브랜드는 로고만 남긴다.

     ★ 실측: 브랜드 블록이 131px(로고 + "ChartControl" + "v1.0")을 차지했다.
       390px 화면에서 그 3분의 1이다. 이름과 버전은 좁은 화면에서 정보 가치가
       낮다 — 사용자는 자기가 어느 서비스에 있는지 이미 안다.
     ★ 로고(Q)는 남긴다. 홈으로 가는 링크이므로 없애면 이동 수단이 사라진다.
  */
  .app-brand__name,
  .app-brand__ver {
    display: none;
  }

  /*
     거래모드 토글(현물/선물/모의)의 여백을 줄인다.

     ★ 숨기지 않는다 — 지금 모의인지 실거래인지는 **주문 전에 반드시 알아야
       하는 정보**다. 자리만 줄인다.
  */
  .app-header .seg {
    margin-right: 4px !important;
  }
  .app-header .seg__opt {
    padding-left: 6px;
    padding-right: 6px;
  }

  /*
     연결 상태 표시를 줄인다 (실측 127px → 약 40px).

     ★★ **연결 상태 자체는 남긴다.** 시세가 끊긴 것을 모르고 주문하면 낡은
       가격으로 판단한다. 점과 상태 글자(WS/RECON/DOWN)는 유지한다.

     ★ 지연(↔0ms)과 마지막 수신 시각(◷4s)만 숨긴다. 좁은 화면에서 그 두 값은
       정보 가치가 낮고(끊김은 상태 글자로 이미 드러난다), 합쳐서 80px 이 넘는다.
       title 에는 지연·출처가 그대로 남아 길게 눌러 확인할 수 있다.
  */
  .conn-cluster__latency,
  .conn-cluster__seg:nth-child(3) {
    display: none;
  }

  /*
     '레이아웃' 버튼은 그대로 둔다.

     ★ 글자를 CSS 로만 접으려 했는데, 이 버튼의 마크업은
       `<button class="header-tool"><Icon/> 레이아웃</button>` 로 **글자가 감싸는
       요소 없이 직접 들어 있다**(실측 확인). 텍스트 노드만 골라 숨기는 안전한
       CSS 방법이 없고, `font-size: 0` 은 아이콘까지 흔든다.
     ★ 마크업을 고치는 것은 디자이너 산출물 변경이므로 하지 않는다. 대신 위에서
       확보한 공간(브랜드·nav·연결상태 = 약 300px)으로 충분히 들어온다.
  */

  /* 좁은 화면에서 의미가 적은 항목을 숨긴다.
     기능을 없애는 것이 아니라 같은 기능이 사이드바·설정에 있는 항목만 숨긴다. */
  .app-header .header-tool:has(> .header-tool__label),
  .app-nav__label {
    /* 라벨만 숨기고 아이콘은 남긴다 */
  }

  /*
     ★ 여기서 768 블록을 잠시 닫는다 — 아래 거래 화면 세로 배치는 **900px** 에서 켜야 한다.
  */
}

/* ---------------------------------------------------------------
   거래 화면 세로 배치 (900px 이하)
   ---------------------------------------------------------------
   ★★★ **중단점을 세로 스택(`.trade-body { display:flex }`, 아래 5단계)과 맞춘다.**

     스택은 900px 이하에서 켜지는데 이 규칙들은 768px 블록 안에 있었다. 그래서
     769~900px 에서는 flex 로 바뀐 뒤 위젯에 높이를 줄 규칙이 없어 위젯이 접혔다.
     실측(800×900, /trade): 차트 728×**10** · 주문 728×**61** · 포지션 728×**12**,
     캔버스 3×22 — 태블릿 세로·작은 노트북 창에서 차트와 주문이 사라진 것이다.

   ★ 이 블록을 통째로 옮기지 않고 **제자리에서** 중단점만 바꾼다. 뒤따르는 규칙과의
     선후(캐스케이드 순서)가 바뀌지 않게 하기 위해서다.
   ★ 헤더·서랍·터치 크기 같은 휴대폰 전용 규칙은 768 에 그대로 둔다 — 769~900 은
     사이드바가 흐름에 있는 태블릿 폭이다.
   --------------------------------------------------------------- */
@media (max-width: 900px) {
  /* --- 거래 화면: 24열 → 1열 세로 배치 --- */
  .trade-body {
    /*
       세로 1열로 접는다.

       ★ app.jsx 가 `gridTemplateRows: repeat(auto-fill, 40px)` 를 인라인으로 넣는다.
         그러면 행 높이가 40px 로 고정돼 위젯이 겹치고 스크롤이 생기지 않는다
         (실제로 겪었다). 인라인을 덮으려면 !important 가 필요하다.
    */
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
    grid-auto-rows: auto !important;
    /* 세로로 쌓이므로 화면보다 길어진다. 스크롤을 허용한다. */
    overflow-y: auto;
    overflow-x: hidden;
  }

  /*
     위젯의 배치 인라인 스타일을 무력화한다.

     ★ layout-engine 은 `grid-area: row / col / span h / span w` 를 인라인으로 넣는다.
       grid-row 만 덮으면 grid-area 가 이겨서 위젯이 전부 같은 줄에 겹친다
       (실제로 겪었다 — 스크롤이 안 되고 내용이 보이지 않았다).
       grid-area 자체를 덮어야 한다.
  */
  .trade-body > .widget {
    grid-area: auto / 1 / auto / -1 !important;
    /* 위젯마다 최소 높이를 준다. 0 높이면 내용이 보이지 않는다. */
    min-height: 220px;

    /*
       ★★★ **내용을 위젯 안에 담는다 — 실제로 못 눌리는 버튼이 있었다.**

         실측(2026-09-14 iPhone 13, 프로덕션):
           관심목록 위젯   4,144  329x220   →  144~364
           별(☆) 버튼      17,382 …  17,622 →  **위젯 밖 382~622**
           그 자리는 차트 위젯(368~846) 이고, 차트 캔버스는 z-index 2 다.
           → `elementFromPoint` 가 CANVAS 를 돌려준다 = **탭이 캔버스로 간다.**

         원인은 `overflow: visible` 이다. 관심목록은 220px 인데 종목이 그보다 많아
         행들이 위젯 밖으로 흘러나왔고, 아래 위젯이 그 위를 덮었다. 눈에는 보이니
         눌러도 되는 버튼처럼 생겼는데 아무 반응이 없다 — 오늘 고친 「종료」 버튼과
         **증상이 같다.**

       ★ `hidden` 으로 담고, 목록은 안쪽에서 스크롤시킨다(아래 규칙).
       ★★ 세로만 담지 않는다. 차트 도구 줄이 **오른쪽으로** 삐져나와 사이드바
         (337px) 아래로 들어가 `Indicators`(318~396) 와 `Lock drawings`(340~374) 가
         못 눌렸다. 가로도 담아야 한다.
    */
    overflow: hidden;
  }

  /*
     ★★ 담기만 하면 내용이 잘린다. 목록·본문은 안쪽에서 스크롤되게 한다.
     ★ `min-height: 0` 이 없으면 flex 자식이 줄어들지 않아 스크롤이 생기지 않는다
       (flex 기본 `min-height: auto` 때문이다 — 자주 놓치는 지점이다).
  */
  .trade-body > .widget > .widget__body,
  .trade-body > .widget .panel {
    min-height: 0;
    min-width: 0;
  }

  .trade-body > .widget .panel__body,
  .trade-body > .widget .mw-list,
  .trade-body > .widget .trade-list {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  /*
     ★★★ 차트 도구 줄은 **가로 스크롤**로 만든다.

       커밋 db3ebd2 에서 "컨트롤을 숨기지 말고 넘치게 두자" 고 했는데, 넘친 버튼이
       사이드바 아래로 들어가 **아예 못 눌리게** 됐다. 숨긴 것보다 나쁘다 —
       보이는데 안 눌리면 고장으로 읽는다.
     ★ 가로 스크롤이면 모든 버튼에 닿을 수 있고 위젯 밖으로 나가지 않는다.
  */
  .trade-body > .widget .chart-tool-wrap,
  .trade-body > .widget .chart-tf,
  .trade-body > .widget .chart-drawtools {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /*
     ★★★ **가로 스크롤이 켜져 있는데 동작하지 않았다 — 자식이 찌그러졌기 때문이다.**

       실측(390×844, /trade): `.chart-toolbar` 는 이미 `overflow-x: auto` 인데
       `scrollWidth === clientWidth === 350` 이었다. 넘치는 내용이 없다는 뜻이다.
       내용이 없어서가 아니라 flex 기본값 `flex-shrink: 1` 때문에 **컨테이너들이
       12~16px 로 찌그러졌고**, 그 안의 버튼은 자기 크기를 유지하며 밖으로 넘쳤다:

         .chart-tf        box 18,417  **64**x36   ← 안의 버튼은 20/51/82 에 있다(119까지)
         .chart-tool-wrap box 86,419  **16**x32   ← Indicators 버튼이 그 밖으로 나간다
         .chart-tool-wrap box 107,419 **12**x32   ← Compare
         .chart-tool-wrap box 123,419 **14**x32   ← Templates

       넘친 버튼들이 서로 겹쳐 **중심점이 다른 버튼에 가려졌다.** 그래서
       "타임프레임 15m 을 눌렀는데 Templates 가 눌린다" 가 된다. 실측 가림 22건.

     ★ `overflow-x: auto` 는 **넘칠 때만** 스크롤을 만든다. 찌그러지면 넘치지 않으므로
       스크롤도 생기지 않는다 — 두 속성은 함께 있어야 의미가 있다.

     ★ 구분선(`__sep`)은 폭 0 이 정상이므로 제외하지 않아도 무해하다.
  */
  .chart-toolbar > *,
  .chart-tf > *,
  .chart-tool-wrap > *,
  .chart-drawtools > * {
    flex: 0 0 auto;
  }

  /* 차트는 더 높게 — 봉을 읽을 수 있어야 한다. */
  /*
     ★★★ 340px 로는 차트를 볼 수 없다 — 실측(2026-09-14 iPhone 13):

       차트 위젯  374 × 340
       실제 캔버스 278 × **121**

       위젯 안에서 「Single/2/2×2/3×2」 줄, 시간대 줄(1m…1W), 그림 도구 줄이
       높이를 먹고 캔버스에 121px 만 남았다. 거래할 수 있는 크기가 아니다.

     ★ 그래서 위젯 높이를 화면 기준으로 키운다. `max()` 로 작은 기기에서도
       최소치를 보장한다.
     ★★ `vh` 만 쓰지 않는다 — 일부 모바일 브라우저에서 주소창 높이에 따라 `vh` 가
       흔들려 스크롤 중 차트 높이가 변한다.
     ★ 컨트롤 줄들을 숨기지는 않는다. 시간대 전환은 차트의 핵심 기능이고, 숨기면
       모바일에서 그 기능에 접근할 방법이 사라진다.
  */
  .trade-body > .widget[data-widget-type='chart'] {
    min-height: max(72vh, 460px);
  }

  /* 오더북·체결은 목록이라 적당한 높이로 */
  .trade-body > .widget[data-widget-type='orderBook'],
  .trade-body > .widget[data-widget-type='recentTrades'] {
    min-height: 260px;
  }

  /*
     ★★ 세로 스택에서는 그리기 도구를 **가로 막대**로 차트 위에 둔다(아래 900px 블록의
       "하단 레일" 이 그것을 전제로 `flex-direction: row` 를 준다).

       그런데 그 전제(`.chart-body` 세로 배치·도구 폭 100%)는 768px 블록에만 있었다.
       위젯 높이를 900 으로 맞추자 그 틈이 드러났다 — 실측(850px): 도구 막대가 가로로
       누운 채 `.chart-body` 가 가로 flex 로 남아 **도구가 677px, 차트가 89px** 을 차지했다
       (캔버스 64×415).
     ★ 전역 규칙(768 블록)을 옮기지 않고 거래 화면 차트에만 한정해 적는다 — 769~900 의
       다른 화면 차트까지 바꾸지 않기 위해서다.
  */
  .trade-body > .widget[data-widget-type='chart'] .chart-body {
    flex-direction: column;
  }
  .trade-body > .widget[data-widget-type='chart'] .chart-drawtools {
    width: 100%;
    height: auto;
    flex: 0 0 auto;
  }
  .trade-body > .widget[data-widget-type='chart'] .chart-kline-wrap {
    width: 100%;
    min-height: 240px;
  }

}

/* 휴대폰 (768px 이하) — 위에서 잠시 닫았던 블록을 이어 간다. */
@media (max-width: 768px) {
  /* --- 표: 가로 스크롤 허용 --- */
  .pos-body,
  .tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tbl {
    /* 열을 숨기지 않는다. 어느 열이 사라졌는지 알 수 없기 때문이다. */
    min-width: 640px;
  }

  /* 탭이 많아 넘친다. 가로 스크롤로 전부 접근 가능하게. */
  .pos-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .pos-tabs::-webkit-scrollbar { display: none; }
  .pos-tabs .tab { flex: 0 0 auto; }
  .pos-tabs__right { flex: 0 0 auto; }

  /* --- 터치 대상 확대 --- */
  /* 32px 미만은 손가락으로 정확히 누를 수 없다. */
  .btn,
  .tab,
  .chart-tool,
  .chart-tf__btn,
  .seg__opt,
  .header-tool,
  .mw-tab {
    min-height: 32px;
  }

  .btn--xs,
  .btn--sm {
    /* 작은 버튼도 최소 높이를 지킨다. 폭은 내용에 맡긴다. */
    min-height: 30px;
    padding-inline: 10px;
  }

  /*
     드로잉 도구를 가로 막대로 눕힌다.

     ★ .chart-body 는 가로 flex 다. 도구에 width:100% 를 주면 차트가 차지할 폭이
       0 이 되어 캔버스가 사라진다(실제로 겪었다 — 차트 영역이 비어 보였다).
       그래서 .chart-body 를 세로 flex 로 바꾸고 도구를 그 위에 올린다.
  */
  .chart-body {
    flex-direction: column;
  }

  .chart-drawtools {
    flex-direction: row;
    overflow-x: auto;
    width: 100%;
    /* 세로 막대의 고정 폭을 해제한다. */
    height: auto;
    flex: 0 0 auto;
    scrollbar-width: none;
  }
  .chart-drawtools::-webkit-scrollbar { display: none; }
  .chart-drawtools button { flex: 0 0 auto; min-width: 34px; min-height: 34px; }

  /* 차트는 남은 공간을 모두 쓴다. 세로 flex 에서는 높이가 대상이다. */
  .chart-kline-wrap {
    width: 100%;
    min-height: 240px;
  }

  /* --- 패널·모달 --- */
  .modal {
    /* 화면 폭을 넘지 않게. 고정 width 를 덮는다. */
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px);
    max-height: 88dvh;
    overflow-y: auto;
  }

  .chart-ind-panel {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px);
    /* 화면 밖으로 나가지 않게 위치를 고정한다. */
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
  }

  /* --- 페이지 셸 (관리자·설정 등) --- */
  .page-shell__head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  /* --- 구현 상태 배지: 화면을 가리지 않게 --- */
  .qt-prov-host {
    right: 6px;
    bottom: 6px;
    max-width: calc(100vw - 12px);
  }
  .qt-prov-badge__note {
    /* 좁은 화면에서는 설명을 접는다. title 로 여전히 읽을 수 있다. */
    display: none;
  }
}

/* ---------------------------------------------------------------
   작은 휴대폰 (430px 이하)
   --------------------------------------------------------------- */
@media (max-width: 430px) {
  :root {
    --grid-gap: 4px;
  }

  /* 브랜드 버전 표기는 공간을 먹는다. */
  .app-brand__ver {
    display: none;
  }

  /* 헤더 우측 도구 중 데스크톱 전용 항목을 접는다.
     같은 기능이 사이드바·설정 화면에 있는 것만 대상으로 한다. */
  .app-header .header-tool--desktop-only {
    display: none;
  }

  .tbl {
    min-width: 560px;
    font-size: 11px;
  }

  /* 주문 입력은 세로로 길어도 괜찮다. 값을 읽을 수 있는 것이 우선이다. */
  .oe-row,
  .op-row {
    flex-wrap: wrap;
  }
}

/* ---------------------------------------------------------------
   서랍 열기 버튼 (좁은 화면에서만 보인다)
   --------------------------------------------------------------- */
.qt-drawer-toggle {
  display: none;
}

@media (max-width: 768px) {
  .qt-drawer-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    margin-right: 2px;
    border: 1px solid var(--color-border-default, var(--n-800));
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-secondary, #9aa5b5);
    cursor: pointer;
  }

  .qt-drawer-toggle:active {
    background: var(--color-bg-hover, var(--n-850));
  }
}

/* 햄버거 세 줄. icons.jsx 에 Menu 가 없어 CSS 로 그린다. */
.qt-drawer-toggle__bars,
.qt-drawer-toggle__bars::before,
.qt-drawer-toggle__bars::after {
  display: block;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
}

.qt-drawer-toggle__bars {
  position: relative;
}

.qt-drawer-toggle__bars::before,
.qt-drawer-toggle__bars::after {
  content: '';
  position: absolute;
  left: 0;
}

.qt-drawer-toggle__bars::before { top: -4.5px; }
.qt-drawer-toggle__bars::after { top: 4.5px; }

/* ============================================================
   노트북 폭 (769px ~ 1599px) — 헤더 잘림 방지
   ------------------------------------------------------------
   문제
   ----
   헤더 내용이 최대 1,845px 인데 흔한 노트북은 1280~1600px 이다.
   실측 결과 super 등급은 1600px 에서도 245px 넘쳤고, 일반 사용자도
   1280px 에서 110px 넘쳤다. 넘친 부분은 화면 밖으로 나가 보이지 않는다 —
   오른쪽 끝의 프로필·알림 버튼에 손이 닿지 않는다.

   접근
   ----
   요소를 삭제하지 않는다. 좁아질수록 **글자 라벨만** 접어서 아이콘으로
   남긴다. 기능은 그대로 있고 폭만 줄어든다.
   그래도 넘치면 가로 스크롤을 허용한다 — 잘려서 못 누르는 것보다
   스크롤해서 누르는 편이 낫다.
   ============================================================ */
@media (min-width: 769px) and (max-width: 1599px) {
  .app-header {
    /*
       마지막 방어선.

       라벨을 접어도 넘치는 조합(super 등급 + 좁은 화면)이 있다.
       그때 화면 밖으로 밀려 사라지는 대신 스크롤로 접근하게 한다.
    */
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .app-header::-webkit-scrollbar { display: none; }

  /*
     개발·디자인 문서 링크의 글자 라벨을 접는다.

     Design / Handoff / Library 는 super·admin 만 보는 내부 문서다.
     제품 운영에 쓰는 도구가 아니므로 좁은 화면에서 가장 먼저 양보한다.
     아이콘은 남으므로 title 로 이름을 알 수 있다.
  */
  .app-header .header-tool[title="Design System"] > span,
  .app-header .header-tool[title="Developer Handoff"] > span,
  .app-header .header-tool[title="Design Library"] > span {
    display: none;
  }
}

@media (min-width: 769px) and (max-width: 1439px) {
  /*
     1440px 미만에서는 개발 문서 링크를 아예 감춘다.

     실측: 1280px 에서 내용 1,385px / 화면 1,280px — 105px 넘쳤고, 이 링크
     3개가 87px(+간격)를 차지했다. 넘친 만큼 오른쪽 끝의 프로필·알림 버튼이
     화면 밖으로 밀려 누를 수 없었다.

     내부 문서와 실제 조작 버튼 중 하나를 양보해야 한다면 문서 쪽이다.
     팀은 URL(design-system.html 등)로 직접 열 수 있고, /admin/design-ops
     화면에도 같은 링크가 있다 — 기능이 사라지는 것이 아니다.
  */
  .app-header .header-tool[title="Design System"],
  .app-header .header-tool[title="Developer Handoff"],
  .app-header .header-tool[title="Design Library"] {
    display: none;
  }
}

@media (min-width: 769px) and (max-width: 1439px) {
  /*
     등급 스위치는 실서비스에서 렌더되지 않는다(app.jsx 에서 처리).
     디자인 미리보기에서는 실제로 동작하는 도구이므로 여기서도 남긴다 —
     미리보기는 폭이 넉넉한 환경에서 보는 것을 전제한다.
  */

  /* 레이아웃·입금 버튼의 글자를 접고 아이콘만 남긴다. */
  .app-header .header-tool > span:not(.header-tool__badge) {
    display: none;
  }
}

/* ============================================================
   터치 대상 확대 (모바일 전용)

   무엇이 문제였나
   -------------
   실측(390×844, 실제로 손이 닿는 요소만): 32px 미만 대상이 라우트당 3~20개.
   가장 작은 것은 즐겨찾기 별 **14×15px** 이었다. 손가락으로 정확히 누르기
   어렵고, 옆을 누르면 아무 일도 일어나지 않아 사용자는 기능이 고장난 줄 안다.

   어떻게 고치는가
   -------------
   ★★ **보이는 크기는 건드리지 않는다.** 디자이너가 정한 모양이 그대로 남아야
     하므로, `::after` 로 투명한 영역만 넓힌다. 화면은 똑같고 손가락만 편해진다.

   ★★ **겹치는 곳에는 넣지 않는다.**
     인접 요소와 간격이 0인 것들(`.btn--xs`, `.btn--sm`, `.seg__opt`,
     시간축 버튼의 좌우)은 확장하면 **옆 버튼이 눌린다.** 작아서 못 누르는 것보다
     엉뚱한 것이 눌리는 게 나쁘다 — 주문 화면에서는 특히 그렇다.
     그래서 실측한 간격이 충분한 대상만 넓혔고, 나머지는 그대로 두었다.

   ★ 데스크톱에는 적용하지 않는다. 마우스는 30px 도 충분히 정확하다.
   ============================================================ */

@media (max-width: 768px) {
  /*
     즐겨찾기 별 — 14×15px, 가장 작았다.

     좌우 간격 339px · 위아래 30px 로 여유가 크므로 넉넉히 넓힌다.
  */
  .sh-identity__star {
    position: relative;
  }
  .sh-identity__star::after {
    content: '';
    position: absolute;
    /* 14×15 → 약 40×39 */
    inset: -12px -13px;
  }

  /*
     ★ 접힌 사이드바(레일) 항목은 확장하지 않는다 — 시도했다가 되돌렸다.

       가로 20px 이라 넓히고 싶었지만, 확장 영역이 레일을 넘어 **본문 위로
       올라갔다.** 실측에서 차트 패널 헤더·시세 값이 잡혔다(오탭 20건).
       그 상태로 두면 차트를 만질 때 사이드바 메뉴가 반응해 화면이 이동한다 —
       작아서 못 누르는 것보다 훨씬 나쁘다.

       세로는 이미 36px 로 기준에 가깝다. 가로를 늘리려면 레일 자체를 넓혀야
       하고 그것은 디자인 변경이므로 임의로 하지 않는다.
  */

  /*
     구현 상태 표시 토글 — 48×20px.

     화면 구석에 혼자 있어(가로 422px · 세로 32px 여유) 세로를 넓혀도 겹치지 않는다.
  */
  .qt-prov-badge__toggle {
    position: relative;
  }
  .qt-prov-badge__toggle::after {
    content: '';
    position: absolute;
    inset: -10px -4px;
  }

  /*
     ★ 차트 도구 버튼(비교·템플릿)도 확장하지 않는다.

       세로 여유가 15px 로 보였지만, 도구 줄이 가로 스크롤 컨테이너 안에 있어
       확장 영역이 컨테이너 경계를 넘어 옆 패널과 겹쳤다(실측에서 잡힘).
       세로 32px 로 기준에 가까우므로 그대로 둔다.
  */

  /*
     차트 상단 아이콘 버튼 — 22×32px.

     세로 간격 8px. 가로는 2px 이므로 세로만.
  */
  .chart-toolbar .btn--icon {
    position: relative;
  }
  .chart-toolbar .btn--icon::after {
    content: '';
    position: absolute;
    inset: -4px 0;
  }

  /*
     호가창 방향 버튼 — 22×20px.

     세로 간격 8px, 가로 2px. 세로만 넓힌다.
  */
  .ob-side-btn {
    position: relative;
  }
  .ob-side-btn::after {
    content: '';
    position: absolute;
    inset: -6px 0;
  }

  /*
     ★ 확장하지 않은 것 (기록)

       아래 대상들은 인접 요소와 간격이 0 이라 넓히면 옆이 눌린다:
         · .btn--xs / .btn--sm  (33×30 · 157×30, 간격 0)
         · .seg__opt            (31×32, 세그먼트 — 서로 붙어 있는 것이 정상)
         · .chart-tf__btn       (30×32, 시간축 — 좌우 간격 1px)
         · .pct-slider__stop    (8×8, 슬라이더 눈금 — 슬라이더 자체가 큰 대상이다)

       세로 30px 버튼들은 32px 기준에 2px 모자라지만, 위아래 여유가 없어
       확장이 오탭을 만든다. 크기를 늘리려면 디자인 변경이 필요하므로
       임의로 하지 않는다.
  */
}

/* ============================================================
   모바일에서 화면 밖으로 밀려난 조작 요소
   ------------------------------------------------------------
   ★★ `tools/mobile-clip-check.mjs` 가 찾아낸 것들이다. 기존 도구들은 전부
      통과했는데(문서 가로 스크롤이 안 생기거나, 데스크톱 폭만 검사해서),
      실제로는 사용자가 누를 수 없는 버튼들이었다.

   ★ 여기서 하는 일은 **자리를 만들어 주는 것**이지 기능을 없애는 것이 아니다.
     같은 기능이 다른 곳에 없는 버튼은 숨기지 않는다.
   ============================================================ */

@media (max-width: 900px) {
  /*
     랜딩 헤더 — 좌우 여백이 48px 씩 고정이라 '로그인/회원가입' 이 밖으로 나갔다
     (390px 에서 '회원가입' left=435, 즉 화면 밖).

     ★ 랜딩은 **가입 전 첫 화면**이다. 여기서 가입 버튼에 닿지 못하면 그대로
       떠난다. 가장 먼저 고쳐야 하는 종류의 결함이다.
     ★ 가운데 내비게이션(Features/Pricing/Exchanges/Design)은 접는다 —
       페이지 내부 앵커이고, 아래로 스크롤하면 같은 내용이 순서대로 나온다.
  */
  .landing-header {
    padding-left: 12px;
    padding-right: 12px;
    gap: 8px;
  }
  .landing-nav {
    display: none;
  }

  /*
     심볼 헤더(BTC/USDT · 마크가격 · 펀딩 …) — 가로 스크롤은 되지만 스크롤바를
     숨겨서 오른쪽 끝의 Alerts/Share/More 에 닿는 방법을 알 수 없었다.

     ★ 헤더와 같은 방식으로 오른쪽에 페이드를 깔아 "더 있다" 를 알린다.
     ★ `pointer-events: none` — 페이드가 버튼 클릭을 가로채면 안 된다.
  */
  .symbol-header--v2::after {
    content: '';
    position: sticky;
    right: 0;
    flex: 0 0 auto;
    align-self: stretch;
    width: 16px;
    margin-left: -16px;
    background: linear-gradient(
      to right,
      transparent,
      var(--color-bg-surface, rgba(12, 16, 22, 0.92))
    );
    pointer-events: none;
  }

  /*
     섹션 카드의 우측 액션(Filter · Export CSV · 기간 버튼 1D/1W/1M/1Y 등)이
     제목과 한 줄에 놓여 밖으로 밀려났다.

     ★ 줄바꿈을 허용해 아래로 내린다. 숨기면 필터·내보내기 기능에 접근할 수
       없고, 그 기능들은 다른 경로가 없다.
     ★ `min-width: 0` — flex 자식이 내용 폭을 고집해 줄바꿈을 막는 것을 푼다.
  */
  .section-card__head,
  .card__head,
  /* ★ 실제 컨테이너는 `.page-header__actions` 였다(도구가 부모 사슬로 확인).
       Filter · Export CSV · Export Report · 기간 버튼(90D/1Y/All) ·
       "잔고·포지션 새로고침" 이 모두 여기에 있고 제목과 한 줄에 놓여 밖으로
       밀려났다. 이 기능들은 다른 경로가 없어서 숨길 수 없다. */
  .page-header {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .section-card__head > *,
  .card__head > *,
  .page-header > * {
    min-width: 0;
  }
  .section-card__actions,
  .card__actions,
  .page-header__actions {
    flex-wrap: wrap;
    row-gap: 6px;
  }
}

/* ============================================================
   좁은 화면에서 밀려나는 세그먼트·툴바
   ------------------------------------------------------------
   `tools/mobile-clip-check.mjs` 가 남긴 항목들.
   ============================================================ */

@media (max-width: 900px) {
  /*
     섹션 카드 안의 세그먼트 탭 (예: /markets 의 All·Favorites·Gainers·Losers·New).

     ★★ 360px 에서 Gainers(407) · Losers(476) · New(538) 가 화면 밖이었다.
       `.seg` 는 고정 폭 flex 라 줄바꿈도 스크롤도 없었다 — 즉 **영구히 닿을
       수 없었다.** 필터를 못 쓰면 목록에서 원하는 것을 찾을 수 없다.

     ★ 헤더의 거래모드 세그먼트(현물/선물/모의)는 제외한다. 그쪽은 항목이
       3개뿐이고 이미 들어오며, 줄바꿈하면 헤더 높이가 흔들린다.

     ★ 가로 스크롤 + 페이드로 처리한다. 줄바꿈보다 이쪽이 나은 이유: 탭은
       한 줄에 있어야 "이것들이 한 묶음" 으로 읽힌다.
  */
  /*
     ★★ `.seg` 에 overflow 를 주는 것만으로는 부족했다. 부모
       `.section-card__actions` 가 **549px 로 부풀어**(360px 화면에서) `.seg`
       자체를 화면 밖으로 밀어냈다. flex 자식은 기본적으로 내용 폭을 고집하므로
       (`min-width: auto`) 부모가 줄어들지 않는다.
       실측: .seg w=303(스크롤 가능) 인데 left=407 → 화면 밖.
     ★ 그래서 컨테이너에 `min-width: 0` + `max-width: 100%` 를 함께 준다.
  */
  .section-card__actions,
  .card__actions,
  .page-header__actions {
    min-width: 0;
    max-width: 100%;
  }

  /*
     ★★ 가로 스크롤 → 줄바꿈 (2026-09-27, 4차 후반).
       위 설명의 '페이드' 는 실제로 만든 적이 없다 — 스크롤바만 숨겨서 360px /markets 에서
       'New'(fil 'Bago') 가 **보이지 않는 스크롤 안**에 있었고 단서가 없었다. 고객은 그 탭이 있는
       줄 모른다. 3차의 마켓워치 탭(widgets.jsx .mw-tabs)과 같은 방식으로 줄을 바꿔 전부 보이게 한다.
     ★ 묶음으로 읽히는 것은 배경(.seg 상자)이 지킨다 — 두 줄이 되어도 한 상자 안이다.
  */
  .section-card__actions .seg,
  .card__actions .seg,
  .page-header__actions .seg {
    flex-wrap: wrap;
    row-gap: 2px;
    max-width: 100%;
    min-width: 0;
  }
  .section-card__actions .seg__opt,
  .card__actions .seg__opt,
  .page-header__actions .seg__opt {
    /* 줄바꿈 단위가 항목 하나가 되게 — 글자가 찌그러지거나 한 항목이 두 줄로 쪼개지지 않게. */
    flex: 0 0 auto;
  }

  /*
     차트 툴바 — 가로 스크롤은 되는데 스크롤바를 숨겨 단서가 없었다
     (AI 분석 · 최신으로 이동 · 스크린샷 · 전체화면이 오른쪽 끝에 있다).
  */
  .chart-toolbar::after {
    content: '';
    position: sticky;
    right: 0;
    flex: 0 0 auto;
    align-self: stretch;
    width: 16px;
    margin-left: -16px;
    background: linear-gradient(
      to right,
      transparent,
      var(--color-bg-surface, rgba(12, 16, 22, 0.92))
    );
    pointer-events: none;
  }

  /*
     랜딩 푸터의 링크가 한 줄에 몰려 밖으로 나갔다('문의하기' left=371).

     ★ 푸터에는 문의·약관·개인정보 링크가 있다. 약관 링크에 닿지 못하면
       법적 문서를 볼 수 없다 — 숨기면 안 되고 줄바꿈해야 한다.
  */
  .landing-footer,
  .landing-footer > * {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}

/* ============================================================
   랜딩 페이지 — 모바일 대응
   ------------------------------------------------------------
   ★★ 랜딩에는 모바일 규칙이 **아예 없었다.** 데스크톱 그리드(3열 가격표,
      4열 거래소, 좌우 48px 여백)가 360px 화면에도 그대로 적용돼서, 세 번째
      가격 카드의 '문의하기' 버튼이 화면 밖(left=371)에 있었다.

   ★ 랜딩은 **가입 전 첫 화면**이다. 여기서 요금제를 못 보거나 CTA 에 닿지
     못하면 그대로 떠난다. 다른 화면보다 먼저 고쳐야 하는 종류의 결함이다.
   ============================================================ */

@media (max-width: 900px) {
  /* 히어로 — 좌우 여백을 줄이고 글자를 화면에 맞춘다. */
  .landing-hero {
    padding-left: 16px;
    padding-right: 16px;
  }
  .landing-hero h1 {
    /* 큰 제목이 넘쳐 잘리지 않게. 최소 크기는 읽을 수 있는 선에서 유지. */
    font-size: clamp(28px, 8vw, 56px);
    line-height: 1.15;
    word-break: keep-all;
  }

  /* 히어로 통계 — 4개가 한 줄에 안 들어간다. */
  .landing-hero-stats {
    flex-wrap: wrap;
    gap: 18px 28px;
    justify-content: center;
  }

  .landing-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  /*
     그리드 섹션을 1열로 접는다.

     ★ 기능·가격·거래소는 위에서 아래로 읽어도 뜻이 통한다. 좁은 화면에서
       2열로 두면 글자가 너무 작아진다(가격표는 숫자를 읽어야 한다).
  */
  .landing-feat-grid,
  .landing-pricing {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* 거래소는 로고 + 이름이라 2열까지는 읽을 수 있다. */
  .landing-exchanges {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* 푸터 링크(문의·약관·개인정보)가 한 줄에 몰리지 않게. */
  .landing-foot {
    flex-wrap: wrap;
    row-gap: 10px;
    padding-left: 16px;
    padding-right: 16px;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 900px) {
  /*
     포지션 탭 (포지션 · 미체결 · 주문내역 · 체결내역 · 자금이동 · AI 신호).

     ★ 가로 스크롤은 되는데 스크롤바를 숨겨 오른쪽 끝 항목(자금 이동 · AI 신호)에
       닿는 방법을 알 수 없었다. 페이드로 알린다.
  */
  .pos-tabs::after {
    content: '';
    position: sticky;
    right: 0;
    flex: 0 0 auto;
    align-self: stretch;
    width: 16px;
    margin-left: -16px;
    background: linear-gradient(
      to right,
      transparent,
      var(--color-bg-panel, rgba(14, 18, 25, 0.94))
    );
    pointer-events: none;
  }

  /*
     그리기 도구 막대의 스크롤 단서.

     ★ 이 막대는 위(985줄 근처)에서 이미 **가로로 눕혀** 놓았다
       (`flex-direction: row` + `overflow-x: auto`). 좁은 화면에서 세로 막대는
       차트 높이를 너무 먹기 때문이다.
     ★ 그런데 스크롤바를 숨겨서 오른쪽 끝 도구(그림 숨기기 · 전체 삭제)에
       닿는 방법을 알 수 없었다. 페이드로 알린다.
     ★ 세로 규칙을 따로 주지 않는다 — 위 규칙과 충돌해 방향이 흔들린다
       (실제로 그렇게 만들었다가 되돌렸다).
  */
  .chart-drawtools::after {
    content: '';
    position: sticky;
    right: 0;
    flex: 0 0 auto;
    align-self: stretch;
    width: 14px;
    margin-left: -14px;
    background: linear-gradient(
      to right,
      transparent,
      var(--color-bg-panel, rgba(14, 18, 25, 0.94))
    );
    pointer-events: none;
  }
}

/* ============================================================================
   ★★★ 모바일 입력칸 — iOS Safari 자동 확대 차단

   실측(iPhone 12 뷰포트, 프로덕션): 가입 화면의 입력칸이 **font-size 13px ·
   높이 21px** 이었다.

   iOS Safari 는 **16px 미만**의 입력칸을 탭하면 화면을 강제로 확대한다. 그리고
   확대를 **되돌리지 않는다.** 그 뒤 화면이 잘려 다음 칸과 [Create account] 버튼이
   화면 밖으로 나간다 — 가입이 사실상 막힌다.

   이것이 감사에서 가장 ROI 가 높다고 지목된 항목이다. 실제 고객 6명 중 모바일로
   시도했다가 포기한 사람이 있었는지는 알 수 없다(기록이 없다). 다만 막히는 것은 확인됐다.

   ★ user-scalable=no 로 막지 않는다. 확대를 못 하게 만들면 저시력 이용자가
     화면을 읽을 수 없다(접근성 위반). **원인인 폰트 크기를 고친다.**

   ★ 16px 은 iOS 의 기준값이다. 여기서 줄이면 다시 확대된다.

   ★ 높이도 함께 올린다. 21px 은 손가락으로 정확히 누르기 어렵다(권장 최소 44px).
   ============================================================================ */
@media (max-width: 768px) {
  .input,
  .num-input,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;   /* ★ iOS 자동 확대 기준값 — 줄이면 안 된다 */
    min-height: 44px;  /* ★ 손가락 터치 권장 최소 */
  }

  /* ★ 라벨·도움말도 함께 키운다. 입력칸만 키우면 그 위 글자가 상대적으로 더 작아 보인다. */
  .auth-field__label,
  .input-group__label { font-size: 13px; }

  /*
     ★ 동의 체크박스는 필수 항목이다. 작으면 못 누르고, 못 누르면 [Create account]
       버튼이 계속 비활성으로 남는다 — 이용자는 이유를 알 수 없다.
  */
  label.chk { min-height: 44px; display: flex; align-items: center; gap: 8px; }
  label.chk input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 auto; }

  /* ★ 주 버튼도 같은 기준으로 키운다. */
  .btn--lg { min-height: 48px; font-size: 15px; }
}

/* ============================================================================
   ★★★ 터치 영역 — 보이는 크기는 그대로, 누를 수 있는 범위만 넓힌다

   실측(iPhone 12 뷰포트, 프로덕션, 로그인 후 4개 화면): **105개**가 24px 미만이었다.
     .sb-pin          20×20  ×36   사이드바 고정 버튼
     .mw-row__star    16×16  ×21   관심종목 별표
     .qt-widget-close 20×20  ×8    패널 닫기
     .pct-slider__stop  8×8  ×4    비율 슬라이더 눈금

   ★★ **크기를 직접 키우면 배치가 깨진다.** 이 요소들은 좁은 행 안에 절대배치로
     들어가 있고(.sb-pin 은 right:4px, .qt-widget-close 는 모서리 바깥), 실제로
     예전에 qt-widget-close 를 옮기다가 헤더 버튼과 **겹침 5건**을 만든 적이 있다.

   ★ 그래서 `::before` 로 **투명한 확장 영역**만 만든다. 보이는 모양·위치는 그대로이고
     손가락이 닿는 범위만 44×44 가 된다. 레이아웃에 영향이 없다(position:absolute).

   ★ `content: ''` 가 반드시 필요하다 — 없으면 의사요소가 생성되지 않는다.
   ★ 부모에 position 이 없으면 확장 영역이 엉뚱한 곳에 생긴다. 위 네 요소는 모두
     absolute 이거나 inline-flex 이므로 relative 를 함께 준다.
   ★ 데스크톱에는 적용하지 않는다 — 마우스는 정확하고, 넓은 투명 영역이 옆 요소의
     클릭을 가로챌 수 있다.
   ============================================================================ */
@media (max-width: 768px) {
  /* ★★ (2026-10-06) .qt-widget-close 를 뺐다 — 이미 absolute 인데 relative 로 덮여 **흐름 안으로 들어왔다**:
       모바일 거래 화면에서 차트 카드 오른쪽에 20px 빈 칸이 생기고 × 가 카드 밖 위에 떠 있었다(390px 실측). */
  .sb-pin,
  .mw-row__star,
  .pct-slider__stop,
  .btn--icon,
  .btn--xs {
    position: relative;
  }

  .sb-pin::before,
  .mw-row__star::before,
  .qt-widget-close::before,
  .pct-slider__stop::before,
  .btn--icon::before,
  .btn--xs::before {
    content: '';
    position: absolute;
    /*
       ★ 44px 기준을 중앙 정렬로 만든다. 요소가 20px 이면 위아래로 12px 씩 넓어진다.
         top/left 를 50% 로 두고 translate 로 당기면 요소 크기와 무관하게 동작한다.
    */
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    /* ★ 보이지 않아야 한다. 배경을 주면 회색 사각형이 나타난다. */
    background: transparent;
    /*
       ★★ 확장 영역이 **버튼 자신의 클릭 범위**여야 한다. pointer-events 를 none 으로
         두면 넓힌 의미가 없고, auto 로 두어야 부모 버튼이 이벤트를 받는다.
    */
    pointer-events: auto;
    /* ★ 아이콘/글자보다 뒤에 둔다 — 위에 오면 자체 렌더를 가릴 수 있다. */
    z-index: 0;
  }

  /* ★ 별표는 16px 이라 글자 자체도 조금 키운다 — 무엇인지 보이지 않으면 못 누른다. */
  .mw-row__star { font-size: 14px; }
}

/* ============================================================================
   ★★ 남은 터치 대상 — 1차 수정(::before 44px) 후 재측정해서 나온 것들

   105개 → 35개로 줄었고, 남은 것은 성격이 달라 방식도 다르다:

     푸터 링크 (16px 높이 · 6종 × 3화면)
       "Business information · Terms · Privacy · Risk Disclosure · Refund Policy · 이메일"
       ★ 줄바꿈되는 인라인 링크다. ::before 로 44px 상자를 씌우면 **옆 링크와 겹쳐**
         엉뚱한 링크가 눌린다. 그래서 세로 padding 으로 실제 높이를 키운다.
       ★★ 이 링크들은 법정 고지(전자상거래법 제10조)와 약관·환불정책이다.
         모바일에서 못 누르면 고지가 열리지 않는 것과 같다.

     체크박스 input (20×20 · 4개)
       ★ label.chk 안의 것은 앞서 20px+44px 행으로 처리했다. 여기 남은 것은 그 밖의
         설정 토글이다. width/height 를 직접 키운다 — 네이티브 위젯이라 ::before 가
         적용되지 않는다(replaced element).

     사이드바 아이콘 (20×36 — 폭이 부족)
       ★ 접힌 사이드바의 아이콘이다. 높이는 충분하고 **폭만** 모자라다.
         min-width 로 넓힌다. 사이드바 자체 폭 안에서 늘어나므로 배치가 깨지지 않는다.

     호가창 방향 버튼 (22×20)
       ★ 두 개가 나란히 붙어 있어 ::before 44px 는 서로 겹친다. padding 으로 키운다.
   ============================================================================ */
@media (max-width: 768px) {
  /*
     ★ 푸터·법적 링크. 인라인 요소라 padding 만으로는 높이가 늘어도 클릭 범위가
       늘지 않을 수 있어 inline-block 으로 바꾼다.
  */
  .qt-footer a,
  .foot-links a,
  footer a {
    display: inline-block;
    padding: 8px 4px;
    min-height: 24px;
  }

  /* ★ 네이티브 체크박스·라디오는 ::before 가 안 통한다 — 크기를 직접 준다. */
  input[type="checkbox"],
  input[type="radio"] {
    width: 24px;
    height: 24px;
  }

  /* ★ 접힌 사이드바 항목 — 높이는 충분하고 폭만 모자랐다(20×36). */
  .sb-item-v2 {
    min-width: 44px;
  }

  /* ★ 호가창 방향 버튼 — 나란히 붙어 있어 확장 상자 대신 padding 으로 키운다. */
  .ob-side-btn {
    min-width: 32px;
    min-height: 28px;
  }
}

/* ============================================================================
   ★ 터치 대상 3차 — 재측정으로 남은 것 (105 → 35 → 8)

   ★★ 남은 8개 중 **5개는 내 측정의 오탐**이었다:
        input 20×20 4개 → 부모 `label.chk` 가 **44px** 다. 라벨을 누르면 토글되므로
                          실제 터치 대상은 44px 다. 요소 크기만 재면 이렇게 틀린다.
        span.qt-drawer-toggle__bars 14×2 → 햄버거 아이콘의 **장식 막대**다.
                          부모 button 이 대상이다.
      그래서 이 둘은 손대지 않는다. **고칠 것이 없는데 고치면 오히려 배치를 깬다.**

   ★ 실제로 미달인 것은 링크·별표 3종이다:
        a "Connect a key →"  95×14 / 92×13   — 거래소 키 연결 유도. 이걸 못 누르면
                                               실거래를 시작할 수 없다.
        a "or email support…" 182×17          — 문의 경로.
        span.sh-identity__star 14×15          — role="button" 인 관심종목 별표
                                               (헤더의 것. 목록 행의 것은 1차에서 처리).
   ============================================================================ */
@media (max-width: 768px) {
  /*
     ★ 본문 안 인라인 링크. ::before 확장 상자는 옆 글자와 겹치므로 padding 을 쓴다.
       inline-block 이어야 세로 padding 이 클릭 범위로 잡힌다.
     ★ 범위를 좁게 잡는다 — 모든 <a> 에 주면 문단 안 링크가 줄 간격을 벌린다.
  */
  /*
     ★★ 처음엔 `.qt-widget a[href^="#/"]` 로 잡으려 했는데 **빗나갔다**(실측: 95×14 로
       그대로 남았다). 그 링크는 클래스가 없고 인라인 style 만 있어서 붙을 자리가
       없었다 — 그래서 widgets.jsx 에 `.qt-inline-cta` 를 붙였다.
     ★ 교훈: 선택자를 추측하지 말고 실제 DOM 을 보고 정한다.
  */
  .qt-inline-cta,
  .acct-empty a,
  .qt-widget a[href^="#/"],
  a[href^="mailto:"] {
    display: inline-block;
    padding: 6px 2px;
    min-height: 24px;
  }

  /* ★ 헤더 관심종목 별표 — role="button" 이라 실제 조작 요소다. */
  .sh-identity__star {
    position: relative;
    font-size: 16px;
    min-width: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .sh-identity__star::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    background: transparent;
    pointer-events: auto;
    z-index: 0;
  }
}

/* ============================================================
   모바일 하단 탭바 + 바텀시트 + 티커 (2026-09-21, 1~3단계)
   ============================================================ */
.cc-tabbar{ display:flex !important; flex-direction:row !important; align-items:stretch !important; justify-content:space-between !important; box-sizing:border-box; position:fixed; left:0; right:0; bottom:0; z-index:9999; background:var(--n-900); border-top:1px solid var(--n-800); padding-bottom:env(safe-area-inset-bottom,0); min-height:54px; }
.cc-tabbar a{ flex:1 1 0 !important; display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:center !important; gap:4px !important; text-decoration:none !important; min-height:50px; }
@media (max-width:900px){ .app-shell, .page-shell { padding-bottom:54px; } }
.cc-sheet-dim{ position:fixed; inset:0; z-index:9998; background:rgba(0,0,0,.55); opacity:0; pointer-events:none; transition:opacity .22s ease; }
.cc-sheet{ position:fixed; left:0; right:0; bottom:0; z-index:9999; background:var(--n-900); border-top:1px solid var(--n-800); border-radius:14px 14px 0 0; padding:8px 16px calc(14px + env(safe-area-inset-bottom,0)); transform:translateY(102%); transition:transform .26s cubic-bezier(.32,.72,.34,1); max-height:86dvh; overflow-y:auto; }
.cc-sheet.is-open{ transform:translateY(0); }
.cc-sheet-dim.is-open{ opacity:1; pointer-events:auto; }
.cc-sheet__grab{ width:36px; height:4px; border-radius:2px; background:var(--color-text-secondary); margin:0 auto 12px; }
.cc-sheet__head{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:10px; }
.cc-sheet__head b{ font-size:15px; font-weight:900; display:block; }
.cc-sheet__meta{ display:flex; align-items:center; gap:6px; margin-top:6px; flex-wrap:wrap; font-family:'IBM Plex Mono',monospace; font-size: var(--fs-2xs); color:#848E9C; }
.cc-sheet__meta span{ display:inline-flex; align-items:center; min-height:22px; padding:0 8px; border-radius:999px; background:var(--n-850); border:1px solid var(--n-800); }
/* ★ 닫기 ✕ 는 글자 크기 그대로 두고 **누르는 자리만** 44×44 로 넓힌다(실측 전 25×30).
     음수 여백으로 넓힌 만큼을 되돌려 머리줄 배치가 바뀌지 않게 한다. */
.cc-sheet__x, #ccHubX{ color:#848E9C; font-size:15px; background:none; border:0; padding:6px; cursor:pointer; min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; margin:-7px -10px -7px 0; }
.cc-sheet__tabs{ display:flex; background:var(--n-850); border-radius:7px; padding:4px; gap:4px; margin-bottom:14px; }
.cc-sheet__tabs button{ flex:1; text-align:center; font-family:inherit; font-size:13px; font-weight:900; padding:11px 0; border-radius:5px; color:#848E9C; background:transparent; border:0; min-height:46px; display:flex; align-items:center; justify-content:center; gap:6px; cursor:pointer; }
.cc-sheet__tabs button::before{ content:''; width:0; height:0; border-left:5px solid transparent; border-right:5px solid transparent; }
.cc-sheet__tabs button[data-side="long"]::before{ border-bottom:7px solid var(--color-trade-long); }
.cc-sheet__tabs button[data-side="short"]::before{ border-top:7px solid var(--color-trade-short); }
.cc-sheet__tabs button.on[data-side="long"]{ background:var(--color-trade-long); color:var(--color-on-trade); }
.cc-sheet__tabs button.on[data-side="long"]::before{ border-bottom-color:var(--n-950); }
.cc-sheet__tabs button.on[data-side="short"]{ background:var(--color-trade-short); color:var(--color-on-trade); }
.cc-sheet__tabs button.on[data-side="short"]::before{ border-top-color:var(--n-000); }
.cc-sheet__submit{ width:100%; min-height:54px; border:0; border-radius:6px; background:var(--color-trade-long); color:var(--color-on-trade); font-family:inherit; font-size:15px; font-weight:900; cursor:pointer; }
.cc-sheet__submit.is-sell{ background:var(--color-trade-short); color:var(--color-on-trade); }
.cc-sheet__note{ margin-top:9px; text-align:center; font-family:'IBM Plex Mono',monospace; font-size: var(--fs-2xs); color:#848E9C; }
@media (prefers-reduced-motion: reduce){ .cc-sheet, .cc-sheet-dim{ transition-duration:.01ms !important; } }


/* ============================================================
   5단계: /trade 모바일 우선순위 재배치 (2026-09-25 운영 보강)
   ------------------------------------------------------------
   ★ 이전 규칙은 `.market-watch` / `[class*="chart"]` 같은 클래스에 기대고 있었다.
     그런데 실제 DOM 은 `data-widget-type` 를 단다(`layout-engine.jsx`). 그래서
     순서 재배치와 마켓워치 접기가 의도만 있고 거의 적용되지 않았다.

   ★ 모바일에서는 "한 화면에 다 보이게 축소" 가 아니라 "차트 → 주문 → 포지션 →
     보조 패널" 순서로 앱처럼 세로 스택을 만든다. 주문까지 닿는 속도가 우선이다.
   ============================================================ */
@media (max-width: 900px){
  .app-shell,
  .page-shell {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 220;
    backdrop-filter: blur(18px);
    background: rgba(11, 14, 17, 0.92);
    border-bottom-color: var(--n-800);
  }

  .page-header {
    position: sticky;
    top: 0;
    z-index: 120;
    backdrop-filter: blur(16px);
    background: rgba(11, 14, 17, 0.94);
    padding: 12px 12px 10px;
  }
  /*
     ★★ (2026-10-11) 밝은 테마가 기본이 된 뒤(R206) 휴대폰 화면 제목이 **어두운 바탕 위 어두운 글자**였다 —
       위 배경이 어두운 색으로 박혀 있어서다(390px 실측: 제목 'Portfolio' 거의 안 보임). 밝은 테마에서는 면 토큰을 쓴다.
  */
  html[data-theme="light"] .page-header {
    background: color-mix(in oklab, var(--color-bg-surface) 94%, transparent);
  }

  .page-body {
    padding: 10px;
    gap: 10px;
  }

  .panel,
  .section-card,
  .kpi-card,
  .modal {
    border-radius: 14px;
    border-color: var(--n-800);
    box-shadow: none;
  }

  .panel__header,
  .section-card__head {
    min-height: 42px;
    padding-inline: 12px;
  }

  .panel__title,
  .section-card__title {
    font-size: 12px;
    letter-spacing: 0.04em;
  }

  .symbol-header--v2 {
    grid-template-columns: 1fr;
    height: auto;
    padding: 0 12px;
    background: rgba(11, 14, 17, 0.96);
    border-bottom-color: var(--n-800);
  }

  .sh-group {
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid var(--n-800);
  }

  .sh-group:last-child {
    border-bottom: 0;
  }

  .sh-group--range {
    display: none;
  }

  .sh-group--meta,
  .sh-actions {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sh-group--meta::-webkit-scrollbar,
  .sh-actions::-webkit-scrollbar {
    display: none;
  }

  .sh-group--meta {
    gap: 10px;
  }

  .sh-group--meta .sh-meta-cell {
    min-width: 78px;
  }

  .sh-actions {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    gap: 8px;
  }

  .sh-actions > * {
    flex: 0 0 auto;
  }

  .trade-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px;
    padding: 8px 8px calc(94px + env(safe-area-inset-bottom, 0px));
  }

  .trade-body > .widget[data-widget-type='chart'] { order: 1 !important; }
  .trade-body > .widget[data-widget-type='orderEntry'] { order: 2 !important; }
  .trade-body > .widget[data-widget-type='positions'] { order: 3 !important; }
  .trade-body > .widget[data-widget-type='aiCopilot'] { order: 4 !important; }
  .trade-body > .widget[data-widget-type='orderBook'] { order: 5 !important; }
  .trade-body > .widget[data-widget-type='recentTrades'] { order: 6 !important; }
  .trade-body > .widget[data-widget-type='marketWatch'] { order: 7 !important; }
  .trade-body > .widget[data-widget-type='assetsRisk'] { order: 8 !important; }
  .trade-body > .widget[data-widget-type='miniChart'] { order: 9 !important; }

  .trade-body > .widget[data-widget-type='marketWatch'] {
    min-height: 280px;
  }

  .trade-body > .widget[data-widget-type='marketWatch'] .panel__body {
    max-height: 320px;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .panel {
    background: linear-gradient(180deg, rgba(16, 19, 25, 0.98) 0%, rgba(11, 14, 17, 0.98) 100%);
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .panel__header {
    position: sticky;
    top: 0;
    z-index: 4;
    background: rgba(11, 14, 17, 0.97);
    backdrop-filter: blur(18px);
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-margin {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    background: rgba(17, 22, 29, 0.95);
    border-bottom-color: var(--n-800);
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-margin__group {
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-mmode {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-mmode__label {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7F8A99;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-mmode__value,
  .trade-body > .widget[data-widget-type='orderEntry'] .oe-lev {
    min-height: 34px;
    padding-inline: 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-tabs {
    position: sticky;
    top: 43px;
    z-index: 3;
    background: rgba(11, 14, 17, 0.98);
    padding: 0 12px;
    gap: 8px;
    border-bottom-color: var(--n-800);
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-tab {
    min-height: 38px;
    padding: 10px 2px 8px;
    font-size: 12px;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-body {
    gap: 10px;
    padding: 12px;
    padding-bottom: 14px;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-balance,
  .trade-body > .widget[data-widget-type='orderEntry'] .oe-summary {
    background: rgba(17, 22, 29, 0.92);
    border: 1px solid var(--n-800);
    border-radius: 12px;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-balance {
    padding: 10px 12px;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .input-group {
    min-height: 56px;
    border-radius: 12px;
    border-color: var(--n-800);
    background: var(--n-900);
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .input-group__label {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .pct-slider__labels {
    font-size: 10px;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .chk {
    min-height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--n-900);
    border: 1px solid var(--n-800);
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-summary {
    gap: 6px;
    padding: 10px 12px;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-summary__row {
    font-size: 11px;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-warn,
  .trade-body > .widget[data-widget-type='orderEntry'] .auth-alert {
    border-radius: 12px;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-buttons {
    position: sticky;
    bottom: 0;
    z-index: 3;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 6px;
    margin-top: 0;
    background: linear-gradient(to top, rgba(11, 14, 17, 0.98) 74%, rgba(11, 14, 17, 0));
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-buttons .btn {
    min-height: 54px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
  }

  .trade-body > .widget[data-widget-type='orderEntry'] .oe-buttons .btn--outline {
    background: var(--n-850) !important;
  }

  .trade-body > .widget[data-widget-type='positions'] .panel__header,
  .trade-body > .widget[data-widget-type='orderBook'] .panel__header,
  .trade-body > .widget[data-widget-type='recentTrades'] .panel__header,
  .trade-body > .widget[data-widget-type='marketWatch'] .panel__header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(11, 14, 17, 0.96);
    backdrop-filter: blur(14px);
  }

  .trade-body > .widget[data-widget-type='positions'] .pos-tabs,
  .trade-body > .widget[data-widget-type='marketWatch'] .mw-tabs,
  .trade-body > .widget[data-widget-type='marketWatch'] .mw-list-head,
  .trade-body > .widget[data-widget-type='recentTrades'] .rt-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--n-900);
  }

  .trade-body > .widget[data-widget-type='positions'] .pos-tabs {
    gap: 6px;
    padding: 8px 10px;
  }

  .trade-body > .widget[data-widget-type='positions'] .pos-tabs .tab,
  .trade-body > .widget[data-widget-type='positions'] .pos-tabs__right > * {
    flex: 0 0 auto;
    min-height: 34px;
    border-radius: 999px;
  }

  .trade-body > .widget[data-widget-type='positions'] .tbl th,
  .trade-body > .widget[data-widget-type='positions'] .tbl td,
  .trade-body > .widget[data-widget-type='orderBook'] .tbl th,
  .trade-body > .widget[data-widget-type='orderBook'] .tbl td,
  .trade-body > .widget[data-widget-type='recentTrades'] .rt-row,
  .trade-body > .widget[data-widget-type='marketWatch'] .mw-row {
    font-size: 11px;
  }

  .trade-body > .widget[data-widget-type='orderBook'] .panel__body,
  .trade-body > .widget[data-widget-type='recentTrades'] .panel__body,
  .trade-body > .widget[data-widget-type='positions'] .pos-body {
    max-height: 320px;
  }

  .trade-body > .widget[data-widget-type='aiCopilot'] .panel__header,
  .trade-body > .widget[data-widget-type='aiCopilot'] .ai-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(11, 14, 17, 0.96);
  }

  .trade-body > .widget[data-widget-type='aiCopilot'] .ai-msg__bubble,
  .trade-body > .widget[data-widget-type='aiCopilot'] .ai-composer {
    border-radius: 14px;
  }

  .toast-region {
    left: 8px;
    right: 8px;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}


/* ============================================================
   BINANCE/BITGET APP SKIN (2026-09-21) — 디자인 전용 오버레이
   var(--n-925) 플랫 / 골드 var(--brand-primary-500) / 그린 #0ECB81 / 레드 #F6465D
   ============================================================ */
/* ============================================================
   6단계: 한 손 조작형 정교화 (2026-09-25 3차)
   ------------------------------------------------------------
   ★ 1·2차는 "깨지지 않게" 와 "앱처럼 보이게" 였다. 3차는 **한 손으로
     끝까지 조작되는가** 다. 거래소 앱과의 차이는 대부분 이 지점에서 난다:

       · 툴바가 손가락 아래에서 흔들리지 않는가
       · 스크롤 단위가 손가락에 맞는가
       · 지금 무엇이 켜져 있는지 스크롤 중에도 보이는가
       · 잘못 눌렀을 때 되돌릴 수 있는가

   ★ 데스크톱 규칙은 건드리지 않는다. 전부 900px 이하 조건 안이다.
   ============================================================ */
@media (max-width: 900px) {
  /* --- 차트 툴바: 상단 고정 + 칩형 스크롤 --- */
  .trade-body > .widget[data-widget-type='chart'] .chart-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(11, 14, 17, 0.97);
    backdrop-filter: blur(18px);
    border-bottom-color: var(--n-800);
    min-height: 46px;
    padding: 7px 10px;
    gap: 8px;
    /* 스크롤 단위를 손가락에 맞춘다 — 한 번 튕겨 두 칸씩 넘어가면 못 고른다. */
    scroll-snap-type: x proximity;
  }

  .trade-body > .widget[data-widget-type='chart'] .chart-toolbar > *,
  .trade-body > .widget[data-widget-type='chart'] .chart-tool-wrap > * {
    scroll-snap-align: start;
  }

  .trade-body > .widget[data-widget-type='chart'] .chart-tf {
    background: var(--n-900);
    border: 1px solid var(--n-800);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
  }

  .trade-body > .widget[data-widget-type='chart'] .chart-tf__btn {
    min-height: 34px;
    min-width: 44px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
  }

  .trade-body > .widget[data-widget-type='chart'] .chart-tf__btn.is-active {
    background: rgba(240, 185, 11, 0.14);
    color: var(--brand-primary-500);
    box-shadow: inset 0 0 0 1px rgba(240, 185, 11, 0.28);
  }

  .trade-body > .widget[data-widget-type='chart'] .chart-tool {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--n-900);
    border: 1px solid var(--n-800);
    font-size: var(--fs-sm);
  }

  .trade-body > .widget[data-widget-type='chart'] .chart-tool.is-active {
    background: rgba(240, 185, 11, 0.14);
    border-color: rgba(240, 185, 11, 0.3);
    color: var(--brand-primary-500);
  }

  /*
     구분선은 좁은 화면에서 정보가 아니라 소음이다.
     디자인 요소를 지우는 것이 아니라 **이 조건에서만** 감춘다.
  */
  .trade-body > .widget[data-widget-type='chart'] .chart-toolbar__sep {
    display: none;
  }

  /* --- 그리기 도구: 차트 위 떠 있는 하단 레일 --- */
  .trade-body > .widget[data-widget-type='chart'] .chart-body {
    position: relative;
  }

  .trade-body > .widget[data-widget-type='chart'] .chart-drawtools {
    position: sticky;
    bottom: 0;
    z-index: 4;
    flex-direction: row;
    gap: 4px;
    padding: 8px 10px;
    border-right: 0;
    border-top: 1px solid var(--n-800);
    background: rgba(11, 14, 17, 0.97);
    backdrop-filter: blur(16px);
    border-radius: 0 0 14px 14px;
    scroll-snap-type: x proximity;
  }

  .trade-body > .widget[data-widget-type='chart'] .chart-drawtool {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--n-900);
    border: 1px solid var(--n-800);
    scroll-snap-align: start;
  }

  .trade-body > .widget[data-widget-type='chart'] .chart-drawtool.is-active {
    background: rgba(240, 185, 11, 0.14);
    border-color: rgba(240, 185, 11, 0.3);
    color: var(--brand-primary-500);
  }

  .trade-body > .widget[data-widget-type='chart'] .chart-drawtool-sep {
    width: 1px;
    height: 24px;
    margin: auto 4px;
    flex: 0 0 auto;
  }

  /* HUD·범례가 커진 화면에서 작아 보이지 않게 */
  .trade-body > .widget[data-widget-type='chart'] .chart-hud {
    top: 8px;
    left: 10px;
    font-size: 10px;
  }

  .trade-body > .widget[data-widget-type='chart'] .chart-legend {
    top: 8px;
    right: 10px;
    font-size: var(--fs-2xs);
  }

  /* --- 포지션: 한 줄이 카드처럼 읽히게 --- */
  .trade-body > .widget[data-widget-type='positions'] .tbl {
    border-collapse: separate;
    border-spacing: 0 6px;
    min-width: 680px;
  }

  .trade-body > .widget[data-widget-type='positions'] .tbl th {
    background: transparent;
    border-bottom-color: var(--n-800);
    font-size: var(--fs-2xs);
  }

  .trade-body > .widget[data-widget-type='positions'] .tbl tbody tr {
    background: var(--n-900);
    border-bottom: 0;
  }

  .trade-body > .widget[data-widget-type='positions'] .tbl tbody tr td {
    border-bottom: 0;
    padding-top: 8px;
    padding-bottom: 8px;
    height: auto;
  }

  .trade-body > .widget[data-widget-type='positions'] .tbl tbody tr td:first-child {
    border-radius: 10px 0 0 10px;
    padding-left: 10px;
  }

  .trade-body > .widget[data-widget-type='positions'] .tbl tbody tr td:last-child {
    border-radius: 0 10px 10px 0;
    padding-right: 10px;
  }

  .trade-body > .widget[data-widget-type='positions'] .pos-actions {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .trade-body > .widget[data-widget-type='positions'] .pos-actions .btn--xs {
    min-height: 32px;
  }

  /* --- 오더북·체결: 행 리듬을 손가락에 맞춘다 --- */
  .trade-body > .widget[data-widget-type='orderBook'] .tbl th,
  .trade-body > .widget[data-widget-type='orderBook'] .tbl td {
    height: 24px;
    font-size: 11px;
  }

  .trade-body > .widget[data-widget-type='recentTrades'] .rt-row {
    padding: 4px var(--sp-4);
    line-height: 1.7;
  }

  /* --- 마켓워치: 종목 한 줄을 손가락 크기로 --- */
  .trade-body > .widget[data-widget-type='marketWatch'] .mw-row {
    min-height: 44px;
    align-items: center;
  }

  .trade-body > .widget[data-widget-type='marketWatch'] .mw-row__base {
    font-size: var(--fs-md);
  }

  .trade-body > .widget[data-widget-type='marketWatch'] .mw-tab {
    min-height: 34px;
    border-radius: 999px;
    background: var(--n-900);
    border: 1px solid var(--n-800);
  }

  .trade-body > .widget[data-widget-type='marketWatch'] .mw-tab.is-active {
    background: rgba(240, 185, 11, 0.14);
    border-color: rgba(240, 185, 11, 0.3);
    color: var(--brand-primary-500);
  }

  /* --- AI 코파일럿: 입력창이 키보드 위에 붙어 있게 --- */
  .trade-body > .widget[data-widget-type='aiCopilot'] .ai-composer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: rgba(11, 14, 17, 0.97);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--n-800);
  }

  .trade-body > .widget[data-widget-type='aiCopilot'] .ai-composer .btn--icon,
  .trade-body > .widget[data-widget-type='aiCopilot'] .ai-composer button {
    min-width: 38px;
    min-height: 38px;
    border-radius: 12px;
  }

  /* --- 하단 시트: 한 손으로 누르는 버튼 높이 보장 --- */
  .cc-sheet__tabs button {
    min-height: 48px;
    border-radius: 10px !important;
  }

  .cc-sheet #ccSheetSubmit {
    min-height: 56px !important;
    border-radius: 14px !important;
  }

  .cc-sheet #ccQty,
  .cc-sheet #ccLev {
    min-height: 48px !important;
    border-radius: 12px !important;
  }

  /*
     레버리지 빠른 선택 칩.

     ★ 거래소 앱은 레버리지를 숫자로 타이핑하지 않는다. 3·5·10·20 을 눌러
       고른다. 타이핑은 키보드가 올라와 시트를 가리고, 오타는 곧 위험이다.
     ★★ 값을 **지어내지 않는다** — 시장의 최대 레버리지를 넘는 칩은 그리지
       않는다(`buildSheet` 의 `symMaxLev` 를 그대로 상한으로 쓴다).
  */
  .cc-lev-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: -4px 0 12px;
  }

  /* ★ 44px — 손가락 터치 최소 크기(WCAG 2.5.5·iOS HIG). 40px 에서 옆 칩을 잘못 누르면
       고른 적 없는 배수로 주문이 나간다(실측 390×844: 46×40 ×7). */
  .cc-lev-chips button {
    flex: 1 1 0;
    min-height: 44px;
    border-radius: 10px;
    background: var(--n-900);
    border: 1px solid var(--n-800);
    color: #B7BDC6;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .cc-lev-chips button.on {
    background: rgba(240, 185, 11, 0.14);
    border-color: rgba(240, 185, 11, 0.34);
    color: var(--brand-primary-500);
  }

  .cc-lev-chips button:disabled {
    opacity: 0.35;
  }

  /* --- 더보기 허브: 섹션 머리글과 빠른 진입 --- */
  .cc-hub-section {
    font-family: 'IBM Plex Mono', monospace;
    font-size: var(--fs-2xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    margin: 18px 4px 8px;
  }

  .cc-hub-quick {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 4px;
  }

  .cc-hub-quick a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 0 14px;
    border-radius: 12px;
    background: var(--n-900);
    border: 1px solid var(--n-800);
    text-decoration: none;
  }

  .cc-hub-quick a b {
    display: block;
    font-size: 13px;
    color: var(--color-bg-hover);
  }

  .cc-hub-quick a small {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: var(--fs-2xs);
    color: #848E9C;
  }
}

/* 탭바: 진한 블랙, 66px, 골드 활성 */
.cc-tabbar{ background:rgba(10,13,17,.96) !important; border-top:1px solid var(--n-800) !important; min-height:66px !important; box-shadow:none !important; backdrop-filter:blur(18px); }
.cc-tabbar a{ gap:3px !important; font-size: var(--fs-xs) !important; color:#98A2B0 !important; font-weight:600 !important; letter-spacing:-.1px; position:relative; }
.cc-tabbar a::before{ content:''; position:absolute; top:7px; left:50%; transform:translateX(-50%); width:34px; height:26px; border-radius:13px; background:transparent; transition:background .18s ease, box-shadow .18s ease; }
.cc-tabbar a > *{ position:relative; z-index:1; }
.cc-tabbar a.on, .cc-tabbar a.active, .cc-tabbar a[aria-current="page"]{ color:var(--brand-primary-500) !important; font-weight:800 !important; }
.cc-tabbar a.on::before, .cc-tabbar a.active::before, .cc-tabbar a[aria-current="page"]::before{ background:rgba(240,185,11,.12); box-shadow:inset 0 0 0 1px rgba(240,185,11,.18); }
.cc-tabbar a span, .cc-tabbar a i, .cc-tabbar a b{ font-style:normal; }
/* 시트: 블랙 플랫, 16px 라운드, 조밀 */
.cc-sheet{ background:var(--n-925) !important; border-top:1px solid var(--n-800) !important; border-radius:16px 16px 0 0 !important; box-shadow:0 -8px 24px rgba(0,0,0,.5) !important; }
.cc-sheet__grab{ background:#2B3139 !important; height:5px !important; width:40px !important; border-radius:3px !important; }
.cc-sheet__head b{ letter-spacing:-.3px; }
.cc-sheet__tabs{ background:var(--n-800) !important; border-radius:8px !important; }
.cc-sheet__submit{ border-radius:10px !important; min-height:52px !important; font-size: var(--fs-xl) !important; letter-spacing:.2px; box-shadow:none !important; }
.cc-confirm-box{ border-color:#2B3139 !important; border-radius:14px !important; }
/* 허브/AI/티커/토스트: 카드 플랫화 + 1px 보더 */
[class^="cc-hub"], [class*=" cc-hub"]{ background:var(--n-925) !important; }
[class^="cc-hub"] [class$="-card"], [class^="cc-hub"] li, [class^="cc-hub"] a{ border-color:var(--n-800) !important; }
[class^="cc-ai"], [class*=" cc-ai-"]{ background:var(--n-925) !important; border-color:var(--n-800) !important; }
.cc-ticker, [class^="cc-ticker"]{ background:var(--n-900) !important; border-color:var(--n-800) !important; }
.cc-toast, [class^="cc-toast"]{ background:var(--n-800) !important; border:1px solid #2B3139 !important; color:var(--color-bg-hover) !important; border-radius:10px !important; }
[class^="cc-confirm"], [class*=" cc-confirm"]{ background:var(--n-900) !important; border:1px solid #2B3139 !important; border-radius:10px !important; }
/* /trade 마켓워치 헤더: 앱식 섹션 헤더 */
.market-watch > :first-child, [class*="market-watch"] > :first-child{
  background:var(--n-900) !important; border-bottom:1px solid var(--n-800) !important;
  text-transform:uppercase; font-weight:700 !important;
}
/* 전역: 카드 그림자 제거(플랫), 스크롤바 얇게 */
.cc-sheet, .cc-tabbar, [class^="cc-"]{ box-shadow:none; }
[class^="cc-"] ::-webkit-scrollbar{ width:3px; height:3px; }
[class^="cc-"] ::-webkit-scrollbar-thumb{ background:#2B3139; border-radius:2px; }

/*
   ★★★★ **이 규칙이 미디어쿼리 밖에 있어 데스크톱까지 덮었다.**

     `mobile.css` 는 `index.html` 에서 **맨 마지막**에 로드된다. 그래서 여기 있는
     `.app-brand__logo{height:22px}` 가 `widgets.css` 의 값을 이긴다 — 데스크톱 헤더
     로고를 32px 로 올렸는데 화면에서는 계속 22px 이었다(2026-09-24 실측).

   ★★★ 모바일용 값은 **모바일 조건 안**에 둔다. 파일 이름이 mobile 이라고 해서 규칙이
     모바일에만 적용되는 것이 아니다 — 이름은 폴더 정리이고, 적용 범위는 미디어쿼리다.
   ★★ 좁은 화면에서는 22px 이 맞다(헤더가 낮고 옆에 둘 것이 많다). 그래서 지우지 않고
     조건을 붙인다.
*/
@media (max-width: 900px) {
  .app-brand__logo{height:22px;width:auto;display:block}
}

@media (max-width: 900px) {
  .cc-sheet__meta {
    gap: 5px;
  }

  .cc-sheet__meta span {
    min-height: 24px;
    padding-inline: 9px;
  }

  .cc-sheet__row {
    margin-bottom: 12px !important;
  }

  .cc-sheet__row input {
    border-radius: 12px !important;
  }

  .cc-sheet__note {
    line-height: 1.7;
  }
}

/*
   ★ 같은 이유로 조건 안에 둔다(위 `.app-brand__logo` 주석 참고). 이 파일이 마지막에
     로드되므로 미디어쿼리 밖 규칙은 **데스크톱까지** 덮는다.
*/
@media (max-width: 900px) {
  .auth-shell__brand-logo{height:24px;width:auto;display:block}
}

/* ============================================================
   7단계: 실기기 적합 — 가로모드 · 소형기기 · 좌우 노치 (2026-09-25 4차)
   ------------------------------------------------------------
   ★ 3차까지는 "세로 화면에서 한 손으로 조작되는가" 였다. 4차는 **기기 조건**이다.

       · 가로로 돌리면 세로 공간이 360px 남짓이다. 탭바(62) + 주문 버튼 띠(56)
         + 차트 툴바(46) 를 빼면 차트에 150px 도 남지 않는다. 거래소 앱이 가로에서
         차트를 먼저 살리는 이유가 이것이다 — 고정 띠를 얇게 하고 차트에 돌려준다.
       · 360px 폭 기기에서는 칩과 버튼이 한 줄에 들어가지 않아 **가로 스크롤**이 생긴다.
         폭 전용 분기를 두고, 넘치면 잘라내는 대신 **줄을 바꾼다.**
       · 노치는 세로만이 아니라 **가로에서 좌우**를 먹는다(홈 인디케이터·카메라 홀).
         좌우 safe-area 를 함께 존중한다. 단 이 값은 뷰포트에 viewport-fit=cover 가
         있어야 0 이 아니게 나온다(index.html).

   ★ 데스크톱 규칙은 건드리지 않는다 — 전부 900px 이하 조건 안이다.
   ★ 선택자는 layout-engine 이 실제로 붙이는 data-widget-type 과 이미 쓰던 클래스만
     쓴다. 그럴듯한 클래스명을 지어 쓰면 아무것도 맞지 않는다 — 이 저장소에서 겪었다.
   ============================================================ */

/* --- 좌우 노치 존중: 가로모드에서 글자가 홈 인디케이터에 붙는 것을 막는다 --- */
@media (max-width: 900px) {
  .cc-tabbar,
  .app-header,
  .page-header {
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
  }
}

/* --- 가로모드: 고정 띠를 줄이고 세로를 차트에 돌려준다 --- */
@media (max-width: 900px) and (orientation: landscape) {
  .cc-tabbar { height: 46px; }
  .cc-tabbar a { font-size: var(--fs-2xs); }
  .cc-tabbar a i { width: 16px; height: 16px; }

  .trade-body > .widget[data-widget-type='chart'] .chart-toolbar { min-height: 36px; padding: 4px 8px; }
  .trade-body > .widget[data-widget-type='chart'] .chart-tf__btn { min-height: 28px; min-width: 36px; font-size: 10px; }
  .trade-body > .widget[data-widget-type='chart'] .chart-tool { min-height: 30px; padding: 0 10px; }
  .trade-body > .widget[data-widget-type='chart'] .chart-drawtool { width: 34px; height: 34px; }

  /* 주문 버튼 띠가 가로에서 화면 아래를 크게 먹는다 — 붙박이를 푼다 */
  .trade-body > .widget[data-widget-type='orderEntry'] .oe-buttons { position: static; }

  /* 목록 상한을 줄여 차트에 세로를 넘긴다 */
  .trade-body > .widget[data-widget-type='marketWatch'] .panel__body,
  .trade-body > .widget[data-widget-type='orderBook'] .panel__body,
  .trade-body > .widget[data-widget-type='positions'] .panel__body { max-height: 150px; overflow-y: auto; }

  .trade-body > .widget[data-widget-type='chart'] .chart-body { min-height: 160px; }
}

/* --- 소형기기(360px 이하): 줄을 바꾼다. 가로 스크롤을 만들지 않는다 --- */
@media (max-width: 360px) {
  .cc-tabbar a { font-size: var(--fs-2xs); }
  /* ★ 좁은 기기에서도 높이는 줄이지 않는다(44px) — 줄을 바꿔 폭을 얻는다. */
  .cc-lev-chips button { min-height: 44px; font-size: 11px; flex: 1 1 calc(33.333% - 4px); }
  .cc-sheet__tabs button { min-height: 44px; font-size: 12px; }
  .trade-body > .widget[data-widget-type='chart'] .chart-toolbar { flex-wrap: wrap; row-gap: 4px; }
  .trade-body > .widget[data-widget-type='marketWatch'] .mw-row { min-height: 40px; }
  .trade-body > .widget[data-widget-type='positions'] .tbl tbody tr td { padding-top: 6px; padding-bottom: 6px; }
}

/* ============================================================
   9단계: 주문 시트의 익절·손절 % 칩 (2026-09-25)
   ------------------------------------------------------------
   타입핑 대신 눌러 고른다 — 키보드가 시트를 덮지 않고 오타가 없다.
   ============================================================ */
.cc-tpsl-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}
/* ★ 44px — 익절·손절 %·수량 비율 칩도 주문 값을 바꾸는 단추다(실측 전 85×34). */
.cc-tpsl-chips button {
  flex: 1 1 0;
  min-height: 44px;
  border-radius: 9px;
  background: var(--n-900);
  border: 1px solid var(--n-800);
  color: #848E9C;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.cc-tpsl-chips button.on {
  border-color: rgba(240, 185, 11, 0.34);
  color: var(--brand-primary-500);
  background: rgba(240, 185, 11, 0.12);
}

/* ★ 비율 칩은 '선택됨' 만 표시한다 — 손으로 수량을 고치면 표시를 지운다. */
.cc-tpsl-chips button.cc-pct-idle { background:var(--n-900); border-color:var(--n-800); color:#848E9C; }

/* ============================================================
   8단계: 휴대폰 헤더 — 넘치면 **잘라내지 않고 줄을 바꾼다** (2026-09-27)
   ------------------------------------------------------------
   ★★★ 무엇이 문제였나 (실측 390×844 /trade)
     `.app-header` scrollWidth 485 / clientWidth 390. 언어 버튼 x=388→435, 계정 버튼
     439→469 — **화면 밖**. 필리핀어는 562px(202px 넘침)로 알림 버튼까지 밖이었다.
     위(768 블록)의 `overflow-x:auto` 로 스크롤은 되지만 스크롤바를 숨겨서 넘친다는
     단서가 없었고, 스크롤해서 언어 버튼을 눌러도 **목록이 헤더의 overflow 에 잘려**
     한 항목도 누를 수 없었다(실측: 목록 10개 렌더 · 누를 수 있는 것 0).
     /settings 에도 언어 선택이 없어 휴대폰 고객은 언어를 바꿀 길이 없었다.

   ★★ 어떻게 고치는가
     · 헤더를 **줄바꿈**(flex-wrap)으로 바꾸고 overflow 를 풀어 준다 — 어느 언어에서
       얼마나 길어지든 모든 버튼이 화면 안에 남고, 드롭다운(언어·계정)이 잘리지 않는다.
     · 높이를 고정하지 않는다(셸의 헤더 행도 auto) — 둘째 줄이 본문 밑으로 숨지 않게.
     · 600px 이하에서는 **거래 모드 토글을 둘째 줄 전체**로 보낸다. 모드는 주문 전에
       반드시 보여야 하므로 숨기지 않는다(위 768 블록 주석과 같은 원칙). 첫 줄에는
       메뉴·로고·도구(알림·테마·언어·계정)가 오른쪽 위에 그대로 남는다.
     · 가로 스크롤 단서(페이드)는 스크롤이 없어졌으므로 끈다 — 남기면 버튼을 덮는다.

   ★ 요소를 숨기지 않는다. 기능이 사라지면 휴대폰 고객은 다른 앱을 쓴다.
   ★ 이 블록은 파일 **끝**에 둔다 — 위의 768·900 블록보다 뒤에 와야 이긴다.
     mobile-header-fit 시험이 각 폭에서 실제로 이기는 값을 계산해 확인한다.
   ============================================================ */
@media (max-width: 768px) {
  .app-shell {
    grid-template-rows: auto auto 1fr;
  }

  .app-header {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-h);
    row-gap: 4px;
    padding-top: 4px;
    padding-bottom: 4px;
    overflow: visible;
  }

  .app-header::after {
    display: none;
  }

  /*
     로고 옆 구분선·여백을 줄인다 — 첫 줄에 도구가 모두 들어가게. 로고(홈 링크)는 남긴다.
     ★★ `height: auto` — 데스크톱 규칙은 `height:100%`(헤더 높이)다. 헤더 높이가 auto 가
       되면 그 100% 가 **헤더 전체(두 줄)** 를 따라가 로고가 76px 로 늘고, 헤더 높이는 첫
       계산값(85px)에 묶여 **둘째 줄(모드 토글)이 헤더 밖으로 38px 삐져나갔다**(실측).
  */
  .app-header .app-brand {
    height: auto;
    padding-right: 6px;
    margin-right: 0;
    border-right: 0;
  }
}

@media (max-width: 600px) {
  .app-header .seg {
    order: 99;
    flex: 1 0 100%;
    display: flex;
    margin-right: 0 !important;
  }

  .app-header .seg__opt {
    flex: 1 1 0;
    justify-content: center;
  }
}

/* ============================================================
   AI 띄움 버튼(CCAI 런처) 자리 — 본문 끝을 비워 둔다 (2026-09-27, 3차)
   ------------------------------------------------------------
   ★★ 무엇이 문제였나 (실측 1280×800, ko)
     런처(app.jsx `data-testid="ccai-launcher"`, fixed · 당시 오른쪽 아래 — 4차에 왼쪽 레일로 옮겼다)가 #/wallet 의
     Bitget 'API 연결' 단추 가운데를 덮었다(겹침 74%, 가운데를 누르면 런처가 열린다).
     #/markets 는 목록 끝 '거래' 단추가 **맨 아래로 스크롤해도** 런처 밑에 남았다 —
     본문 아래 여백(24px)이 런처 높이보다 작아 빠져나올 자리가 없었다.
   ★ 본문 끝에 런처 크기만큼 비워 둔다 → 어느 단추든 스크롤로 런처 밖에 둘 수 있다.
     값은 런처 bottom(62) + height(48) = 110 에 여유를 더한 것. 런처를 키우면
     prelaunch-r3-format-mobile 시험이 먼저 깨진다.
   ★ 거래 화면(/trade)은 page-body 가 아니다(위젯 격자) — 여기에 해당하지 않는다.
   ============================================================ */
.page-body:not(.is-full-bleed) { padding-bottom: 124px; }

/*
   ★★ 런처 자리 (2026-09-27, 4차) — 데스크톱은 왼쪽 아래 사이드바 레일 안(app.jsx 주석).
   ★ 900px 이하에는 하단 탭바(mobile-tabbar.js, 같은 `(max-width: 900px)` 기준)가 있고, 그 'AI'
     탭이 AI 시트를 연다. 여기서 사이드바는 서랍이라 왼쪽 아래가 비지 않는다 — 실측 390×844:
     #/wallet 법적 고지 글자, #/trade 시세 띠 위에 런처가 얹혔다. 같은 일을 하는 단추가 둘일
     이유가 없으므로 런처를 감춘다(탭바 기준과 같은 폭이어야 두 단추가 모두 없거나 모두 있는 폭이 없다).
*/
@media (max-width: 900px) {
  .ccai-launcher { display: none !important; }
}
/*
   ★★ 런처 칸 — 사이드바 맨 아래를 비운다 (2026-09-27, 4차 후반).
     런처는 사이드바 위에 떠 있는(fixed) 단추라, 메뉴가 길면(관리자) 메뉴 스크롤이 바닥까지 차서
     런처가 메뉴 항목을 덮었다(실측 1024~1920 펼침 전부). 사이드바 자체에 런처 높이만큼 아래
     여백을 주면 메뉴 스크롤과 펼친 안내(foot)가 그 위에서 끝난다 — 메뉴 길이·안내 글자 줄 수와
     무관하다. 값 = 런처 bottom(6) + height(48) + 틈 6. 런처를 옮기면 이 값도 함께 볼 것.
   ★ 900px 이하에는 런처가 없고 사이드바는 서랍이다 — 여백을 두지 않는다.
*/
@media (min-width: 901px) {
  /*
     169차 — 런처가 오른쪽 아래로 왔다. 그 자리를 **비워 둔다**.

       값 = bottom(54) + height(44) = 98.
       ★ bottom 54 는 출처 배지(`.qt-prov-host`, bottom 12 · 높이 34 = 46)를 넘긴 자리다 —
         같은 모서리에서 두 요소가 겹치면 배지가 안 눌린다(4차 실측이 막으려던 실패).
  */
  :root { --ccai-launcher-lane: 98px; }
  /*
     ★★★★ 187차 — **사이드바 아래 98px 빈 칸을 없앴다**(대표 지시 2026-10-01).

       "Star a menu to keep it in the collapsed rail" 안내를 더 내려달라 + 위 탭들이
       스크롤 없이 들어갈 것 같다는 지적.

       실측(1440×900): 사이드바 `padding-bottom` 이 **98px** 였고, 그만큼 사이드바가
       화면 끝에 닿지 못했다. 그래서 ① 안내가 바닥에서 98px 떠 있었고
       ② 메뉴 목록이 쓸 수 있는 높이가 98px 모자라 **괜히 스크롤**이 생겼다.

       ★ 이 값은 **CCAI 런처 자리를 비워 두려던 것**이다(`--ccai-launcher-lane`).
         그런데 런처는 화면 **오른쪽 아래**에 뜬다 — 사이드바 위가 아니다. 사이드바가
         접히면 폭 60px 안팎이라 런처와 겹칠 일도 없다. 본문은 `.page-body` 가
         `padding-bottom: 124px` 로 이미 자기 자리를 비운다.
       ★ 좁은 화면(≤900px)에서는 사이드바가 서랍으로 바뀌므로 더더욱 필요 없다.
         → 규칙 자체를 지운다. 남겨 두면 "무엇이 이 여백을 만드는가" 를 또 찾게 된다.
  */
}

/*
   ★★ 설정 화면 2열(메뉴 220px + 본문)을 좁은 화면에서 1열로 (2026-09-27 감사).
     390px 에서 본문 카드가 267~542px 에 놓여 화면 밖이 잘렸다 — '비밀번호 변경' 단추와
     이메일 칸이 반쯤 가려졌다. 페이지 전체는 넘치지 않아(scrollWidth 390) 가로 넘침 검사로는
     잡히지 않았다. 인라인 grid 를 이기려면 !important 가 필요하다.
*/
@media (max-width: 720px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }
}

/* ★★★★ (2026-10-05) 모바일: 화면 아래 고정 법적 띠를 숨긴다 — 하단 탭 위에 늘 떠서 본문 높이의 ~25% 를 가렸다(점검 실측).
   같은 링크는 '더보기' 허브 맨 아래에 있다(mobile-tabbar.js cc-hub-legal). */
@media (max-width: 900px) {
  .app-legal-footer { display: none !important; }
}

/* ★★★★ (2026-10-05) 데스크톱: 오른쪽 아래 CCAI 런처(44px · right 12)가 표 맨 오른쪽 단추('거래' 등)를 덮었다(점검 실측 /markets).
   일반 화면 본문 오른쪽에 런처 폭만큼 비워 둔다 — 어떤 행이든 런처 아래로 들어가지 않는다. */
@media (min-width: 901px) {
  .page-body:not(.is-full-bleed) { padding-right: calc(var(--sp-12) + 52px); }
}

/* ★★★★ (2026-10-06) 전체 화면 점검 — 모바일 하단 탭(약 62px)이 화면 맨 아래 요소를 덮었다.
   · 로그인·가입·비밀번호 재설정·인증·KYC·입출금 안내(AuthShell): 끝까지 내려도 약관·개인정보 링크와 가입 칸이 탭 밑에 깔렸다.
   · 관리자 화면: 개발용 출처 배지가 하단 탭 '더보기' 단추를 덮었다(관리자만 보임) — 좁은 화면에서는 숨긴다. */
@media (max-width: 900px) {
  .auth-shell__form { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important; }
  .qt-prov-host { display: none !important; }
}
/* ★★ (2026-10-06) 2:1 · 3:1 · 1:2 · 6칸 격자가 좁은 화면에서 접히지 않았다 — 공지 작성(관리자) 등에서 폼 카드가
   절반 폭으로 눌려 '임시 저장' 단추가 잘렸다(390px 실측). grid-2/3/4 와 같이 1열로 접는다. */
@media (max-width: 900px) {
  .grid-2-1, .grid-3-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
/* ★ (2026-10-06) 세그먼트 단추 묶음이 좁은 화면에서 화면 밖으로 밀려 마지막 항목이 잘렸다(공지 작성 · 카테고리) — 가로로 밀어 보게 한다. */
@media (max-width: 900px) {
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
}

/* ★ (2026-10-06) 휴대폰에서는 패널 닫기(×)를 숨긴다 — 마우스 올림(hover)이 없어 늘 흐린 × 가 떠 있었고,
   한 화면 1열 배치라 닫을 이유가 없다(닫으면 차트가 사라진 것처럼 보인다). */
@media (max-width: 900px) {
  .qt-widget-close { display: none !important; }
}

/* ★★ (2026-10-06) 휴대폰 차트 — 그리기 도구 줄(34px 단추 10여 개)이 늘 펼쳐져 차트 높이를 먹었다. 접어 두고 '✎ 그리기' 로 펼친다. */
.chart-draw-toggle { display: none !important; }
@media (max-width: 900px) {
  .chart-draw-toggle { display: inline-flex !important; flex: 0 0 auto; align-items: center; gap: 4px; }
  .chart-drawtools.is-collapsed { display: none !important; }
}

/* ============================================================
   밝은 테마 · 휴대폰 보정 (2026-10-14)

   ★★★★ **실측 결함: 밝은 테마 + 휴대폰에서 글자가 보이지 않았다.**
     이 파일의 모바일 스킨은 처음부터 어두운 화면 기준으로 쓰였다 — 표면 색을
     `rgba(11,14,17,.96)` 이나 원시 중립 색(`--n-900`·`--n-800`)으로 **직접** 박아 두었다.
     그런데 그 위에 올라가는 글자색은 React 쪽에서 테마 토큰(`--color-text-primary`)으로 온다.
     밝은 테마에서 글자는 거의 검정이 되는데 표면은 그대로 검정이라 **종목명이 사라졌다**
     (실측 360px 밝은 테마: 심볼 머리글의 `BTC/USDT` 가 보이지 않고 `/` 와 PERP 배지만 보였다).

   ★ 고치는 방식: 기존 선언을 50곳 건드리지 않고 **밝은 테마에서만** 표면을 토큰으로 덮는다.
     어두운 테마는 한 줄도 바뀌지 않는다(되돌리기도 이 블록만 지우면 된다).
   ★ `.cc-*`(하단 탭·주문 시트·더보기 허브)는 제외한다 — 그 안의 글자색은 JS 가 밝은 색으로
     직접 넣으므로 어두운 표면이어야 읽힌다. 밝은 테마에서 어두운 탭바로 남는 것은 디자인 판단이다.
   ============================================================ */
@media (max-width: 900px) {
  html[data-theme="light"] .app-header,
  html[data-theme="light"] .page-header,
  html[data-theme="light"] .symbol-header--v2,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='positions'] .panel__header,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderBook'] .panel__header,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='recentTrades'] .panel__header,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='aiCopilot'] .panel__header,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='positions'] .pos-tabs,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='marketWatch'] .mw-tabs,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='marketWatch'] .mw-list-head,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .panel__header,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .oe-tabs,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='marketWatch'] .panel__header,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='aiCopilot'] .ai-header,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='aiCopilot'] .ai-composer,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-toolbar,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-drawtools,
  html[data-theme="light"] .market-watch > :first-child,
  html[data-theme="light"] [class*="market-watch"] > :first-child {
    background: var(--color-bg-surface) !important;
  }

  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .panel,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .oe-buttons,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='recentTrades'] .rt-head,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='positions'] .tbl tbody tr,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-tf,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-tool,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-drawtool,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='marketWatch'] .mw-tab {
    background: var(--color-bg-panel) !important;
  }

  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .oe-margin,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .oe-summary,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .oe-balance,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .oe-buttons .btn--outline {
    background: var(--color-bg-elevated) !important;
  }

  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .input-group,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .chk {
    background: var(--color-bg-input) !important;
  }

  /*
     ★★ 글자색도 같은 문제의 뒷면이다. 모바일 스킨은 켜진 탭·타임프레임을 **고정 금색 `var(--brand-primary-500)`**
       으로 칠한다(어두운 표면 기준). 표면을 밝게 바꾸면 그 금색이 흰 바탕에 올라가 1.6:1 이 된다
       (실측). 밝은 테마에서만 **같은 금색 계열의 진한 값**으로 바꾼다 — 색 정체성은 유지하고
       읽히게만 만든다(흰 바탕 대비 약 4.9:1).
  */
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-tf__btn.is-active,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-tool.is-active,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-drawtool.is-active,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='marketWatch'] .mw-tab.is-active {
    color: oklch(52% 0.13 75) !important;
  }

  /* 테두리도 같은 이유로 원시 어두운 색이었다 — 밝은 표면에서는 보이지 않거나 너무 진하다. */
  html[data-theme="light"] .app-header,
  html[data-theme="light"] .page-header,
  html[data-theme="light"] .symbol-header--v2,
  html[data-theme="light"] .sh-group,
  html[data-theme="light"] .modal,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .oe-margin,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .oe-tabs,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .oe-summary,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .input-group,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='orderEntry'] .chk,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-toolbar,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-tf,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-tool,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-drawtools,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='chart'] .chart-drawtool,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='positions'] .tbl th,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='marketWatch'] .mw-tab,
  html[data-theme="light"] .trade-body > .widget[data-widget-type='aiCopilot'] .ai-composer {
    border-color: var(--color-border-subtle) !important;
  }
}

/*
   ★★★ (2026-10-30 대표 지시 · 점검 실측) 휴대폰에서 차트가 화면 58% 아래(y≈490)에서 시작했다 — 종목·가격·표시가격·지수가격·단추 4개가
     세로로 쌓였다. 휴대폰에서는 종목과 가격을 **한 줄**로, 표시가격·지수가격 줄과 단추 줄은 숨긴다(주문 화면·More 에 같은 정보·기능이 있다).
     900px 이하만. PC 는 그대로.
*/
@media (max-width: 900px) {
  .symbol-header--v2 { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 12px !important; }
  .symbol-header--v2 > .sh-group { padding: 4px 0 !important; border-bottom: 0 !important; }
  .symbol-header--v2 { flex-wrap: nowrap !important; height: auto !important; min-height: 0 !important; }
  .symbol-header--v2 > .sh-group--identity { flex: 1 1 auto; min-width: 0; height: auto !important; min-height: 0 !important; align-items: center; overflow: hidden; }
  .symbol-header--v2 > .sh-group--identity .sh-identity__sub .badge--warning { display: none; }
  .symbol-header--v2 > .sh-price--v2 { flex: 0 0 auto; height: auto !important; align-items: flex-end; text-align: right; }
  .symbol-header--v2 > .sh-price--v2 .change__usd { display: none; }
  .symbol-header--v2 > .sh-price--v2 .val { font-size: 20px !important; line-height: 1.1; }
  .symbol-header--v2 > .sh-group--meta,
  .symbol-header--v2 .sh-actions { display: none !important; }
}

/* (2026-11-08, ledger #131) phone order sheet — Isolated / Cross for this symbol (src/mobile-tabbar.js paintMarginMode).
   Same look as the leverage chips; 44px touch targets; Bybit's account-wide mode is a read-only chip. */
.cc-mm { display: flex; gap: 6px; margin: 0 0 8px; }
.cc-mm[hidden] { display: none; }
.cc-mm__opt {
  flex: 1 1 0; min-height: 44px; border-radius: 10px; background: var(--n-900); border: 1px solid var(--n-800); color: #B7BDC6;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.cc-mm__opt[aria-checked="true"] { background: rgba(240, 185, 11, 0.14); border-color: rgba(240, 185, 11, 0.34); color: var(--brand-primary-500); }
.cc-mm__opt:disabled { opacity: 0.45; cursor: not-allowed; }
.cc-mm__opt[aria-checked="true"]:disabled { opacity: 0.8; }
.cc-mm__opt:focus { outline: none; }
.cc-mm__opt:focus-visible { outline: 2px solid var(--brand-primary-500); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .cc-mm__opt:not(:disabled):not([aria-checked="true"]):hover { border-color: var(--n-700); color: var(--n-100); } }
.cc-mm__ro {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px dashed var(--n-800);
  color: #B7BDC6; font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 700;
}
.cc-mm-note { margin: -2px 0 10px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; line-height: 1.5; color: #848E9C; }
.cc-mm-note[hidden] { display: none; }
.cc-mm-note--err { color: var(--color-danger); }
.cc-mm-note:focus { outline: none; }
.cc-mm-note:focus-visible { outline: 2px solid var(--brand-primary-500); outline-offset: 2px; }
