/* 청산가리 웹 — 휴대폰 화면 (바이비트형 · 10.16부터 기본: boot.js가 html에 ui-a를 붙임) · 900px 이하에서만 · 넓은 화면은 PC 배치 그대로
   ① 위: 종목 + 부제 · 큰 가격 정보(24시간 고가·저가·거래대금) · 글자만 있는 봉 주기  ② 차트: 최고·최저 표시 · 세션 한 줄 (시계 대신 설정에 표준시)
   ③ 보조 칸은 하나만 (아래 탭으로 고름)  ④ 빠른 주문: 매수 · 수량 · 매도  — 만드는 건 ui-a.js */
#uaSp, #uaPx, #uaPanes, #uaCap, .ua-ib, .ua-hl, #cfg #uaTzRow { display: none; }
#uaSym, #uaSym .r { display: contents; } #uaSym small, #uaSym .r > svg { display: none; }   /* 넓은 화면: 종목 칸은 원래대로 */
@media (max-width: 900px) {
  /* ───── ① 위쪽 세 줄 (메뉴줄 순서만 바꿈: 1~9 = 첫 줄 · 10 = 가격 · 20~ = 봉 주기 줄) ───── */
  /* 바탕 = 앱 바탕(--bg): 아이폰(iOS 26)은 상태 표시줄을 페이지 바탕색으로 칠해서(theme-color 무시) 머리줄이 패널색이면 시계 쪽과 톤이 어긋남 */
  html.chsg-web.ui-a header { gap: 0 2px; padding: max(4px, env(safe-area-inset-top)) max(4px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line-soft); background: var(--bg); }
  html.chsg-web.ui-a .brand { order: 1; margin-right: 8px; }
  html.chsg-web.ui-a #uaSym { display: flex; order: 2; flex-direction: column; justify-content: center; min-height: 48px; }
  html.chsg-web.ui-a #uaSym .r { display: flex; align-items: center; gap: 2px; color: var(--hi); }
  html.chsg-web.ui-a #uaSym svg { pointer-events: none; }
  html.chsg-web.ui-a #symSel { -webkit-appearance: none; appearance: none; background: none; border: 0; border-radius: 0; padding: 0; margin: 0; height: auto;
    font: 700 18px/1.2 'IBM Plex Sans KR', system-ui, sans-serif; letter-spacing: -.01em; color: var(--hi); }
  html.chsg-web.ui-a #uaSym small { display: block; margin-top: 1px; font-size: 11px; color: var(--dim); white-space: nowrap; }
  html.chsg-web.ui-a #uaSp { display: block; order: 3; flex: 1; }
  html.chsg-web.ui-a #keyBtn { order: 4; } html.chsg-web.ui-a #pnlBtn { order: 5; } html.chsg-web.ui-a #acctBtn { order: 6; }
  html.chsg-web.ui-a #indBtn { display: none; }   /* 지표 추가는 [지표] 상자의 + 지표 추가 · 레이어에서 */
  html.chsg-web.ui-a header .px { display: none; }
  /* 위쪽 아이콘: 테두리 없이 손가락 크기 */
  html.chsg-web.ui-a .set-btn, html.chsg-web.ui-a .ua-ib { all: unset; cursor: pointer; box-sizing: border-box; width: 40px; height: 44px; display: inline-flex; align-items: center; justify-content: center; position: relative; color: var(--text); }
  html.chsg-web.ui-a .set-btn[hidden] { display: none; }
  html.chsg-web.ui-a .set-btn span { display: none; }
  html.chsg-web.ui-a .set-btn svg, html.chsg-web.ui-a .ua-ib svg { width: 20px; height: 20px; }
  html.chsg-web.ui-a .set-btn.on, html.chsg-web.ui-a .ua-ib.on { background: none; color: var(--acc); }
  html.chsg-web.ui-a #acctBtn.on { color: var(--text); }
  html.chsg-web.ui-a #acctBtn.on::after { top: 10px; right: 8px; width: 7px; height: 7px; }
  /* 큰 가격 정보 */
  html.chsg-web.ui-a #uaPx { display: flex; order: 10; flex: 1 1 100%; min-width: 0; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 0 10px 9px 2px; box-sizing: border-box; }
  html.chsg-web.ui-a #uaPx .l { min-width: 0; }
  html.chsg-web.ui-a #uaPx .p { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
  html.chsg-web.ui-a #uaPx .p b { font: 700 30px/1 'JetBrains Mono', monospace; letter-spacing: -.03em; color: var(--hi); }
  html.chsg-web.ui-a #uaPx .p i { font: 600 13.5px 'JetBrains Mono', monospace; font-style: normal; color: var(--dim); }
  html.chsg-web.ui-a #uaPx .s { margin-top: 6px; font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.chsg-web.ui-a #uaPx .s b { font: 500 11.5px 'JetBrains Mono', monospace; color: var(--text); }
  html.chsg-web.ui-a #uaPx .up { color: var(--buy) !important; } html.chsg-web.ui-a #uaPx .dn { color: var(--sell) !important; }
  html.chsg-web.ui-a #uaPx .s .up { color: var(--buy-txt) !important; } html.chsg-web.ui-a #uaPx .s .dn { color: var(--sell-txt) !important; }
  html.chsg-web.ui-a #uaPx dl { flex: none; display: grid; grid-template-columns: auto auto; gap: 3px 10px; margin: 0; font-size: 11px; line-height: 1.35; white-space: nowrap; }
  html.chsg-web.ui-a #uaPx dt { color: var(--dim); }
  html.chsg-web.ui-a #uaPx dd { margin: 0; text-align: right; font-family: 'JetBrains Mono', monospace; color: var(--text); }
  /* 봉 주기 줄: 글자만 · 고른 것만 굵게 + 밑줄 · 오른쪽에 풋프린트 설정 · 지표 · 레이어 */
  html.chsg-web.ui-a .tf-wrap { order: 20; flex: 1 1 200px; min-width: 0; margin-left: -8px; }   /* 200px: 가격 줄 옆에 붙지 않고 셋째 줄로 · 넘치면 옆으로 밀어 봄 */
  html.chsg-web.ui-a #fpWrap { order: 21; }
  html.chsg-web.ui-a #uaInd { display: inline-flex; order: 22; } html.chsg-web.ui-a #uaLay { display: inline-flex; order: 23; }
  html.chsg-web.ui-a #tfGrp { background: none; border: 0; border-radius: 0; padding: 0; gap: 0; }
  html.chsg-web.ui-a #tfGrp button { height: 44px; box-sizing: border-box; padding: 0 8px; border-radius: 0; display: inline-flex; align-items: center;
    font: 500 13px 'JetBrains Mono', monospace; color: var(--dim); background: none; box-shadow: none; }
  html.chsg-web.ui-a #tfGrp button.on { color: var(--hi); font-weight: 700; box-shadow: inset 0 -2px 0 var(--acc); }
  html.chsg-web.ui-a #tfGrp .tf-more { padding: 0 8px; }
  /* 차트 말고 다른 탭(주문 · 호가 · 설정)에선 위를 줄여서 칸을 넓게 */
  html.chsg-web.ui-a.m-trade .tf-wrap, html.chsg-web.ui-a.m-trade #fpWrap, html.chsg-web.ui-a.m-trade .ua-ib,
  html.chsg-web.ui-a.m-dom .tf-wrap, html.chsg-web.ui-a.m-dom #fpWrap, html.chsg-web.ui-a.m-dom .ua-ib, html.chsg-web.ui-a.m-dom #uaPx,
  html.chsg-web.ui-a.ua-cfg .tf-wrap, html.chsg-web.ui-a.ua-cfg #fpWrap, html.chsg-web.ui-a.ua-cfg .ua-ib, html.chsg-web.ui-a.ua-cfg #uaPx { display: none !important; }

  /* ───── ② 차트 위: 설명 상자는 [지표]를 누를 때만 · 세션은 왼쪽 위 한 줄 · 시계와 칸 접기 버튼 숨김 (폰엔 시계가 있음 · 표준시는 설정 → 세션 · 시간) ───── */
  html.chsg-web.ui-a #clock, html.chsg-web.ui-a #paneBtns, html.chsg-web.ui-a .ua-hide { display: none !important; }
  html.chsg-web.ui-a #cfg #uaTzRow { display: flex; }
  html.chsg-web.ui-a #legendBox { display: none; }
  html.chsg-web.ui-a.ua-leg #legendBox { display: flex; top: 30px; }
  html.chsg-web.ui-a #sess { left: 10px; right: auto !important; top: 7px; text-align: left; display: flex; align-items: center; gap: 8px; font-size: 11px; }
  html.chsg-web.ui-a #sess[hidden] { display: none; }
  html.chsg-web.ui-a #sess .g { margin-top: 0; gap: 0; }
  html.chsg-web.ui-a #sess .g i { display: none; }
  html.chsg-web.ui-a #sess .g span { color: var(--dim); font-weight: 500; }
  /* 보이는 구간 최고 · 최저 (짧은 선 + 가격) */
  html.chsg-web.ui-a .ua-hl { display: flex; position: absolute; z-index: 6; align-items: center; gap: 3px; transform: translateY(-50%); pointer-events: none;
    font: 500 10.5px 'JetBrains Mono', monospace; color: var(--text); white-space: nowrap; }
  html.chsg-web.ui-a .ua-hl::before { content: ''; width: 16px; height: 1px; background: var(--dim); }
  html.chsg-web.ui-a .ua-hl.lt { flex-direction: row-reverse; }
  html.chsg-web.ui-a .ua-hl[hidden], html.chsg-web.ui-a.ua-leg .ua-hl { display: none; }   /* 설명 상자를 열면 겹치니 숨김 */

  /* ───── ③ 보조 칸 고르기 + ④ 빠른 주문 (아래 탭 바로 위에 고정 · 차트는 그 위까지) ───── */
  html.chsg-web.ui-a main { padding-bottom: calc(var(--m-tab) + 112px); }
  html.chsg-web.ui-a.m-tools main { padding-bottom: var(--m-tab); }
  html.chsg-web.ui-a.m-tools #uaPanes, html.chsg-web.ui-a.m-tools #uaCap { display: none; }
  html.chsg-web.ui-a #uaPanes { display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: calc(var(--m-tab) + 68px); height: 44px; box-sizing: border-box; align-items: center;
    padding: 0 max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left)); background: var(--bg); border-top: 1px solid var(--line-soft); }
  html.chsg-web.ui-a #uaPanes { overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }   /* 보조지표 칸이 늘면 옆으로 밀어 봄 */
  html.chsg-web.ui-a #uaPanes::-webkit-scrollbar { display: none; }
  html.chsg-web.ui-a #uaPanes button { all: unset; cursor: pointer; flex: none; white-space: nowrap; height: 43px; box-sizing: border-box; padding: 0 11px; display: flex; align-items: center;
    font: 500 12.5px 'IBM Plex Sans KR', system-ui, sans-serif; color: var(--dim); }
  html.chsg-web.ui-a #uaPanes button.on { color: var(--hi); font-weight: 700; box-shadow: inset 0 -2px 0 var(--acc); }
  html.chsg-web.ui-a #uaCap { display: block; position: fixed; z-index: 40; left: 0; right: 0; bottom: var(--m-tab); height: 68px; box-sizing: border-box;
    padding: 6px max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); background: var(--bg); }
  html.chsg-web.ui-a #uaCap .in { height: 56px; box-sizing: border-box; padding: 5px; border-radius: 28px; background: var(--panel); box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(0,0,0,.35);
    display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); gap: 6px; }
  html.chsg-web.ui-a #uaCap .in button { all: unset; cursor: pointer; border-radius: 23px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; color: #fff; transition: opacity .15s; }
  html.chsg-web.ui-a #uaCap .k { font: 600 11.5px 'IBM Plex Sans KR', system-ui, sans-serif; }
  html.chsg-web.ui-a #uaCap .v { font: 700 15px 'JetBrains Mono', monospace; }
  /* 색 · 확인 테두리는 위 버튼 초기화(.in button, all: unset)보다 우선이 높아야 함 — 낮으면 블랙 테마에서 색이 빠짐 */
  html.chsg-web.ui-a #uaCap .in .b { background: #13806C; } html.chsg-web.ui-a #uaCap .in .s { background: #D23F36; }
  html.chsg-web.ui-a[data-theme="light"] #uaCap .in .b { background: #0A7D6C; } html.chsg-web.ui-a[data-theme="light"] #uaCap .in .s { background: #C9372E; }
  html.chsg-web.ui-a #uaCap .in .q { background: var(--panel2); color: var(--hi); }
  html.chsg-web.ui-a #uaCap .q .u { display: flex; align-items: center; gap: 3px; font: 500 10.5px 'IBM Plex Sans KR', system-ui, sans-serif; color: var(--dim); }
  html.chsg-web.ui-a #uaCap.lock .in .b, html.chsg-web.ui-a #uaCap.lock .in .s { opacity: .5; }
  html.chsg-web.ui-a #uaCap .in .cf { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--acc); }
  html.chsg-web.ui-a #uaMsg { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); max-width: calc(100% - 24px); box-sizing: border-box; padding: 9px 12px;
    border-radius: 10px; background: var(--panel); box-shadow: 0 0 0 1px var(--line), 0 10px 28px rgba(0,0,0,.4); display: flex; align-items: center; gap: 10px;
    font: 500 12.5px 'IBM Plex Sans KR', system-ui, sans-serif; color: var(--text); white-space: nowrap; }
  html.chsg-web.ui-a #uaMsg[hidden] { display: none; }
  html.chsg-web.ui-a #uaMsg button { all: unset; cursor: pointer; padding: 4px 9px; border-radius: 6px; background: var(--acc); color: #fff; font-weight: 600; }
  /* 아래 탭: 고른 탭은 흰색(화이트 테마는 먹색) */
  html.chsg-web.ui-a #mTabs button.on { color: var(--hi); }
}
