* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Noto Sans KR', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── 헤더 ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 10, 17, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.header-in {
  /* 브랜드를 화면 왼쪽 끝에 — 가운데 정렬 컨테이너 제거(CEO) */
  max-width: none;
  margin: 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-title .logo-mark { width: 36px; height: 24px; flex-shrink: 0; }

.header-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.segmented-btn {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
}

.segmented-btn button {
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 4px;
}

.segmented-btn button.active {
  background: var(--surface2);
  color: var(--gold);
}

.segmented-btn button:hover:not(.active) {
  color: var(--fg);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.toggle-switch input[type="checkbox"] {
  width: 40px;
  height: 24px;
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: background 0.3s;
}

.toggle-switch input[type="checkbox"]::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--fg);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left 0.3s;
}

.toggle-switch input[type="checkbox"]:checked {
  background: var(--long);
}

.toggle-switch input[type="checkbox"]:checked::after {
  left: 20px;
}

.lang-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* ── 레이아웃 ── */
.console {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 200px;
  background: rgba(20, 24, 38, 0.5);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  overflow-y: auto;
  position: fixed;
  height: calc(100vh - 64px - 32px);  /* 하단 위험고지 푸터 공간 */
  left: 0;
  top: 64px;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu li {
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--fg);
  transition: color 0.2s;
  cursor: pointer;
}
.sidebar-menu .nav-ico { width: 16px; height: 16px; flex-shrink: 0; opacity: .9; }

.sidebar-menu li.active {
  border-left-color: var(--gold);
}

.sidebar-menu li.active a {
  color: var(--fg);
  font-weight: 600;
}

.sidebar-menu a:hover {
  color: var(--gold-soft, #f0ce96);
}

.sidebar-logout {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
}

.sidebar-logout button {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-logout button:hover {
  background: rgba(255, 96, 125, 0.1);
  color: var(--short);
  border-color: var(--short);
}

.main {
  margin-left: 200px;
  flex: 1;
  padding: 16px 32px 50px;  /* 상단 당김 + 하단 마퀴 푸터 자리 */
  max-width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;   /* 회사정보 푸터를 바닥에 고정(margin-top:auto) */
}
/* 화면 컨테이너는 flex 항목 — 콘텐츠 길면 늘고, 짧으면 푸터를 아래로 민다 */
.main > .screen.active { flex: 0 0 auto; }

/* ── 로그인 ── */
/* ── 로그인 (중앙 카드 · 2단 분할 · 우주·금색) ── */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(70% 55% at 50% -5%, rgba(224, 177, 94, .07), transparent 60%),
    var(--bg);
}
.auth-lang {
  position: absolute; top: 16px; right: 18px; z-index: 5;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); background: rgba(255,255,255,.04);
  border: 1px solid var(--border); border-radius: 20px; cursor: pointer;
}
.auth-lang:hover { color: var(--gold); border-color: rgba(224,177,94,.4); }
.auth-card {
  position: relative;
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

/* 좌: 브랜드 소개 패널 */
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  padding: 52px clamp(30px, 3.2vw, 50px);
  border-right: 1px solid var(--border);
  background:
    radial-gradient(120% 85% at 12% 8%, rgba(224, 177, 94, .17), transparent 55%),
    radial-gradient(90% 70% at 92% 92%, rgba(92, 134, 232, .12), transparent 60%),
    linear-gradient(160deg, #0c1020, #070910 72%);
}
.auth-brand::before {  /* 별 점묘 */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image:
    radial-gradient(1px 1px at 18% 28%, rgba(255, 255, 255, .55), transparent),
    radial-gradient(1px 1px at 68% 62%, rgba(255, 255, 255, .38), transparent),
    radial-gradient(1.4px 1.4px at 42% 82%, rgba(240, 206, 150, .55), transparent),
    radial-gradient(1px 1px at 84% 22%, rgba(255, 255, 255, .42), transparent),
    radial-gradient(1px 1px at 30% 66%, rgba(255, 255, 255, .3), transparent);
}
.auth-brand-in { position: relative; width: 100%; }
.auth-logo { display: flex; align-items: center; gap: 15px; margin-bottom: 26px; }
.auth-logo .logo-mark { width: 74px; height: auto; }
.auth-wordmark { font-family: 'Noto Serif KR', serif; display: inline-flex; align-items: baseline; gap: 9px; }
.auth-wordmark .k { font-size: 36px; font-weight: 700; color: var(--fg); }
.auth-wordmark .c { font-size: 22px; color: var(--gold); letter-spacing: 2px; }
.auth-eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: .4px; color: var(--gold);
  border: 1px solid rgba(224, 177, 94, .35); border-radius: 999px; padding: 5px 13px;
  margin-bottom: 22px; background: rgba(224, 177, 94, .06);
}
.auth-head {
  font-family: 'Noto Serif KR', serif; font-size: clamp(27px, 3vw, 38px);
  line-height: 1.32; font-weight: 700; color: var(--fg); margin-bottom: 16px;
}
.auth-head .g { color: var(--gold); }
.auth-sub { font-size: 14px; line-height: 1.7; color: var(--muted); margin-bottom: 30px; max-width: 430px; }
.auth-feats { list-style: none; display: flex; flex-direction: column; gap: 18px; margin-bottom: 34px; }
.auth-feats li { display: flex; gap: 14px; align-items: center; }
.auth-feats .af-ic {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center; font-size: 17px;
  border-radius: 10px; background: rgba(224, 177, 94, .1); border: 1px solid rgba(224, 177, 94, .25);
}
.auth-feats .af-txt { display: block; }
.auth-feats b { display: block; font-size: 14px; color: var(--fg); margin-bottom: 2px; }
.auth-feats .af-txt span { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.auth-brand-foot { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 18px; }

/* 우: 폼 패널 */
.auth-form { display: flex; align-items: flex-start; justify-content: center; padding: 52px clamp(28px, 3vw, 52px); background: var(--surface); }
.auth-form-in { width: 100%; max-width: 360px; }
.auth-form-brand { display: none; align-items: center; gap: 9px; font-family: 'Noto Serif KR', serif; font-size: 21px; font-weight: 700; color: var(--gold); margin-bottom: 22px; }
.auth-form-brand .logo-mark { width: 40px; height: auto; }
.auth-title { font-family: 'Noto Serif KR', serif; font-size: 25px; font-weight: 700; color: var(--fg); }
.auth-desc { font-size: 13px; color: var(--muted); margin: 6px 0 22px; }
.auth-tabs { display: flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; padding: 9px; border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; border-radius: 7px; cursor: pointer; transition: all .15s; }
.auth-tabs button.active { background: var(--gold); color: #1b1405; }
.auth-submit {
  width: 100%; height: 46px; margin-top: 4px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #1b1405;
  font-size: 15px; font-weight: 700; box-shadow: 0 6px 18px rgba(224, 177, 94, .25);
  transition: filter .15s, box-shadow .15s;
}
.auth-submit:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(224, 177, 94, .35); }
.auth-foot { display: flex; align-items: flex-start; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.auth-foot svg { flex: none; margin-top: 1px; }

@media (max-width: 900px) {
  .auth { padding: 0; }
  .auth-card { grid-template-columns: 1fr; max-width: none; border: none; border-radius: 0; box-shadow: none; min-height: 100vh; }
  .auth-brand { display: none; }
  .auth-form-brand { display: flex; }
  .auth-form { min-height: 100vh; }
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  color: var(--fg);
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 12px;
  text-align: center;
}

/* ── 소셜 로그인 ── */
.social-logins {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.social-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, box-shadow 0.15s;
}

/* 아이콘은 좌측 고정 슬롯, 라벨은 버튼 정중앙(표준 소셜 버튼 정렬) */
.social-btn .social-ic {
  position: absolute;
  left: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.social-btn .social-label { pointer-events: none; }

.social-btn:hover {
  filter: brightness(0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.social-btn.google {
  background: #fff;
  color: #1f1f1f;
  border-color: #dadce0;
}

.social-btn.kakao {
  background: #fee500;
  color: #191600;
}

.social-btn.naver {
  background: #03c75a;
  color: #fff;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 22px 0 18px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider::before { margin-right: 12px; }
.divider::after { margin-left: 12px; }

/* ── 완전자동(자동승인) 히든 패널 — 헤더 7탭 진입 ── */
.aa-ov { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.aa-dialog { width: 100%; max-width: 340px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.aa-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.aa-head b { font-size: 16px; font-weight: 700; color: var(--fg); }
.aa-bolt { color: var(--muted); transition: color .2s; }
.aa-bolt.on { color: var(--gold); }
.aa-body { min-height: 48px; font-size: 14px; }
.aa-muted { color: var(--muted); }
.aa-err { color: var(--danger); }
.aa-status { color: var(--muted); line-height: 1.5; }
.aa-status.on { color: var(--gold); }
.aa-row { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.aa-row span { font-size: 15px; color: var(--fg); }
.aa-warn { margin-top: 10px; font-size: 12px; color: var(--pulse); line-height: 1.5; }
.aa-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.aa-close { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 8px 16px; font-size: 13px; cursor: pointer; }
.aa-close:hover { color: var(--fg); }

/* ── 트레이딩뷰 차트 모달 (티커 클릭) ── */
.tv-ov { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.tv-modal { width: 100%; max-width: 1100px; height: 82vh; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0, 0, 0, .55); }
.tv-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex: none; }
.tv-head .tv-back { color: var(--fg); cursor: pointer; font-size: 14px; }
.tv-head .tv-back:hover { color: var(--gold); }
.tv-head b { font-size: 15px; font-weight: 700; color: var(--fg); }
.tv-body { position: relative; flex: 1; min-height: 0; }
.tv-chart { position: absolute; inset: 0; }
.tv-spinner { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); }
.tv-err { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
/* 티커 = 차트 링크(리스트 카드·상세) */
.pos-sym.tv-link, .pd-sym.tv-link { cursor: pointer; }
.pos-sym.tv-link:hover, .pd-sym.tv-link:hover { color: var(--gold); }

/* ── 화면별 콘텐츠 ── */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* 관제소 홈 */
.console-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

/* ── 관제소 브릿지 씬 (mockups/bridge-crew-mockup.html 이식, .bscene 스코프) ── */
.bridge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.bridge-tag {
  font-family: 'Noto Serif KR', serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.10em;
  color: var(--gold);
  text-transform: uppercase;
}

.bscene {
  --gold: #e0b15e; --gold-soft: #f0ce96; --line: #232a3c;
  --alpha: #2fcfc4; --faint: #5a6076;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  /* 완전 블랙 기조(CEO) — 바닥 쪽만 아주 옅은 톤으로 깊이 유지 */
  background: linear-gradient(180deg, #000000 0%, #010207 60%, #04050a 100%);
  /* 화면 높이를 꽉 채워 크루가 바닥에 서고, 자산/모드 박스는 스크롤 아래로 */
  height: calc(100vh - 166px);
  min-height: 540px;
}
@media (max-width: 720px) { .bscene { height: calc(100vh - 152px); min-height: 460px; } }

.bscene .badge {
  position: absolute; top: 14px; right: 14px; z-index: 30;
  font-size: 11px; letter-spacing: 1px; color: #c9cee0;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(8, 10, 17, .55);
  backdrop-filter: blur(4px); border-radius: 100px; padding: 5px 12px;
}
.bscene .badge b { color: var(--gold-soft); font-weight: 600; }

.bscene .viewport {
  position: absolute; left: 2%; right: 2%; top: 4%; height: 60%;
  border: 1px solid rgba(140, 160, 220, .22); border-radius: 14px 14px 10px 10px; overflow: hidden;
  /* 완전 블랙 우주(별·천체·유성은 캔버스가 그림) */
  background: radial-gradient(120% 130% at 50% 0%, #04060d 0%, #010208 45%, #000000 100%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .5);
}
.bscene .viewport canvas { position: relative; z-index: 1; width: 100%; height: 100%; display: block; }
/* 관측창 우주 레이어 — 원경 starfield(은은·느린 시차) 위로 파노라마가 천천히 항해 */
.bscene .vp-far, .bscene .vp-pan {
  position: absolute; top: 0; bottom: 0; left: 0;
  display: flex; width: max-content; height: 100%;
  pointer-events: none; will-change: transform;
}
.bscene .vp-far img, .bscene .vp-pan img { height: 100%; width: auto; display: block; }
.bscene .vp-far { opacity: .55; animation: vp-sail 2140s linear infinite, vp-glim 9s ease-in-out infinite alternate; z-index: 0; }
.bscene .vp-pan { opacity: .92; mix-blend-mode: screen; animation: vp-sail 1800s linear infinite; z-index: 0; }
@keyframes vp-sail { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes vp-glim { from { opacity: .45; } to { opacity: .68; } }
@media (prefers-reduced-motion: reduce) { .bscene .vp-far, .bscene .vp-pan { animation: none; } }
.bscene .frame { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to right, rgba(8, 10, 17, .5), transparent 12%, transparent 88%, rgba(8, 10, 17, .5)); }
.bscene .strut { position: absolute; top: 0; bottom: 0; width: 5px; background: rgba(10, 13, 24, .85);
  border-left: 1px solid rgba(140, 160, 220, .10); border-right: 1px solid rgba(140, 160, 220, .10); }
.bscene .strut.s1 { left: 33%; } .bscene .strut.s2 { left: 66%; }

.bscene .floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40%;
  /* 세로 그리드 라인 제거(CEO) — 바닥 음영만 유지 */
  background: linear-gradient(180deg, transparent 0%, rgba(224, 177, 94, .03) 60%, rgba(0, 0, 0, .28) 100%);
  pointer-events: none;
}

.bscene .holotable { position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%); width: 150px; z-index: 5; text-align: center; }
.bscene .holotable .disk { width: 120px; height: 26px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(224, 177, 94, .28), rgba(224, 177, 94, .05) 68%, transparent 72%);
  border: 1px solid rgba(224, 177, 94, .30); transition: box-shadow .5s, border-color .5s; }
.bscene .orbitring { position: relative; width: 120px; height: 66px; margin: 0 auto -8px; transform: scaleY(.42); }
.bscene .orbitring i { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold-soft); box-shadow: 0 0 8px 1px rgba(240, 206, 150, .8); animation: b-orb 7s linear infinite; transform-origin: center; }
.bscene .orbitring i:nth-child(2) { width: 3.5px; height: 3.5px; background: #9fb6ff; box-shadow: 0 0 7px 1px rgba(150, 180, 255, .8); animation-duration: 10s; animation-delay: -3s; }
.bscene .orbitring i:nth-child(3) { width: 3px; height: 3px; background: var(--alpha); box-shadow: 0 0 7px 1px rgba(47, 207, 196, .8); animation-duration: 12.5s; animation-delay: -7s; }
@keyframes b-orb { 0% { transform: translate(-50%, -50%) rotate(0deg) translateX(52px); } 100% { transform: translate(-50%, -50%) rotate(360deg) translateX(52px); } }
.bscene .holotable .cap { font-size: 10px; letter-spacing: 2px; color: rgba(240, 206, 150, .55); margin-top: 4px; }
.bscene .holotable.flare .disk { box-shadow: 0 0 46px 12px rgba(224, 177, 94, .30); border-color: rgba(240, 206, 150, .8); }

.bscene .stations { position: absolute; left: 0; right: 0; bottom: 4%; display: flex; justify-content: space-evenly; align-items: flex-end; z-index: 10; }
.bscene .station { position: relative; width: 150px; display: flex; flex-direction: column; align-items: center; }
@media (max-width: 720px) { .bscene .station { width: 23%; } }

.bscene .crewbox { position: relative; height: 146px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: -24px; z-index: 1; }
.bscene .holo { position: relative; width: 96px; height: 144px; animation: b-bob 3.6s ease-in-out infinite; }
.bscene .station:nth-child(2) .holo { animation-delay: -1.2s; }
.bscene .station:nth-child(3) .holo { animation-delay: -2.1s; }
.bscene .station:nth-child(4) .holo { animation-delay: -0.6s; }
.bscene .holo .crewart { width: 100%; height: 100%; object-fit: contain; display: block;
  /* 배경은 알파 투명(밝기=알파로 재처리)이라 박스 없음. 발광 아트라 글로우 절제. */
  -webkit-user-drag: none; user-select: none;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 35%, transparent));
  animation: b-flick 5.5s steps(1) infinite; }
.bscene .holo .cone { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); width: 84px; height: 16px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 55%, transparent), transparent 72%); opacity: .7; z-index: -1; }
@keyframes b-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes b-flick { 0%, 7.9%, 10%, 61.9%, 64%, 100% { opacity: .96; } 8%, 9.9% { opacity: .72; } 62%, 63.9% { opacity: .8; } }

.bscene .desk { position: relative; width: 128px; z-index: 2;
  background: linear-gradient(180deg, #1a2032, #12172488 86%);
  border: 1px solid #2a3348; border-bottom-color: #1a2032; border-radius: 10px 10px 4px 4px;
  padding: 8px 9px 10px; box-shadow: 0 10px 22px rgba(0, 0, 0, .45); }
@media (max-width: 720px) { .bscene .desk { width: 100%; min-width: 74px; } }
.bscene .b-screen { height: 34px; border-radius: 6px; background: #0a0e1a; border: 1px solid #232c44; overflow: hidden; position: relative;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .6), 0 0 10px color-mix(in srgb, var(--c) 22%, transparent); }
.bscene .b-screen svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bscene .b-screen polyline { fill: none; stroke: var(--c); stroke-width: 1.4; opacity: .85;
  stroke-dasharray: 200; stroke-dashoffset: 200; animation: b-draw 6s linear infinite; }
@keyframes b-draw { to { stroke-dashoffset: 0; } }
.bscene .b-screen .dot { position: absolute; right: 5px; top: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--c); animation: b-blink 1.6s steps(1) infinite; }
@keyframes b-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .15; } }
.bscene .nametag { margin-top: 7px; text-align: center; font-size: 11px; letter-spacing: 1.5px; font-weight: 700; color: var(--c); }
.bscene .nametag small { display: block; font-weight: 400; letter-spacing: 0; color: var(--muted); font-size: 10.5px; margin-top: 1px; }

.bscene .bubble { position: absolute; bottom: 234px; left: 50%; transform: translateX(-50%) translateY(4px);
  min-width: 132px; max-width: 180px; z-index: 20; background: rgba(13, 17, 30, .92);
  border: 1px solid color-mix(in srgb, var(--c) 55%, #232a3c); border-radius: 10px; padding: 7px 10px;
  font-size: 11.5px; color: #d7dcea; line-height: 1.5; opacity: 0; transition: opacity .35s, transform .35s; pointer-events: none; text-align: left; }
.bscene .bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; transform: translateX(-50%) rotate(45deg);
  background: rgba(13, 17, 30, .92); border-right: 1px solid color-mix(in srgb, var(--c) 55%, #232a3c); border-bottom: 1px solid color-mix(in srgb, var(--c) 55%, #232a3c); }
.bscene .bubble b { color: var(--c); font-weight: 700; }
.bscene .station.talking .bubble { opacity: 1; transform: translateX(-50%) translateY(0); }

.bscene .station.holding .holo .crewart { filter: drop-shadow(0 0 16px color-mix(in srgb, var(--c) 65%, transparent)) brightness(1.28) saturate(1.15); }
.bscene .station.holding .holo .cone { opacity: 1; height: 20px; width: 86px; }
.bscene .station.holding .crewbox::after { content: ''; position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); z-index: -1;
  width: 104px; height: 104px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 26%, transparent), transparent 74%); animation: b-aura 2.6s ease-in-out infinite; }
@keyframes b-aura { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
/* 라벨은 JS 가 data-hold 로 주입한다(6개국어) — CSS 에 문자열을 박으면 번역이 불가능하다.
   깜박임(steps) 대신 맥동 — 전원이 껐다 켜지는 느낌이 아니라 숨쉬듯 밝아졌다 어두워진다. */
.bscene .station.holding .nametag::after { content: attr(data-hold); display: block; color: var(--c); font-size: 9.5px; letter-spacing: .5px;
  font-weight: 600; margin-top: 3px; animation: b-holdPulse 2.8s ease-in-out infinite; }
@keyframes b-holdPulse {
  0%, 100% { opacity: .38; text-shadow: none; }
  50%      { opacity: 1;   text-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }
}

/* 보유 크루의 데스크 — 크루 색으로 은은히 발광(같은 주기로 함께 맥동) */
.bscene .station.holding .desk {
  border-color: color-mix(in srgb, var(--c) 55%, #2a3348);
  animation: b-deskPulse 2.8s ease-in-out infinite;
}
@keyframes b-deskPulse {
  0%, 100% { box-shadow: 0 10px 22px rgba(0, 0, 0, .45),
                         0 0 10px color-mix(in srgb, var(--c) 18%, transparent),
                         inset 0 0 12px color-mix(in srgb, var(--c) 8%, transparent); }
  50%      { box-shadow: 0 10px 22px rgba(0, 0, 0, .45),
                         0 0 22px color-mix(in srgb, var(--c) 42%, transparent),
                         inset 0 0 18px color-mix(in srgb, var(--c) 16%, transparent); }
}

/* 모션 최소화 선호 시 맥동 정지(밝기는 유지) */
@media (prefers-reduced-motion: reduce) {
  .bscene .station.holding .nametag::after,
  .bscene .station.holding .desk { animation: none; }
  .bscene .station.holding .nametag::after { opacity: .9; }
}

.bscene .fx { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.bscene .fire-btn { position: absolute; right: 14px; bottom: 12px; z-index: 45;
  border: 1px solid rgba(224, 177, 94, .5); border-radius: 10px; cursor: pointer;
  background: rgba(224, 177, 94, .12); color: var(--gold-soft); font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 8px 14px; backdrop-filter: blur(4px); transition: .2s; }
.bscene .fire-btn:hover { background: rgba(224, 177, 94, .22); }
.bscene .fire-btn:disabled { opacity: .45; cursor: default; }
.bscene .fire-btn.warp { right: 162px; border-color: rgba(140, 160, 220, .4); background: rgba(140, 160, 220, .10); color: #c3cdea; }
.bscene .fire-btn.warp:hover { background: rgba(140, 160, 220, .2); }
.bscene .fire-btn.warp.on { background: rgba(140, 160, 220, .32); color: #fff; border-color: rgba(180, 200, 255, .7); }

.bscene .station.alert .b-screen { box-shadow: 0 0 18px color-mix(in srgb, var(--c) 65%, transparent), inset 0 0 12px rgba(0, 0, 0, .6); animation: b-alert .42s steps(2) 4; }
@keyframes b-alert { 50% { border-color: var(--c); } }
.bscene .station .holo { transition: opacity .65s, filter .65s; }
.bscene .station.demat .holo { opacity: 0; filter: blur(3px) brightness(2); }
.bscene .station.demat .cone { opacity: 0; transition: .5s; }

.bscene .shock { position: absolute; z-index: 38; border: 2px solid rgba(224, 177, 94, .75); border-radius: 50%;
  pointer-events: none; transform: translate(-50%, -50%); animation: b-shock 1.1s ease-out forwards; }
@keyframes b-shock { from { width: 24px; height: 24px; opacity: .95; } to { width: 460px; height: 460px; opacity: 0; } }

/* 승인 카드 — 앱 signal_screen.dart 이식 */
.bscene .acard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.94);
  width: 340px; max-height: 86%; overflow-y: auto; z-index: 50; opacity: 0; pointer-events: none;
  transition: opacity .35s, transform .35s; background: #14141c; border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px; padding: 18px; box-shadow: 0 30px 70px rgba(0, 0, 0, .7), 0 0 30px color-mix(in srgb, var(--ac, #e0b15e) 20%, transparent); }
.bscene .acard.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.bscene .acard::-webkit-scrollbar { width: 5px; }
.bscene .acard::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }

.bscene .ac-head { display: flex; align-items: center; gap: 11px; }
.bscene .ac-icon { width: 42px; height: 42px; flex-shrink: 0; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #f7c661, #e0941e); color: #0c0c0f; font-size: 12px; font-weight: 800; }
.bscene .ac-hmid { flex: 1; min-width: 0; }
.bscene .ac-sym { font-size: 15px; font-weight: 600; color: #ededef; }
.bscene .ac-hsub { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.bscene .ac-chip { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 6px; }
.bscene .ac-ttype { font-size: 11px; color: #8a8f98; }
.bscene .ac-badges { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.bscene .ac-side { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(45, 212, 167, .15); color: #2dd4a7; }
.bscene .ac-lev { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(224, 177, 94, .1); border: 1px solid rgba(224, 177, 94, .2); color: #f0ce96; }

.bscene .ac-demo { font-size: 9.5px; color: #5a6076; text-align: right; margin-top: 8px; letter-spacing: .04em; }

.bscene .ac-price { margin-top: 12px; }
.bscene .ac-plabel { font-size: 12px; color: #8a8f98; }
.bscene .ac-pval { font-size: 30px; font-weight: 800; color: #ededef; line-height: 1.1; margin-top: 2px; }

.bscene .ac-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; margin-top: 14px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; overflow: hidden; }
.bscene .ac-cell { padding: 12px 6px; text-align: center; }
.bscene .ac-cell + .ac-cell { border-left: 1px solid rgba(255, 255, 255, .12); }
.bscene .ac-cl { font-size: 11px; color: #8a8f98; }
.bscene .ac-cv { font-size: 13px; font-weight: 700; margin-top: 4px; }
.bscene .ac-cd { font-size: 10px; color: #8a8f98; margin-top: 2px; }

.bscene .ac-comp { display: none; align-items: center; justify-content: space-between; margin-top: 12px; padding: 10px 14px; border-radius: 14px; border: 1px solid; }
.bscene .ac-comp-l { font-size: 13px; font-weight: 800; }
.bscene .ac-comp-r { font-size: 11px; color: #8a8f98; }

.bscene .ac-count { display: flex; justify-content: center; margin-top: 18px; }
.bscene .ac-ring { position: relative; width: 92px; height: 92px; }
.bscene .ac-ring svg { width: 92px; height: 92px; }
.bscene .ac-ring circle { fill: none; stroke-width: 6; }
.bscene .ac-ring-bg { stroke: rgba(255, 255, 255, .12); }
.bscene .ac-ring-fg { stroke: var(--ac, #e0b15e); stroke-linecap: round; }
.bscene .ac-ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bscene .ac-ring-txt > div:first-child { font-size: 20px; font-weight: 800; color: #ededef; font-variant-numeric: tabular-nums; }
.bscene .ac-ring-sub { font-size: 9.5px; color: #8a8f98; margin-top: 1px; }

.bscene .ac-btns { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.bscene .ac-ok { width: 100%; background: #e0b15e; color: #1a1407; font-weight: 800; padding: 15px; border-radius: 12px; font-size: 14px; cursor: pointer; border: 0; font-family: inherit; }
.bscene .ac-no { width: 100%; background: transparent; color: #8a8f98; padding: 11px; border: 0; font-size: 13px; cursor: pointer; font-family: inherit; }

.bscene .acard .result { display: none; text-align: center; font-weight: 800; font-size: 15px; padding: 10px 0 2px; }
.bscene .acard.done .ac-count, .bscene .acard.done .ac-btns { display: none; }
.bscene .acard.done .result { display: block; }

.bscene .commlog { position: absolute; left: calc(2% + 12px); top: calc(4% + 12px); z-index: 25; width: min(300px, 46%);
  font-size: 10.8px; color: #aab2c8; background: rgba(8, 10, 17, .62); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; backdrop-filter: blur(5px); }
.bscene .commlog .t { color: var(--faint); letter-spacing: 1px; font-size: 9.5px; margin-bottom: 4px; }
.bscene .commlog .row { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bscene .commlog .k { font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .bscene *, .bscene *::before, .bscene *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.account-strip {
  background: rgba(224, 177, 94, 0.05);
  border: 1px solid rgba(224, 177, 94, 0.2);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.strip-item {
  text-align: center;
}

.strip-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.strip-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
}

/* 계기판 */
.perf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.perf-tabs {
  display: flex;
  gap: 8px;
}

.perf-tabs button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.perf-tabs button.active {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}

.summary-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.tile-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-weight: 600;
}

.tile-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
}

.tile-value.positive {
  color: var(--long);
}

.tile-value.negative {
  color: var(--short);
}

/* ── 계기판 레이아웃 (4행 구조) ── */

.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* 1행: KPI 7장 */
.dashboard-row1 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid rgba(224, 177, 94, 0.14);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  height: 112px;
  display: flex;
  flex-direction: column;
}

.kpi-card.highlight {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold), 0 0 12px rgba(224, 177, 94, 0.1);
}

.kpi-label {
  font-size: 13px;
  color: var(--fg);
  letter-spacing: .4px;
  margin-bottom: 4px;
  font-weight: 600;
  flex-shrink: 0;
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.kpi-value.positive { color: var(--long); }
.kpi-value.negative { color: var(--short); }

.kpi-subtext {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  text-align: center;
  flex-grow: 1;
}

.kpi-card.highlight { overflow: hidden; }
.kpi-sparkline {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 22px; opacity: .85; pointer-events: none;
}

/* PF 게이지 */
.kpi-gauge {
  width: 100%;
  height: 6px;
  margin-top: 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.kpi-gauge-fill {
  height: 100%;
  background: var(--long);
  border-radius: 3px;
  transition: width 0.3s;
}

/* 2행: 2컬럼 레이아웃 */
.dashboard-row2 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);  /* 1행 KPI 7장과 열 정렬 */
  gap: 12px;
  align-items: stretch;
}
.dashboard-row2-left { grid-column: 1 / 5; }
.dashboard-row2-right { grid-column: 5 / 8; }

.dashboard-row2-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-row2-right {
  min-width: 0;
}

.chart-card {
  background: var(--surface);
  border: 1px solid rgba(224, 177, 94, 0.14);
  border-radius: 10px;
  padding: 14px 16px;
}

.chart-card:nth-child(1) {
  height: 260px;
  display: flex;
  flex-direction: column;
}

.chart-card:nth-child(2) {
  height: 160px;
  display: flex;
  flex-direction: column;
}

.chart-card-title {
  font-size: 14px;
  color: var(--fg);
  letter-spacing: .4px;
  margin-bottom: 8px;
  font-weight: 600;
  flex-shrink: 0;
}

.chart-card { overflow: hidden; }
.chart-card .chart-fill { flex: 1; min-height: 0; }
/* 누적:일별 = 6.5:3.5 (CEO) */
.dashboard-row2-left .chart-card.cum { flex: 6.5; }
.dashboard-row2-left .chart-card.grow { flex: 3.5; }

.uplot {
  max-width: 100%;
  height: 100%;
}

/* 캘린더 */
.calendar-card {
  background: var(--surface);
  border: 1px solid rgba(224, 177, 94, 0.14);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.calendar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.calendar-nav {
  display: flex;
  gap: 4px;
}

.calendar-nav button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(224, 177, 94, 0.14);
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-nav button:hover {
  color: var(--fg);
  border-color: var(--gold);
}

/* 주식 국장/미장 종합요약 바 + 토글 */
.stock-mkt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 2px;
  padding: 10px 14px;
  border: 1px solid rgba(224, 177, 94, 0.18);
  border-radius: 8px;
  background: rgba(224, 177, 94, 0.04);
}
.mkt-combined { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.mkt-c-label { color: var(--gold); font-weight: 600; letter-spacing: .3px; }
.mkt-c-item { color: var(--muted); }
.mkt-c-item b { margin-left: 4px; font-variant-numeric: tabular-nums; }
.mkt-c-sep { color: var(--muted); opacity: .5; }
.mkt-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.mkt-toggle button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.mkt-toggle button:hover { color: var(--fg); }
.mkt-toggle button.active { background: var(--gold); color: #0a0c14; font-weight: 600; }
.mkt-combined b.positive { color: var(--long); }
.mkt-combined b.negative { color: var(--short); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.calendar-day {
  height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
  color: var(--faint);
  border: 1px solid rgba(224, 177, 94, 0.08);
  position: relative;
  padding-top: 4px;
  overflow: hidden;
}

.calendar-day.header {
  background: none;
  border: none;
  height: auto;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  padding-top: 0;
}

.calendar-day.empty {
  background: none;
  border: none;
}

.calendar-day.positive {
  background: rgba(45, 212, 167, 0.16);
  color: var(--long);
  border-color: rgba(45, 212, 167, 0.35);
}

.calendar-day.negative {
  background: rgba(242, 96, 125, 0.18);
  color: var(--short);
  border-color: rgba(242, 96, 125, 0.38);
}

.calendar-day .cal-pnl { font-size: 13px; font-weight: 700; margin-top: 2px; }
.calendar-day .cal-pct { font-size: 10px; opacity: .85; }

/* 월간 합계 — 캘린더 그리드 안 합쳐진 셀 (레퍼런스 우하단) */
.calendar-total {
  border: 1px solid rgba(224, 177, 94, .35);
  background: rgba(224, 177, 94, .07);
  border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  padding: 6px; min-height: 76px;
}
.calendar-total.full { margin-top: 6px; }
.calendar-total .ct-label { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.calendar-total .ct-value { font-size: 17px; font-weight: 700; }
.calendar-total .ct-value.positive { color: var(--gold); }
.calendar-total .ct-value.negative { color: var(--short); }
.calendar-total .ct-sub { font-size: 12px; color: var(--muted); }

/* 카드 우상단 금색 라인 아이콘 + 알약 배지 + 차트 헤더/범례 */
.kpi-card, .stat-card { position: relative; }
.card-ico { position: absolute; top: 12px; right: 12px; width: 17px; height: 17px; opacity: .7; }
.pct-pill { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 12px; font-weight: 600; line-height: 1.4; }
.pct-pill.pos { background: rgba(45, 212, 167, .12); color: var(--long); }
.pct-pill.neg { background: rgba(242, 96, 125, .12); color: var(--short); }
.chart-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; flex-shrink: 0; }
.chart-big { font-size: 20px; font-weight: 700; }
.chart-big.positive { color: var(--long); }
.chart-big.negative { color: var(--short); }
.chart-legend {
  flex-shrink: 0; margin-top: 4px; font-size: 11px; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.chart-legend .leg-line { width: 18px; height: 2px; background: var(--gold); border-radius: 1px; display: inline-block; }
.chart-legend-chips { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-bottom: 4px; flex-shrink: 0; }
.leg-chip { display: flex; align-items: center; gap: 5px; }
.leg-chip .sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.leg-chip .sw.pos { background: var(--long); }
.leg-chip .sw.neg { background: var(--short); }

/* 차트 카드 제목행 + 드롭다운(월/단위) */
.chart-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.chart-controls { display: flex; gap: 6px; }
.chart-controls select {
  background: var(--surface2, rgba(255,255,255,.04)); color: var(--fg);
  border: 1px solid rgba(224, 177, 94, .25); border-radius: 6px;
  font-size: 11px; padding: 3px 6px; cursor: pointer;
}
.chart-controls select:focus { outline: none; border-color: var(--gold); }

/* 2행 높이 정렬: 좌 하단 카드가 남는 높이를 채우고, 캘린더는 컬럼 전체 높이 */
.dashboard-row2-left .chart-card.grow { flex: 1; }
.dashboard-row2-right .calendar-card { height: 100%; display: flex; flex-direction: column; }
.dashboard-row2-right .calendar-grid { flex-shrink: 0; }

/* PF 미니 계기판 (KPI 카드) */
.kpi-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pf-dial { width: 58px; height: 32px; flex-shrink: 0; }

/* 수익/손실 분포 — 도넛 좌 + 범례 우, 총수익/총손실 미니카드, PF 바 */
.donut-flex { display: flex; align-items: center; justify-content: center; gap: 20px; flex: 1; }
.donut-flex .donut-legend { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--muted); }
.donut-flex .donut-legend b { color: var(--fg); font-size: 14px; }
.dist-mini-row { display: flex; gap: 10px; margin-top: 12px; }
.dist-mini { flex: 1; border-radius: 8px; padding: 8px 10px; }
.dist-mini.pos { background: rgba(45, 212, 167, .08); border: 1px solid rgba(45, 212, 167, .25); }
.dist-mini.neg { background: rgba(242, 96, 125, .08); border: 1px solid rgba(242, 96, 125, .25); }
.dist-mini .dm-label { font-size: 12px; color: var(--muted); }
.dist-mini .dm-value { font-size: 15px; font-weight: 700; }
.dist-mini .dm-value.positive { color: var(--long); }
.dist-mini .dm-value.negative { color: var(--short); }
.dist-mini .dm-sub { font-size: 11px; color: var(--muted); }
.pf-bar-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.pf-bar-row b { color: var(--fg); font-size: 13px; }
.pf-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.pf-bar > div { height: 100%; border-radius: 3px; }

/* 리스크 계기판 다이얼 */
.risk-gauge-container { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.risk-dial { width: 170px; height: 100px; }
.risk-score-sub { font-size: 13px; font-weight: 700; color: var(--fg); margin: 2px 0 8px; }

.calendar-day .cal-date {
  font-size: 10px;
  color: var(--faint);
  font-weight: 600;
  position: absolute;
  top: 4px;
  left: 4px;
}

.calendar-day.positive .cal-date,
.calendar-day.negative .cal-date {
  color: inherit;
}

.calendar-day .cal-pnl {
  font-size: 12px;
  font-weight: 700;
  margin-top: 18px;
  color: inherit;
}

.calendar-day .cal-pct {
  font-size: 10px;
  margin-top: 2px;
  color: inherit;
}

.calendar-summary {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(224, 177, 94, 0.14);
  display: flex;
  justify-content: space-around;
  flex-shrink: 0;
}

/* 3행: 통계 6장 */
.dashboard-row3 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid rgba(224, 177, 94, 0.14);
  border-radius: 10px;
  padding: 14px 16px;
  height: 102px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 13px;
  color: var(--fg);
  letter-spacing: .4px;
  margin-bottom: 3px;
  font-weight: 600;
  flex-shrink: 0;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.stat-value.positive { color: var(--long); }
.stat-value.negative { color: var(--short); }

.stat-detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  text-align: center;
  flex-grow: 1;
}

/* 4행: 패널 4장 */
.dashboard-row4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.panel-card {
  background: var(--surface);
  border: 1px solid rgba(224, 177, 94, 0.14);
  border-radius: 10px;
  padding: 16px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.panel-title {
  font-size: 14px;
  color: var(--fg);
  letter-spacing: .4px;
  margin-bottom: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.donut-container {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.donut-container svg {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 10px;
  margin-bottom: 8px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.donut-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mini-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-top: 1px solid var(--border);
}

.mini-stat:first-child {
  border-top: none;
  margin-bottom: 8px;
}

.mini-stat-label {
  color: var(--muted);
}

.mini-stat-value {
  font-weight: 600;
  color: var(--fg);
}

.risk-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.risk-gauge-visual {
  width: 150px;
  height: 150px;
  position: relative;
}

.risk-gauge-visual svg {
  width: 100%;
  height: 100%;
}

.risk-gauge-text {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
}

.risk-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 10px;
  flex-grow: 1;
}

.mini-stat {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 13px;
  border-top: 1px solid rgba(224, 177, 94, 0.1);
}

.mini-stat:first-child {
  border-top: none;
}

.mini-stat-label {
  color: var(--muted);
  font-size: 13px;
}

.mini-stat-value {
  color: var(--fg);
  font-weight: 600;
}

.risk-detail-label {
  color: var(--muted);
  font-size: 10px;
}

.risk-detail-value {
  color: var(--fg);
  font-weight: 600;
  font-size: 11px;
}

.risk-detail-value.danger {
  color: var(--short);
}

/* 반응형 */
@media (max-width: 1300px) {
  .dashboard-row1 {
    grid-template-columns: repeat(4, 1fr);
  }

  /* 좁은 화면: 7컬럼 정렬 의미 없음 — 차트/캘린더 위아래 스택 */
  .dashboard-row2 { grid-template-columns: 1fr; }
  .dashboard-row2-left { grid-column: auto; }
  .dashboard-row2-right { grid-column: auto; }

  .dashboard-row4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1000px) {
  .dashboard-row2 {
    grid-template-columns: 1fr;
  }

  .dashboard-row1 {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-row3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-row4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-row1 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-row3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-day {
    height: 50px;
  }
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.calendar-day {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: default;
  background: var(--surface2);
  color: var(--muted);
}

.calendar-day.positive {
  background: rgba(45, 212, 167, 0.2);
  color: var(--long);
}

.calendar-day.negative {
  background: rgba(242, 96, 125, 0.2);
  color: var(--short);
}

.calendar-day.header {
  background: none;
  aspect-ratio: auto;
  font-size: 11px;
  color: var(--muted);
}

.calendar-day.empty {
  background: none;
}

.calendar-day .cal-date {
  font-size: 11px;
  color: var(--faint);
}

.calendar-day.positive .cal-date,
.calendar-day.negative .cal-date {
  color: inherit;
}

.calendar-day .cal-pnl {
  font-size: 10px;
  margin-top: 2px;
}

/* 테이블 */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  background: var(--surface2);
  padding: 12px;
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

tr:hover {
  background: rgba(224, 177, 94, 0.03);
}

.strategy-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.strategy-badge.vector {
  background: rgba(255, 210, 74, 0.2);
  color: var(--vector);
}

.strategy-badge.pulse {
  background: rgba(255, 111, 156, 0.2);
  color: var(--pulse);
}

.strategy-badge.ember {
  background: rgba(255, 138, 92, 0.2);
  color: var(--ember);
}

.strategy-badge.alpha {
  background: rgba(47, 207, 196, 0.2);
  color: var(--alpha);
}

/* 가이드·설정 */
.guide-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.guide-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
}

.guide-section p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg);
  margin-bottom: 8px;
}

.guide-section ul {
  margin-left: 20px;
  font-size: 12px;
  color: var(--muted);
}

.guide-section li {
  margin-bottom: 6px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
}

.settings-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

.settings-value {
  font-size: 12px;
  color: var(--muted);
}

/* 토스트 알림 */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  max-width: 300px;
  z-index: 200;
  animation: slideIn 0.3s ease;
}

.toast.error {
  border-color: var(--danger);
  background: rgba(217, 138, 138, 0.1);
  color: var(--danger);
}

.toast.success {
  border-color: var(--long);
  background: rgba(45, 212, 167, 0.1);
  color: var(--long);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 모바일 */
@media (max-width: 860px) {
  .header-in {
    padding: 0 16px;
  }

  .header-left {
    gap: 16px;
  }

  .header-title {
    font-size: 16px;
  }

  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 16px;
  }

  .console-home {
    grid-template-columns: 1fr;
  }

  .summary-tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .account-strip {
    grid-template-columns: 1fr;
  }

  .perf-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 로딩 스핀 */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--fg);
}

.empty-state-desc {
  font-size: 12px;
  line-height: 1.6;
}

/* 카드 내용 가운데 정렬 — 제목 좌측 유지, 내용은 중앙(CEO) */
.kpi-card .kpi-value, .stat-card .stat-value { margin-top: 10px; text-align: center; }
.kpi-card .kpi-row { justify-content: center; gap: 14px; margin-top: 8px; }

/* ── 하단 위험고지 마퀴 푸터 (turtle to whale DisclaimerTicker 색 이식: #f59e0b 앰버) ── */
.risk-footer {
  position: fixed; left: 0; right: 0; bottom: 0; height: 32px; z-index: 90;
  display: flex; align-items: center; padding: 0;
  /* 어두운 불투명 베이스 + 앰버 틴트 — 밑 콘텐츠 비침 방지 */
  background: linear-gradient(0deg, rgba(245, 158, 11, .05), rgba(245, 158, 11, .05)), #0a0d15;
  border-top: 1px solid rgba(245, 158, 11, .30);
}
.risk-marquee { flex: 1; overflow: hidden; }
.risk-track {
  display: inline-flex; width: max-content; white-space: nowrap;
  animation: risk-scroll 60s linear infinite;
}
.risk-track:hover { animation-play-state: paused; }
.risk-items { display: inline-flex; }
.risk-items em {
  font-style: normal; font-size: 12px; font-weight: 500;
  color: rgba(245, 158, 11, .8); padding-right: 56px;
}
@keyframes risk-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .risk-track { animation: none; } }

/* 손익 부호색 — 트레이딩 내역 테이블·통계 값 */
td.positive { color: var(--long); }
td.negative { color: var(--short); }
.stat-value.positive { color: var(--long); }
.stat-value.negative { color: var(--short); }

/* ── 관제소 크루 아래 오빗 (랜딩 orbit.js 재사용) ── */
.console-orbit-card {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid rgba(224, 177, 94, .14);
  border-radius: 12px;
  padding: 14px 16px 10px;
}
.console-orbit-title { font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 8px; }
.console-orbit {
  position: relative; width: 100%; max-width: 560px; aspect-ratio: 1;
  margin: 0 auto; overflow: hidden; border-radius: 8px; background: var(--bg);
}
.console-orbit canvas { display: block; width: 100%; height: 100%; }

/* ── 보유 포지션 카드 (앱 이식) ── */
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pos-card {
  background: var(--surface); border: 1px solid rgba(224, 177, 94, .14);
  border-left: 3px solid var(--ec, var(--gold));
  border-radius: 12px; padding: 16px; cursor: pointer;
  transition: border-color .35s ease, box-shadow .35s ease;
}
.pos-card:hover { border-color: color-mix(in srgb, var(--ec) 50%, transparent); }
/* 값이 롤링될 때(가격 변동) 카드 테두리가 엔진색으로 잠깐 발광 → 실시간 생동감 */
.pos-card.pos-live {
  border-color: color-mix(in srgb, var(--ec, var(--gold)) 60%, transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--ec, var(--gold)) 26%, transparent);
}
.pos-head { display: flex; align-items: center; gap: 8px; }
.pos-sym { font-size: 16px; font-weight: 700; color: var(--fg); flex: 1; }
.engine-chip {
  font-size: 11px; font-weight: 700; color: var(--ec);
  border: 1px solid color-mix(in srgb, var(--ec) 45%, transparent);
  background: color-mix(in srgb, var(--ec) 10%, transparent);
  border-radius: 100px; padding: 2px 10px;
}
.pos-badge-reserved { font-size: 11px; color: var(--gold); border: 1px solid rgba(224,177,94,.4); border-radius: 100px; padding: 2px 8px; }
.pos-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pos-side { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 8px; }
.pos-side.long { color: var(--long); background: rgba(45,212,167,.12); }
.pos-side.short { color: var(--short); background: rgba(242,96,125,.12); }
.pos-lev { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.pos-roe { font-size: 26px; font-weight: 700; margin-top: 10px; text-align: center; }
.pos-roe.positive { color: var(--long); } .pos-roe.negative { color: var(--short); }
.pos-roe-sub { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 8px; }
.pos-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 6px; }
.pos-rows > div { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; border-top: 1px solid rgba(255,255,255,.05); }
.pos-rows span { color: var(--muted); } .pos-rows b { color: var(--fg); font-weight: 600; }
.pos-guard { margin-top: 10px; }
.pos-guard .pg-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.pos-guard .pg-row b { color: var(--long); }
.pos-guard .pg-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden; }
.pos-guard .pg-bar > div { height: 100%; background: var(--long); border-radius: 3px; }
.pos-detail { margin-top: 10px; border-top: 1px dashed rgba(224,177,94,.25); padding-top: 8px; }
.pos-detail .pd-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; }
.pos-detail .pd-row span { color: var(--muted); } .pos-detail .pd-row b { color: var(--fg); }
.pos-hint { margin-top: 8px; font-size: 11px; color: var(--faint, #5a6076); text-align: center; }

/* ── 관측창 좌측 유리창 HUD 오빗 ── */
.bscene .vp-orbit {
  /* 왼쪽 유리창(0~33%, 스트럿 s1 경계)에 정확히 맞춤 — 투명 HUD, 드래그 회전 가능 */
  position: absolute; left: 0; top: 0; bottom: 0; width: 33%;
  z-index: 2; pointer-events: auto; overflow: hidden;
  cursor: grab;
}
.bscene .vp-orbit:active { cursor: grabbing; }
.bscene .vp-orbit canvas { width: 100% !important; height: 100% !important; display: block; }
/* HUD 스캔리스트 — 감시 티커 위로 스텝 스크롤 (랜딩 이식) */
.bscene .hud-scan {
  position: absolute; left: 8px; top: 16px; bottom: 16px; width: 118px;
  overflow: hidden; z-index: 3; pointer-events: none;
  font-size: 9px; line-height: 16px; font-family: 'Noto Sans KR', sans-serif;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}
.bscene .hud-scan-row {
  height: 16px; display: flex; justify-content: space-between; align-items: center;
  padding: 0 3px; white-space: nowrap; overflow: hidden;
}
.bscene .hud-scan-row .hs-left { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.bscene .hud-scan-row .hs-right { flex-shrink: 0; margin-left: 4px; color: #7B8194; }
/* HUD 범례 — 앱 오빗 우하단 범례 동일(8항목) */
.bscene .hud-legend {
  position: absolute; right: 10px; bottom: 10px; z-index: 3; pointer-events: none;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px 10px;
  max-width: 190px; font-size: 9.5px; color: rgba(200, 208, 228, .85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}
.bscene .hud-legend .hl-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.bscene .hud-legend .hl-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
/* 브리핑 문단 (포지션 상세) */
.pos-detail .pd-brief {
  font-size: 12.5px; line-height: 1.7; color: var(--fg);
  background: rgba(224, 177, 94, .06); border: 1px solid rgba(224, 177, 94, .18);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}

/* ══ 보유 포지션 — 앱 1:1 이식 (positions.js) ══ */
/* 리스트 (PositionCard) */
.pos-list { max-width: 760px; }
.pl-card {
  display: flex; align-items: center; gap: 11px; margin-bottom: 10px; padding: 13px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; cursor: pointer;
  transition: border-color .15s;
}
.pl-card:hover { border-color: rgba(224, 177, 94, .4); }
.pl-coin {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #F7C661, #E0941E);
  color: #0C0C0F; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pl-coin.big { width: 42px; height: 42px; border-radius: 13px; font-size: 12px; }
.pl-mid { flex: 1; min-width: 0; }
.pl-top { display: flex; align-items: center; gap: 7px; }
.pl-base { font-size: 14px; font-weight: 600; color: var(--fg); }
.pl-side { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.pl-side.long { color: var(--long); background: rgba(45, 212, 167, .12); }
.pl-side.short { color: var(--short); background: rgba(242, 96, 125, .12); }
.pl-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.pl-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pl-right b { font-size: 15px; font-weight: 700; }
.pl-right span { font-size: 12px; }
.pl-reserved {
  font-size: 12px; font-weight: 800; color: var(--gold);
  background: rgba(224, 177, 94, .13); border: 1px solid rgba(224, 177, 94, .4);
  border-radius: 8px; padding: 5px 9px;
}
.positive { color: var(--long); } .negative { color: var(--short); }

/* 상세 (position_detail_screen) */
.pd-backrow { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pd-back { color: var(--fg); font-size: 15px; cursor: pointer; }
.pd-mode { font-size: 11.5px; color: #F0B90B; }
.pd-wrap { max-width: 1080px; }
.pd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
@media (max-width: 980px) { .pd-cols { grid-template-columns: 1fr; } }
.pd-symrow { display: flex; align-items: flex-start; gap: 11px; }
.pd-symmid { flex: 1; min-width: 0; }
.pd-sym { font-size: 15px; font-weight: 600; color: var(--fg); }
.pd-chart-ic { font-size: 12px; }
.pd-chiprow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.pd-ttype { font-size: 11px; color: var(--muted); }
.sig-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px;
  color: var(--sc); background: color-mix(in srgb, var(--sc) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--sc) 45%, transparent);
  font-size: 12.5px; font-weight: 800; letter-spacing: .3px;
}
.sig-chip .sig-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sc); }
.sig-chip em { font-style: normal; font-size: 11px; font-weight: 400; color: var(--muted); }
.sig-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px;
  color: var(--sc); background: color-mix(in srgb, var(--sc) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--sc) 40%, transparent);
  font-size: 11px; font-weight: 800;
}
.pd-pills { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.pd-pill { padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pd-pill.long { color: var(--long); background: rgba(45, 212, 167, .15); }
.pd-pill.short { color: var(--short); background: rgba(242, 96, 125, .15); }
.pd-pill.gold { color: var(--gold-soft, #F0CE96); background: rgba(224, 177, 94, .10); border: 1px solid rgba(224, 177, 94, .20); }
.pd-pnl { text-align: center; margin: 8px 0 0; }
.pd-pnl-label { font-size: 12px; color: var(--muted); }
.pd-roe { font-size: 28px; font-weight: 800; letter-spacing: -1px; margin-top: 2px; }
.pd-pnl-sub { font-size: 13px; font-weight: 600; margin-top: 3px; }
.pd-entrymark { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
/* 실시간 값 롤링 — 숫자가 흔들리지 않게 등폭 숫자 사용(글로우는 리스트 카드 테두리로) */
.pd-roe[data-live] { font-variant-numeric: tabular-nums; }
.pd-compound {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 13px;
  color: #2FCFC4; background: rgba(47, 207, 196, .08); border: 1px solid rgba(47, 207, 196, .2);
  border-radius: 14px; font-size: 13px;
}
.pd-compound .pdc-ic { font-size: 15px; }
.pd-compound .pdc-cum { margin-left: auto; font-size: 11px; color: var(--muted); }
.pd-reserved {
  margin-top: 18px; padding: 14px 16px; border-radius: 16px;
  background: rgba(224, 177, 94, .08); border: 1px solid rgba(224, 177, 94, .2);
}
.pd-reserved .pdr-head { font-size: 12.5px; font-weight: 700; color: var(--gold); }
.pd-reserved .pdr-body { font-size: 12.5px; color: var(--fg); line-height: 1.55; margin-top: 9px; }
.pd-reserved .pdr-sub { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 6px; }

/* 카드 공통 */
.pd-card { margin-top: 10px; padding: 10px 13px 10px; border: 1px solid var(--border); border-radius: 14px; }
.pd-card.gold { background: rgba(224, 177, 94, .05); border-color: rgba(224, 177, 94, .18); }
.pd-card.soft { background: rgba(255, 255, 255, .02); }
.pd-card.plain { border: none; padding: 2px 0 0; }
.pd-card-title { font-size: 12.5px; font-weight: 600; color: var(--gold-soft, #F0CE96); margin-bottom: 8px; }
.pd-card-title.muted { color: var(--fg); }
.pd-card-title small { font-weight: 400; font-size: 10px; color: var(--muted); margin-left: 7px; }
.pd-card-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pd-card-title-row .pd-card-title { margin-bottom: 0; }
.pd-card-foot { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 6px; }
.pd-rat-row, .pd-fact-row { display: flex; align-items: flex-start; gap: 9px; padding: 3px 0; font-size: 12.5px; }
.pd-rat-row .pdr-ic, .pd-fact-row .pdr-ic { width: 16px; text-align: center; color: var(--gold-soft, #F0CE96); font-size: 12px; flex-shrink: 0; }

/* 라인 아이콘(컬러 이모지 대체) — stroke 전용, 주변 글자색·크기를 그대로 따른다.
   fill:none 이 핵심(면이 차면 이모지처럼 덩어리로 보인다). */
.pd-ico {
  width: 1em; height: 1em; vertical-align: -0.13em;
  fill: none; stroke: currentColor; stroke-width: 1.35;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.pdr-ic .pd-ico { width: 13px; height: 13px; vertical-align: -0.16em; }
.pd-card-title .pd-ico, .pdr-head .pd-ico, summary .pd-ico { width: 14px; height: 14px; vertical-align: -0.14em; margin-right: 1px; }
.sig-badge .pd-ico, .pos-badge-reserved .pd-ico { width: 11px; height: 11px; vertical-align: -0.1em; }
.pdr-label { width: 64px; flex-shrink: 0; font-size: 11.5px; color: var(--muted); padding-top: 1px; }
.pd-rat-row b, .pd-fact-row b { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--fg); line-height: 1.4; }
.pd-fact-row2 { display: flex; gap: 9px; padding: 3px 0 3px 25px; font-size: 12px; }
.pd-fact-row2 .pdr-label { width: 62px; }
.pd-fact-row2 b { font-weight: 700; }
.pd-group { font-size: 11.5px; font-weight: 800; color: var(--gold-soft, #F0CE96); padding: 11px 0 1px; cursor: pointer; }
.pd-live { margin-top: 10px; border-radius: 14px; background: rgba(224, 177, 94, .08); border: 1px solid rgba(224, 177, 94, .2); overflow: hidden; }
.pd-live summary { padding: 9px 13px; font-size: 12.5px; font-weight: 700; color: var(--gold); cursor: pointer; list-style: none; }
.pd-live summary small { font-weight: 400; font-size: 10px; color: var(--muted); margin-left: 7px; }
.pd-live-body { padding: 0 14px 12px; }
.pd-level { display: flex; align-items: center; gap: 12px; padding: 4px 0; font-size: 12.5px; }
.pd-level .pdr-label { width: 58px; }
.pd-level b { flex: 1; color: var(--fg); font-weight: 600; }
.pd-level-tag { font-size: 10.5px; flex-shrink: 0; }
.pd-status { font-size: 11.5px; line-height: 1.6; margin-top: 8px; }
.pd-status.center { text-align: center; }
.pd-status.muted { color: var(--muted); } .pd-status.gold { color: var(--gold); } .pd-status.positive { color: var(--long); }
.goldtxt { color: var(--gold-soft, #F0CE96); }
.muted { color: var(--muted); }

/* 수익 보호 게이지 */
.pd-gauge-zero { font-size: 10.5px; color: var(--muted); margin: 8px 0 5px; }
.pd-gauge { position: relative; height: 14px; margin-bottom: 13px; }
.pd-gauge .pdg-track { position: absolute; left: 0; right: 0; top: 1px; height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .06); }
.pd-gauge .pdg-fill { position: absolute; left: 0; top: 1px; height: 12px; border-radius: 999px; background: linear-gradient(90deg, rgba(45, 212, 167, .5), var(--long)); }
.pd-gauge .pdg-protect { position: absolute; top: -2px; width: 2px; height: 18px; background: var(--gold); }
.pd-gauge .pdg-peak { position: absolute; top: -3px; width: 2px; height: 20px; background: var(--gold-soft, #F0CE96); }
.pd-gauge .pdg-cur { position: absolute; top: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--long); border: 2px solid #0C0C12; }
.pd-gauge-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.pd-gauge-legend b { font-size: 11px; font-weight: 700; }
.pd-gauge-legend .pdg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--long); box-shadow: 0 0 6px rgba(45, 212, 167, .6); }
.pd-gauge-legend .pdg-dash { display: inline-block; width: 10px; height: 2px; background: var(--gold); vertical-align: middle; }
.pd-gauge-legend .pdg-tick { display: inline-block; width: 2px; height: 11px; background: var(--gold-soft, #F0CE96); vertical-align: middle; }
/* 보호선 아래 실제 가격 병기 — %(가격 변동률)만으로는 "얼마에 익절되나"가 안 잡힌다. */
.pd-gauge-legend .pdg-sub { display: block; margin-top: 3px; font-size: 10px; font-weight: 600; text-align: center; color: var(--gold-soft, #F0CE96); opacity: .78; }
.pd-gauge-zero .pdg-basis { opacity: .8; }

/* 트리거 행 */
.pd-trig { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; }
.pd-tag { padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.pd-tag.long { color: var(--long); background: rgba(45, 212, 167, .14); }
.pd-tag.short { color: var(--short); background: rgba(242, 96, 125, .14); }
.pd-tag.gold { color: var(--gold); background: rgba(224, 177, 94, .14); }
.pd-trig-desc { flex: 1; color: var(--muted); }
.pd-trig b { font-size: 13px; font-weight: 600; color: var(--fg); }

/* 계약수/증거금/명목가치 */
.pd-facts3 { display: flex; margin-top: 10px; border: 1px solid var(--border); border-radius: 14px; padding: 9px 0; }
.pd-facts3 > div { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--border); }
.pd-facts3 > div:first-child { border-left: none; }
.pd-facts3 span { font-size: 11px; color: var(--muted); }
.pd-facts3 b { font-size: 13px; font-weight: 700; color: var(--fg); }

/* 종료 버튼 */
.pd-actions { display: flex; gap: 10px; margin-top: 12px; max-width: 560px; }
.pd-actions button { flex: 1; padding: 11px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.pd-btn-partial { background: none; border: 1px solid var(--border); color: var(--fg); }
.pd-btn-close { background: var(--short); border: none; color: #fff; font-weight: 700; }
.pd-autonote { text-align: left; font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 8px; max-width: 560px; }

/* 시트·다이얼로그 */
.pd-sheet-ov { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; }
.pd-sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 20px 20px 0 0; padding: 12px 20px 18px; max-width: 560px; margin: 0 auto; }
.pds-handle { width: 38px; height: 4px; border-radius: 999px; background: var(--border); margin: 0 auto 14px; }
.pds-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pds-head b { font-size: 16px; font-weight: 700; color: var(--fg); }
.pds-head span { font-size: 12px; font-weight: 600; }
.pds-chips { display: flex; gap: 10px; margin-bottom: 6px; }
.pds-chip { flex: 1; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: none; color: var(--fg); cursor: pointer; }
.pds-chip.on { border-color: var(--gold); background: rgba(224, 177, 94, .1); color: var(--gold); }
.pds-slider { width: 100%; accent-color: var(--short); margin: 10px 0; }
.pds-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12.5px; color: var(--muted); }
.pds-row b { font-size: 13px; font-weight: 700; color: var(--fg); }
.pds-go { width: 100%; margin-top: 16px; padding: 14px; border: none; border-radius: 10px; background: var(--short); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }
.pds-note { text-align: center; font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 10px; }
.pd-dialog { background: var(--surface); border-radius: 18px; padding: 22px; max-width: 340px; }
.pd-dialog.wide { max-width: 480px; max-height: 80vh; overflow-y: auto; }
.pd-dialog b { font-size: 16px; font-weight: 700; color: var(--fg); }
.pd-dialog p { font-size: 13px; color: var(--muted); line-height: 1.7; margin-top: 10px; }
.pdd-actions { display: flex; justify-content: flex-end; gap: 16px; margin-top: 16px; }
.pdd-actions button { background: none; border: none; font-size: 14px; cursor: pointer; }
.pdd-cancel { color: var(--muted); }
.pdd-ok { color: var(--short); }
.pdd-ok.gold { color: var(--gold-soft, #F0CE96); font-weight: 700; }
.pd-closing { background: transparent; text-align: center; color: var(--fg); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pd-closing b { font-size: 14px; }
.pd-closing span { font-size: 12px; color: var(--muted); }

/* ── 법적 문서 모달 (legal.js · 위험고지·약관·검증리포트) ── */
.lg-ov { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); z-index: 1300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lg-modal { width: 100%; max-width: 720px; height: 86vh; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0, 0, 0, .55); }
.lg-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex: none; }
.lg-head .lg-back { color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.lg-head .lg-back:hover { color: var(--gold); }
.lg-head b { font-size: 15px; font-weight: 700; color: var(--fg); }
.lg-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px 40px; }

/* ── 거래소 키 발급 가이드 (keyguide.js) ── */
.kg-link { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--gold); cursor: pointer; white-space: nowrap; }
.kg-link:hover { text-decoration: underline; }
.kg-intro { font-size: 13px; color: var(--muted); line-height: 1.65; margin: 0 0 16px; }
.kg-ip { padding: 15px 16px; background: var(--surface); border: 1px solid var(--gold); border-radius: 14px; margin-bottom: 12px; }
.kg-ip-label { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.kg-ip-row { display: flex; align-items: center; gap: 12px; }
.kg-ip-val { flex: 1; font-size: 21px; font-weight: 800; color: var(--gold); letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.kg-ip-copy { flex: none; padding: 7px 14px; background: transparent; border: 1px solid var(--gold); border-radius: 9px; color: var(--gold); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.kg-ip-copy:hover { background: rgba(224, 177, 94, .12); }
.kg-ip-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 8px; }
.kg-warn { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; background: rgba(217, 138, 138, .10); border: 1px solid rgba(217, 138, 138, .35); border-radius: 12px; margin-bottom: 18px; font-size: 12.5px; font-weight: 600; color: var(--fg); line-height: 1.5; }
.kg-warn-ic { color: #d98a8a; flex: none; }
.kg-tabs { display: flex; gap: 7px; margin-bottom: 14px; }
.kg-tab { flex: 1; padding: 10px 4px; text-align: center; background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all .14s; }
.kg-tab.on { background: rgba(224, 177, 94, .10); border-color: rgba(224, 177, 94, .40); color: var(--gold); }
.kg-note, .kg-pre, .kg-coin { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border-radius: 12px; margin-bottom: 14px; font-size: 12px; line-height: 1.6; color: var(--fg); }
.kg-note, .kg-coin { background: rgba(224, 177, 94, .08); border: 1px solid rgba(224, 177, 94, .20); }
.kg-pre { background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.kg-note-ic { flex: none; }
.kg-steps { margin-top: 4px; }
.kg-step { display: flex; align-items: flex-start; gap: 12px; padding: 7px 0; }
.kg-step-n { flex: none; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: rgba(224, 177, 94, .10); border: 1px solid rgba(224, 177, 94, .35); border-radius: 50%; color: var(--gold); font-size: 12px; font-weight: 800; }
.kg-step-t { font-size: 13.5px; color: var(--fg); line-height: 1.55; padding-top: 2px; }

.lg-trans-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; padding: 9px 12px; margin-bottom: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 10px; }
.lg-doc-title { font-size: 17px; font-weight: 700; color: var(--gold); }
.lg-doc-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; margin-bottom: 16px; }
.lg-sec { margin-bottom: 16px; }
.lg-sec-h { font-size: 13.5px; font-weight: 700; color: var(--fg); margin-bottom: 7px; }
.lg-sec-p { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.65; margin-bottom: 5px; }

.lg-h { font-size: 15px; font-weight: 700; color: var(--gold); margin: 22px 0 8px; }
.lg-body > .lg-h:first-child { margin-top: 0; }
.lg-p { font-size: 12.5px; color: var(--fg); line-height: 1.65; margin-bottom: 4px; }
.lg-p.muted { color: var(--muted); }

.lg-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin: 8px 0 4px; }
.lg-items { padding: 14px 16px; }
.lg-item { display: flex; align-items: flex-start; gap: 9px; padding: 6px 0; }
.lg-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-soft); margin-top: 7px; flex: none; }
.lg-dot.sm { width: 4px; height: 4px; margin-top: 8px; }
.lg-item-t { font-size: 12.5px; font-weight: 600; color: var(--fg); }
.lg-item-d { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 1px; }

.lg-metrics { overflow: hidden; }
.lg-metric { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid rgba(35, 42, 60, .5); }
.lg-metric:first-child { border-top: none; }
.lg-metric.odd { background: rgba(20, 24, 38, .4); }
.lg-metric-l { font-size: 12.5px; color: var(--fg); }
.lg-metric-v { font-size: 13px; font-weight: 700; color: var(--gold); }

.lg-checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.lg-chip { font-size: 11.5px; color: var(--fg); padding: 6px 11px; border-radius: 20px; background: var(--surface); border: 1px solid; }
.lg-chip.ok { border-color: rgba(224, 177, 94, .35); }
.lg-chip.no { border-color: rgba(242, 96, 125, .35); }
.lg-chip.no { color: var(--short); }

.lg-returns { overflow: hidden; padding-bottom: 6px; }
.lg-ret-head, .lg-ret-row { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr 1fr; align-items: center; padding: 11px 16px; }
.lg-ret-head { font-size: 11.5px; color: var(--muted); padding-bottom: 6px; }
.lg-ret-head span:not(:first-child), .lg-ret-row span:not(.lg-ret-label) { text-align: right; }
.lg-ret-row { border-top: 1px solid rgba(35, 42, 60, .5); }
.lg-ret-label { font-size: 12.5px; color: var(--fg); }
.lg-ret-row.hi .lg-ret-label { font-weight: 700; }
.lg-ret-tot { font-size: 12.5px; font-weight: 700; color: var(--fg); }
.lg-ret-row.hi .lg-ret-tot { color: var(--gold); }
.lg-ret-cagr { font-size: 12.5px; font-weight: 700; color: var(--gold); }
.lg-ret-mdd { font-size: 12px; color: var(--short); }

.lg-equity { padding: 14px 16px 12px; }
.lg-equity-top { display: flex; align-items: baseline; gap: 7px; margin-bottom: 8px; }
.lg-equity-top b { font-size: 20px; font-weight: 800; color: var(--gold); }
.lg-equity-top span { font-size: 11px; color: var(--muted); }
.lg-equity-svg { display: block; width: 100%; height: 150px; }

.lg-disc-top { font-size: 11.5px; color: var(--fg); line-height: 1.6; padding: 14px; border-radius: 14px; background: rgba(242, 96, 125, .08); border: 1px solid rgba(242, 96, 125, .35); margin-bottom: 18px; }
.lg-disc-bot { font-size: 11px; color: var(--muted); line-height: 1.7; padding: 14px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--border); margin-top: 20px; }

.lg-collapse { padding: 0; }
.lg-collapse summary { font-size: 12.5px; font-weight: 700; color: var(--gold-soft); padding: 14px 16px; cursor: pointer; list-style: none; }
.lg-collapse summary::-webkit-details-marker { display: none; }
.lg-collapse summary::before { content: '▸ '; }
.lg-collapse[open] summary::before { content: '▾ '; }
.lg-collapse-body { padding: 0 16px 16px; }

.lg-legal-btns { display: flex; gap: 10px; margin-top: 12px; }
.lg-btn { flex: 1; background: none; border: 1px solid var(--border); color: var(--gold-soft); border-radius: 10px; padding: 12px; font-size: 12.5px; cursor: pointer; }
.lg-btn:hover { border-color: var(--gold); }

.lg-company { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.lg-company-h { font-size: 12.5px; font-weight: 700; color: var(--fg); margin-bottom: 7px; }
.lg-company-body { font-size: 11.5px; color: var(--muted); line-height: 1.75; }
.lg-company-body a { color: var(--gold-soft); }

/* ── 하단 회사정보 푸터 (main 하단 스크롤 노출) ── */
/* 회사정보 푸터 — 왼쪽 정렬·바닥 고정(margin-top:auto). 콘텐츠 짧아도 화면 바닥에 붙는다. */
.app-footer { margin-top: auto; padding: 20px 0 8px; border-top: 1px solid var(--border); text-align: left; }
.af-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.af-links a { font-size: 12px; color: var(--gold-soft); cursor: pointer; }
.af-links a:hover { color: var(--gold); text-decoration: underline; }
.af-biz { font-size: 11px; color: var(--faint); line-height: 1.7; }
.af-biz a { color: var(--muted); }

/* ── 설정: 거래소 API 키 관리 ── */
.key-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.key-block:first-of-type { border-top: none; padding-top: 8px; }
.key-block-h { font-size: 13px; font-weight: 600; color: var(--fg); margin-bottom: 8px; }
.key-block-sub { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.key-live { font-size: 12px; font-weight: 600; color: var(--short); }
.key-label { display: block; font-size: 11.5px; color: var(--muted); margin: 8px 0 4px; }
.key-note { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.key-input { width: 100%; background: var(--bg2); border: 1px solid var(--border); color: var(--fg); border-radius: 10px; padding: 11px 13px; font-size: 13px; margin-top: 8px; font-family: inherit; }
.key-input:focus { outline: none; border-color: var(--gold); }
select.key-input { cursor: pointer; }
.key-save { width: 100%; margin-top: 12px; background: var(--surface2); border: 1px solid var(--border); color: var(--fg); border-radius: 10px; padding: 12px; font-size: 13px; cursor: pointer; }
.key-save:hover { border-color: var(--gold); color: var(--gold-soft); }
.key-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.key-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 6px 8px 6px 12px; font-size: 12.5px; color: var(--fg); }
.key-chip-x { background: none; border: none; color: var(--short); cursor: pointer; font-size: 12px; padding: 0 2px; line-height: 1; }
.key-chip-x:hover { color: #ff8fa6; }
.ex-select { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-btn { background: var(--bg2); border: 1px solid var(--border); color: var(--muted); border-radius: 10px; padding: 9px 16px; font-size: 12.5px; cursor: pointer; }
.ex-btn:hover { color: var(--fg); }
.ex-btn.on { border-color: var(--gold); color: var(--gold); background: rgba(224, 177, 94, .1); font-weight: 600; }

/* ── 헤더 배경음악 토글 ── */
.bgm-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; display: inline-flex; align-items: center; }
.bgm-btn:hover { color: var(--gold); }
.bgm-btn.on { color: var(--gold); }

/* ── 헤더 시그널 벨 + 배지 ── */
.sig-bell { position: relative; background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; display: inline-flex; align-items: center; }
.sig-bell:hover { color: var(--gold); }
.sig-badge { position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--short); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }

/* ── 시그널 승인 모달 ── */
.sig-ov { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); z-index: 1400; display: flex; align-items: center; justify-content: center; padding: 20px; }
.sig-modal { width: 100%; max-width: 460px; max-height: 88vh; background: var(--bg); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0, 0, 0, .55); }
.sig-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); flex: none; }
.sig-head b { font-size: 15px; font-weight: 700; color: var(--fg); }
.sig-head .sig-x { color: var(--muted); cursor: pointer; font-size: 15px; }
.sig-head .sig-x:hover { color: var(--gold); }
.sig-deck { overflow-y: auto; padding: 16px 18px 22px; }
.sig-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 40px 10px; line-height: 1.7; }
.sig-empty span { font-size: 12px; color: var(--faint); }

.sig-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; }
.sig-nav-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--fg); width: 34px; height: 30px; border-radius: 9px; font-size: 16px; cursor: pointer; }
.sig-nav-btn:disabled { opacity: .35; cursor: default; }
.sig-nav-idx { font-size: 12px; color: var(--muted); }

.sig-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.sig-top { display: flex; align-items: flex-start; gap: 11px; }
.sig-logo { width: 42px; height: 42px; flex: none; border-radius: 13px; background: linear-gradient(135deg, #F7C661, #E0941E); color: #0C0C0F; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.sig-top-mid { flex: 1; min-width: 0; }
.sig-sym { font-size: 15px; font-weight: 600; color: var(--fg); display: inline-flex; align-items: center; gap: 5px; }
.sig-chart-ic { font-size: 12px; opacity: .8; }
.tv-link { cursor: pointer; }
.tv-link:hover { color: var(--gold); }
.sig-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.sig-chip { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1px solid; display: inline-flex; gap: 5px; align-items: center; }
.sig-chip-fl { font-size: 10px; font-weight: 500; opacity: .85; }
.sig-sub { font-size: 11px; color: var(--muted); }
.sig-top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.sig-side { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.sig-side.long { color: var(--long); background: rgba(45, 212, 167, .15); }
.sig-side.short { color: var(--short); background: rgba(242, 96, 125, .15); }
.sig-lev { font-size: 10.5px; font-weight: 600; color: var(--gold-soft); padding: 3px 9px; border-radius: 999px; background: rgba(224, 177, 94, .1); border: 1px solid rgba(224, 177, 94, .2); }

.sig-nova, .sig-gravity, .sig-note, .sig-corr { font-size: 11.5px; line-height: 1.5; padding: 9px 12px; border-radius: 12px; margin-top: 10px; color: var(--fg); border: 1px solid; }
.sig-nova { background: rgba(224, 177, 94, .12); border-color: rgba(224, 177, 94, .4); }
.sig-nova b { color: var(--gold); }
.sig-gravity { background: rgba(92, 107, 192, .12); border-color: rgba(92, 107, 192, .4); }
.sig-gravity b { color: #9FA8FF; }
.sig-note.ember { background: rgba(255, 138, 92, .08); border-color: rgba(255, 138, 92, .33); }
.sig-note.alpha { background: rgba(47, 207, 196, .08); border-color: rgba(47, 207, 196, .33); }
.sig-note.stock { background: rgba(111, 216, 255, .08); border-color: rgba(111, 216, 255, .33); }
.sig-corr { background: rgba(224, 177, 94, .08); border-color: rgba(224, 177, 94, .35); color: var(--muted); }
.sig-corr b { color: var(--gold); }

.sig-price-row { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.sig-price-l { font-size: 12px; color: var(--muted); }
.sig-price-r { font-size: 12px; color: var(--muted); }
.sig-price-r b.long { color: var(--long); } .sig-price-r b.short { color: var(--short); }
.sig-price { font-size: 30px; font-weight: 800; color: var(--fg); margin-top: 2px; }

.sig-params { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 16px; padding: 12px 0; margin-top: 14px; }
.sig-param { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.sig-param-div { width: 1px; background: var(--border); }
.sig-param-k { font-size: 11px; color: var(--muted); }
.sig-param-v { font-size: 13px; font-weight: 700; }
.sig-param-v.fg { color: var(--fg); } .sig-param-v.muted { color: var(--muted); }
.sig-param-v.long { color: var(--long); } .sig-param-v.short { color: var(--short); }
.sig-param-sub { font-size: 10px; color: var(--muted); }

.sig-comp { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: #2FCFC4; background: rgba(47, 207, 196, .08); border: 1px solid rgba(47, 207, 196, .33); border-radius: 14px; padding: 11px 14px; margin-top: 12px; }
.sig-comp-cum { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--muted); }
.sig-comp-cum b { font-weight: 700; } .sig-comp-cum b.long { color: var(--long); } .sig-comp-cum b.short { color: var(--short); }

.sig-brief { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 11px 14px; margin-top: 12px; }
.sig-brief-h { font-size: 12px; font-weight: 700; color: var(--fg); margin-bottom: 6px; }
.sig-brief-h span { font-size: 10px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.sig-fact { display: flex; gap: 10px; padding: 4px 0; font-size: 12px; }
.sig-fact-l { width: 62px; color: var(--muted); font-size: 11.5px; flex: none; }
.sig-fact-v { font-weight: 600; color: var(--fg); }
.sig-fact-v.long { color: var(--long); } .sig-fact-v.short { color: var(--short); }

.sig-count { display: flex; flex-direction: column; align-items: center; margin-top: 18px; }
.sig-ring { width: 92px; height: 92px; }
.sig-ring-bg { fill: none; stroke: var(--border); stroke-width: 5; }
.sig-ring-fg { fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .5s linear, stroke .3s; }
.sig-ring-t { fill: var(--fg); font-size: 18px; font-weight: 800; }
.sig-ring-sub { fill: var(--muted); font-size: 8.5px; }
.sig-count-note { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.4; margin-top: 10px; padding: 0 10px; }

.sig-approve { width: 100%; margin-top: 18px; background: var(--gold); color: #1A1407; border: none; border-radius: 12px; padding: 15px; font-size: 14px; font-weight: 800; cursor: pointer; font-family: inherit; }
.sig-approve:hover { background: var(--gold-soft); }
.sig-approve:disabled { opacity: .6; cursor: default; }
.sig-reject { width: 100%; margin-top: 4px; background: none; border: none; color: var(--muted); padding: 12px; font-size: 13px; cursor: pointer; font-family: inherit; }
.sig-reject:hover { color: var(--fg); }

/* ── 설정: 알림음/배경음악 미리듣기 ── */
.audio-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.audio-test { background: var(--bg2); border: 1px solid var(--border); color: var(--fg); border-radius: 10px; padding: 9px 14px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.audio-test:hover { border-color: var(--gold); color: var(--gold-soft); }

/* ── 언어 선택 메뉴 (i18n) ── */
.lang-menu { position: fixed; z-index: 1500; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: 0 16px 48px rgba(0,0,0,.5); min-width: 150px; }
.lang-item { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--fg); font-size: 13px; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-family: inherit; }
.lang-item:hover { background: var(--bg2); }
.lang-item.on { color: var(--gold); font-weight: 600; }
