/* =====================================================================
   모바일 셸 — 종합 앱 5탭 레이아웃 (Phase 1 프로토타입)
   theme.css 변수(--bg/--line/--up/--down/--green/--radius …)를 재사용한다.
   데스크톱에서도 480px 모바일 프레임으로 미리보기.
   ===================================================================== */
body.mobile { background: #0b0e13; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 0 1px rgba(0,0,0,.05);
}

/* ===== 헤더 ===== */
.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}
.ah-logo { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.ah-logo b { color: #b79dff; }   /* 블랙스완 브랜드 액센트(바이올렛) */
.ah-actions { display: flex; align-items: center; gap: 6px; }
.ah-btn {
  position: relative; border: 0; background: transparent; cursor: pointer;
  width: 38px; height: 38px; border-radius: 12px; font-size: 19px;
  display: grid; place-items: center; color: var(--text);
}
.ah-btn:active { background: var(--line-soft); }
.ah-badge {
  position: absolute; top: 3px; right: 2px;
  background: var(--kr-red); color: #fff; font-size: 10px; font-weight: 700;
  line-height: 1; padding: 2px 4px; border-radius: 8px;
}

/* ===== 본문 스크롤 ===== */
.home-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 16px calc(76px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}

/* ===== 섹션 카드 공통 ===== */
.sec { background: var(--window); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sec-pad { padding: 16px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.sec-more { font-size: 13px; color: var(--text-faint); border: 0; background: none; cursor: pointer; }
.sec-date { font-size: 12px; color: var(--text-faint); }

/* ===== 교육 히어로 (최상단) ===== */
.edu-hero {
  background: linear-gradient(135deg, #58CC02 0%, #46a302 100%);
  color: #fff; border-radius: var(--radius); padding: 18px;
  box-shadow: 0 12px 26px -14px rgba(70,163,2,.7);
}
.edu-hero .eh-top { display: flex; align-items: center; justify-content: space-between; }
.edu-hero .eh-streak { font-size: 13px; font-weight: 700; background: rgba(255,255,255,.22); padding: 5px 10px; border-radius: 999px; }
.edu-hero h2 { margin: 10px 0 2px; font-size: 20px; font-weight: 800; }
.edu-hero p { margin: 0 0 12px; font-size: 13px; opacity: .92; }
.eh-mission { height: 8px; background: rgba(255,255,255,.28); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.eh-mission > i { display: block; height: 100%; background: #fff; border-radius: 999px; }
.eh-cta { display: inline-block; background: #fff; color: var(--green-d); font-weight: 800; font-size: 14px; padding: 10px 16px; border-radius: 12px; }
.eh-lu { position: absolute; }

/* ===== 관심 브리핑 (가로 캐러셀) ===== */
.brief-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.brief-row::-webkit-scrollbar { display: none; }
.brief-item { flex: 0 0 auto; width: 72px; text-align: center; cursor: pointer; }
.brief-logo { width: 56px; height: 56px; margin: 0 auto 6px; border-radius: 50%; background: var(--line-soft);
  display: grid; place-items: center; font-size: 22px; position: relative; }
.brief-name { font-size: 12px; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brief-rate { font-size: 12px; font-weight: 700; }
.brief-add .brief-logo { border: 2px dashed var(--line); background: transparent; color: var(--text-faint); }

/* 과열지수 배지(도넛 링) */
.heat-ring { position: absolute; inset: -3px; border-radius: 50%; padding: 3px;
  background: conic-gradient(var(--heat-c) calc(var(--heat)*1%), var(--line-soft) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0); }

/* ===== 리스트 아이템 (이슈/시그널/인사이트/공지) ===== */
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.item:first-of-type { border-top: 0; }
.item-body { flex: 1; min-width: 0; }
.item-title { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.4; }
.item-sub { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.item-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--line-soft); flex: 0 0 auto; }

/* 시그널 배지 */
.sig { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.sig:first-of-type { border-top: 0; }
.sig-tag { font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.sig-tag.opp { color: #7fd6a0; background: #14251c; }
.sig-tag.risk { color: #b79dff; background: #221a33; }
.sig-main { flex: 1; min-width: 0; }
.sig-name { font-size: 14px; font-weight: 700; }
.sig-reason { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-ago { font-size: 12px; color: var(--text-faint); }

/* ===== 퀵메뉴 ===== */
.quick { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px;
  background: var(--window); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 12px; color: var(--text); font-weight: 600; }
.quick .qi { font-size: 24px; }

/* ===== 인기 종목 픽 ===== */
.pick-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.pick-tabs button { border: 1px solid var(--line); background: var(--window); color: var(--text-dim);
  font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.pick-tabs button.on { background: var(--text); color: #fff; border-color: var(--text); }
.rowlist .rrow { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.rowlist .rrow:first-child { border-top: 0; }
.rrow .rlogo { width: 32px; height: 32px; border-radius: 50%; background: var(--line-soft); display: grid; place-items: center; font-size: 14px; flex: 0 0 auto; }
.rrow .rname { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .rrate { font-size: 14px; font-weight: 800; }
/* 급등 이유 한 줄(뉴스 헤드라인) */
.rowlist .rrow.has-news { align-items: flex-start; }
.rrow.has-news .rlogo, .rrow.has-news .rrate, .rrow.has-news .star-btn { margin-top: 1px; }
.rrow.has-news .rname { white-space: normal; }
.rrow .rn-t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-news { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; line-height: 1.35; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-news:empty { display: none; }
/* 고수의 선택 — 전략 설명 */
.sec-note { margin: 2px 0 10px; font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }
.strat-desc { margin: 4px 0 12px; padding: 10px 12px; background: var(--line-soft); border-radius: 10px;
  font-size: 12.5px; line-height: 1.55; color: var(--text-dim); }
.strat-desc b { color: var(--text); font-weight: 700; }
.strat-desc:empty { display: none; }
/* 순위 더보기 뷰 */
.rank-back { display: inline-flex; align-items: center; margin-bottom: 10px; padding: 6px 12px 6px 8px; border: 1px solid var(--line-soft);
  border-radius: 999px; background: var(--window); color: var(--text-dim); font-size: 13px; font-weight: 600; cursor: pointer; }
.rank-back:active { transform: scale(.97); }
.rrow .rk-no { width: 22px; flex: 0 0 auto; text-align: center; font-size: 13px; font-weight: 800; color: var(--text-faint);
  font-variant-numeric: tabular-nums; }
.rrow.has-news .rk-no { margin-top: 1px; }

/* ===== 주요지수 캐러셀 ===== */
.idx-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.idx-row::-webkit-scrollbar { display: none; }
.idx-card { flex: 0 0 auto; width: 140px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; }
.idx-name { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.idx-val { font-size: 18px; font-weight: 800; margin: 2px 0; }
.idx-chg { font-size: 12px; font-weight: 700; }
.idx-spark { height: 34px; margin-top: 6px; }

/* 등락 색 */
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text-faint); }

/* ===== 탭바 ===== */
.tabbar {
  position: sticky; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5,1fr);
  background: var(--bg); border-top: 1px solid var(--line-soft);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 16px -8px rgba(0,0,0,.12);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px;
  font-size: 11px; color: var(--text-faint); font-weight: 600; }
.tab .ti { font-size: 20px; filter: grayscale(1) opacity(.7); }
.tab.on { color: var(--text); }
.tab.on .ti { filter: none; }

/* ===== 스켈레톤 / 상태 ===== */
.skeleton-hero { height: 130px; border-radius: var(--radius); background: linear-gradient(90deg,#eee,#f6f6f6,#eee); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.sk { border-radius: 8px; background: linear-gradient(90deg,#eee,#f6f6f6,#eee); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { font-size: 13px; color: var(--text-faint); text-align: center; padding: 10px 0; }

@media (min-width: 500px) {
  body.mobile { padding: 16px 0; }
  .app { border-radius: 22px; overflow: hidden; min-height: min(900px, calc(100dvh - 32px)); box-shadow: 0 30px 60px -30px rgba(0,0,0,.3); }
  .home-scroll { max-height: none; }
}

/* ===== 서브탭(페이지 상단 탭) ===== */
.subtabs { display: flex; gap: 16px; align-items: center; padding: 4px 16px 0; overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { border: 0; background: none; font-size: 18px; font-weight: 800; color: var(--text-faint);
  padding: 8px 0; cursor: pointer; white-space: nowrap; position: relative; letter-spacing: -.3px; }
.subtabs button.on { color: var(--text); }
.subtabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--text); border-radius: 3px; }
.page-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px 6px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 800; }
.right-link { font-size: 14px; color: var(--blue); font-weight: 700; }

/* 한/미 토글 */
.ktoggle { display: inline-flex; background: var(--line-soft); border-radius: 999px; padding: 3px; }
.ktoggle button { border: 0; background: none; font-size: 13px; font-weight: 700; color: var(--text-dim); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.ktoggle button.on { background: var(--window); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* 필터칩 */
.chips-row { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--window);
  font-size: 13px; font-weight: 700; color: var(--text-dim); padding: 6px 12px; border-radius: 999px; white-space: nowrap; cursor: pointer; }
.chip.on { border-color: var(--green); color: var(--green-d); }
.chip.on::before { content: "✓"; color: var(--green-d); }

/* 뉴스 카드(마켓보이스) */
.news { padding: 14px 16px; border-bottom: 8px solid var(--line-soft); }
.news h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: var(--text); line-height: 1.4; }
.news p { margin: 0 0 8px; font-size: 14px; color: var(--text-dim); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news .nmeta { font-size: 12px; color: var(--text-faint); margin-bottom: 8px; }
.news .nthumb { width: 100%; height: 150px; border-radius: 12px; background: var(--line-soft); object-fit: cover; margin-bottom: 8px; display: grid; place-items: center; font-size: 40px; }
.tags-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tags-row::-webkit-scrollbar { display: none; }
.stock-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--line-soft); border-radius: 999px;
  padding: 6px 11px; font-size: 13px; font-weight: 600; white-space: nowrap; }

/* 테마 행 · 도구 그리드(발견) */
.theme-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.theme-row:first-child { border-top: 0; }
.theme-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--line-soft); display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }
.theme-name { flex: 1; font-size: 15px; font-weight: 700; }
.tool-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.tool-grid a { display: flex; align-items: center; gap: 10px; padding: 16px; background: var(--window); border-radius: var(--radius); box-shadow: var(--shadow); font-weight: 700; font-size: 14px; color: var(--text); }
.tool-grid .tg-ico { font-size: 24px; }

/* 마켓분석 게이지 */
.gauge-hero { text-align: center; padding: 8px 0 4px; }
.gauge-hero .gh-band { font-size: 26px; font-weight: 800; }
.gauge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.gauge-cell { border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px; text-align: center; }
.gauge-cell .gc-label { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.gauge-cell .gc-state { margin-top: 6px; font-size: 15px; font-weight: 800; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.st-hot { color: #ff8f7a; background: #2a1719; }
.st-cool { color: #7fbfff; background: #14202e; }
.st-mid { color: var(--text-dim); background: var(--line-soft); }

/* 커뮤니티 포스트 */
.post { padding: 16px; border-bottom: 8px solid var(--line-soft); }
.post .p-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post .p-av { width: 38px; height: 38px; border-radius: 50%; background: var(--line-soft); display: grid; place-items: center; font-size: 16px; }
.post .p-name { font-size: 14px; font-weight: 700; }
.post .p-ago { font-size: 12px; color: var(--text-faint); }
.post .p-title { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.post .p-body { font-size: 14px; color: var(--text-dim); line-height: 1.55; white-space: pre-line; }
.post .p-acts { display: flex; align-items: center; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--text-faint); font-weight: 600; }
.post.tappable { cursor: pointer; }
.post.tappable:active { background: var(--line-soft); }
.post .p-acts .p-like { background: none; border: 0; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-faint); padding: 4px 0; display: inline-flex; align-items: center; gap: 5px; }
.post .p-acts .p-like.on { color: var(--up); }
.post .p-acts .p-like b { font-weight: 800; }
.post .p-acts .p-open { margin-left: auto; color: var(--green-d); font-weight: 700; }
.fab { position: fixed; right: max(16px, calc(50% - 240px + 16px)); bottom: calc(80px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 18px; background: var(--green); color: #fff; border: 0; font-size: 28px;
  box-shadow: 0 10px 24px -8px rgba(88,204,2,.7); z-index: 25; cursor: pointer; }
.banner { margin: 0 16px; padding: 12px 14px; background: var(--sky); border-radius: 12px; font-size: 13px; color: var(--blue-d); font-weight: 600; }

/* ===== 주요지수 상세 행(지수/환율/금리) ===== */
.dsec { padding: 4px 16px; }
.drow { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.drow:first-child { border-top: 0; }
.drow .dname { font-size: 15px; font-weight: 700; color: var(--text); }
.drow .dsub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.drow .dval { font-size: 17px; font-weight: 800; text-align: right; }
.drow .dchg { font-size: 13px; font-weight: 700; text-align: right; margin-top: 2px; }

/* ===== 주요지수 — 카드 캐러셀 + 등락률 보드 ===== */
.ix-carousel { display: flex; gap: 10px; overflow-x: auto; padding: 14px 16px; scrollbar-width: none; }
.ix-carousel::-webkit-scrollbar { display: none; }
.ix-card { flex: 0 0 auto; width: 150px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.ix-name { font-size: 12.5px; font-weight: 700; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-val { font-size: 19px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.ix-chg { font-size: 12px; font-weight: 700; margin-top: 2px; }
.ix-spark { margin-top: 8px; height: 40px; }
.ix-spark .spark { width: 100%; height: 40px; display: block; }
.ixboard-sec { padding: 4px 16px 8px; }
.ixboard { border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.ixb-row { display: grid; grid-template-columns: 58px repeat(5, 1fr); align-items: center; padding: 11px 10px; border-top: 1px solid var(--line-soft); }
.ixb-row:first-child { border-top: 0; }
.ixb-head { background: var(--statusbar); }
.ixb-head .ixb-c { color: var(--text-faint); font-weight: 700; }
.ixb-nm { font-size: 13px; font-weight: 800; color: var(--text); }
.ixb-c { font-size: 12px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ixb-c.flat { color: var(--text-faint); }
.ixb-more { width: 100%; text-align: center; background: none; border: 0; margin-top: 10px; padding: 4px; color: var(--text-dim); font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; }

/* 투자자별 매매동향 */
.inv-sec { padding: 4px 16px 16px; }
.inv-toggle { display: inline-flex; gap: 4px; background: var(--statusbar); border-radius: 999px; padding: 3px; margin-bottom: 12px; }
.inv-toggle button { border: 0; background: none; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-dim); padding: 6px 16px; border-radius: 999px; cursor: pointer; }
.inv-toggle button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.inv-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.inv-date { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-family: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--text); background: var(--surface); }
.inv-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); font-family: var(--mono); margin-top: 4px; }
.inv-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
.inv-lg { font-size: 12.5px; font-weight: 600; color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.inv-lg i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.inv-lg b { font-weight: 800; font-variant-numeric: tabular-nums; }
.inv-chart { height: 150px; }
.inv-svg { width: 100%; height: 100%; display: block; }
.inv-foot { font-size: 11.5px; color: var(--text-faint); margin-top: 8px; font-family: var(--mono); }

/* 정규장 등락률 상승/하락 순위 */
.gain-sec { padding: 4px 16px 16px; }
.gain-ctrl { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.gain-cols { display: flex; flex-direction: column; gap: 22px; }
.gain-col { min-width: 0; }
.gain-h { font-size: 13px; font-weight: 800; margin-bottom: 4px; padding-bottom: 7px; border-bottom: 2px solid var(--line-soft); }
.gain-h.up { color: var(--up); }
.gain-h.down { color: var(--down); }
.gain-list { display: flex; flex-direction: column; min-width: 0; }
.gain-row { display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.gain-row:first-child { border-top: 0; }
.gr-rank { font-size: 12px; font-weight: 800; color: var(--text-faint); text-align: center; font-variant-numeric: tabular-nums; }
.gr-name { min-width: 0; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-pct { flex: 0 0 auto; font-size: 12.5px; font-weight: 800; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== 관심 종목 추가(검색) ===== */
.wl-search { display: flex; gap: 8px; margin-bottom: 12px; }
.wl-search input { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: 14px; font-family: var(--sans); color: var(--text); background: var(--window); }
.wl-search input:focus { outline: none; border-color: var(--green); }
.wl-results { margin-top: 8px; }
.wl-results:empty { display: none; }
.wl-add { border: 0; background: var(--sky); color: var(--blue-d); font-weight: 800; font-size: 18px; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; flex: 0 0 auto; }
.wl-add.on { background: #14251c; color: var(--green-d); }
.star-btn { border: 0; background: none; font-size: 20px; cursor: pointer; padding: 0 2px; line-height: 1; }
.star-btn.off { color: var(--line); }
.star-btn.on { color: var(--yellow); }

/* ===== 공용 토스트 ===== */
.app-toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  background: rgba(20,24,31,.94); color: #fff; font-size: 13px; font-weight: 600; padding: 11px 16px; border-radius: 12px;
  z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 82%; text-align: center; }
.app-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== 메뉴 시트(햄버거) ===== */
.menu-overlay { position: fixed; inset: 0; z-index: 70; }
.menu-overlay .ms-back { position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background .2s; }
.menu-overlay.show .ms-back { background: rgba(0,0,0,.4); }
.ms-sheet { position: absolute; top: 0; right: 0; height: 100%; width: min(320px, 84%); background: var(--window);
  box-shadow: -20px 0 50px -20px rgba(0,0,0,.4); transform: translateX(100%); transition: transform .22s ease;
  display: flex; flex-direction: column; padding: 14px 0 env(safe-area-inset-bottom); overflow-y: auto; }
.menu-overlay.show .ms-sheet { transform: translateX(0); }
.ms-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 18px 12px; }
.ms-head b { font-size: 18px; font-weight: 800; }
.ms-x { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--text-dim); }
.ms-login { margin: 0 16px 8px; padding: 13px; background: var(--green); color: #fff; border: 0; border-radius: 12px; font-weight: 800; font-size: 15px; cursor: pointer; }
.ms-prof { display: flex; align-items: center; gap: 10px; margin: 0 16px 8px; padding: 12px 14px; background: var(--statusbar); border-radius: 12px; }
.ms-prof .ms-av { width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; }
.ms-prof b { display: block; font-size: 15px; }
.ms-prof a { font-size: 12px; color: var(--blue); }
.ms-prof .ms-out { margin-left: auto; border: 1px solid var(--line); background: none; border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--text-dim); cursor: pointer; }
.ms-nav { display: flex; flex-direction: column; padding: 6px 0; }
.ms-nav a { padding: 13px 20px; font-size: 15px; font-weight: 600; color: var(--text); }
.ms-nav a:active { background: var(--line-soft); text-decoration: none; }

/* ===== 디자인 고도화 — 모션 · 마이크로 인터랙션 ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
/* 섹션 진입: 위로 페이드인 + 순차 지연(stagger) */
.home-scroll > * { animation: fadeUp .4s both cubic-bezier(.22,.61,.36,1); }
.home-scroll > *:nth-child(2) { animation-delay: .04s; }
.home-scroll > *:nth-child(3) { animation-delay: .08s; }
.home-scroll > *:nth-child(4) { animation-delay: .12s; }
.home-scroll > *:nth-child(5) { animation-delay: .16s; }
.home-scroll > *:nth-child(n+6) { animation-delay: .2s; }

/* 눌림 피드백(터치 타깃 살짝 눌림) */
.rrow, .quick a, .tool-grid a, .brief-item, .theme-row, .idx-card, .news, .post,
.eh-cta, .ms-login, .chip, .pick-tabs button, .wl-add, .star-btn {
  transition: transform .12s ease, box-shadow .2s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.rrow:active, .quick a:active, .tool-grid a:active, .theme-row:active, .idx-card:active { transform: scale(.985); }
.eh-cta:active, .ms-login:active, .wl-add:active { transform: scale(.95); }
.star-btn:active { transform: scale(.82); }

/* 탭바 활성 아이콘 살짝 떠오름 */
.tab .ti { transition: transform .2s cubic-bezier(.34,1.56,.64,1); }
.tab.on .ti { transform: translateY(-1px) scale(1.1); }

/* 서브탭 밑줄이 부드럽게 */
.subtabs button::after { transition: opacity .18s; }

/* 데스크톱 프레임 미리보기에서 카드 hover */
@media (hover: hover) {
  .sec:hover, .news:hover, .post:hover { box-shadow: 0 18px 38px -18px rgba(0,0,0,.18); }
  .ms-nav a:hover { background: var(--line-soft); }
}

/* =====================================================================
   서브 페이지 셸 — ‹뒤로 헤더 + 탭바 유지. 레거시 콘텐츠(theme.css)를
   480px 프레임 안으로 자연스럽게 담기 위한 오버라이드.
   ===================================================================== */
.app-header.sub { gap: 4px; }
.app-header.sub .ah-title {
  flex: 1; min-width: 0; margin: 0 2px;
  font-size: 17px; font-weight: 800; letter-spacing: -.3px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ah-btn.back { font-size: 27px; margin-left: -6px; }

/* 레거시 본문(article.content)을 모바일 폭에 맞춤 */
.mobile .home-scroll .content { padding: 0; max-width: none; width: 100%; }
.mobile .home-scroll .content > h1 { font-size: 22px; margin: 2px 0 8px; }
.mobile .home-scroll .content > h2 { font-size: 18px; margin: 22px 0 8px; padding-top: 16px; }
.mobile .home-scroll .content .comment { font-size: 12px; }
.mobile .home-scroll .content > p { font-size: 14px; line-height: 1.6; margin: 8px 0; }

/* 검색/상세 (stocks.js) */
.mobile .search-wrap { margin: 4px 0 10px; }
.mobile .stock-panel { margin-top: 12px; }
.mobile .stock-head { flex-wrap: wrap; }
.mobile .stock-head .px { font-size: 20px; }
.mobile .chart-wrap canvas { height: 260px; }
.mobile .stock-grid { grid-template-columns: repeat(2, 1fr); }
.mobile .index-bar { gap: 12px 16px; }

/* 순위/모의투자/마이 등 표 계열이 가로로 넘치지 않도록 */
.mobile .rank-table, .mobile .mkt-list, .mobile .profile-card { width: 100%; }
.mobile .home-scroll { scroll-behavior: smooth; }

/* 서브페이지 진입 모션은 통짜 본문 한 번만(계단식 X) */
.mobile .home-scroll > .content { animation: fadeUp .4s both cubic-bezier(.22,.61,.36,1); }

/* =====================================================================
   디자인 일관성 — 레거시 콘텐츠(theme.css, 다크 잔재)를 모바일 카드 시스템으로.
   흰 카드 + 부드러운 라인 + radius + 산세리프 숫자 + 상승빨강/하락파랑 대비.
   범위는 .mobile 안으로 한정해 데스크톱 레거시엔 영향 없음.
   ===================================================================== */
.mobile .content { font-size: 15px; color: var(--text); }

/* 버튼: 알약형 · 브랜드 그린 */
.mobile .content .btn {
  font-family: var(--sans); font-size: 14px; font-weight: 700; letter-spacing: -.2px;
  padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--window); color: var(--text);
}
.mobile .content .btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.mobile .content .btn.ghost { background: var(--window); color: var(--text-dim); }
.mobile .content .btn.sm { padding: 8px 12px; font-size: 13px; }
.mobile .content .btn:active { transform: scale(.97); }

/* 배지: 흰 배경에서 읽히도록 대비 교정 */
.mobile .content .badge {
  font-family: var(--sans); font-weight: 700; font-size: 12px; border: 0;
  padding: 5px 11px; background: var(--line-soft); color: var(--text-dim);
}
.mobile .content .badge.red { background: #2a1719; color: var(--up); }
.mobile .content .badge.blue { background: var(--sky); color: var(--blue-d); }

/* 콜아웃: 부드러운 안내 박스 */
.mobile .content .callout {
  background: var(--sky); border: 0; border-left: 3px solid var(--blue);
  border-radius: 12px; color: var(--blue-d); font-size: 13px; line-height: 1.55; margin: 16px 0;
}

/* 기능 카드 그리드 → 2열 화이트 카드 */
.mobile .content .cards { gap: 10px; grid-template-columns: 1fr 1fr; margin: 14px 0; }
.mobile .content .card {
  background: var(--window); border: 1px solid var(--line-soft);
  border-radius: 14px; box-shadow: var(--shadow); padding: 14px;
}
.mobile .content .card h3 { font-size: 14px; }
.mobile .content .card p { font-size: 12.5px; color: var(--text-dim); }

/* 검색창 · 칩 · 지수바: 산세리프 · 라운드 화이트 */
.mobile .content .search-box { background: var(--window); border: 1.5px solid var(--line); border-radius: 14px; }
.mobile .content .search-box .prompt { color: var(--green-d); }
.mobile .content .search-box input { font-family: var(--sans); font-size: 15px; }
.mobile .content .chips .chip { font-family: var(--sans); font-weight: 600; background: var(--window); border: 1px solid var(--line); }
.mobile .content .result-item { background: var(--window); border: 1px solid var(--line-soft); border-radius: 12px; }
.mobile .content .index-bar { gap: 10px 16px; }
.mobile .content .index-bar .ix { font-family: var(--sans); }
.mobile .content .index-bar .ix-px, .mobile .content .index-bar .ix-chg { font-weight: 700; }

/* 종목 상세 패널 = 화이트 카드 */
.mobile .stock-panel { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--window); box-shadow: var(--shadow); }
.mobile .stock-head { border-bottom: 1px solid var(--line-soft); padding: 16px; gap: 6px 10px; }
.mobile .stock-head .nm { font-size: 19px; font-weight: 800; }
.mobile .stock-head .cd { font-family: var(--sans); font-size: 12px; }
.mobile .stock-head .px { font-family: var(--sans); font-size: 21px; font-weight: 800; }
.mobile .stock-head .chg { font-family: var(--sans); font-size: 13px; font-weight: 700; }

/* 지표 2×2 · 화이트 셀 · 산세리프 숫자 */
.mobile .stock-grid { grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); }
.mobile .metric { background: var(--window); padding: 13px 16px; }
.mobile .metric .label { font-family: var(--sans); }
.mobile .metric .value { font-family: var(--sans); font-size: 16px; font-weight: 800; }

/* 게이지 · 분류 · 뉴스 · 차트 구분선 통일 + 산세리프 숫자 */
.mobile .mania { padding: 16px; gap: 14px; border-top-color: var(--line-soft); }
.mobile .gauge .num { font-family: var(--sans); }
.mobile .classify, .mobile .chart-card { border-top-color: var(--line-soft); }
.mobile .classify { padding: 16px; }
.mobile .classify .cmetrics span { font-family: var(--sans); }

/* 순위 표 · 프로필 카드 = 화이트 카드 · 산세리프 숫자 */
.mobile .mkt-list, .mobile .rank-table, .mobile .profile-card { border: 1px solid var(--line-soft); border-radius: 14px; box-shadow: var(--shadow); }
.mobile .mkt-head { background: var(--statusbar); }
.mobile .mkt-row .px, .mobile .mkt-row .chg { font-family: var(--sans); font-size: 13.5px; font-weight: 700; }
.mobile .mania-chip { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }

/* 계산기 · 코드카드 */
.mobile .calc-card { border: 1px solid var(--line-soft); border-radius: 14px; background: var(--window); box-shadow: var(--shadow); padding: 16px; margin: 12px 0; }
.mobile .calc-field input, .mobile .calc-quote input { font-family: var(--sans); border-radius: 10px; }
.mobile .calc-result .metric .value { font-family: var(--sans); }
.mobile .codecard { border-radius: 12px; font-size: 12px; line-height: 1.7; overflow-x: auto; }

/* ===== 커뮤니티 허브 서브탭(링크형) ===== */
.subtabs a {
  font-size: 18px; font-weight: 800; color: var(--text-faint); text-decoration: none;
  padding: 8px 0; white-space: nowrap; position: relative; letter-spacing: -.3px;
}
.subtabs a.on { color: var(--text); }
.subtabs a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--text); border-radius: 3px; }
.comm-subnav { border-bottom: 1px solid var(--line-soft); }

/* 피드 정렬(최신/인기): 서브탭 밑줄과 구분되게 칩형 */
.comm-sort { gap: 8px; padding: 8px 16px 4px; }
.comm-sort button { font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; color: var(--text-dim); }
.comm-sort button.on { color: var(--text); background: var(--line-soft); }
.comm-sort button.on::after { display: none; }

/* ===== 하단 탭 SVG 아이콘(appshell이 주입) ===== */
.tab .ti.svg { display: grid; place-items: center; }
.tab .ti.svg svg { width: 23px; height: 23px; display: block; }

/* ===== 장중 LIVE 점(초록 펄스) — theme.css @keyframes live-pulse 재사용 ===== */
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22C55E;
  margin-right: 6px; vertical-align: middle; animation: live-pulse 1.4s infinite; }
.mkt.live { color: #16A34A; font-weight: 700; }

/* ===== 터치 타깃 확대(≥40~44px) ===== */
.ah-btn { min-width: 42px; min-height: 42px; }
.tab { min-height: 50px; }
.star-btn { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; }
.wl-add { min-width: 40px; min-height: 40px; }

/* ===== 로그인 유도 바텀시트 ===== */
.login-sheet-overlay { position: fixed; inset: 0; z-index: 80; }
.login-sheet-overlay .ls-back { position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background .22s; }
.login-sheet-overlay.show .ls-back { background: rgba(0,0,0,.45); }
.login-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto;
  background: var(--window); border-radius: 22px 22px 0 0; text-align: center;
  padding: 10px 22px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .26s cubic-bezier(.22,.61,.36,1);
  box-shadow: 0 -20px 50px -20px rgba(0,0,0,.4); }
.login-sheet-overlay.show .login-sheet { transform: translateY(0); }
.ls-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 0 auto 14px; }
.ls-emoji { font-size: 34px; }
.ls-title { font-size: 18px; font-weight: 800; margin: 8px 0 4px; letter-spacing: -.3px; }
.ls-sub { font-size: 13px; color: var(--text-dim); margin: 0 0 18px; line-height: 1.5; }
.ls-go { width: 100%; border: 0; background: var(--green); color: #fff; font-weight: 800; font-size: 16px;
  padding: 15px; border-radius: 14px; cursor: pointer; }
.ls-go:active { transform: scale(.98); }
.ls-skip { width: 100%; border: 0; background: none; color: var(--text-faint); font-size: 14px; font-weight: 600;
  padding: 12px; margin-top: 6px; cursor: pointer; }

/* ===== 종목 로고(회사 마크) — 폴백은 첫 글자.
   컨테이너는 heat-ring(바깥 inset:-3px)이 있어 overflow:hidden 금지 → 로고 자체를 원형 클립. ===== */
.rlogo, .brief-logo { position: relative; }
.slogo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  background: #fff; z-index: 1; }
/* 종목 상세 헤더 로고 */
.mobile .stock-head { align-items: center; }
.stock-logo { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; position: relative;
  background: var(--line-soft); display: grid; place-items: center; font-weight: 800; color: var(--text-dim); font-size: 16px; }
/* 순위표 인라인 로고 */
.mklogo { display: inline-block; width: 20px; height: 20px; border-radius: 50%; overflow: hidden; position: relative;
  vertical-align: -5px; margin-right: 7px; background: var(--line-soft); text-align: center; font-size: 11px;
  font-weight: 700; color: var(--text-dim); line-height: 20px; }

/* ===== 경제 캘린더 ===== */
.cal-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  gap: 18px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.cal-nav b { font-size: 17px; font-weight: 800; letter-spacing: -.3px; min-width: 110px; text-align: center; }
.cal-arrow { width: 38px; height: 38px; border: 1px solid var(--line); background: var(--window); border-radius: 12px;
  font-size: 20px; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.cal-arrow:active { transform: scale(.94); background: var(--line-soft); }

.cal-list { display: flex; flex-direction: column; }
.cal-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line-soft); }
.cal-row:first-child { border-top: 0; }
/* 지나간 일정은 날짜·제목만 흐리게(결과값은 또렷하게 유지) */
.cal-row.past .cal-date, .cal-row.past .cal-title, .cal-row.past .cal-note, .cal-row.past .cal-tag { opacity: .5; }
.cal-row.today { background: var(--sky); border-radius: 12px; padding: 12px 10px; border-top: 0; }
.cal-date { text-align: center; background: var(--line-soft); border-radius: 10px; padding: 6px 0; }
.cal-row.today .cal-date { background: var(--blue); color: #fff; }
.cal-date b { display: block; font-size: 18px; font-weight: 800; line-height: 1; }
.cal-date span { font-size: 11px; color: var(--text-faint); }
.cal-row.today .cal-date span { color: rgba(255,255,255,.85); }
.cal-title { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.4; }
.cal-note { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
/* 지나간 일정 결과값(실제/예상/이전 + 평가) */
.cal-result { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.cal-result .cr { font-size: 11.5px; color: var(--text-dim); background: var(--line-soft); padding: 2px 8px; border-radius: 7px;
  font-variant-numeric: tabular-nums; }
.cal-result .cr b { font-weight: 800; color: var(--text); }
.cr-actual b { color: var(--text); }
.cr-actual.up b { color: #7fd6a0; }
.cr-actual.down b { color: #ff8f7a; }
.cr-verdict { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.cr-verdict.up { color: #7fd6a0; background: #14251c; }
.cr-verdict.down { color: #ff8f7a; background: #2a1719; }

/* ===== 오늘의 장 총평 ===== */
.ov-idxrow { display: flex; gap: 10px; margin-bottom: 12px; }
.ov-idx { flex: 1; background: var(--statusbar); border-radius: 12px; padding: 10px 12px; }
.ov-in { display: block; font-size: 12px; color: var(--text-faint); font-weight: 700; }
.ov-iv { display: block; font-size: 17px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 2px; }
.ov-ic { display: block; font-size: 12.5px; font-weight: 800; margin-top: 1px; }
.ov-text { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin: 0; }
.ov-text b { color: var(--text); font-weight: 700; }
.ov-foot { font-size: 11.5px; color: var(--text-faint); margin-top: 12px; font-family: var(--mono); }

/* ===== 공지사항 ===== */
.notices-wrap { padding: 14px 16px 28px; }
.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 15px 16px; }
.notice.hl { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent); }
.nt-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.nt-tag { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.t-공지 { color: #7fbfff; background: #14202e; }
.t-업데이트 { color: #7fd6a0; background: #14251c; }
.t-기능 { color: #b79dff; background: #221a33; }
.t-이벤트 { color: #ffce7a; background: #2a2314; }
.nt-pin { font-size: 11px; font-weight: 800; color: var(--text-dim); background: var(--line-soft); padding: 3px 8px; border-radius: 999px; }
.nt-date { font-size: 12px; color: var(--text-faint); font-family: var(--mono); }
.nt-del { margin-left: auto; background: none; border: 0; color: var(--up); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.nt-title { font-size: 16px; font-weight: 800; color: var(--text); margin: 0 0 6px; line-height: 1.4; }
.nt-body { font-size: 14px; color: var(--text-dim); line-height: 1.65; }
.notice-compose { background: var(--statusbar); border: 1px solid var(--line); border-radius: 16px; padding: 15px 16px;
  margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.nc-h { font-size: 14px; font-weight: 800; color: var(--text); }
.nc-input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-family: inherit;
  font-size: 14px; background: var(--surface); color: var(--text); }
textarea.nc-input { resize: vertical; line-height: 1.5; }
.nc-row { display: flex; align-items: center; gap: 14px; }
.nc-row .nc-input { flex: 0 0 auto; width: auto; }
.nc-pin-lbl { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); font-weight: 600; }
.notice-compose .btn.primary { align-self: flex-start; }
.cal-today { font-size: 11px; font-weight: 800; color: var(--blue-d); background: #fff; padding: 1px 7px; border-radius: 999px; }
.cal-tag { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.t-지표 { color: #7fbfff; background: #14202e; }
.t-만기 { color: #ff8f7a; background: #2a1719; }
.t-배당 { color: #7fd6a0; background: #14251c; }
.t-정책 { color: #b79dff; background: #221a33; }
.t-실적 { color: #ffce7a; background: #2a2314; }
.t-물가 { color: #5fc8d8; background: #12262c; }
.t-고용 { color: #7fd6a0; background: #14251c; }
.t-성장 { color: #ffce7a; background: #2a2314; }

.cal-chips { display: flex; flex-direction: column; gap: 8px; }
.cal-chip { display: flex; align-items: center; gap: 8px; padding: 11px 12px; background: var(--statusbar);
  border-radius: 12px; font-size: 14px; font-weight: 600; }
.cal-chip > span:first-child { flex: 1; min-width: 0; }
.cal-chip em { font-size: 11.5px; color: var(--text-faint); font-style: normal; }

/* ===== 재무정보 · 배당 (종목 상세) ===== */
.fin-card { border-top: 1px solid var(--line-soft); padding: 16px; }
.fin-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fin-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 13px; }
.fin-table th, .fin-table td { padding: 7px 8px; text-align: right; white-space: nowrap; }
.fin-table thead td { color: var(--text-faint); font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--line-soft); }
.fin-table thead td i { font-style: normal; color: var(--green-d); font-size: 10px; margin-left: 1px; }
.fin-table th { text-align: left; color: var(--text-dim); font-weight: 600; }
.fin-table tbody tr { border-bottom: 1px solid var(--line-soft); }
.fin-table tbody tr:last-child { border-bottom: 0; }
.fin-table tbody td { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.fin-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--text-dim); }
.fin-keys b { color: var(--text); font-weight: 800; margin-left: 4px; }
.fin-div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fd-cell { border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; }
.fd-cell span { display: block; font-size: 12px; color: var(--text-faint); margin-bottom: 3px; }
.fd-cell b { font-size: 18px; font-weight: 800; }
.fin-dps { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; scrollbar-width: none; }
.fin-dps::-webkit-scrollbar { display: none; }
.fin-dps span { flex: 0 0 auto; background: var(--line-soft); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 800; text-align: center; }
.fin-dps em { display: block; font-style: normal; font-size: 11px; color: var(--text-faint); font-weight: 600; margin-bottom: 2px; }
.fin-note { font-size: 11px; color: var(--text-faint); margin: 12px 0 0; line-height: 1.5; }

/* ===== 마이페이지 아이콘 런처(4열) ===== */
.my-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 2px; margin: 8px 0 18px; }
.mg-item { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 2px; border-radius: 14px; color: var(--text); text-decoration: none; }
.mg-item:active { background: var(--line-soft); transform: scale(.97); }
.mg-ico { width: 46px; height: 46px; border-radius: 50%; background: var(--statusbar); display: grid; place-items: center; font-size: 22px; }
.mg-lbl { font-size: 11.5px; font-weight: 600; color: var(--text-dim); text-align: center; line-height: 1.2; }

/* ===== 시황: 지수 카드(가로) + 상승/하락 2단 ===== */
.mki-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mki-row::-webkit-scrollbar { display: none; }
.mki-card { flex: 0 0 auto; width: 132px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--window); }
.mki-name { font-size: 13px; color: var(--text-dim); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mki-val { font-size: 20px; font-weight: 800; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.mki-chg { font-size: 12.5px; font-weight: 700; }

.updown { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.ud-head { font-size: 13px; font-weight: 800; padding: 4px 2px 8px; border-bottom: 2px solid var(--line-soft); }
.ud-head.up { color: var(--up); }
.ud-head.down { color: var(--down); }
.ud-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); color: var(--text); text-decoration: none; }
.ud-row:last-child { border-bottom: 0; }
.ud-row:active { background: var(--line-soft); }
.ud-nm { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ud-pct { font-size: 13.5px; font-weight: 800; flex: 0 0 auto; }

/* ===== 뉴스룸 타임라인 + 종목칩 ===== */
.news-tl { position: relative; }
.news-tl::before { content: ""; position: absolute; left: 7px; top: 20px; bottom: 20px; width: 2px; background: var(--line-soft); }
.tl-item { display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line-soft);
  color: var(--text); text-decoration: none; position: relative; }
.tl-item:first-child { border-top: 0; }
.tl-item:active { background: var(--line-soft); }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin: 5px auto 0;
  box-shadow: 0 0 0 3px var(--window); z-index: 1; }
.tl-time { font-size: 12px; color: var(--text-faint); font-weight: 600; }
.tl-title { font-size: 15px; font-weight: 700; line-height: 1.42; margin: 3px 0 0; color: var(--text); }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.nchip { display: inline-flex; align-items: center; gap: 5px; background: var(--line-soft); border-radius: 999px;
  padding: 5px 11px; font-size: 12px; font-weight: 600; color: var(--text-dim); cursor: pointer; }
.nchip b { font-weight: 800; }
.nchip:active { transform: scale(.95); }

/* ===== 스파크라인(지수 카드·미니차트) ===== */
.spark { width: 100%; height: 100%; display: block; }
.mki-spark { display: block; height: 30px; margin-top: 8px; }

/* ===== 커뮤니티 인기 종목 원형칩 스트립 ===== */
.hot-strip { padding: 14px 16px 10px; border-bottom: 8px solid var(--line-soft); }
.hot-head { font-size: 14px; font-weight: 800; margin-bottom: 12px; color: var(--text); }
.hot-row { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; }
.hot-row::-webkit-scrollbar { display: none; }
.hot-item { flex: 0 0 auto; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 5px; text-decoration: none; color: var(--text); }
.hot-logo { width: 52px; height: 52px; border-radius: 50%; background: var(--line-soft); display: grid; place-items: center;
  font-size: 20px; font-weight: 800; color: var(--text-dim); position: relative; }
.hot-name { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62px; }
.hot-pct { font-size: 11.5px; font-weight: 800; }
.hot-item:active { transform: scale(.96); }

/* 옛 IDE 테마의 코드주석 접두("// ") 제거 — 모바일 부제는 일반 텍스트로 */
.mobile .comment::before { content: none; }
.mobile .comment { font-family: var(--sans); }

/* ===== 누적 수익률(종목 상세) ===== */
.returns-card { padding: 14px 16px; border-top: 1px solid var(--line-soft); }
.ret-title { font-size: 13px; font-weight: 700; color: var(--text-dim); margin-bottom: 10px; }
.ret-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ret-cell { border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px; text-align: center; }
.ret-l { font-size: 12px; color: var(--text-faint); font-weight: 600; }
.ret-v { font-size: 16px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ===== 테마 상세(구성 종목) ===== */
.theme-row { cursor: pointer; }
.theme-arrow { color: var(--text-faint); font-size: 18px; margin-left: 2px; flex: 0 0 auto; }
.td-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; }
.td-back { border: 0; background: var(--line-soft); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; color: var(--text-dim); cursor: pointer; }
.td-back:active { transform: scale(.96); }
.td-head b { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.td-cnt { margin-left: auto; font-size: 12px; color: var(--text-faint); font-weight: 600; }
.td-desc { font-size: 13px; color: var(--text-dim); line-height: 1.55; padding: 0 16px 8px; margin: 0; }

/* ===== 테마 대표종목 로고 클러스터 ===== */
.theme-ico.cluster { background: none; width: auto; display: flex; overflow: visible; flex: 0 0 auto; }
.tc-logo { width: 30px; height: 30px; border-radius: 50%; background: var(--line-soft); position: relative; overflow: hidden;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--text-dim); box-shadow: 0 0 0 2px var(--window); }
.theme-ico.cluster .tc-logo + .tc-logo { margin-left: -10px; }
/* 대표종목 2x2 격자 아이콘 */
.theme-ico.grid4 { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 0;
  background: var(--statusbar); padding: 0; overflow: hidden; }
.tg-cell { position: relative; overflow: hidden; background: var(--statusbar); display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: var(--text-faint); }
.theme-ico.grid4 .slogo { border-radius: 0; }

/* ===== 모의투자 모바일 맞춤(오버플로 방지 · 산세리프) ===== */
.mobile .paper-wrap { flex-direction: column; gap: 12px; }
.mobile .paper-rail { flex-direction: row; overflow-x: auto; width: 100%; flex-basis: auto; position: static; padding-bottom: 4px; scrollbar-width: none; }
.mobile .paper-rail::-webkit-scrollbar { display: none; }
.mobile .rail-cap { display: none; }
.mobile .rail-slot { flex: 0 0 auto; min-width: 92px; }
.mobile .paper-summary { grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); }
.mobile .paper-summary > div { background: var(--window); padding: 14px 16px; }
.mobile .paper-summary .label { font-family: var(--sans); }
.mobile .paper-summary .big { font-family: var(--sans); font-size: 19px; letter-spacing: -.3px; }
.mobile .paper-summary .mid { font-family: var(--sans); font-size: 15px; }
.mobile .profile-card { border: 1px solid var(--line-soft); border-radius: var(--radius); }
.mobile .mkt-head.ph-grid, .mobile .mkt-row.ph-grid { grid-template-columns: 1fr 90px 54px; }
.mobile .ph-grid .h-qty, .mobile .ph-grid .h-cur, .mobile .ph-grid .h-mania { display: none; }
.mobile .hold-row .nm .qm { display: inline; }
.mobile .hold-row .nm a { color: var(--text); }
.mobile .conv-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
.mobile .paper-trade { flex-wrap: wrap; }
.mobile .paper-acct { font-family: var(--sans); }

/* 모의투자 — 증권사식 계좌 히어로 */
.acct-hero { background: var(--window); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 15px; }
.ah-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.ah-label { font-size: 13px; color: var(--text-dim); font-weight: 600; width: 100%; }
.ah-total { font-size: 27px; font-weight: 800; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.ah-ret { font-size: 15px; font-weight: 800; }
.ah-sub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.ah-sub span { display: block; font-size: 11.5px; color: var(--text-faint); }
.ah-sub b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 주문 박스 */
.order-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--statusbar); border-radius: 12px; padding: 10px; }
.order-box #pb-q { flex: 1; min-width: 130px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-family: var(--sans); font-size: 14px; background: var(--window); }
.order-box #pb-qty { width: 70px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 8px; font-family: var(--sans); font-size: 14px; text-align: right; background: var(--window); }
.order-box .paper-buy { flex: 0 0 auto; }

/* 포인트 활용 카드(행 레이아웃 — 안 깨짐) */
.pt-card { background: var(--window); border: 1px solid var(--line-soft); border-radius: 14px; box-shadow: var(--shadow); padding: 4px 14px; }
.pt-row { display: flex; align-items: center; gap: 10px; padding: 13px 0 11px; border-top: 1px solid var(--line-soft); }
.pt-row:first-child { border-top: 0; }
.pt-label { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; }
.pt-label small { display: block; font-size: 11.5px; color: var(--text-faint); font-weight: 500; margin-top: 2px; }
.pt-ctl { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.pt-ctl input { width: 76px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 8px; font-family: var(--sans); font-size: 14px; text-align: right; background: var(--window); }
.pt-ctl .unit { font-size: 12px; color: var(--text-faint); }
.pt-card .paper-msg { padding: 0 0 8px; margin: 0; }

/* 모의투자 하는 법 카드 */
.howto { background: var(--sky); border-radius: 14px; padding: 14px 16px; margin: 6px 0 12px; }
.ht-title { font-size: 15px; font-weight: 800; color: var(--blue-d); margin-bottom: 8px; }
.ht-steps { margin: 0; padding-left: 20px; }
.ht-steps li { font-size: 13.5px; color: var(--text); line-height: 1.6; margin: 3px 0; }
.ht-steps b { color: var(--blue-d); }

/* ===== 홈 모의투자 히어로 ===== */
.paper-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none;
  background: linear-gradient(135deg, #1CB0F6 0%, #1899D6 100%); color: #fff; border-radius: var(--radius);
  padding: 18px; box-shadow: 0 12px 26px -14px rgba(24,153,214,.7); }
.paper-hero .ph-l { min-width: 0; }
.paper-hero .ph-cap { font-size: 13px; font-weight: 700; opacity: .92; }
.paper-hero .ph-total { font-size: 24px; font-weight: 800; margin-top: 3px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.paper-hero .ph-ret { font-size: 13px; font-weight: 700; margin-top: 2px; color: #fff; opacity: .95; }
.paper-hero .ph-title { font-size: 18px; font-weight: 800; margin-top: 3px; }
.paper-hero .ph-desc { font-size: 12.5px; opacity: .92; margin-top: 3px; }
.paper-hero .ph-cta { flex: 0 0 auto; background: #fff; color: var(--blue-d); font-weight: 800; font-size: 14px; padding: 10px 14px; border-radius: 12px; }
.paper-hero:active { transform: scale(.99); }

/* ===== 블랙스완 게임 배너 ===== */
/* 홈 시장 데이터 토글(국내/미국) */
.mktsel { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mktsel .mktsel-l { font-size: 13px; font-weight: 800; color: var(--text-dim); }
.mktsel .mktsel-seg { display: inline-flex; background: var(--window); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.mktsel .mktsel-seg button { border: 0; background: none; color: var(--text-dim); font-family: inherit; font-weight: 800; font-size: 12.5px; padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.mktsel .mktsel-seg button.on { background: var(--sky); color: var(--blue); }

/* 블랙스완 대시보드(홈 메인 히어로) */
.bs-dash { display: block; text-decoration: none; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #1a1030 0%, #2a1636 50%, #401526 100%); border: 1px solid #4a3a6e;
  border-radius: var(--radius); padding: 22px 20px 20px; box-shadow: 0 22px 46px -18px rgba(20,6,30,.95); }
.bs-dash::before { content: ""; position: absolute; right: -50px; top: -60px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,210,74,.22), transparent 68%); }
.bs-dash > * { position: relative; z-index: 1; }
.bs-dash:active { transform: scale(.995); }
.bd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bd-brand { font-size: 13px; font-weight: 800; opacity: .95; }
.bd-new { font-size: 10.5px; font-weight: 900; background: #ffd24a; color: #3a2b0a; border-radius: 999px; padding: 3px 9px; }
.bd-done { font-size: 10.5px; font-weight: 900; background: rgba(255,255,255,.16); color: #cbb8ff; border-radius: 999px; padding: 3px 9px; }
.bd-title { font-size: 26px; font-weight: 900; line-height: 1.2; letter-spacing: -.6px; margin-top: 12px;
  background: linear-gradient(90deg, #fff, #d9c4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bd-desc { font-size: 12.5px; opacity: .8; line-height: 1.45; margin-top: 8px; max-width: 300px; }
.bd-stats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 11.5px; font-weight: 700; opacity: .95; }
.bd-stats .bd-lv { background: rgba(255,210,74,.18); color: #ffd24a; font-weight: 900; border-radius: 999px; padding: 2px 9px; }
.bd-stats b { color: #ffd24a; }
.bd-xp { height: 6px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.bd-xp i { display: block; height: 100%; background: linear-gradient(90deg, #4FA3FF, #ffd24a); border-radius: 999px; }
.bd-cta { display: block; text-align: center; margin-top: 16px; background: #FF4B4B; color: #fff; font-weight: 800; font-size: 15px; padding: 13px; border-radius: 13px; }

/* ===== 종목 상세 하단 매수/매도 액션 바 ===== */
.stock-ab { display: flex; gap: 8px; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line-soft); box-shadow: 0 -2px 16px -8px rgba(0,0,0,.14); }
.stock-ab[hidden] { display: none; }
.sab-star { flex: 0 0 auto; min-width: 78px; border: 1px solid var(--line); background: var(--window); border-radius: 12px;
  padding: 13px 8px; font-size: 13.5px; font-weight: 700; color: var(--text-dim); cursor: pointer; }
.sab-star.on { color: var(--yellow); border-color: var(--yellow); }
.sab-btn { flex: 1; border: 0; border-radius: 12px; padding: 14px; font-size: 16px; font-weight: 800; color: #fff; cursor: pointer; }
.sab-btn.buy { background: var(--up); }
.sab-btn.sell { background: var(--down); }
.sab-btn:active { transform: scale(.98); }
.sab-note { flex: 1; text-align: center; font-size: 12px; color: var(--text-faint); }

/* ===== 주문 시트(바텀시트) ===== */
.order-sheet-overlay { position: fixed; inset: 0; z-index: 80; }
.order-sheet-overlay .os-back { position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background .22s; }
.order-sheet-overlay.show .os-back { background: rgba(0,0,0,.45); }
.order-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; background: var(--window);
  border-radius: 22px 22px 0 0; padding: 10px 22px calc(22px + env(safe-area-inset-bottom)); text-align: center;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.22,.61,.36,1); box-shadow: 0 -20px 50px -20px rgba(0,0,0,.4); }
.order-sheet-overlay.show .order-sheet { transform: translateY(0); }
.os-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 0 auto 14px; }
.os-title { font-size: 18px; font-weight: 800; }
.order-sheet.buy .os-title b { color: var(--up); }
.order-sheet.sell .os-title b { color: var(--down); }
.os-price { font-size: 13px; color: var(--text-dim); margin: 4px 0 18px; }
.os-qty { display: flex; align-items: center; justify-content: center; gap: 10px; }
.os-mm { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--window); border-radius: 12px; font-size: 22px; color: var(--text); cursor: pointer; }
.os-qty input { width: 100px; text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 18px; font-weight: 800; font-family: var(--sans); }
.os-qty span { font-size: 14px; color: var(--text-dim); }
.os-msg { min-height: 18px; font-size: 13px; color: var(--text-dim); margin: 14px 0; }
.os-go { width: 100%; border: 0; border-radius: 14px; padding: 15px; font-size: 16px; font-weight: 800; color: #fff; cursor: pointer; }
.os-go.buy { background: var(--up); }
.os-go.sell { background: var(--down); }
.os-go:active { transform: scale(.98); }

/* ===== 종목 상세 핵심 지표(표준 우선) + 온도 보조배지 ===== */
.keymx { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border-top: 1px solid var(--line-soft); }
.km-cell { background: var(--window); padding: 12px 16px; }
.km-cell span { display: block; font-size: 12px; color: var(--text-faint); }
.km-cell b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.heat-chip-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.heat-chip { font-size: 13px; font-weight: 800; padding: 5px 12px; border-radius: 999px; }
.heat-note { font-size: 11.5px; color: var(--text-faint); }

/* 헤더 아이콘 SVG 통일 */
.ah-btn.ah-svg svg { width: 22px; height: 22px; display: block; }
.ah-btn.back.ah-svg svg { width: 24px; height: 24px; }

/* ===== 콘텐츠 아이콘 통일(퀵메뉴·마이 그리드·메뉴 시트) ===== */
.quick .qi { display: grid; place-items: center; height: 26px; color: var(--green-d); }
.quick .qi svg { width: 26px; height: 26px; }
.mg-ico svg { width: 24px; height: 24px; }
.ms-nav a { display: flex; align-items: center; gap: 12px; }
.ms-ic { flex: 0 0 auto; width: 22px; height: 22px; display: inline-grid; place-items: center; color: var(--text-dim); }
.ms-ic svg { width: 20px; height: 20px; }

/* 내 ETF — 모의투자와 동일한 모바일 레이아웃(레일 가로 스크롤) */
.mobile .etf-wrap { flex-direction: column; gap: 12px; }
.mobile .etf-rail { flex-direction: row; overflow-x: auto; width: 100%; flex-basis: auto; position: static; padding-bottom: 4px; scrollbar-width: none; }
.mobile .etf-rail::-webkit-scrollbar { display: none; }
.mobile .etf-rail .rail-cap { display: none; }
.mobile .etf-rail .rail-slot { flex: 0 0 auto; min-width: 92px; }

/* ===== 강의 — 깔끔한 세로 학습 경로(캐릭터 제거) ===== */
.lesson-path { display: flex; flex-direction: column; padding: 6px 0 4px; position: relative; }
.lp-row { display: flex; align-items: center; gap: 14px; padding: 10px 8px; position: relative; }
.lp-row::before { content: ""; position: absolute; left: 31px; top: 0; height: 50%; width: 2px; background: var(--line-soft); }
.lp-row:first-child::before { display: none; }
.lp-row::after { content: ""; position: absolute; left: 31px; top: 50%; bottom: 0; width: 2px; background: var(--line-soft); }
.lp-row:last-child::after { display: none; }
.lp-node { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; position: relative; z-index: 1;
  border: 2px solid var(--line); background: var(--window); color: var(--text-dim); font-weight: 800; font-size: 16px; cursor: pointer; transition: transform .12s ease; }
.lp-node:active { transform: scale(.94); }
.lp-row.done .lp-node { background: var(--green); border-color: var(--green); color: #fff; }
.lp-row.now .lp-node { border-color: var(--green); color: var(--green-d); box-shadow: 0 0 0 4px rgba(88,204,2,.16); }
.lp-row.lock .lp-node { color: var(--text-faint); border-style: dashed; cursor: default; background: var(--statusbar); }
.lp-info { min-width: 0; }
.lp-name { font-size: 15px; font-weight: 700; color: var(--text); }
.lp-row.lock .lp-name { color: var(--text-faint); }
.lp-meta { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.lp-now { color: var(--green-d); }
.lp-progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.lp-bar { flex: 1; height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.lp-bar > i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .4s ease; }
.lp-progress span { font-size: 12px; color: var(--text-dim); font-weight: 700; white-space: nowrap; }
.done-badge { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; font-size: 34px; font-weight: 800; }
.done-badge.ok { background: #14251c; color: var(--green-d); }
.done-badge.retry { background: var(--line-soft); color: var(--text-dim); }

/* 이모지 제거로 비게 된 아이콘 자리 숨김 */
.callout .emoji:empty, .ls-emoji:empty, .tg-ico:empty { display: none; }

/* ===== 접근성 / 모션 감소 ===== */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .sk, .skeleton-hero { animation: none; }
  .home-scroll > * { animation: none; }
  * { transition: none !important; animation-duration: .001s !important; }
}

/* ===================== PWA 설치 UI ===================== */
/* 메뉴 시트의 '앱 설치' 버튼 */
.ms-install {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin: 4px 0 8px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: linear-gradient(135deg, rgba(183,157,255,.14), rgba(79,163,255,.10));
  color: var(--text); font-size: 15px; font-weight: 700; cursor: pointer; text-align: left;
}
.ms-install .ms-ic { width: 20px; height: 20px; color: #b79dff; }
.ms-install em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 500; color: var(--text-dim); }

/* 홈 모바일 설치 배너 */
.pwa-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(135deg, rgba(183,157,255,.16), rgba(79,163,255,.10));
}
.pwa-b-ico { font-size: 22px; }
.pwa-b-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pwa-b-txt b { font-size: 14px; }
.pwa-b-txt span { font-size: 12px; color: var(--text-dim); }
.pwa-b-go {
  margin-left: auto; flex: none; padding: 8px 16px; border: 0; border-radius: 999px;
  background: #b79dff; color: #12101a; font-weight: 800; font-size: 13px; cursor: pointer;
}
.pwa-b-x { flex: none; border: 0; background: transparent; color: var(--text-faint); font-size: 15px; cursor: pointer; padding: 4px; }

/* 데스크톱 'QR로 모바일에서 보기' 패널 */
.pwa-desk { display: flex; align-items: center; gap: 18px; }
.pwa-desk-txt { flex: 1; min-width: 0; }
.pwa-desk-txt b { display: block; font-size: 17px; margin-bottom: 4px; }
.pwa-desk-txt p { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; margin: 0 0 8px; }
.pwa-url {
  display: inline-block; font-family: ui-monospace, monospace; font-size: 12.5px;
  color: #b79dff; background: rgba(183,157,255,.12); padding: 3px 10px; border-radius: 8px;
}
.pwa-qr { flex: none; width: 112px; height: 112px; border-radius: 12px; background: #fff; padding: 6px; }

/* 준비 중(비활성) 필터 칩 — 마켓보이스 등 */
.chip.soon { opacity: .4; cursor: default; }

/* 차트 기간 최저/최고가 */
.chart-hilo { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px 2px; font-size: 12px; }
.chart-hilo b { font-weight: 800; }
.chart-hilo em { font-style: normal; color: var(--text-faint); margin-left: 4px; }
.chart-hilo .hl-lo b { color: var(--down); }
.chart-hilo .hl-hi b { color: var(--up); }

/* 증권사 리포트 (홈) */
.rpt-list { display: flex; flex-direction: column; }
.rpt-row { display: block; padding: 10px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.rpt-row:last-child { border-bottom: 0; }
.rpt-top { display: flex; align-items: baseline; gap: 6px; }
.rpt-stock { flex: none; color: #b79dff; font-weight: 800; font-size: 13px; }
.rpt-title { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpt-meta { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.rpt-go { color: var(--blue); margin-left: 4px; }
.rpt-op { color: var(--up); font-weight: 800; }

/* 실시간 경제 유튜브 */
.yt-sub { font-size: 12px; color: var(--text-dim); margin: -4px 0 10px; }
.yt-list { display: flex; flex-direction: column; gap: 12px; }
.yt-row { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; color: inherit; }
.yt-thumb { position: relative; flex: none; width: 128px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #000; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-play { position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; }
.yt-body { flex: 1; min-width: 0; }
.yt-title { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-ch { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* 관심종목 알람 설정 */
.alarm-off p { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin: 0 0 12px; }
.alarm-onbadge { color: var(--green); font-weight: 800; }
.alarm-on { display: flex; flex-direction: column; }
.alarm-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.alarm-thr { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px 12px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-dim); transition: opacity .15s; }
.thr-ctl { display: inline-flex; align-items: center; gap: 10px; }
.thr-ctl button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--window); color: var(--text); font-size: 18px; line-height: 1; }
.thr-ctl b { min-width: 52px; text-align: center; font-size: 15px; color: var(--text); }
.alarm-acts { display: flex; gap: 8px; margin-top: 14px; }
.alarm-acts .btn { flex: 1; }
.alarm-acts .btn.danger { color: var(--down); }

/* 종목 상세 리포트 컨센서스 */
.rpt-consensus { display: flex; gap: 8px; margin: 4px 0 12px; }
.rpt-consensus .rc-cell { flex: 1; background: var(--card-2, rgba(255,255,255,.03)); border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px; text-align: center; }
.rpt-consensus .rc-cell span { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 3px; }
.rpt-consensus .rc-cell b { font-size: 15px; font-weight: 800; }
