/* pocket-folio — Trading Hub 디자인을 그대로 따른다 (toss-volume-monitor/app/static/app.css 의 토큰 · 카드 · 목록 · 조절 막대).
   글자 크기를 설정에서 키울 수 있게 글자는 rem (1rem = 16px × 글자 크기 배율 --z · 2026-12-04 엄마 눈에 맞춰 15 → 16). 상승=빨강 / 하락=파랑. */
:root {
  color-scheme: light dark;
  --z: 1;
  --bg: #F5F5F7; --bg-elev: #FFFFFF; --card: #FFFFFF; --card-2: #F9F9FB;
  --label: #1D1D1F; --label-2: #636368; --label-3: #737378;
  --separator: rgba(0, 0, 0, 0.07); --fill: rgba(120, 120, 128, 0.10); --fill-2: rgba(120, 120, 128, 0.16);
  --accent: #0A7AFF; --accent-soft: rgba(10, 122, 255, 0.10);
  --up: #F0413C; --up-soft: rgba(240, 65, 60, 0.10); --down: #2A6DEB; --down-soft: rgba(42, 109, 235, 0.10);
  --warn: #FF9500; --warn-soft: rgba(255, 149, 0, 0.12); --good: #34C759; --good-soft: rgba(52, 199, 89, 0.12);
  --grid: rgba(0, 0, 0, 0.06);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.05), 0 20px 60px rgba(0, 0, 0, 0.10);
  --radius: 18px; --radius-sm: 12px; --sidebar: 236px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg-elev: #0E0E10; --card: #1C1C1E; --card-2: #232326;
    --label: #F5F5F7; --label-2: #A6A6AB; --label-3: #8A8A8F;
    --separator: rgba(255, 255, 255, 0.08); --fill: rgba(120, 120, 128, 0.20); --fill-2: rgba(120, 120, 128, 0.30);
    --accent: #0A84FF; --accent-soft: rgba(10, 132, 255, 0.16);
    --up: #FF5A54; --up-soft: rgba(255, 90, 84, 0.16); --down: #4C8DFF; --down-soft: rgba(76, 141, 255, 0.16);
    --warn: #FF9F0A; --warn-soft: rgba(255, 159, 10, 0.16); --good: #30D158; --good-soft: rgba(48, 209, 88, 0.16);
    --grid: rgba(255, 255, 255, 0.07);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.5), 0 24px 70px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg-elev: #0E0E10; --card: #1C1C1E; --card-2: #232326;
  --label: #F5F5F7; --label-2: #A6A6AB; --label-3: #8A8A8F;
  --separator: rgba(255, 255, 255, 0.08); --fill: rgba(120, 120, 128, 0.20); --fill-2: rgba(120, 120, 128, 0.30);
  --accent: #0A84FF; --accent-soft: rgba(10, 132, 255, 0.16);
  --up: #FF5A54; --up-soft: rgba(255, 90, 84, 0.16); --down: #4C8DFF; --down-soft: rgba(76, 141, 255, 0.16);
  --warn: #FF9F0A; --warn-soft: rgba(255, 159, 10, 0.16); --good: #30D158; --good-soft: rgba(48, 209, 88, 0.16);
  --grid: rgba(255, 255, 255, 0.07);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.5), 0 24px 70px rgba(0, 0, 0, 0.6);
}

/* ---------- 기본 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; font-size: calc(16px * var(--z)); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: pan-x pan-y; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--label); font: 1rem/1.45 var(--font);
  font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
input { font: inherit; }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.muted { color: var(--label-2); }
.hidden, [hidden] { display: none !important; }

/* ---------- 앱 골격: 노트북 = 왼쪽 메뉴, 폰 = 아래 탭 ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 22px 14px max(18px, env(safe-area-inset-bottom)); background: var(--bg-elev);
  border-right: 1px solid var(--separator); display: flex; flex-direction: column; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #0A7AFF, #5AC8FA); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(10,122,255,.35); flex: none; }
.brand .logo svg { width: 20px; height: 20px; }
.brand b { font-size: 1.13rem; letter-spacing: -0.02em; }
.brand small { display: block; color: var(--label-2); font-size: .77rem; margin-top: -2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border: 0; background: transparent;
  border-radius: 11px; color: var(--label-2); font-weight: 500; font-size: .97rem; cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.nav button svg { width: 19px; height: 19px; flex: none; }
.nav button:hover { background: var(--fill); color: var(--label); }
.nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-actions { display: flex; gap: 6px; }
.side-actions button { flex: 1; padding: 8px; border: 0; background: var(--fill); border-radius: 10px; font-size: .83rem; color: var(--label-2); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.side-actions button:hover { color: var(--label); background: var(--fill-2); }
.side-actions svg { width: 15px; height: 15px; }
.upd { font-size: .77rem; color: var(--label-3); padding: 0 6px; display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--label-3); flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); animation: pulse 2s infinite; }
.dot.pre { background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--good-soft); } 70% { box-shadow: 0 0 0 5px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.app > .main { min-width: 0; overflow-x: clip; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator); }
.topbar h1 { font-size: 1.33rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; white-space: nowrap; }
.topbar .acct { margin-left: auto; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--fill); color: var(--label); display: none; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.demo-pill { display: inline-flex; align-items: center; font-size: .73rem; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }

.page { display: none; padding: 22px 28px 60px; max-width: 1600px; margin: 0 auto; }
.page.active { display: block; animation: rise .28s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 카드 / 그리드 ---------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--separator); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card h3 { margin: 0 0 12px; font-size: .87rem; font-weight: 600; color: var(--label-2); letter-spacing: .01em; display: flex; align-items: center; gap: 8px; word-break: keep-all; }
.card h3 .r { margin-left: auto; font-weight: 500; color: var(--label-3); font-size: .83rem; }
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--card-2); border: 1px solid var(--separator); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.kpi .k { font-size: .8rem; color: var(--label-2); font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.kpi .v { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 3px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: .8rem; color: var(--label-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

/* ---------- 목록 ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--separator); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--fill); box-shadow: -6px 0 0 var(--fill), 6px 0 0 var(--fill); border-radius: 10px; border-bottom-color: transparent; }
.row.static { cursor: default; }
.row.static:hover { background: none; box-shadow: none; border-bottom-color: var(--separator); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; font-size: .97rem; display: flex; align-items: center; gap: 7px; white-space: nowrap; min-width: 0; }
.row .title .cd { font-size: .77rem; font-weight: 500; color: var(--label-3); flex: none; }
.row .title .tn { min-width: 0; overflow: hidden; white-space: normal; word-break: keep-all; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.3; }   /* 긴 ETF 이름은 두 줄까지 */
.row .meta { font-size: .8rem; color: var(--label-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.row .meta > span { white-space: nowrap; }
.row .right { text-align: right; flex: none; min-width: 84px; font-variant-numeric: tabular-nums; }
.row .right .v { font-weight: 600; font-size: .97rem; white-space: nowrap; }
.row .right .d { font-size: .8rem; color: var(--label-2); margin-top: 1px; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .77rem; font-weight: 600; padding: 3px 8px; border-radius: 7px; background: var(--fill); color: var(--label-2); white-space: nowrap; flex: none; }
.badge.buy { background: var(--up-soft); color: var(--up); }
.badge.sell { background: var(--down-soft); color: var(--down); }
.badge.div { background: var(--good-soft); color: var(--good); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }
/* 허브 .badge.xs 와 같다 — 표 · 목록 안의 계좌 표시. 줄 높이를 늘리지 않는다 (합계일 때만 줄이 커져 글자가 달라 보였다) */
.badge.xs { font-size: .66rem; padding: 1px 6px; border-radius: 6px; vertical-align: 1px; }
table.tbl td .badge.xs { margin-left: 6px; }
.scroll { overflow-y: auto; overscroll-behavior: contain; }
.empty { padding: 34px 16px; text-align: center; color: var(--label-2); font-size: .9rem; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .87rem; table-layout: fixed; }
table.tbl th { text-align: right; font-weight: 500; color: var(--label-3); font-size: .77rem; padding: 6px 8px; border-bottom: 1px solid var(--separator); white-space: nowrap; }
table.tbl th:first-child, table.tbl td:first-child { text-align: left; }
table.tbl td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--separator); white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
table.tbl tbody tr { cursor: pointer; }
table.tbl tbody tr:hover td { background: var(--fill); }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td .nm { font-weight: 600; }
table.tbl td .cd { font-size: .77rem; color: var(--label-3); margin-left: 6px; }

/* ---------- 조절 막대 · 단추 · 입력 ---------- */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-size: .83rem; font-weight: 500; color: var(--label-2); cursor: pointer; transition: background-color .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--label); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.seg button:focus:not(:focus-visible) { outline: none; }
/* 허브와 같다: 고른 칸이 굵어져도 칸 폭이 안 바뀌게 두 굵기 폭을 다 잡아 둔다 */
.seg button::before, .seg button::after { content: attr(data-t); display: block; height: 0; overflow: hidden; visibility: hidden; white-space: nowrap; pointer-events: none; user-select: none; -webkit-user-select: none; }
.seg button::before { font-weight: 500; }
.seg button::after { font-weight: 600; }
:root[data-theme="dark"] .seg button.on { background: #48484A; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: #48484A; box-shadow: 0 1px 3px rgba(0,0,0,.3); } }
.btn { border: 0; background: var(--fill); color: var(--label); min-height: 40px; padding: 0 16px; border-radius: 10px; font-size: .93rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, transform .05s; }
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--up); color: #fff; }
.btn.danger:hover { background: var(--up); filter: brightness(1.08); }
.inp { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid transparent; background: var(--fill); color: var(--label); outline: none; font-size: .93rem; min-width: 0; }
.inp:focus { border-color: var(--accent); background: transparent; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--label); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .9rem; font-weight: 500; opacity: 0; transition: opacity .25s ease, transform .25s ease; z-index: 100; pointer-events: none; box-shadow: var(--shadow-lg); }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 시트 (상세 · 설정) ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.35); display: grid; place-items: center; padding: 20px; }
.sheet { position: relative; width: min(560px, 100%); max-height: min(82vh, 760px); overflow: auto; background: var(--bg-elev); border: 1px solid var(--separator); border-radius: 20px; padding: 20px 20px 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.sheet h2 { margin: 0 40px 2px 0; font-size: 1.33rem; letter-spacing: -.02em; }
.sheet-bg { opacity: 0; transition: opacity .22s ease; }
.sheet-bg.on { opacity: 1; }
.sheet-bg:not(.on) { pointer-events: none; }
.sheet { transform: translateY(14px) scale(.985); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.sheet-bg.on .sheet { transform: none; }
.sheet .sub { color: var(--label-2); font-size: .87rem; margin-bottom: 14px; }
.sheet-x { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--fill); color: var(--label-2); cursor: pointer; display: grid; place-items: center; }
.sheet-x svg { width: 12px; height: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: .93rem; }
.kv dt { color: var(--label-2); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.set-sec { margin-top: 18px; }
.set-sec h4 { margin: 0 0 8px; font-size: .8rem; color: var(--label-3); font-weight: 600; }
.field { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--separator); }
.field:last-child { border-bottom: 0; }
.field .main { flex: 1; min-width: 0; }
.field .t { font-weight: 600; font-size: .93rem; display: block; }
.field .m { font-size: .8rem; color: var(--label-2); }
.pw-form { display: grid; gap: 8px; }
.err { color: var(--up); font-size: .85rem; min-height: 1.2em; }

/* ---------- 차트 ---------- */
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.row > .sw { margin-right: 10px; }
.split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--fill); margin: 4px 0 10px; }
.split > span { display: block; height: 100%; }
.idx { display: flex; flex-direction: column; gap: 6px; }
.idx .top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.idx .px { font-size: 1.73rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.idx .ch { font-weight: 600; font-variant-numeric: tabular-nums; }
.idx svg.spark { width: 100%; height: 56px; }
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.flow > div { background: var(--card-2); border: 1px solid var(--separator); border-radius: 12px; padding: 8px 10px; font-size: .8rem; color: var(--label-2); }
.flow b { display: block; font-size: .97rem; color: var(--label); font-variant-numeric: tabular-nums; }
.rank { width: 22px; font-size: .8rem; font-weight: 700; color: var(--label-3); text-align: center; flex: none; }
.sec-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--separator); font-size: .9rem; }
.sec-row:last-child { border-bottom: 0; }
.sec-row span:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.skel { background: linear-gradient(100deg, var(--fill) 30%, color-mix(in srgb, var(--fill-2) 70%, var(--fill)) 42%, var(--fill-2) 50%, color-mix(in srgb, var(--fill-2) 70%, var(--fill)) 58%, var(--fill) 70%);
  background-size: 200% 100%; animation: skIn .35s ease-out .12s both, shimmer 1.8s linear infinite; border-radius: 8px; min-height: 60px; color: transparent !important; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes skIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes subIn { from { opacity: 0; } to { opacity: 1; } }


/* ---------- 차트 색 (CSP: SVG 에 style 을 못 쓰므로 class 로) ---------- */
.page > * + * { margin-top: 14px; }
.bu { fill: var(--up); } .bd { fill: var(--down); }
.lu { stroke: var(--up); } .ld { stroke: var(--down); }
.track { stroke: var(--fill); }
.k0 { stroke: #0A7AFF; } .k1 { stroke: #34C759; } .k2 { stroke: #FF9500; } .k3 { stroke: #AF52DE; }
.k4 { stroke: #FF2D55; } .k5 { stroke: #5AC8FA; } .k6 { stroke: #FFCC00; } .k7 { stroke: #A2845E; } .kc { stroke: #B4B4BA; }
.f0 { fill: #0A7AFF; } .f1 { fill: #34C759; } .f2 { fill: #FF9500; } .f3 { fill: #AF52DE; }
.f4 { fill: #FF2D55; } .f5 { fill: #5AC8FA; } .f6 { fill: #FFCC00; } .f7 { fill: #A2845E; } .fc { fill: #B4B4BA; }
.split-svg { border-radius: 99px; overflow: hidden; margin: 2px 0 8px; }
.rank.top { color: var(--accent); }
.kpi.skel { min-height: 76px; }
@media (max-width: 860px) { .page > * + * { margin-top: 12px; } }

/* ---------- 탭 막대 (폰) ---------- */
.tabbar { display: none; }
@media (max-width: 1080px) {
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
/* 노트북(넓은 창): 허브처럼 상단바를 떠 있는 띠로 두지 않고 페이지 첫 줄처럼 — 배경·흐림·밑줄 없이 스크롤하면 같이 올라간다 */
@media (min-width: 861px) {
  .topbar { position: relative; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; padding: 18px 28px 6px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { flex-wrap: wrap; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; gap: 10px; border-bottom-color: transparent; background: color-mix(in srgb, var(--bg) 88%, transparent); }
  .topbar h1 { font-size: 1.73rem; font-weight: 800; letter-spacing: -0.025em; }
  .icon-btn { display: grid; margin-left: auto; }
  .topbar .acct { order: 5; margin-left: 0; width: 100%; display: grid; }
  .topbar .acct button { padding: 7px 0; }
  .page { padding: 8px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page.active { animation: subIn .26s ease-out both; }
  .card { padding: 16px; border-radius: 18px; box-shadow: none; }
  .card h3 { font-size: .93rem; color: var(--label); font-weight: 700; }
  .kpi { padding: 11px 12px; }
  .kpi .v { font-size: 1.25rem; }
  .seg button { padding: 7px 12px; font-size: .87rem; }
  .field { padding: 13px 0; }
  .g-2, .g-main { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
      .scroll { max-height: none !important; overflow: visible; }
    .tabbar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--bg-elev) 85%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--separator); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar button { border: 0; background: transparent; color: var(--label-3); font-size: .67rem; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; cursor: pointer; }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar button.active { color: var(--accent); }
  .sheet-bg { place-items: end stretch; padding: 0; }
  .sheet { width: 100%; border-radius: 20px 20px 0 0; max-height: 86vh; padding-bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition-duration: .32s; }
  .row:hover { background: none; box-shadow: none; border-bottom-color: var(--separator); }
  .row:last-child:hover { border-bottom-color: transparent; }
  .donut { width: 140px; height: 140px; }
  .legend .w { display: none; }
  .hide-m { display: none !important; }
}
@media (min-width: 861px) { .m-only { display: none !important; } }

/* ---------- 로그인 (허브 login.html 과 같은 카드) ---------- */
body.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 22px; padding: 36px 28px 28px; box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 12px 40px rgba(0,0,0,0.06); border: 1px solid var(--separator); }
.login-icon { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, #0A7AFF, #5AC8FA); margin: 0 auto 20px; display: grid; place-items: center; }
.login-icon svg { width: 34px; height: 34px; }
.login-card h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; text-align: center; margin: 0 0 6px; }
.login-sub { text-align: center; color: var(--label-2); font-size: 1rem; margin: 0 0 24px; }
.login-card form { display: grid; gap: 10px; }
.login-inp { width: 100%; height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; background: var(--fill); color: var(--label); font-size: 1.13rem; outline: none; }
.login-inp:focus { border-color: var(--accent); background: transparent; }
.login-inp.code::placeholder { letter-spacing: normal; }
.login-inp.code { text-align: center; letter-spacing: .3em; font-weight: 600; font-variant-numeric: tabular-nums; }
.login-btn { width: 100%; height: 52px; margin-top: 6px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 1.13rem; font-weight: 600; cursor: pointer; }
.login-btn:disabled { opacity: .5; }
.login-err { display: none; margin-top: 14px; padding: 11px 14px; border-radius: 10px; font-size: .93rem; background: var(--up-soft); color: var(--up); }
.login-err.on { display: block; }
.login-foot { text-align: center; color: var(--label-3); font-size: .8rem; margin-top: 22px; }

/* 히트맵 (허브와 같은 색 · 칸 모양) */
.hm-card { padding: 14px 14px 12px; }
.hm-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hm-bar h3 { margin: 0 auto 0 6px; }
.hm-bar .seg.off { visibility: hidden; }
.hm { position: relative; height: 600px; border-radius: 12px; overflow: hidden; background: var(--card); transition: opacity .2s; }
.hm.hm-out { opacity: 0; transition-duration: .12s; }
.hm > .empty { position: absolute; inset: 0; display: grid; place-items: center; }
.hm-t { position: absolute; box-sizing: border-box; color: #fff; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1px 3px; }
.hm-t .n { font-weight: 600; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
.hm-t .p { font-weight: 700; font-variant-numeric: tabular-nums; opacity: .95; line-height: 1.2; }
.hm-t.xs .n, .hm-t.xs .p { display: none; }
.hm-t.sm .p { display: none; }
@media (hover: hover) { .hm-t:hover { z-index: 2; box-shadow: 0 0 0 2px var(--label) inset; } }
.hm-g { position: absolute; box-sizing: border-box; pointer-events: none; }
.hm-g > b { position: absolute; left: 6px; top: 2px; max-width: calc(100% - 12px); font-size: 11px; line-height: 15px; font-weight: 700; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-foot { display: flex; align-items: center; gap: 12px; margin: 10px 6px 0; font-size: .77rem; color: var(--label-3); font-variant-numeric: tabular-nums; }
.hm-foot #hmNote { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-legend { display: flex; align-items: center; gap: 6px; flex: none; }
.hm-legend i { display: block; width: 120px; height: 8px; border-radius: 4px; }
@media (max-width: 860px) {
  .hm-card { padding: 12px 10px 10px; }
  .hm { height: 520px; }
  .hm-bar h3 { margin-left: 4px; }
  .hm-legend i { width: 72px; }
}
@media (max-width: 860px) {
  /* 히트맵 고르기: 제목 · 기간 한 줄, 코스피 · 코스닥 · 업종은 아래 줄 전체 폭 (기간 칸은 숨겨도 자리를 지켜 아래가 밀리지 않게) */
  .hm-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .hm-bar #hmKind { grid-column: 1 / -1; display: grid; }
  .hm-bar #hmKind button { padding: 7px 0; }
  .flow { gap: 6px; }
  .flow > div { padding: 8px 8px; }
  .flow b { font-size: .9rem; white-space: nowrap; }
}

/* ---------- 매매 기록 (허브 기록 탭과 같은 구성) ---------- */
.rec-kpis { display: grid; grid-template-columns: minmax(0, 1fr); }
.rec-kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; }
.rec-kpi.skel { min-height: 96px; }
.rec-kpi .k-r { margin-left: auto; padding-left: 8px; font-weight: 500; color: var(--label-3); white-space: nowrap; }
.rec-row.single { grid-template-columns: minmax(0, 1fr); }
.rec-row h3 { min-height: 34px; }
.rec-nav { display: inline-flex; gap: 4px; margin: 0 8px 0 auto; }
.rec-nav button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--fill); color: var(--label); font-size: 1.2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.rec-nav button:hover:not(:disabled) { background: var(--fill-2); }
.rec-nav button:disabled { opacity: .35; cursor: default; }
.rec-note { margin-top: 8px; font-size: .77rem; color: var(--label-3); font-variant-numeric: tabular-nums; }
.rec-note:empty { display: none; }
.chart { position: relative; }
.chart .cv svg { display: block; }
.cv-empty { display: grid; place-items: center; padding: 0; }
.rc text { font-size: 11px; fill: var(--label-3); font-variant-numeric: tabular-nums; }
.rc .gl { stroke: var(--grid); stroke-width: 1; }
.rc .zl { stroke: var(--label-3); stroke-width: 1; }
.rc .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rc .au { fill: var(--up-soft); } .rc .ad { fill: var(--down-soft); }
.rc .gd { stroke: var(--label-3); stroke-width: 1; stroke-dasharray: 3 3; }
.rc .du { fill: var(--up); stroke: var(--card); stroke-width: 2; } .rc .dd { fill: var(--down); stroke: var(--card); stroke-width: 2; }
.gest { position: absolute; inset: 0; z-index: 2; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: pointer; }
#pfHistChart .gest { cursor: default; }
.tip { position: absolute; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .12s; min-width: 150px; background: var(--bg-elev); border: 1px solid var(--separator); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 9px 12px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.tip.on { opacity: 1; }
.tip .t { font-weight: 600; margin-bottom: 4px; white-space: nowrap; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; color: var(--label-2); padding: 1px 0; white-space: nowrap; }
.tip .r b { color: var(--label); font-weight: 600; }
.hist-one { font-size: .9rem; padding: 2px 2px 4px; font-variant-numeric: tabular-nums; }
.hist-one b { font-size: 1.13rem; margin-right: 6px; }
.inc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; align-items: stretch; }
.inc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1fr 1fr; gap: 10px; }
.inc-cell { display: flex; flex-direction: column; justify-content: center; }
.inc-cell .v { font-size: 1.33rem; }
.inc-list { max-height: 13.4rem; overflow-y: auto; border-top: 1px solid var(--separator); }
.inc-row { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) 6.6rem 9.6rem; gap: 10px; align-items: center; padding: 7px 4px; font-size: .83rem; border-bottom: 1px solid var(--separator); cursor: pointer; font-variant-numeric: tabular-nums; }
.inc-row:hover { background: var(--fill); }
.inc-row > span:nth-child(3), .inc-row > span:nth-child(4) { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inc-lab { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; min-width: 0; }
.inc-list .empty { padding: 26px 0; }
table.rec-tbl { table-layout: auto; }
.rec-tbl td, .rec-tbl th { white-space: nowrap; }
.rec-tbl td b { font-weight: 600; }
.rec-tbl .badge { margin-left: 6px; padding: 2px 6px; }
.rec-tbl tr.none td { text-align: center !important; color: var(--label-3); padding: 28px 0; cursor: default; }
.rec-tbl tr.none:hover td { background: none; }
.rec-pct { margin-left: 6px; font-size: .83rem; font-weight: 500; white-space: nowrap; }
.rec-sel { color: var(--accent); font-weight: 600; }
.mini { border: 0; background: var(--fill); color: var(--label); border-radius: 9px; height: 28px; margin: -5px 0 -5px 8px; padding: 0 11px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.mini:hover { background: var(--fill-2); }
.rec-sells { max-height: 560px; overflow-y: auto; }
.rec-sells thead th, .rec-pop-list thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
#recSellTbl td:nth-child(-n+2), #recSellTbl th:nth-child(-n+2), #recPopTbl td:first-child, #recPopTbl th:first-child { text-align: left; }
.sheet.wide { width: min(820px, 100%); }
.rec-pop h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.rec-pop-sym { font-size: .87rem; font-weight: 500; color: var(--label-2); }
.rec-pop-now { margin-left: 6px; font-size: 1rem; white-space: nowrap; }
.rec-pop-now .lab { margin-right: 6px; font-size: .8rem; font-weight: 500; color: var(--label-2); }
.rec-pop .sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
.rec-pop-list { max-height: min(56vh, 520px); overflow-y: auto; }
#recPopTbl tbody tr { cursor: default; }
#pfHistNote span { white-space: nowrap; }
#pfHistNote span + span::before { content: " · "; }
@media (min-width: 861px) { .rec-sells, .rec-pop-list { padding-right: 10px; } }
@media (max-width: 1080px) { .inc-wrap { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
@media (max-width: 860px) {
  .rec-nav { display: none; }
  #recSeg { margin-left: auto; }
  .rec-kpi { padding: 16px; box-shadow: none; }
  .rec-kpi .s { white-space: normal; }
  .inc-row { grid-template-columns: 4.2rem minmax(0, 1fr) auto; gap: 2px 10px; }
  #pfHist h3 { flex-wrap: wrap; row-gap: 2px; }
  #pfHistNote { flex-basis: 100%; margin-left: 0; display: flex; flex-wrap: wrap; column-gap: 8px; font-size: .8rem; }
  #pfHistNote span + span::before { content: none; }
  .rec-tbl .cd, .rec-tbl .pp { display: none; }
  .inc-row > span:nth-child(4) { grid-column: 2 / -1; text-align: left; font-size: .77rem; }
  .inc-list { max-height: 15.4rem; }
  .rec-sells { max-height: none; overflow: visible; }
}
.tbl-wrap { overflow-x: auto; }
@media (max-width: 380px) { #recSymTbl .rec-pct { display: none; } }   /* 360px 폰: 실현 손익 옆 수익률까지 두면 아랫줄 승률이 잘렸다 */
#recSellTbl .cd { display: none; }   /* 매도 기록은 종목 코드 없이 (넓이가 모자랐다 — 종목별 성과 · 창에는 있다) */
/* 1180px 아래 노트북 · 태블릿: 보유 종목은 폰처럼 목록, 요약 칸은 두 줄 (16px 글자로 칸이 모자라 숫자가 잘렸다) */
@media (min-width: 861px) and (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.rec-tbl td, .rec-tbl th { padding-left: 6px !important; padding-right: 6px !important; }
/* 업종 카드: 옆 카드(내 종목 수급) 높이에 맞춰 채우고 넘치면 카드 안에서 스크롤 — 8줄만 두면 아래가 290px 비었다 */
#mkGrid > .card:has(#mkSec) { display: flex; flex-direction: column; }
#mkSec { flex: 1 1 0; min-height: 19rem; overflow-y: auto; }
/* 표 → 두 줄 목록: 폰 · 1180px 아래 노트북 (16px 글자로 매도 기록 8칸이 카드를 240px 넘었다) */
@media (max-width: 1180px) {
  .rec-card .tbl-wrap, .rec-pop-list { overflow-x: hidden; }
  .rec-tbl, .rec-tbl tbody { display: block; width: 100%; }
  .rec-tbl thead { display: none; }
  .rec-tbl tr { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; column-gap: 4px; row-gap: 2px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--separator); }
  .rec-tbl tbody tr:first-child { border-top: 0; }
  table.rec-tbl td { padding: 0 !important; border: 0 !important; background: none !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
  .rec-tbl td b { font-size: .93rem; }
  .rec-tbl .rec-sub { font-size: .8rem; } .rec-tbl .rec-sub:not(.up):not(.down) { color: var(--label-3); }
  .rec-tbl td.rec-r { text-align: right; justify-self: end; }
  .rec-tbl tr.none { display: block; } .rec-tbl tr.none td { display: block; }
  #recSymTbl td:nth-child(1) { grid-area: 1 / 1 / 2 / 3; }
  #recSymTbl td:nth-child(4) { grid-area: 1 / 3; }
  #recSymTbl td:nth-child(2) { grid-area: 2 / 1; }
  #recSymTbl td:nth-child(3) { grid-area: 2 / 2; }
  #recSymTbl td:nth-child(3)::before { content: "· 승률 "; }
  #recSymTbl td:nth-child(5) { grid-area: 2 / 3; }
  #recSellTbl td:nth-child(2) { grid-area: 1 / 1 / 2 / 3; }
  #recSellTbl td:nth-child(5) { grid-area: 1 / 3; }
  #recSellTbl td:nth-child(1) { grid-area: 2 / 1; }
  #recSellTbl td:nth-child(3) { grid-area: 2 / 2; }
  #recSellTbl td:nth-child(3)::before { content: "· "; }
  #recSellTbl td:nth-child(8) { grid-area: 2 / 3; }
  #recSellTbl td:nth-child(8)::before { content: "판 뒤 "; color: var(--label-3); }
  #recSellTbl td:nth-child(4), #recSellTbl td:nth-child(6), #recSellTbl td:nth-child(7) { display: none; }
  #recPopTbl td:nth-child(1) { grid-area: 1 / 1 / 2 / 3; font-size: .93rem; font-weight: 600; }
  #recPopTbl td:nth-child(4) { grid-area: 1 / 3; }
  #recPopTbl td:nth-child(2) { grid-area: 2 / 1; }
  #recPopTbl td:nth-child(3) { grid-area: 2 / 2; }
  #recPopTbl td:nth-child(3)::before { content: "· "; }
  #recPopTbl td:nth-child(6) { grid-area: 2 / 3; }
  #recPopTbl td:nth-child(6)::before { content: "판 뒤 "; color: var(--label-3); }
  #recPopTbl td:nth-child(5) { display: none; }
}
@media (min-width: 861px) and (max-width: 1180px) {   /* 지수 카드 수급 칸: '−25,244억' 이 두 줄로 꺾였다 */
  .flow { gap: 6px; }
  .flow > div { padding: 8px 8px; }
  .flow b { font-size: .9rem; white-space: nowrap; }
}
/* 글자 '크게' · 좁은 폰: 큰 숫자는 화면 폭에 맞춰 조금 줄이고, 표의 종목 이름은 이름만 … (계좌 배지는 보이게) */
@media (max-width: 860px) {
  .kpi .v { font-size: min(1.25rem, 5.4vw); }
  .inc-cell .v { font-size: min(1.33rem, 5.4vw); }
  .inc-cell .s { white-space: normal; }
}
@media (max-width: 1180px) {
  #recSymTbl td:nth-child(1), #recSellTbl td:nth-child(2) { display: flex; align-items: baseline; min-width: 0; }
  #recSymTbl td:nth-child(1) b, #recSellTbl td:nth-child(2) b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .rec-tbl td .badge { flex: none; }
}

/* 자산 구성 도넛 — 허브와 같은 규칙 (허브 app.css '자산 구성 도넛') */
.mix-wrap { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.mix { flex: 1 1 100%; }
.mix-body { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.mix-donut { flex: 0 0 auto; }
.mix-donut .mix-arc { transition: opacity .15s ease; }
.mix-donut.dim .mix-arc { opacity: .3; }
.mix-donut.dim .mix-arc.on { opacity: 1; }
.mix-donut .mix-center { font-weight: 700; fill: var(--label); font-variant-numeric: tabular-nums; }
.mix-donut .mix-sub { font-weight: 500; font-size: 10.5px; fill: var(--label-3); }
.mix-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 380px; min-width: 0; }
.mix-legend li { display: grid; grid-template-columns: 10px minmax(90px, 150px) 1fr auto auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; font-size: .87rem; }
.mix-legend .bar { height: 7px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.mix-legend .bar .fill { display: block; height: 100%; border-radius: 4px; width: 0; transition: width .25s ease; }
@media (hover: hover) { .mix-legend li:hover { background: var(--fill); } }
.mix-legend .dot { width: 9px; height: 9px; border-radius: 3px; }
.mix-legend .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--label-2); }
.mix-legend .pct { font-weight: 700; color: var(--label); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.mix-legend .amt { color: var(--label-3); font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
@media (max-width: 860px) {
  .mix-body { gap: 14px; justify-content: center; }
  .mix-legend { flex-basis: 100%; }
  .mix-legend li { grid-template-columns: 10px minmax(0, 1fr) auto auto; padding: 7px 2px; font-size: .9rem; }
  .mix-legend .bar { display: none; }
  #pfMixNote { display: none; }
}

/* 폰 위쪽 줄의 화면 모드 · 로그아웃 (허브 폰 설정 탭의 .set-acct 와 같은 버튼) */
.btn.sm { font: inherit; font-size: .75rem; font-weight: 600; min-height: 0; height: 28px; padding: 0 11px; border-radius: 9px; border: 0; background: var(--fill); color: var(--label); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; line-height: 1; white-space: nowrap; }
@media (max-width: 860px) {
  .top-acts:not([hidden]) { display: flex !important; gap: 8px; margin-left: auto; }
  .top-acts .btn { height: 32px; border-radius: 10px; }
}

/* 종목 히트맵 — 허브와 같은 규칙: 대분류(.sm-g) › 업종(.sm-i) › 종목(.sm-t) */
.hm-t { transition: background-color .5s ease, left .4s ease, top .4s ease, width .4s ease, height .4s ease; }
.sm-g, .sm-i { position: absolute; box-sizing: border-box; pointer-events: none; transition: left .4s ease, top .4s ease, width .4s ease, height .4s ease; }
.hm.no-anim .hm-t, .hm.no-anim .sm-g, .hm.no-anim .sm-i { transition: none; }
.sm-g > b { position: absolute; left: 6px; top: 3px; right: 6px; font-size: 11px; font-weight: 700; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.sm-i > b { position: absolute; left: 4px; top: 0; right: 4px; font-size: 10px; font-weight: 600; line-height: 13px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 이름을 누르면 그 묶음 창 (글자 폭만 누를 수 있게) */
.sm-g > b.pick, .sm-i > b.pick { pointer-events: auto; cursor: pointer; right: auto; max-width: calc(100% - 12px); }
@media (hover: hover) { .sm-g > b.pick:hover, .sm-i > b.pick:hover { color: var(--label); text-decoration: underline; } }
.sm-t.sm .n { display: block; } .sm-t.sm .p { display: none; }
.hm.stocks { height: 680px; }
.sheet:has(.sm-pop) { width: min(1100px, 100%); max-height: 92vh; }
.sheet-x.sheet-back { right: 48px; }
.sheet .sm-pop h2 { margin-right: 80px; }
.sm-pop h2 .sm-pop-sub { margin-left: 8px; font-size: .8rem; font-weight: 500; color: var(--label-3); letter-spacing: 0; }
.sm-pop h2 .sm-pop-sub b { font-weight: 600; }
.hm.sm-pop-map { height: min(64vh, 620px); margin-top: 14px; }
@media (max-width: 860px) {
  .sm-pop h2 .sm-pop-sub { display: block; margin: 4px 0 0; }
  .hm.sm-pop-map { height: 62vh; }
}

/* 포트폴리오 — 허브와 같은 규칙 (위쪽 요약 카드 · 보유 종목 표 · 폰 요약) */
.pf-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-head .name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.pf-hero-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 600; color: var(--good); background: var(--good-soft); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.live-pill .dot { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); animation: pulse 2s infinite; }
.live-pill.off { color: var(--label-3); background: var(--fill); }
.live-pill.off .dot { background: var(--label-3); box-shadow: none; animation: none; }
.pf-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pf-toolbar h3 { margin: 0; }
.pf-toolbar .pf-cnt { font-weight: 500; font-size: .8rem; color: var(--label-3); margin-left: 6px; }
.pf-toolbar .live-pill { margin-left: auto; }
table.pf-tbl { table-layout: fixed; min-width: 1080px; }
table.pf-tbl td { padding: 10px 10px; font-size: .82rem; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
table.pf-tbl td:first-child { font-weight: 600; white-space: nowrap; }
table.pf-tbl td:first-child .code { font-size: .75rem; color: var(--label-3); font-weight: 500; margin-left: 6px; }
table.pf-tbl tr.h { cursor: pointer; }
@media (hover: hover) { table.pf-tbl tr.h:hover td { background: var(--fill); } }
table.pf-tbl tr.colhead td { padding: 4px 8px 8px; font-size: .72rem; color: var(--label-3); font-weight: 500; border-bottom: 1px solid var(--separator); white-space: nowrap; cursor: default; }
table.pf-tbl td.pf-none { text-align: center; color: var(--label-3); padding: 30px; }
/* 칸 폭: 허브 표와 같은 순서 · 원화 금액이 달러보다 길어 금액 칸을 조금 넓혔다 */
.pf-tbl col.w17 { width: 17%; } .pf-tbl col.w16 { width: 16%; } .pf-tbl col.w11 { width: 11%; } .pf-tbl col.w10 { width: 10%; } .pf-tbl col.w9 { width: 9%; } .pf-tbl col.w8 { width: 8%; } .pf-tbl col.w7 { width: 7%; }
@media (max-width: 1180px) { .pf-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#pfM { display: none; }
#pfM + #pfHero { margin-top: 0; }
@media (max-width: 860px) {
  #pfHero, #pfTableCard { display: none; }
  #pfM { display: block !important; }
  #pfM > .card + .card { margin-top: 12px; }
  .pfm-hero { padding: 16px; }
  .pfm-acct { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--label-2); font-weight: 600; }
  .pfm-acct .live-pill { margin-left: auto; }
  .pfm-k { margin-top: 14px; font-size: .82rem; color: var(--label-2); }
  .pfm-total { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
  .pfm-pl { font-size: .94rem; font-weight: 600; margin-top: 2px; }
  .pfm-stats { margin-top: 14px; padding-top: 6px; border-top: 1px solid var(--separator); }
  .pfm-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; }
  .pfm-stat span { font-size: .88rem; color: var(--label-2); flex: none; }
  .pfm-stat b { font-size: .94rem; font-weight: 700; text-align: right; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pfm-list { padding: 16px 16px 6px; }
  .pfm-list h3 { margin-bottom: 4px; }
  .pfm-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--separator); cursor: pointer; }
  .pfm-row:last-child { border-bottom: 0; }
  .pfm-row:active { opacity: .6; }
  .pfm-row .l { flex: 1; min-width: 0; }
  .pfm-row .nm { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pfm-row .nm .badge { margin-left: 6px; }
  .pfm-row .sub { font-size: .78rem; color: var(--label-3); margin-top: 2px; }
  .pfm-row .r { text-align: right; flex: none; min-width: 140px; }
  .pfm-row .val { font-size: 1rem; font-weight: 700; }
  .pfm-row .pl { font-size: .82rem; font-weight: 600; margin-top: 2px; }
  .pf-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 넓은 창(맥 · 그램): 허브와 같다 — 오른쪽 내용(.main)만 스크롤해서 사이드바는 절대 안 움직인다.
   고무줄 효과는 .main 안에서만 (contain). 위쪽 줄은 스크롤 영역 밖에 고정해 두고 스크롤에 맞춰 같이 올려 보낸다 */
html[data-env="desktop"] { --topbar-h: 64px; }
@keyframes topbar-away { to { transform: translateY(calc(-1 * var(--topbar-h))); } }
@media (min-width: 861px) {
  html[data-env="desktop"], html[data-env="desktop"] body { height: 100%; overflow: hidden; }
  html[data-env="desktop"] .app { height: 100vh; height: 100dvh; min-height: 0; }
  html[data-env="desktop"] .app > .main { height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior-y: contain; }
  @supports (animation-timeline: scroll()) {
    html[data-env="desktop"] .app > .main { scroll-timeline: --pf-main block; padding-top: var(--topbar-h); }
    html[data-env="desktop"] .topbar { position: fixed; top: 0; left: var(--sidebar); right: 0; height: var(--topbar-h); box-sizing: border-box; padding-right: calc(28px + var(--main-sbw, 0px)); animation: topbar-away linear both; animation-timeline: --pf-main; animation-range: 0 var(--topbar-h); }
    html[data-env="desktop"] .app > .main > .page.active { min-height: calc(100% + 1px); }
  }
}
