/* Auto Trading — 회색 바탕 · 노란 포인트 · 도트 글꼴.
   글꼴은 아래 --font-* 세 줄(+ --bold)만 바꾸면 화면 전체가 바뀝니다.
   지금: 글자 = 둥근모꼴+ Fixedsys (김정태, 퍼블릭 도메인 — 글꼴 파일 판매만 금지)
         숫자 = PF스타더스트 3.0 (피나타, 무료·상업 사용 가능 / 수정·재배포 금지)
   'PFNum' 은 숫자와 숫자에 붙는 기호(. , % + - − $ : /)에만 쓰이도록 unicode-range 로 묶었습니다.
   그래서 글자 사이에 섞인 숫자도 자동으로 PF스타더스트가 됩니다.
   둥근모꼴은 굵기가 하나뿐이라 굵은 글자는 '도트 굵게'(오른쪽으로 1px 겹쳐 찍기, --bold)로 냅니다.
   숫자도 같은 방식으로 굵어지게 PF스타더스트 보통 굵기 파일 하나만 씁니다 (진짜 굵은 파일 + 도트 굵게가 겹치면 뭉개짐).
   ⚠ 둥근모꼴은 12px 에서 일부 글자가 깨짐('롱'이 '등'처럼 보임) → 작은 글자는 13px 이상(11px 은 괜찮음).
   굵기 규칙: 본문·설명·표 = 400 / 버튼·탭·제목·숫자 값 = 700 / 큰 숫자·맨 위 탭 = 800
   (전에 쓴 글꼴: 던파 비트비트체 v2 → PF스타더스트 3.0 → 둥근모꼴+) */
@font-face { font-family: 'PFNum'; font-weight: 100 900; font-display: swap;
  unicode-range: U+0024-0025, U+002B-003A, U+2212;
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2506-1@1.0/PFStardust.woff2') format('woff2'); }
@font-face { font-family: 'DungGeunMo'; font-weight: 400; font-display: swap;
  /* 같은 글꼴을 더 잘 압축되는 형식(woff2)으로만 바꿔 우리 서버에서 (1.6 MB → 0.8 MB, 글자 모양 같음 — tools/make_fonts.py) */
  src: url('/static/fonts/DungGeunMo.woff2') format('woff2'); }
/* 영어 글자(A–Z, a–z)만 갈무리11 — 둥근모꼴의 영어는 작은 크기에서 뭉개져 읽기 어려움 (2026-11-14 운영자 요청).
   맨 위 탭(OFFICE…)·큰 판정 글자(SHORT/LONG)는 --font-title 이라 그대로 둥근모꼴 */
@font-face { font-family: 'LatinUI'; font-weight: 100 900; font-display: swap;
  unicode-range: U+0041-005A, U+0061-007A; size-adjust: 82%;   /* 영어 대문자가 한글보다 커 보여서 한글 높이에 맞춤 */
  /* 갈무리11 에서 위 52자만 남긴 파일 (0.5 MB → 2 KB, 글자 모양 같음 — tools/make_fonts.py, OFL 예약 이름 규칙대로 이름은 LatinUI) */
  src: url('/static/fonts/LatinUI.woff2') format('woff2'); }
/* 둥근모에 없는 기호(▲ ▼ ⚠ ① 등)는 원래대로 갈무리 글꼴로 그림 — 그 기호만 떼어 낸 작은 파일을 먼저 (각 0.5 MB → 7~13 KB, 같은 글자).
   굵기는 갈무리 원본과 같게 (갈무리11 만 굵은 글씨 파일이 따로 있음). 여기에도 없는 드문 글자만 갈무리 전체를 받음 — tools/make_fonts.py */
@font-face { font-family: 'SymUI'; font-weight: 400; font-display: swap; src: url('/static/fonts/SymUI.woff2') format('woff2'); }
@font-face { font-family: 'SymUI'; font-weight: 700; font-display: swap; src: url('/static/fonts/SymUI-Bold.woff2') format('woff2'); }
@font-face { font-family: 'SymMono'; font-weight: 400; font-display: swap; src: url('/static/fonts/SymMono.woff2') format('woff2'); }
@font-face { font-family: 'SymTitle'; font-weight: 400; font-display: swap; src: url('/static/fonts/SymTitle.woff2') format('woff2'); }
/* 갈무리 전체 (예전 galmuri.css 의 같은 파일·같은 굵기) — 기호 범위(위 Sym* 가 이미 다 가짐)는 빼서, 갈무리에도 없는 기호(∓ ⏳ 등) 때문에
   0.5 MB 를 헛받지 않게. 둥근모·Sym* 에 없는 드문 글자(일본어 등)가 나올 때만 받음 */
@font-face { font-family: 'Galmuri11'; font-weight: 400; font-display: swap; unicode-range: U+0000-009F, U+0250-1FFF, U+2C00-2FFF, U+3040-FEFF, U+FFF0-10FFFF;
  src: local('Galmuri11 Regular'), url('https://cdn.jsdelivr.net/npm/galmuri@2.40.3/dist/Galmuri11.woff2') format('woff2'); }
@font-face { font-family: 'Galmuri11'; font-weight: 700; font-display: swap; unicode-range: U+0000-009F, U+0250-1FFF, U+2C00-2FFF, U+3040-FEFF, U+FFF0-10FFFF;
  src: local('Galmuri11 Bold'), url('https://cdn.jsdelivr.net/npm/galmuri@2.40.3/dist/Galmuri11-Bold.woff2') format('woff2'); }
@font-face { font-family: 'GalmuriMono11'; font-weight: 400; font-display: swap; unicode-range: U+0000-009F, U+0250-1FFF, U+2C00-2FFF, U+3040-FEFF, U+FFF0-10FFFF;
  src: local('GalmuriMono11 Regular'), url('https://cdn.jsdelivr.net/npm/galmuri@2.40.3/dist/GalmuriMono11.woff2') format('woff2'); }
@font-face { font-family: 'Galmuri14'; font-weight: 400; font-display: swap; unicode-range: U+0000-009F, U+0250-1FFF, U+2C00-2FFF, U+3040-FEFF, U+FFF0-10FFFF;
  src: local('Galmuri14 Regular'), url('https://cdn.jsdelivr.net/npm/galmuri@2.40.3/dist/Galmuri14.woff2') format('woff2'); }

:root {
  --font-ui: 'PFNum', 'LatinUI', 'DungGeunMo', 'SymUI', 'Galmuri11', 'Malgun Gothic', sans-serif;
  --font-title: 'PFNum', 'DungGeunMo', 'SymTitle', 'Galmuri14', sans-serif;
  --font-num: 'PFNum', 'LatinUI', 'DungGeunMo', 'SymMono', 'GalmuriMono11', monospace;
  --bold: 1px 0 0 currentColor;     /* 700 굵기 */
  --bold-x: 1px 0 0 currentColor;   /* 800 굵기 */
  /* 색: 거래소 앱의 회색·노랑 느낌을 참고하되 값은 모두 직접 조금씩 바꾼 것 */
  --bg: #17191f; --panel: #1d2228; --panel2: #262c34; --deep: #121418; --line: #2c323a;
  --text: #e9ebef; --muted: #868f9b; --yellow: #f1bb14; --yellow2: #f7cf3c; --ink: #1c1604;
  --green: #12c784; --red: #f3495f; --blue: #4f9ff0; --green-bg: rgba(18, 199, 132, .14); --red-bg: rgba(243, 73, 95, .14);
  --floor: #4b5058; --floor2: #555a62; --grout: #3d4148; --sill: #8d949e; --radius: 6px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--font-ui); font-weight: 400; text-shadow: none; font-size: 14px; line-height: 1.5; letter-spacing: .3px; -webkit-font-smoothing: none; font-synthesis: none; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--yellow); }
b, strong { font-weight: 700; text-shadow: var(--bold); }
main { max-width: 560px; margin: 0 auto; padding: 0 12px 40px; }
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 10px 12px 12px; max-width: 560px; margin: 0 auto; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.u { text-decoration: underline dotted; text-underline-offset: 3px; }
.num, .big-num { font-family: var(--font-num); }
.big-num { font-size: 22px; font-weight: 800; text-shadow: var(--bold-x); color: var(--yellow); }
.up { color: var(--green); } .down { color: var(--red); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- 박스·버튼 */
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.box.danger { background: #241a1e; border-color: #5c2a33; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.panel > * + *, .col > * + *, .grp > * + * { margin-top: 10px; }
.btn { min-height: 44px; padding: 0 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius);
       font-weight: 700; text-shadow: var(--bold); cursor: pointer; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--yellow2); color: var(--ink); border-color: var(--yellow2); }
.btn.go { background: var(--yellow2); color: var(--ink); border-color: var(--yellow2); margin-left: auto; }
.btn.red { background: var(--red); color: #fff; border-color: var(--red); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button { min-height: 36px; min-width: 44px; padding: 0 10px; background: var(--panel2); border: 1px solid transparent;
              border-radius: 4px; color: var(--muted); font-weight: 700; text-shadow: var(--bold); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--yellow2); color: var(--ink); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 13px; letter-spacing: .3px; font-weight: 700; text-shadow: var(--bold); color: var(--muted);
         background: var(--panel2); }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.warn { background: rgba(241, 187, 20, .14); color: var(--yellow); }
.badge.err, .badge.live { background: var(--red-bg); color: var(--red); }
.badge.mode { background: rgba(79, 159, 240, .14); color: var(--blue); }
.badge.long { background: var(--green-bg); color: var(--green); }
.badge.short { background: var(--red-bg); color: var(--red); }
.badge.sample { background: rgba(160, 120, 240, .16); color: #c3a9ff; }

/* ---- 맨 위 탭 */
.tabs { display: grid; grid-template-columns: 1fr 1fr 1fr 48px 48px; gap: 6px; }
.tab { min-height: 44px; display: flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap;
       background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
       font-family: var(--font-title); font-size: 20px; font-weight: 800; text-shadow: var(--bold-x); letter-spacing: 1px; }
.tab .short { display: none; }
@media (max-width: 520px) { .tab { font-size: 16px; letter-spacing: 0; } .tab .long { display: none; } .tab .short { display: inline; } }
@media (max-width: 400px) { .tabs { gap: 4px; } .tab { font-size: 15px; } }   /* 아이콘 탭 2개가 생겨 'TRAINING' 이 꽉 차지 않게 */
.tab.icon { color: var(--yellow); }
.tab.icon svg { display: block; }
.tab.icon:hover { border-color: var(--yellow); }
/* 게임 같은 빨간 점: 엔진 정지·긴급(진한 빨강, 깜빡) 또는 새 경고 */
.tab.icon { position: relative; }
.red-dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--red);
           border: 2px solid var(--bg); }
.alert-now { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 4px; background: #241a1e; border: 1px solid #5c2a33; }
.alert-now.lv-WARN { background: #262114; border-color: #5c4c1c; }
.alert-now b { color: var(--red); } .alert-now.lv-WARN b { color: var(--yellow); }
.alert-ok { color: var(--green); font-weight: 700; text-shadow: var(--bold); }
.log.new { position: relative; padding-left: 12px; }
.log.new::before { content: ''; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.tab[aria-current="page"] { background: var(--yellow2); color: var(--ink); border-color: var(--yellow2); }
.strip { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }
/* 맨 위 엔진 표시: 짧은 글자 + 작은 여백 */
.badge.mini { padding: 0 6px; font-size: 13px; line-height: 22px; white-space: nowrap; }
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.subtabs button { min-height: 44px; padding: 0 14px; background: none; border: 0; border-bottom: 3px solid transparent;
                  color: var(--muted); font-weight: 700; text-shadow: var(--bold); cursor: pointer; }
.subtabs button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--yellow); }
.sec { font-size: 16.5px; font-weight: 700; text-shadow: var(--bold); margin: 16px 0 6px; }
.sec.first { margin-top: 0; }
.sec small { font-weight: 400; text-shadow: none; color: var(--muted); font-size: 13px; margin-left: 6px; }

/* ---- 로그인 */
.login { position: fixed; inset: 0; background: #07090e; overflow: hidden; }
.crt { position: absolute; inset: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 16px; background: #080b16; }
.login-bg { position: absolute; left: 0; top: 0; z-index: 0; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.login-bg.moving { will-change: transform; }
.login-bg.src { visibility: hidden; }              /* 휜 CRT 화면(WebGL)을 쓸 때: 겹들은 그림 재료로만 */
.login-bg.login-gl { image-rendering: auto; }
.login-bg.moving.hires { image-rendering: auto; }   /* 컴퓨터: 고해상도 겹은 1px 보다 잘게 움직일 때 부드럽게 섞음 */
/* 주사선 (가로 줄무늬) + 아주 약한 깜빡임 */

/* 가장자리 어둡게 + 가운데 상자 둘레 조금 어둡게 (글이 잘 보이게) */
.crt::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;     /* 가운데 로그인 상자 둘레만 살짝 어둡게 (글이 잘 보이게) */
              background: radial-gradient(ellipse 34% 30% at center, rgba(8, 10, 16, .55), rgba(8, 10, 16, 0) 100%); }
.login-box { position: relative; z-index: 4; background: rgba(26, 30, 38, .9); border: 1px solid rgba(241, 187, 20, .35);
             box-shadow: 0 8px 30px rgba(0, 0, 0, .5), 0 0 18px rgba(241, 187, 20, .08); }
.login-box .brand { text-shadow: var(--bold-x), 0 0 8px rgba(241, 187, 20, .55), -1px 0 rgba(255, 70, 90, .35), 1px 0 rgba(90, 220, 255, .3); }
/* 로그인 로고: 큰 도트 글자 두 줄. TRADING 은 아래쪽이 초록·노랑·빨강 띠로 끊겨 내려가는 레트로 게임 타이틀 느낌.
   줄 높이를 글자 높이에 딱 맞춰(0.66em) 줄무늬가 글자 안에서 정확한 높이에 오게 함 */
.logo { margin: 6px 0 0; font-family: var(--font-title); font-weight: 800; letter-spacing: 3px; display: flex; flex-direction: column;
        filter: drop-shadow(0 0 7px rgba(241, 187, 20, .28)); }   /* 빛은 로고 전체에 한 번 (줄무늬 사이로 빛 띠가 생기지 않게) */
.logo-a, .logo-t { display: block; font-size: 47px; line-height: .66; }
.logo-t { margin-top: .14em; }
.logo-a { color: var(--yellow); }
/* TRADING: 띠 무늬는 SVG 글자에 칠함 (아이폰 Safari 에서 글자 끝이 잘리는 문제 피함). 높이 = 글자 높이(0.66em) */
.logo-t { width: 100%; height: .66em; overflow: visible; }
.logo-t text { font-family: inherit; font-weight: inherit; letter-spacing: inherit; font-size: 47px; }
.logo-sub { margin: 6px 0 10px; color: var(--muted); letter-spacing: 1px; font-size: 17px; }
.en-label, .en-btn { font-family: var(--font-title); letter-spacing: 2px; }
.en-label { font-size: 16px; color: var(--text); }
.en-btn { font-size: 16px; }
/* 비밀번호 칸과 로그인 버튼: 폭·양 끝을 똑같이 맞추고, 사이를 조금 더 띄움. 선택 표시는 칸 안쪽으로만 (밖으로 삐져나오지 않게) */
.login-box input, .login-box .en-btn { width: 100%; box-sizing: border-box; margin: 0; }
.login-box input { outline: none; }
.login-box input:focus { border-color: var(--yellow); box-shadow: inset 0 0 0 1px var(--yellow); }
.login-box .en-btn { margin-top: 10px; }
/* 휴대폰: 로그인 상자를 통째로 85% 크기로 (글자·칸·버튼 비율 그대로, 배경 건물이 더 보이게) */
@media (max-width: 899px) { .login-box { transform: scale(.85); } }
/* 옛 CRT 게임 화면 효과 — 배경·로그인 상자 위에 얇게 겹치는 층 (누르기는 통과)
   ① 주사선: 3px 마다 아래 1줄 어둡게 (배경 그림 1점 = 3px 와 맞음)  ② RGB 형광점: 빨강·초록·파랑 세로 줄 아주 옅게
   ③ 가장자리로 갈수록 어둡게 + 안쪽 그림자 (볼록한 유리 느낌)  ④ 왼쪽 위 유리 반사  ⑤ 아주 약한 깜빡임  ⑥ 천천히 내려가는 밝은 띠 */
.crt-fx { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden;
          box-shadow: inset 0 0 70px rgba(0, 0, 0, .55), inset 0 0 14px rgba(0, 0, 0, .6); }
.crt-fx::before { content: ''; position: absolute; inset: 0;
                  background:
                    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, .26) 2px, rgba(0, 0, 0, .26) 3px),
                    repeating-linear-gradient(to right, rgba(255, 40, 70, .05) 0, rgba(255, 40, 70, .05) 1px,
                                              rgba(40, 255, 120, .04) 1px, rgba(40, 255, 120, .04) 2px,
                                              rgba(60, 120, 255, .05) 2px, rgba(60, 120, 255, .05) 3px); }
.crt-fx::after { content: ''; position: absolute; inset: 0;
                 background:
                   radial-gradient(ellipse 70% 45% at 28% 12%, rgba(255, 255, 255, .055), rgba(255, 255, 255, 0) 70%),
                   radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .42) 100%);
                 animation: crt-flicker 3.2s steps(1) infinite; }
.crt-roll { position: absolute; left: 0; right: 0; top: -30%; height: 30%;
            background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(200, 230, 255, .035) 50%, rgba(255, 255, 255, 0));
            animation: crt-roll 9s linear infinite; }
@keyframes crt-flicker { 0% { opacity: 1; } 31% { opacity: .9; } 33% { opacity: 1; } 71% { opacity: .94; } 72% { opacity: 1; } }
@keyframes crt-roll { from { transform: translateY(0); } to { transform: translateY(440%); } }
@media (prefers-reduced-motion: reduce) { .crt-fx::after, .crt-roll { animation: none; } .crt-roll { display: none; } }
/* 컴퓨터(넓은 화면): 화면 전체가 아니라 노란 테두리의 CRT 화면 안에만 */
.crt-frame { display: none; }
@media (min-width: 900px) {
  /* 옛 CRT 모니터처럼 네 변이 살짝 볼록한 노란 테두리 (SVG). 테두리 바깥은 검게 덮음 */
  .crt { inset: 8vh 7vw; overflow: visible; background: none; }
  .crt-frame { display: block; position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; overflow: visible; }   /* 테두리는 화면 효과 위 */
  .crt-mask { fill: #07090e; }
  .crt-glow { fill: none; stroke: rgba(241, 187, 20, .22); stroke-width: 10px; vector-effect: non-scaling-stroke; }
  /* 노란 테두리 빛: 'AUTO TRADING' 글자처럼 은은하게 번지는 빛 */
  .crt-lines { filter: drop-shadow(0 0 3px rgba(241, 187, 20, .75)) drop-shadow(0 0 12px rgba(241, 187, 20, .35)); }
  .crt-line { fill: none; stroke: var(--yellow); stroke-width: 4px; vector-effect: non-scaling-stroke; }

}
.login-box { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 8px; }
.brand { font-family: var(--font-title); font-size: 24px; font-weight: 800; text-shadow: var(--bold-x); color: var(--yellow); margin: 0; letter-spacing: 2px; }
.login-box input, .ask input, .stop-in { min-height: 44px; padding: 0 10px; background: var(--panel2); border: 1px solid var(--line);
       border-radius: var(--radius); }
.msg { min-height: 1.5em; color: var(--red); margin: 0; }
.msg.up { color: var(--green); } .msg.muted { color: var(--muted); }

/* ---- 차트 (실시간 · 확대/축소 · 끌어서 이동 · 십자선) */
.chart-box { padding: 8px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.chart { position: relative; }
.pxc-head { display: flex; gap: 8px; flex-wrap: wrap; font-family: var(--font-num); font-size: 13px; min-height: 18px; padding: 0 2px 4px; }
/* 손가락: 차트 안에서는 상하좌우 끌기·두 손가락 모두 차트가 받음 (컴퓨터와 같게). 페이지 스크롤은 차트 밖을 밀어서 */
.pxc-wrap { position: relative; overflow: hidden; background: var(--deep); border-radius: 4px; touch-action: none; cursor: crosshair;
            user-select: none; -webkit-user-select: none; }
.pxc-tools { display: flex; gap: 4px; align-items: center; justify-content: flex-end; padding-top: 6px; }
.pxc-tools button { min-width: 40px; min-height: 36px; background: var(--panel2); border: 0; border-radius: 4px;
                    font-weight: 800; text-shadow: var(--bold-x); font-size: 16px; cursor: pointer; }
.pxc-tools button.auto { font-size: 14px; color: var(--muted); }
.pxc-tools button.auto.on { color: var(--yellow); }                 /* 가격 자동 맞춤 켜짐 */
.pxc-live { margin-right: auto; font-size: 13px; letter-spacing: .5px; font-weight: 700; text-shadow: var(--bold); color: var(--muted); }
.pxc-live.on { color: var(--green); }
.px-canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.px-lines { position: absolute; left: 0; top: 0; pointer-events: none; }
.px-axisgrab { position: absolute; right: 0; top: 0; bottom: 16px; width: 64px; touch-action: none; cursor: ns-resize; }
.px-spark { display: block; border-radius: 4px; }
.px-overlay { position: absolute; inset: 0; pointer-events: none; }
.px-label { position: absolute; font-family: var(--font-num); font-size: 13px; letter-spacing: .3px; line-height: 14px; padding: 0 4px; white-space: nowrap; }
.px-label.ax { right: 0; text-align: right; color: var(--muted); }
.px-label.tag { background: rgba(18, 20, 24, .88); font-weight: 700; text-shadow: var(--bold); }
.px-label.k-stop { color: #ff8e9c; } .px-label.k-exit { color: #8cc2ff; } .px-label.k-entry { color: var(--text); }
.px-label.k-target { color: #6fe3b2; } .px-label.k-level { color: var(--muted); }
.px-label.k-last { color: #fff; font-weight: 700; text-shadow: var(--bold); }
.px-label.k-last.up { background: var(--green); } .px-label.k-last.down { background: var(--red); }
.px-label.k-cross { background: #5d6573; color: #fff; }
.px-time { position: absolute; bottom: 0; width: 60px; text-align: center; font-family: var(--font-num); font-size: 11px; letter-spacing: .3px;
           line-height: 16px; color: var(--muted); }
.px-time.cross { background: #5d6573; color: #fff; }
.px-msg { position: absolute; left: 8px; top: 8px; color: var(--muted); }

/* ---- 종목 칩 */
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chips-title { font-family: var(--font-ui); font-size: 16px; letter-spacing: .8px; font-weight: 800; text-shadow: var(--bold-x); color: var(--yellow); margin-right: 2px; }
.chips button { min-height: 40px; min-width: 52px; background: var(--panel2); border: 1px solid transparent; border-radius: 4px;
                font-weight: 700; text-shadow: var(--bold); color: var(--muted); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--yellow2); color: var(--ink); }
.chips button.add { min-width: 44px; color: var(--yellow); border: 1px dashed var(--yellow); background: none; }
.row-wrap { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---- 픽셀 오피스 */
/* 바닥: 금융가 사무실 느낌의 회색 석재 타일 (줄눈 + 두 가지 톤 체크) */
.office { --wall-h: 76px; position: relative; height: 640px; background-color: var(--floor); border: 1px solid var(--line); border-radius: var(--radius);
          overflow: hidden;
          background-image: linear-gradient(var(--grout) 2px, transparent 2px),
                            linear-gradient(90deg, var(--grout) 2px, transparent 2px),
                            conic-gradient(var(--floor2) 25%, transparent 0 50%, var(--floor2) 0 75%, transparent 0);
          background-size: 36px 36px, 36px 36px, 72px 72px;
          background-position: 0 var(--wall-h), 0 var(--wall-h), 0 var(--wall-h); }
/* 통유리 창: 풍경은 sky.js 가 캔버스에 그림 (시간·날씨·계절). 창틀 기둥·창턱은 아래 CSS */
.office .wall { position: absolute; left: 0; top: 0; right: 0; height: var(--wall-h); background: #26324f; overflow: hidden;
                border-bottom: 3px solid var(--sill); }
.office .wall canvas.sky { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.office .wall::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
                        background-image: linear-gradient(90deg, #6b727d 3px, transparent 3px), linear-gradient(#6b727d 2px, transparent 2px);
                        background-size: 120px 100%, 100% 40px; background-position: 0 0, 0 -2px; }
.office .wall::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #6b727d; z-index: 1; }
/* 팀별 카펫 구역 */
.office .zone { position: absolute; background: rgba(28, 33, 42, .30); border: 1px solid rgba(255, 255, 255, .07); border-radius: 2px; }
/* 트레이딩 본부: 창문 앞 가운데에 붙은 별도 방 — 양옆·아래는 회색 벽, 창 쪽은 벽 없음 · 금빛 카펫 · 아래 벽 가운데 문 */
.office .zone.hq { border: 4px solid #8d949e; border-top: 0; border-radius: 0 0 3px 3px;   /* 위쪽은 창문과 맞닿아 벽 없음 */
                   background-color: rgba(78, 60, 22, .5);
                   background-image: linear-gradient(45deg, rgba(247, 207, 60, .07) 25%, transparent 25% 75%, rgba(247, 207, 60, .07) 75%);
                   background-size: 12px 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 3px 0 rgba(0, 0, 0, .3); }
.office .zone.hq::after { content: ''; position: absolute; bottom: -4px; left: 44%; width: 12%; height: 4px; background: var(--floor2); }
.office .zone.hq::before { content: ''; position: absolute; bottom: -4px; left: calc(44% - 3px); width: 3px; height: 12px; background: #6b727d; }
.office .room { position: absolute; background: var(--bg); color: var(--yellow); border: 1px solid var(--yellow); border-radius: 3px;
                font-size: 13px; font-weight: 700; text-shadow: var(--bold); padding: 0 6px; white-space: nowrap; z-index: 1; }
.office .room.hq { background: #2a2418; z-index: 2; transform: translateX(-50%); }   /* 방 위쪽 벽 가운데 이름표 */
.office .live { position: absolute; right: 8px; top: 6px; z-index: 3; background: var(--bg); border-radius: 3px; padding: 0 8px; font-size: 13px; font-weight: 700; text-shadow: var(--bold); }
.agent { position: absolute; width: 104px; margin-left: -52px; display: flex; flex-direction: column; align-items: center;
         gap: 2px; background: none; border: 0; padding: 0; cursor: pointer; }
.agent .name { font-size: 13px; letter-spacing: .6px; font-weight: 700; text-shadow: var(--bold); line-height: 1; color: var(--yellow); background: var(--bg); padding: 2px 4px; border-radius: 2px; }
.agent:hover .spr, .agent:focus-visible .spr { transform: translateY(-2px); }
.agent.speaking .name { background: var(--yellow2); color: var(--ink); }

/* 직원 그림 (sprites.js): 바탕(원본) · 숨쉬는 상체 · 가슴 · 얼굴(입·눈) 층을 겹쳐 그림. 칸 아래 끝 = 책상 아래 끝 */
.spr-img { position: relative; display: block; width: 90px; }
.spr-img .spr-inner { position: absolute; left: 0; bottom: 0; }
.spr-img canvas { position: absolute; }
.spr-img .spr-face { position: absolute; left: 0; top: 0; }
/* 숨쉬기·가슴 출렁임: sprites.js 가 화면 점 단위로 미리 그린 그림을 바꿔 끼움 (CSS 애니메이션 아님 — 흐려지지 않게) */
.spr .spr-breath { image-rendering: pixelated; }
/* 눈 깜빡임: 깜빡일 때만 sprites.js 가 b-half → b-closed → b-half 를 잠깐 붙임 (사람마다 9~24초 아무 때나) */
.spr .spr-blink canvas { opacity: 0; }
.spr .spr-blink.b-half canvas.half, .spr .spr-blink.b-closed canvas.closed { opacity: 1; }
/* 말하기: 말하는 동안 입이 열렸다 닫혔다 (불규칙하게) */
.spr .spr-mouth { opacity: 0; transform-origin: 50% 40%; }
.agent.speaking .spr-mouth { animation: px-talk 1.1s steps(1) infinite; }
@keyframes px-talk {
  0% { opacity: 1; transform: scaleY(1); } 14% { opacity: 1; transform: scaleY(.55); } 24% { opacity: 0; }
  36% { opacity: 1; transform: scaleY(1); } 50% { opacity: 0; } 58% { opacity: 1; transform: scaleY(.6); }
  70% { opacity: 1; transform: scaleY(1); } 82% { opacity: 0; } 90% { opacity: 1; transform: scaleY(.55); }
}
@media (prefers-reduced-motion: reduce) {
  .agent.speaking .spr-mouth { animation: none; }   /* 숨쉬기·가슴은 sprites.js 타이머가 "동작 줄이기"면 멈춤 */
}
.bubble { position: absolute; max-width: 46%; background: #fff; color: #1a1630; border: 2px solid #1a1630; border-radius: 4px;
          font-size: 13px; padding: 2px 6px; z-index: 4; pointer-events: none; }
/* 말풍선 꼬리: 테두리색 삼각형 위에 흰 삼각형을 겹쳐 그림. --tail = 말하는 직원 쪽 가로 위치 */
.bubble::before, .bubble::after, .detail-pop::before, .detail-pop::after {
  content: ''; position: absolute; left: var(--tail, 50%); width: 0; height: 0; border-style: solid; border-color: transparent; transform: translateX(-50%); }
.bubble::before { top: calc(100% + 2px); border-width: 9px 7px 0; border-top-color: #1a1630; }
.bubble::after  { top: 100%; border-width: 8px 5px 0; border-top-color: #fff; }
.bubble.below::before, .detail-pop::before { top: auto; bottom: calc(100% + 2px); border-width: 0 7px 9px; border-top-color: transparent; border-bottom-color: #1a1630; }
.bubble.below::after, .detail-pop::after   { top: auto; bottom: 100%; border-width: 0 5px 8px; border-top-color: transparent; border-bottom-color: #fff; }
.meeting-line { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* ---- 콘솔 */
.console { background: var(--deep); }
.console-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.console-head .title { font-family: var(--font-ui); font-size: 16px; letter-spacing: .8px; font-weight: 800; text-shadow: var(--bold-x); color: var(--yellow); }
.console-body { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; max-height: 360px; overflow-y: auto; }
.stage { text-align: center; color: var(--green); font-size: 14px; font-weight: 700; text-shadow: var(--bold); margin: 4px 0 0; }
.console { position: relative; }
.line { display: flex; gap: 6px; align-items: flex-start; margin: 0; width: 100%; text-align: left; background: none; border: 0; border-radius: 3px;
        padding: 1px 2px; color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer; }
.line:hover .txt, .line.open .txt { color: var(--yellow); }
.line:focus-visible { outline: 2px solid var(--yellow); outline-offset: 1px; }
/* 콘솔 발언 '자세히' 작은 창 — 오피스 말풍선과 같은 흰 바탕·검은 테두리·꼬리 */
.detail-pop { position: absolute; z-index: 5; width: min(380px, calc(100% - 20px)); background: #fff; color: #1a1630;
              border: 2px solid #1a1630; border-radius: 4px; padding: 8px 10px 10px; box-shadow: 3px 3px 0 rgba(0, 0, 0, .45); }
.detail-pop.up::before { bottom: auto; top: calc(100% + 2px); border-width: 9px 7px 0; border-bottom-color: transparent; border-top-color: #1a1630; }
.detail-pop.up::after  { bottom: auto; top: 100%; border-width: 8px 5px 0; border-bottom-color: transparent; border-top-color: #fff; }
.detail-pop .head { display: flex; align-items: center; gap: 6px; }
.detail-pop .role { flex: 1; font-size: 12.5px; color: #555a6e; }
.detail-pop .x { background: none; border: 0; color: #1a1630; font-size: 18px; line-height: 1; padding: 0 4px; cursor: pointer; }
.detail-pop .body { margin: 6px 0 0; font-size: 14px; line-height: 1.6; white-space: pre-line; overflow-y: auto; overscroll-behavior: contain; }
.detail-pop .muted { color: #666b7e; margin: 4px 0 0; }
.tag { flex: none; min-width: 60px; text-align: center; font-size: 13px; letter-spacing: .5px; font-weight: 700; text-shadow: var(--bold); padding: 2px 4px; border-radius: 3px; color: #1a1630; }
.ask { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.ask-row { display: flex; gap: 6px; }
.ask-row input { flex: 1; min-width: 0; }

/* ---- 판정 줄 */
.verdict { display: grid; grid-template-columns: minmax(84px, auto) repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; background: var(--deep); }
.verdict .vd-head { min-width: 0; }
.verdict .conf { font-size: 13px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
/* 판정 아랫줄 (전체 폭): 결정 표시 + 이유 + 실행 정보 — 좁은 왼쪽 칸에 구겨 넣지 않음 */
.verdict-note { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px;
                border-top: 1px solid var(--line); padding-top: 7px; margin-top: 2px; min-width: 0; }
.verdict-note .bits { color: var(--muted); }
.verdict-note .vd-exec { flex-basis: 100%; color: var(--text); }
/* ' · ' 로 이은 짧은 정보 조각 — 조각 안에서는 줄이 안 바뀜 */
.bits { display: inline-flex; flex-wrap: wrap; align-items: center; min-width: 0; }
.bits .bit { white-space: nowrap; }
.bits > * + *::before { content: '·'; margin: 0 6px; color: var(--muted); }
.verdict .dir { font-family: var(--font-title); font-weight: 800; text-shadow: var(--bold-x); font-size: 26px; line-height: 1; }
.cell { background: var(--panel); border-radius: 4px; padding: 4px 8px; }
.cell .k { font-size: 13px; color: var(--muted); }
.cell .v { font-family: var(--font-num); font-weight: 700; text-shadow: var(--bold); font-size: 15px; }

/* ---- 숫자 카드 */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.stat.hl { border-color: var(--yellow); }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-family: var(--font-num); font-weight: 700; text-shadow: var(--bold); font-size: 18px; line-height: 1.3; }
.stat .s { font-size: 13px; color: var(--muted); }
.hero .v { font-family: var(--font-title); font-weight: 800; text-shadow: var(--bold-x); font-size: 40px; color: var(--text); line-height: 1.1; }
.hero .row { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); }
.posline { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.posline .right { margin-left: auto; }

/* ---- 포지션 카드 */
.pos { display: flex; flex-direction: column; gap: 8px; }
.pos .head { display: flex; align-items: flex-start; gap: 8px; }
.pos .head-l { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; min-height: 36px; }
.pos .who { font-family: var(--font-title); font-weight: 800; text-shadow: var(--bold-x); font-size: 15.5px; color: var(--yellow); }
.pos .pnl { font-family: var(--font-title); font-weight: 800; text-shadow: var(--bold-x); font-size: 30px; line-height: 1; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.kv .k { font-size: 13px; color: var(--muted); }
.kv .v { font-family: var(--font-num); font-weight: 700; text-shadow: var(--bold); font-size: 15px; }
/* 포지션 카드 오른쪽 위 '포지션 종료' 버튼 */
.pos-close { flex: none; min-height: 30px; padding: 0 9px; font-size: 13px; background: var(--red-bg); color: var(--red); border: 1px solid var(--red);
             border-radius: 4px; font-weight: 700; text-shadow: var(--bold); white-space: nowrap; cursor: pointer; }
.pos-close:hover:not(:disabled) { background: var(--red); color: #fff; }
.pos-close:disabled { opacity: .5; cursor: not-allowed; }
.changes { border-top: 1px solid var(--line); padding-top: 6px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.changes .c { display: flex; gap: 6px; }
.changes .c .t { color: var(--muted); flex: none; }

/* ---- 손절 설정 */
.stop-box { border-color: var(--yellow); display: flex; flex-direction: column; gap: 10px; }
.stop-in { font-family: var(--font-num); font-weight: 700; text-shadow: var(--bold); font-size: 20px; color: var(--yellow); width: 100%; }
.preview { background: var(--deep); border-radius: 4px; padding: 8px; }
.preview .r { display: flex; justify-content: space-between; gap: 8px; }
.rules { margin: 0; padding-left: 18px; font-size: 13px; color: #c3c8d2; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }

/* ---- 목록 (거래·로그) */
.list { display: flex; flex-direction: column; gap: 6px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; display: grid;
        grid-template-columns: auto 1fr auto; gap: 4px 8px; align-items: center; }
.item .s { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.log { display: grid; grid-template-columns: 92px 48px minmax(0, 1fr); gap: 6px; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.log > span { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
#alerts-body { min-width: 0; overflow: hidden; }
.alert-more { align-self: center; }
.log .lv-WARN { color: var(--yellow); } .log .lv-ERROR { color: var(--red); } .log .lv-INFO { color: var(--muted); }
.alert { padding: 8px 10px; border-radius: var(--radius); border: 1px solid; }
.alert.err { background: var(--red-bg); border-color: var(--red); color: #ffd1d6; }
.alert.warn { background: rgba(241, 187, 20, .12); border-color: var(--yellow); color: #ffe7a8; }
.empty { color: var(--muted); }
.auto-view { order: 99; margin-left: auto; font-size: 13px; color: var(--muted); letter-spacing: .2px; white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; color: var(--yellow); font: inherit; letter-spacing: inherit; cursor: pointer; text-decoration: underline; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: 92vw; z-index: 40;
         background: var(--yellow2); color: var(--ink); border-radius: var(--radius); font-weight: 700; text-shadow: var(--bold); padding: 10px 14px; }
.toast.bad { background: #ff9fab; }

/* ================================================================ TRAINING (가상 선물 매매 · 클래스 이름은 ax- 그대로) */
.arcade > .subtabs { margin-bottom: 10px; }

/* ================================================================ OFFICE 회의록 */
.hist { display: flex; flex-direction: column; gap: 10px; }
.hist-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; padding-right: 2px; }
.hist-day { position: sticky; top: 0; z-index: 1; background: var(--bg); color: var(--yellow); font-size: 14px; font-weight: 700;
            text-shadow: var(--bold); padding: 6px 2px 2px; }
/* flex-shrink:0 — 목록 높이가 고정이라 회의가 많으면 칸이 눌려 둘째 줄이 아래 테두리에 잘리던 문제 */
.hist-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; width: 100%; text-align: left;
            background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 10px 10px; color: var(--text);
            font: inherit; letter-spacing: inherit; cursor: pointer; min-height: 44px; flex-shrink: 0; line-height: 1.35; }
.hist-day { flex-shrink: 0; }
.hist-row:hover { border-color: var(--muted); }
.hist-row[aria-current="true"] { border-color: var(--yellow); background: var(--panel2); }
.hist-row:focus-visible { outline: 2px solid var(--yellow); outline-offset: 1px; }
.hist-row .t { font-family: var(--font-num); font-weight: 700; text-shadow: var(--bold); }
.hist-row .k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-row .s { grid-column: 2 / -1; font-size: 12.5px; color: var(--muted); min-width: 0; }
.hist-row .badge { white-space: nowrap; }
.hist-main > * + * { margin-top: 10px; }
.hist-main .console-body { max-height: 520px; }
.hist-main .meeting-line { margin-top: 0; display: block; }
#hist-head .hh-title { font-weight: 700; text-shadow: var(--bold); color: var(--text); }
#hist-head .hh-sub { margin-top: 2px; font-size: 13px; color: var(--muted); }
@media (min-width: 900px) {
  .hist { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
  .hist-list { max-height: calc(100vh - 230px); }
  .hist-main .console-body { max-height: calc(100vh - 380px); min-height: 280px; }
}
.tc-form > * + * { margin-top: 10px; }
.tc-in { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 12px; background: var(--panel2);
         border: 1px solid var(--line); border-radius: var(--radius); }
.tc-in:focus-within { border-color: var(--yellow); }
.tc-in input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-family: var(--font-num); font-size: 22px;
               font-weight: 700; text-shadow: var(--bold); color: var(--text); }
.tc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-chips button { min-height: 40px; padding: 0 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px;
                   font-family: var(--font-num); font-weight: 700; text-shadow: var(--bold); cursor: pointer; }
.tc-chips button:active { background: var(--yellow2); color: var(--ink); }
.tc-form .msg.ok { color: var(--green); }
/* 기록: 거래 한 건 = 카드 한 장 */
.ax-his .h .grow { flex: 1; }
.ax-his .note, .ax-his-sum .note { font-size: 13px; color: var(--muted); }
.ax-his-sum { background: var(--panel2); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.ax-his-sum .k { font-size: 13px; color: var(--muted); }
.ax-his-sum .v { font-family: var(--font-num); font-weight: 700; text-shadow: var(--bold); font-size: 15px; }
.grid4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 600px) { .grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
#tc-equity { font-family: var(--font-num); }
.ax-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ax-sym { background: none; border: 0; padding: 0; min-height: 44px; font-size: 20px; font-weight: 800; text-shadow: var(--bold-x); cursor: pointer; }
#ax-sym-name { letter-spacing: 1.2px; }
.ax-perp { font-size: 13px; font-weight: 700; text-shadow: var(--bold); background: var(--panel2); border-radius: 3px; padding: 1px 5px; color: var(--muted); }
#ax-chg { font-weight: 700; text-shadow: var(--bold); }
.ax-arcade { margin-left: auto; font-size: 13px; font-weight: 700; text-shadow: var(--bold); color: var(--yellow); }
.ax-icon { min-width: 44px; min-height: 44px; background: none; border: 0; color: var(--text); cursor: pointer; }
.ax-menu { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.ax-menu button { min-height: 40px; padding: 0 12px; background: var(--panel2); border: 0; border-radius: 4px; font-weight: 700; text-shadow: var(--bold); cursor: pointer; }

.ax-grid { display: grid; grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); gap: 10px; align-items: start; }
.ax-chart { grid-column: 1 / -1; order: 3; padding: 8px; }
.ax-book { font-family: var(--font-num); font-size: 13px; }
.ax-fund { display: flex; flex-direction: column; font-size: 13px; margin-bottom: 6px; }
.ax-fund .num { font-size: 13px; font-weight: 700; text-shadow: var(--bold); color: var(--text); }
.ax-book-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); line-height: 1.3; margin-bottom: 4px; }
.ax-book-head .r { text-align: right; }
.ax-asks, .ax-bids { display: flex; flex-direction: column; }
.ax-lvl { position: relative; display: flex; justify-content: space-between; line-height: 22px; padding: 0 2px; cursor: pointer; }
.ax-lvl i { position: absolute; right: 0; top: 1px; bottom: 1px; }
.ax-asks .ax-lvl i { background: var(--red-bg); } .ax-bids .ax-lvl i { background: var(--green-bg); }
.ax-lvl span { position: relative; }
.ax-asks .ax-lvl .p { color: var(--red); } .ax-bids .ax-lvl .p { color: var(--green); }
.ax-mid { text-align: center; padding: 6px 0; }
.ax-mid #ax-last { font-size: 21px; font-weight: 800; text-shadow: var(--bold-x); }
.ax-mid #ax-mark { font-size: 13px; }
.ax-ratio { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; text-shadow: var(--bold); margin-top: 6px; }
.ax-ratio .bar { flex: 1; height: 6px; background: var(--red); border-radius: 2px; overflow: hidden; }
.ax-ratio .bar i { display: block; height: 100%; background: var(--green); }
.ax-tick select { margin-top: 6px; width: 100%; min-height: 36px; background: var(--panel2); border: 0; border-radius: 4px; padding: 0 8px; }

.ax-form { display: flex; flex-direction: column; gap: 8px; }
.ax-side { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel2); border-radius: var(--radius); }
.ax-side button { min-height: 40px; background: none; border: 0; border-radius: var(--radius); font-size: 16px; font-weight: 800; text-shadow: var(--bold-x); color: var(--muted); cursor: pointer; }
.ax-side .buy[aria-pressed="true"] { background: var(--green); color: #fff; }
.ax-side .sell[aria-pressed="true"] { background: var(--red); color: #fff; }
.ax-opts { display: grid; grid-template-columns: 1.4fr 1fr 0.7fr; gap: 6px; }
.ax-opts button { min-height: 40px; background: var(--panel2); border: 0; border-radius: var(--radius); font-weight: 700; text-shadow: var(--bold); cursor: pointer; }
.ax-select select { width: 100%; min-height: 40px; background: var(--panel2); border: 0; border-radius: var(--radius); text-align: center;
                    font-weight: 700; text-shadow: var(--bold); padding: 0 8px; }
.ax-row { display: flex; gap: 6px; }
.ax-in { flex: 1; min-width: 0; display: flex; align-items: center; background: var(--panel2); border-radius: var(--radius); }
.ax-in > button { min-width: 30px; min-height: 52px; background: none; border: 0; font-size: 18px; color: var(--muted); cursor: pointer; }
.ax-in label { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.ax-in label span { font-size: 12px; color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ax-in input { width: 100%; min-width: 0; text-align: center; background: none; border: 0; font-family: var(--font-num); font-size: 17px; font-weight: 700; text-shadow: var(--bold); padding: 0; }
.ax-in input:focus { outline: none; }
.ax-in:focus-within { outline: 1px solid var(--yellow); }
.ax-bbo, .ax-unit { min-width: 64px; background: var(--panel2); border: 0; border-radius: var(--radius); font-weight: 700; text-shadow: var(--bold); cursor: pointer; }
.ax-slider { position: relative; padding: 6px 4px; }
.ax-slider input { width: 100%; accent-color: var(--yellow2); }
.ax-dots { display: flex; justify-content: space-between; padding: 0 2px; pointer-events: none; }
.ax-dots i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid var(--muted); background: var(--bg); }
.ax-kv { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ax-kv.small { font-size: 13px; }
.ax-plus { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--yellow2); color: var(--ink); font-weight: 800; text-shadow: var(--bold-x); line-height: 1; cursor: pointer; }
.ax-check { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.ax-check input { width: 18px; height: 18px; accent-color: var(--yellow2); }
/* TP/SL: 입력칸 기본 너비(글자 20개쯤) 때문에 주문 칸 밖으로 넘치던 것 → 두 칸이 주문 칸 너비 안에서 반씩 */
.ax-tpsl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ax-tpsl label { min-width: 0; display: flex; flex-direction: column; background: var(--panel2); border-radius: var(--radius); padding: 4px 8px; font-size: 13px; color: var(--muted); }
.ax-tpsl label:focus-within { outline: 1px solid var(--yellow); }
.ax-tpsl input { width: 100%; min-width: 0; background: none; border: 0; outline: 0; font-family: var(--font-num); font-size: 15px; font-weight: 700; text-shadow: var(--bold); color: var(--text); padding: 2px 0; }
.ax-go { min-height: 48px; border: 0; border-radius: var(--radius); font-size: 17px; font-weight: 800; text-shadow: var(--bold-x); color: #fff; cursor: pointer; }
.ax-go.buy { background: var(--green); } .ax-go.sell { background: var(--red); }
.ax-go:disabled { opacity: .5; }

.ax-bottom { padding: 0; }
.ax-btabs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; border-bottom: 1px solid var(--line); padding: 0 8px; }
.ax-btabs button { min-height: 44px; padding: 0 10px; background: none; border: 0; border-bottom: 3px solid transparent;
                   color: var(--muted); font-size: 15px; font-weight: 700; text-shadow: var(--bold); cursor: pointer; }
.ax-btabs button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--yellow); }
.ax-btabs .grow { flex: 1; }
.ax-btabs button { white-space: nowrap; }
.ax-btabs > .small { white-space: nowrap; padding: 4px 0; }
.ax-blist { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.ax-pos { border-bottom: 1px solid var(--line); padding-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.ax-pos:last-child { border-bottom: 0; }
.ax-pos .h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; text-shadow: var(--bold); }
.ax-pos .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ax-pos .k { font-size: 13px; color: var(--muted); }
.ax-pos .v { font-family: var(--font-num); font-weight: 700; text-shadow: var(--bold); font-size: 14px; }
.ax-pos .pnl { font-family: var(--font-num); font-weight: 800; text-shadow: var(--bold-x); font-size: 20px; }
.ax-pos .acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ax-pos .acts button { min-height: 36px; background: var(--panel2); border: 0; border-radius: 4px; font-weight: 700; text-shadow: var(--bold); cursor: pointer; }
.ax-empty { text-align: center; color: var(--muted); padding: 18px 0; }
.ax-note { text-align: center; }

.ax-modal { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
.ax-sheet { width: 100%; max-width: 480px; border-radius: 12px 12px 0 0; padding: 16px; max-height: 90vh; overflow: auto; }
.ax-sheet h3 { margin: 0 0 12px; font-size: 18px; font-weight: 800; text-shadow: var(--bold-x); }
.ax-sheet .levbox { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-num); font-size: 26px; font-weight: 800; text-shadow: var(--bold-x); }
.ax-sheet .levbox button { width: 44px; height: 44px; background: var(--panel2); border: 0; border-radius: 4px; font-size: 20px; cursor: pointer; }
.ax-sheet input[type=range] { width: 100%; accent-color: var(--yellow2); margin: 12px 0; }
.ax-sheet .marks { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.ax-sheet .opt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ax-sheet .opt button[aria-pressed="true"] { outline: 2px solid var(--yellow2); }
.ax-sheet .form { display: flex; flex-direction: column; gap: 8px; }
.ax-sheet .form label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.ax-sheet .form input { min-height: 44px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius);
                        padding: 0 10px; font-family: var(--font-num); font-size: 16px; font-weight: 700; text-shadow: var(--bold); color: var(--text); }
.ask-modal { z-index: 40; align-items: center; }
.ask-modal .ax-sheet { border-radius: 12px; margin: 0 12px; }
#ask-text { color: var(--text); font-size: 14px; line-height: 1.6; white-space: pre-line; }

/* ---- 마이페이지 */
.me-accounts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 700px) { .me-accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.me-acc { display: flex; flex-direction: column; gap: 8px; }
.me-acc .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.me-acc .xch { font-family: var(--font-title); font-weight: 800; text-shadow: var(--bold-x); font-size: 13px; letter-spacing: 1px;
               text-transform: uppercase; color: var(--ink); background: var(--yellow2); border-radius: 3px; padding: 1px 8px; }
.me-acc .who { font-weight: 700; text-shadow: var(--bold); font-size: 15px; }
.me-acc .eq { font-family: var(--font-num); font-weight: 800; text-shadow: var(--bold-x); font-size: 28px; line-height: 1.1; }
.go-tab { display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--text); }
a.item.me-pos { text-decoration: none; color: var(--text); }
a.item.me-pos:hover { border-color: var(--yellow); }
.ax-sheet .foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.ax-sheet p { color: var(--muted); font-size: 13px; }

/* ================================================================ 화면 크기별 배치 */
/* Office: 좁은 화면(휴대폰 세로)에서는 두 칸을 풀어 차트 → 직원들 → 콘솔 → 판정·보유 포지션 순서로 쌓음 */
.cols { display: flex; flex-direction: column; gap: 10px; }
.col { min-width: 0; }
@media (max-width: 899.98px) {
  .cols > .col { display: contents; }
  .cols > .col > * + * { margin-top: 0; }
  .g-chart { order: 1; } .g-agents { order: 2; } .g-console { order: 3; } .g-pos { order: 4; }
}
.grp { min-width: 0; }
/* 휴대폰 좌우 밀기로 탭을 바꿨을 때 살짝 밀려 들어오는 느낌 */
.panel.swipe-l { animation: swipe-l .22s ease-out; } .panel.swipe-r { animation: swipe-r .22s ease-out; }
@keyframes swipe-l { from { opacity: .4; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes swipe-r { from { opacity: .4; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .panel.swipe-l, .panel.swipe-r { animation: none; } }
@media (min-width: 900px) {
  main, .top { max-width: 1280px; }
  .top { display: flex; align-items: center; gap: 12px; }
  .tabs { flex: 1; grid-template-columns: repeat(3, minmax(0, 220px)) 48px 48px; }
  .strip { margin-top: 0; }
  .cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .ax-sheet { border-radius: 12px; margin-bottom: 10vh; }
  .ax-modal { align-items: center; }
}
@media (min-width: 1100px) {
  .ax-grid { grid-template-columns: minmax(0, 1fr) 280px 330px; }
  .ax-chart { grid-column: auto; order: 0; }
}
