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

:root {
  --bg-base:       #FFFFFF;
  --bg-surface:    #F8F9FA;
  --bg-elevated:   #F1F3F5;
  --bg-overlay:    #FFFFFF;
  --border-subtle: #E5E7EB;
  --border-default:#D1D5DB;
  --text-primary:  #111827;
  --text-secondary:#6B7280;
  --text-muted:    #9CA3AF;

  --theme-semicon:  #93C5FD;
  --theme-bio:      #6EE7B7;
  --theme-battery:  #FDE047;
  --theme-macro:    #94A3B8;
  --theme-defense:  #67E8F9;
  --theme-power:    #FCA5A5;
  --theme-content:  #F9A8D4;
  --theme-mobility: #FDBA74;
  --theme-consumer: #E2C29B;
  --theme-finance:  #BEF264;
  --theme-earnings: #FCD34D;
  --theme-etc:      #CBD5E1;

  --bull: #16A34A;
  --bear: #DC2626;
  --today-color: #F59E0B;
  --accent: #2563EB;

  --header-h: 36px;
  --filter-h: 80px;
  --tabnav-h: 48px;
}

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  font-size: 17px;
  line-height: 1.4;
  overflow: hidden;
}

/* ── 헤더 ───────────────────────────────── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg-base);
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  padding: 0 12px;
  z-index: 300;
}
@media (max-width: 480px) { #logo { min-width: 0 !important; }
  /* 좁은 화면: 문구를 작게 한 줄로. 줄 끝이 넘치면 말줄임 대신 글자를 화면 폭에 맞춰 줄인다 */
  #header #header-tagline { white-space: nowrap; font-size: clamp(7px, 2.1vw, 8.5px); letter-spacing: 0; padding-left: 6px;
    min-width: 0; overflow: hidden; } }
@media (max-width: 359px) { #header #header-tagline { display: none; } }   /* 아주 좁은 화면은 잘리느니 숨긴다 */
#logo {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  cursor: pointer;
  transition: opacity 0.7s ease;
  min-width: 210px;
  white-space: nowrap;
  overflow: hidden;
}
#tg-link {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0;
  padding: 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
}
#tg-link:hover { color: var(--text-secondary); border-color: var(--border-default); }
#header-tagline {
  text-align: right;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  white-space: nowrap;
  cursor: pointer;
  align-self: center;
  transition: opacity 0.5s ease;
}
#header-tagline.is-motto { color: var(--text-muted); font-weight: 500; }
#header #header-tagline { grid-column: -2 / -1; justify-self: end; }   /* 늘 오른쪽 끝 — ☰을 아래 탭으로 옮긴 뒤 로고 옆으로 붙던 것 (10/25) */
#month-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border-subtle);
}
#month-nav button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 2px 5px;
  line-height: 1;
  border-radius: 3px;
}
#month-nav button:hover { background: var(--bg-elevated); }
@keyframes nav-flash { 0% { background:var(--accent,#2563EB); color:#fff; transform:scale(1.25); } 100% { background:none; color:inherit; transform:scale(1); } }
@keyframes sector-zoom-in {
  0%   { transform: scale(1);    opacity: 1; }
  100% { transform: scale(1.18); opacity: 0; }
}
#month-nav button.nav-flash { animation: nav-flash 0.35s ease-out; }
#today-btn { font-size: 11px !important; color: var(--text-secondary) !important; padding: 2px 7px !important; border: 1px solid var(--border-subtle) !important; border-radius: 4px !important; white-space: nowrap !important; flex-shrink: 0 !important; }
#month-label { font-size: 13px; font-weight: 600; min-width: 72px; text-align: center; white-space: nowrap; position: relative; }
#month-label.is-next-week::after {   /* 날짜 범위 아래 작은 표시 — 줄 폭을 늘리지 않는다 */
  content: '다음 주';
  position: absolute;
  left: 50%; top: 100%;
  transform: translateX(-50%);
  margin-top: -2px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent, #2563EB);
  letter-spacing: 0.2px;
}
@media (max-width: 480px) {
  #period-bar { gap: 2px; }
  #period-bar .period-chip { padding: 4px 10px; }
  #month-nav { margin-left: 4px; padding-left: 6px; gap: 2px; }
  #month-nav button { padding: 2px 4px; }
  #month-label { min-width: 0; font-size: 12.5px; }
}

/* ── 필터바 ─────────────────────────────── */
#filter-bar {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  height: var(--filter-h);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 99;
}
#period-bar {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
#category-bar {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  gap: 5px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  flex-shrink: 0;
  align-items: stretch;
}
#category-bar::-webkit-scrollbar { display: none; }
.period-chip {
  flex-shrink: 0;
  padding: 4px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  user-select: none;
  position: relative;
}
.chip-default {
  position: absolute;
  bottom: 1px;
  right: 4px;
  font-size: 8px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.period-chip.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.filter-chip {
  flex-shrink: 0;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  position: relative;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.filter-chip::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.15s;
}
.new-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--bear, #DC2626);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}
.new-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bear, #DC2626);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 5px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  align-self: center;
}
.filter-chip.active {
  color: var(--text-primary);
  font-weight: 600;
}
.filter-chip.active::after { background: var(--text-primary); }
.filter-chip.active[data-theme]:not([data-theme="all"]) {
  color: var(--chip-color);
}
.filter-chip.active[data-theme]:not([data-theme="all"])::after {
  background: var(--chip-color);
}

/* ── 탭 콘텐츠 컨테이너 ─────────────────── */
#content {
  position: fixed;
  top: calc(var(--header-h) + var(--filter-h));
  bottom: var(--tabnav-h);
  left: 0; right: 0;
  overflow: hidden;
}


.tab-pane {
  display: none;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-pane.active { display: block; }
#tab-briefing { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
#tab-briefing.active { display: block; }

/* ── 광고 슬롯 ──────────────────────────── */
#ad-bar {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  height: var(--filter-h);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 100;
}
#ad-bar.active { display: flex; }
/* ── 트리맵 ─────────────────────────────── */
#treemap-swipe-hint {
  position: fixed;
  bottom: calc(var(--tabnav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.62);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 200;
  opacity: 1;
  transition: opacity 0.8s ease;
}
#treemap-swipe-hint.fade-out { opacity: 0; }
/* 첫 방문 시연 (startTour) — 트리맵 위에 겹쳐 보여 주기만 한다(누르기를 막지 않음, pointer-events: none) */
#tour { position: fixed; inset: 0; z-index: 1200; pointer-events: none; }
#tour[hidden] { display: none; }
#tour .t-ring { position: fixed; border: 3px solid #f59e0b; border-radius: 10px; box-shadow: 0 0 0 4px rgba(245,158,11,0.25);
  transition: all 0.35s ease; opacity: 0; }
#tour .t-ring.on { opacity: 1; animation: tPulse 1s ease-in-out infinite; }
@keyframes tPulse { 50% { box-shadow: 0 0 0 9px rgba(245,158,11,0.12); } }
#tour .t-bub { position: fixed; width: max-content; max-width: min(270px, calc(100vw - 24px)); box-sizing: border-box; padding: 9px 13px; word-break: keep-all; text-align: left; border-radius: 12px; background: rgba(17,24,39,0.92); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.45; box-shadow: 0 6px 18px rgba(0,0,0,0.25); opacity: 0;
  transition: opacity 0.25s, transform 0.25s; transform: translateY(4px); }
#tour .t-bub.on { opacity: 1; transform: none; }
#tour .t-bub small { display: block; margin-top: 3px; font-size: 11px; font-weight: 500; color: rgba(255,255,255,0.7); }
#tour .t-hand { position: fixed; font-size: 34px; line-height: 1; opacity: 0; transition: opacity 0.2s;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35)); }
#tour .t-hand.on { opacity: 1; }
#tour .t-hand.tap { animation: tTap 0.8s ease-in-out 3; }
@keyframes tTap { 50% { transform: scale(0.82); } }
#tour .t-hand.swipe { transition: left 1.1s ease-in-out, opacity 0.2s; }
#treemap-wrap.t-nudge { transition: transform 0.45s ease; transform: translateX(-26px); }
#treemap-wrap.t-back { transition: transform 0.45s ease; transform: none; }
#legend-pop .t-again { margin-top: 8px; width: 100%; padding: 6px 0; border-radius: 8px; border: 1px solid var(--border-default);
  background: var(--bg-elevated); color: var(--text-primary); font-size: 12px; font-weight: 700; cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  #tour .t-ring.on { animation: none; }
  #tour .t-hand { display: none; }
  #treemap-wrap.t-nudge { transform: none; }
}
#treemap-left { position: relative; }
#treemap-section-label {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  padding: 12px 0 6px 12px;
}
@media (min-width: 768px) {
  #treemap-section-label { padding-left: 12px; }
}
#treemap-wrap {
  width: 100%;
  height: clamp(420px, calc(100dvh - var(--header-h) - var(--filter-h) - 44px), 640px);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  background: #FFFFFF;
  user-select: none;
  -webkit-user-select: none;
}
@media (max-width: 767px) {
  #treemap-wrap {
    height: auto;
    max-height: 100vw;
    aspect-ratio: 1 / 1;
  }
}
/* ── 일간 빈 상태 ─────────────────────── */
.empty-day {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; gap: 14px;
  animation: empty-day-in 0.5s ease;
}
@keyframes empty-day-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.empty-day-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  position: relative;
  animation: empty-day-pulse 2.8s ease-in-out infinite;
}
.empty-day-icon::before {
  content: '';
  position: absolute; inset: 10px;
  border-radius: 50%;
  background: var(--border-default);
}
@keyframes empty-day-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%       { transform: scale(1.08); opacity: 1; }
}
.empty-day-msg {
  font-size: 14px; color: var(--text-muted); letter-spacing: 0.3px;
}
.empty-day-btn {
  font-size: 13px; color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 6px; padding: 6px 16px;
  cursor: pointer; transition: background 0.15s;
}
.empty-day-btn:hover { background: var(--bg-surface); }

#treemap-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* D3 생성 셀 */
.cell-date {
  position: absolute;
  border: none;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.2s;
  border-radius: 0;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.55);
}
.cell-date:active { filter: brightness(0.92); }
.date-label {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 14px;
  line-height: 14px;
  background: transparent;
  color: rgba(30,30,30,0.7);
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
  z-index: 10;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.4px;
}
.cell-date.is-today .date-label {
  border-left: 2px solid var(--today-color);
  padding-left: 4px;
  color: var(--today-color);
}
.cell-theme {
  position: absolute;
  overflow: hidden;
  transition: opacity 0.2s;
  cursor: pointer;
  border-radius: 0;
}
.theme-label {
  position: absolute;
  top: 4px; left: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}
.cell-event {
  position: absolute;
  overflow: hidden;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2px 4px;
  border-radius: 0;
}
.cell-event:active { filter: brightness(0.9); }
@keyframes past-fade { from { opacity:1; filter:none; } to { opacity:0.4; filter:grayscale(1); } }
.cell-event[data-past="1"] { animation: past-fade 0.45s ease-out 0.25s both; }
.event-name {
  font-weight: 700;
  line-height: 1.2;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.event-code {
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: rgba(0,0,0,0.4);
  white-space: nowrap;
}
.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 2px;
}
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.85;
}

/* ── 날짜 바텀시트 이벤트 리스트 ───────── */
.date-sheet-list { margin-top: 6px; }
.date-sheet-row {
  display: flex;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  gap: 8px;
}
.date-sheet-row:last-child { border-bottom: none; }
.date-sheet-row:active { background: var(--bg-elevated); }
.date-sheet-bar { width: 3px; height: 34px; border-radius: 2px; flex-shrink: 0; }
.date-sheet-main { flex: 1; min-width: 0; }
.date-sheet-title { font-size: 17px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.date-sheet-meta { font-size: 14px; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-sheet-dots { display: flex; gap: 2px; flex-shrink: 0; align-items: center; }

/* ── Tab 3: 브리핑 ──────────────────────── */
/* 종목 검색 */
#stock-search-wrap {
  position: relative;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
#stock-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0 10px;
  height: 36px;
  transition: border-color 0.15s;
}
#stock-search-bar:focus-within {
  border-color: var(--accent,#2563EB);
}
#stock-search-bar svg { flex-shrink:0; color: var(--text-muted); }
#stock-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  min-width: 0;
}
#stock-search-input::placeholder { color: var(--text-muted); }
#stock-search-clear {
  background: none; border: none; padding: 2px 4px;
  color: var(--text-muted); cursor: pointer; font-size: 14px; line-height:1;
  border-radius: 4px;
}
#stock-search-clear:hover { color: var(--text-primary); }
#stock-search-dropdown {
  position: absolute;
  top: calc(100% - 4px);
  left: 16px; right: 16px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 200;
  max-height: min(62vh, 480px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 6px 6px;
}
/* 통합 검색 결과 — 종목·일정·테마 세 묶음 */
.ss-gh { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); margin: 8px 6px 2px; }
.ss-row { display: flex; align-items: center; gap: 8px; padding: 8px 8px; border-radius: 8px; cursor: pointer; }
.ss-row:hover, .ss-row.on { background: var(--bg-elevated); }
.ss-row.past { opacity: 0.45; }
.ss-m { flex: 1; min-width: 0; }
.ss-t { font-size: 13.5px; color: var(--text-primary); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-t small { font-size: 11.5px; color: var(--text-muted); margin-left: 2px; }
.ss-s { font-size: 11.5px; color: var(--text-secondary); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-s span { font-size: 11px !important; }
.ss-d { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.ss-why { font-size: 10.5px; color: var(--text-muted); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 0 4px; margin-left: 5px; vertical-align: 1px; }
.ss-more { text-align: center; font-size: 13px; color: var(--accent, #2563EB); padding: 8px; cursor: pointer; }
.ss-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 6px; }
.ss-tag { font-size: 12px; border-radius: 6px; padding: 2px 8px; background: var(--bg-elevated); color: var(--text-secondary); cursor: pointer; }
.ss-tag small { color: var(--text-muted); }
#stock-search-dropdown mark { background: rgba(250, 204, 21, 0.35); color: inherit; border-radius: 2px; padding: 0 1px; }
.stock-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}
.stock-item:last-child { border-bottom: none; }
.stock-item:hover, .stock-item:active { background: var(--bg-elevated); }
.stock-item-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.stock-item-code {
  font-size: 12px; color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: 4px; padding: 1px 5px;
}
.stock-item-cnt { margin-left: auto; font-size: 11px; color: var(--text-muted); }
#stock-filter-chip-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 2px;
}
#stock-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(37,99,235,0.12);
  border: 1px solid rgba(37,99,235,0.3);
  border-radius: 999px;
  padding: 3px 10px 3px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent,#2563EB);
}
#stock-filter-chip button {
  background: none; border: none; padding: 0;
  color: var(--accent,#2563EB); cursor: pointer;
  font-size: 14px; line-height:1; opacity: 0.7;
}
#stock-filter-chip button:hover { opacity: 1; }
/* 종목 검색 첫 안내 — 처음 온 사람에게만, 검색칸을 한 번 누르면 사라진다 */
#stock-hint { position: relative; display: inline-flex; align-items: center; gap: 7px; margin: 12px 0 2px 4px; padding: 8px 8px 8px 11px;
  border-radius: 12px; background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; font-size: 12.5px; font-weight: 500;
  line-height: 1.35; box-shadow: 0 6px 18px rgba(37,99,235,0.28);
  animation: hint-in 0.35s ease-out, hint-bob 1.4s ease-in-out 0.4s 3; }
#stock-hint::before { content: ''; position: absolute; top: -6px; left: 20px; width: 12px; height: 12px; border-radius: 2px;
  background: #2f5ae9; transform: rotate(45deg); }                 /* 검색칸을 가리키는 꼬리 */
#stock-hint b { font-weight: 800; }
#sx-mo-w { position: relative; }
.sx-mo-ld { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--text-muted); pointer-events: none; }
#stock-hint svg { flex-shrink: 0; opacity: 0.9; }
#stock-hint button { flex-shrink: 0; width: 20px; height: 20px; border: none; border-radius: 50%; background: rgba(255,255,255,0.18);
  color: #fff; font-size: 14px; line-height: 20px; padding: 0; cursor: pointer; }
#stock-hint button:hover { background: rgba(255,255,255,0.3); }
#stock-hint[hidden] { display: none; }
@keyframes hint-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes hint-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
/* 종목 보기 카드 — 일정 수 + 브리핑 언급 (setStockFilter → _stockCard) */
/* 페이지 정보 — 서버가 담아 보낸 그 주소의 글(pages.app_page). 하단 정보 맨 끝에 접혀 있다.
   숨기지 않는다(구글이 그려 본 화면에 주소마다 다른 글이 있어야 색인 — 2026-10-15), 대신 하단 글씨처럼 조용하게 */
/* 검색용 글(pages.app_page가 body 끝에 넣는 #ssr-content) — 바로 뒤 스크립트가 아래 '페이지 정보'(접힘)로 옮기기 전에
   화면에 한 번 그려져 새로고침마다 글자가 휙 보였다 사라졌다(10/19). 옮기기 전(body 바로 아래)에는 숨긴다. 검색 로봇은 그대로 읽는다 */
body > #ssr-content { display: none; }
#page-sum { margin: 14px 0 0; font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
#page-sum summary { cursor: pointer; font-size: 12px; font-weight: 400; color: var(--text-muted); list-style: none; }
#page-sum summary::-webkit-details-marker { display: none; }
#page-sum h1 { font-size: 15px; margin: 12px 0 4px; color: var(--text-primary); }
#page-sum h2 { font-size: 13.5px; margin: 14px 0 4px; color: var(--text-primary); }
#page-sum ul { margin: 4px 0; padding-left: 18px; }
#page-sum li { margin: 2px 0; }
#page-sum a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#page-sum p { margin: 4px 0; }
/* 일정 상세창 — 출처 기사 (이 일정을 뽑은 글에 있던 기사) */
.src-arts a { display: block; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--border-subtle); border-radius: 8px;
  font-size: 13px; line-height: 1.45; color: var(--text-primary); text-decoration: none; }
.src-arts a:hover { background: var(--bg-elevated); }
.next-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
/* 이어서 보기 줄 (10/18 시인성): 위 작은 줄 = 종류·날짜·언론사, 굵은 줄 = 무엇을 여는지, 오른쪽 화살표 = 누를 수 있음 */
.next-row { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 8px; align-items: center; min-height: 56px;
  padding: 14px 12px 14px 14px; border-radius: 12px; border: 1px solid var(--border-default); background: var(--bg-base);
  box-shadow: 0 1px 2px rgba(15,23,42,0.05); color: var(--text-primary); text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: background .12s, border-color .12s; }
.next-row:hover, .next-row:active { background: var(--bg-elevated); border-color: var(--border-default); }
.next-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.next-row em { grid-column: 1; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); letter-spacing: -0.1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-row em::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 0 6px 1px 0; background: var(--text-muted); vertical-align: middle; }
.next-row[data-k="ev"] em { color: var(--accent); } .next-row[data-k="ev"] em::before { background: var(--accent); }
.next-row[data-k="news"] em { color: #047857; } .next-row[data-k="news"] em::before { background: #10B981; }
.next-row b { grid-column: 1; font-size: 14px; font-weight: 700; line-height: 1.42; color: var(--text-primary); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: keep-all; overflow-wrap: anywhere; }
.next-row i { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--bg-elevated); font-style: normal; font-size: 16px; font-weight: 700; color: var(--text-secondary); }
.src-arts small { display: block; margin-top: 2px; font-size: 11px; color: var(--text-muted); }
#stock-card { margin: 6px 0 2px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated); font-size: 13px; color: var(--text-secondary); }
#stock-card[hidden] { display: none; }
#stock-card .sk-n b { color: var(--text-primary); }
#stock-card details { margin-top: 8px; }
#stock-card summary { cursor: pointer; font-weight: 600; color: var(--text-primary); list-style: none; }
#stock-card summary::-webkit-details-marker { display: none; }
#stock-card summary::after { content: ' ▾'; color: var(--text-muted); }
#stock-card details[open] summary::after { content: ' ▴'; }
#stock-card ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 340px; overflow-y: auto; }
#stock-card li { padding: 8px 0; border-top: 1px solid var(--border-subtle); line-height: 1.5; }
#stock-card li a { font-size: 12px; color: var(--text-muted); text-decoration: underline; }
#stock-card .sk-hd { font-weight: 600; color: var(--text-primary); margin: 2px 0; }
#stock-no-result {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
#schedule-list {
  padding-bottom: 8px;
}
.load-more-btn {
  display: block;
  width: calc(100% - 32px);
  max-width: 400px;
  margin: 24px 16px 28px;
  padding: 12px;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
}
.load-more-btn:hover { background: var(--bg-elevated); }
.date-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 12px 8px;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  border-top: 1px solid var(--border-subtle);
}
.date-group-header:first-child { border-top: none; margin-top: 0; padding-top: 14px; }
.dday-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 2px;
}
.dday-badge.today { background: var(--today-color); color: #fff; }
.dday-badge.future { background: var(--bg-elevated); color: var(--text-muted); }
.event-count { margin-left: auto; color: var(--text-muted); font-weight: 400; }

.event-row {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 4px;
  border-radius: 6px;
  margin: 4px 2px;
  cursor: pointer;
  transition: filter 0.1s;
  gap: 5px;
}
.event-row:active { filter: brightness(0.95); }
.row-time {
  width: 27px;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}
.row-cat {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.4px;
  text-align: center;
  white-space: nowrap;
}
.row-tt { font-size: 9px; font-family: monospace; line-height: 1; }
.row-group { position: relative; }
.row-group-cat {              /* 합친 분류 칸: 묶음의 줄들 왼쪽 칸을 위에서 아래까지 덮는다 */
  position: absolute;
  left: 2px; top: 4px; bottom: 4px;
  width: 33px;                /* 줄 안쪽 여백 4 + 분류 칸 27 + 간격 일부 */
  border-radius: 6px 0 0 6px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 1;
}
.row-theme-bar {
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
}
.row-main {
  flex: 1;
  min-width: 0;
}
/* 일정 확인 뱃지 (event_check.badges, 10/19) — ✓ 확인 초록 · 미정 회색. 목록에는 미정만 작게 */
.sheet-meta-tag.ev-vf { font-family: inherit; line-height: inherit; cursor: pointer; }
#gl-pop a { color: #2563eb; text-decoration: underline; }
.sheet-meta-tag.ev-vf.ok { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.sheet-meta-tag.ev-vf.tbd { color: #6b7280; border-color: #d1d5db; background: #f3f4f6; }
/* 해외 일정 발표 시각 — 날짜는 한국 날짜, 헷갈리지 않게 현지 시각을 같이 (api lat, event_std.local_line, 10/21) */
.ev-lat { margin: 6px 0 2px; font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.ev-lat b { font-weight: 600; color: var(--text-primary); margin-right: 2px; }
.ev-vf-line { margin: 6px 0 2px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.ev-vf-line.ok::before { content: '✓ '; color: #059669; font-weight: 700; }
.ev-vf-line a { color: var(--text-muted); font-size: 12px; text-decoration: underline; }
.ev-vf-pill { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 8px; font-size: 10.5px; font-weight: 600;
  color: #6b7280; background: #f3f4f6; border: 1px solid #e5e7eb; vertical-align: middle; }
.ev-vf-ok { margin-left: 5px; font-size: 11px; font-weight: 700; color: #34d399; vertical-align: middle; }

.row-title {
  font-size: 13px;
  font-weight: 600;
  white-space: normal;
  word-break: keep-all;
  line-height: 1.4;
}
.row-stocks {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.row-stock-go { margin-left: 2px; color: var(--text-muted); }
.row-stock-chip {
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  border: 0.5px solid var(--border-default);
  color: var(--text-secondary);
  background: var(--bg-surface);
  white-space: nowrap;
}
.row-meta {
  display: none;
}
.row-code { display: none; }
.row-catalyst { display: none; }
.row-chevron {
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 2px;
  opacity: 0.5;
}
.row-dots { display: flex; gap: 2px; flex-shrink: 0; }
.row-dday {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
}
.row-stars { display: block; line-height: 1; }

/* ── Tab 2: 🔥뉴스 ──────────────── */
#tab-alpha {
  flex-direction: column;
  padding: 0;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
#tab-alpha.active { display: flex; }

.news-more-btn {
  display: block;
  width: calc(100% - 20px);
  margin: 4px 10px 16px;
  padding: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
}
#news-list { flex: 1; }
#news-list[hidden], #news-hot-wrap[hidden] { display: none; }
/* 뉴스 탭: 언론 기사 | 텔레 속보 */
/* 탭 안 세부 보기 버튼 줄 — 뉴스·브리핑·심리 공통 (탭 위 풍선·두 번 누르기와 같은 일을 한다) */
.view-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-base); }
.view-bar button {
  flex: 1; padding: 8px 0; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border-default); border-radius: 8px;
  background: var(--bg-base); color: var(--text-secondary);
}
.view-bar button.on { background: var(--text-primary); color: var(--bg-base); border-color: var(--text-primary); }
.hot-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 6px; font-size: 12px; color: var(--text-muted); }
#hot-sort { flex-shrink: 0; }
#hot-sort button { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--text-muted); padding: 2px 4px; }
#hot-sort button.on { color: var(--text-primary); font-weight: 700; }
.hot-item {
  display: block;
  padding: 12px 14px; border-bottom: 1px solid var(--border-subtle);
  color: inherit; text-decoration: none;
}
.hot-item:hover { background: var(--bg-elevated); }
.hot-item { cursor: pointer; }
/* 관련 일정: 기사 제목의 종목에 앞으로의 일정이 있으면 (매칭은 news_links.related_event) */
.hot-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hot-rel { flex-shrink: 0; font-size: 11.5px; font-weight: 600; color: #2563eb; background: #eff6ff; border-radius: 6px;
           padding: 2px 7px; text-decoration: none; white-space: nowrap; }
.hot-rel-line { font-size: 13px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }
.hot-rel-line b { color: var(--text-primary); }
.hot-go + .hot-go { margin-left: 6px; }
.hot-item.read .hot-rel { opacity: 0.45; }
.hot-ko { font-size: 13.5px; line-height: 1.45; color: var(--text-secondary); margin-top: 2px; word-break: keep-all; overflow-wrap: anywhere; }
.hot-item.read .hot-ko { opacity: 0.38; }
.hot-more { display: none; margin-top: 8px; }
.hot-item.open .hot-more { display: block; }
.hot-sum { font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); word-break: keep-all; overflow-wrap: anywhere; }
.hot-go { display: inline-block; margin-top: 8px; padding: 6px 12px; border: 1px solid var(--border-subtle); border-radius: 8px;
          font-size: 13px; font-weight: 600; color: var(--text-primary); text-decoration: none; background: var(--bg-base); }
.hot-go:hover { background: var(--bg-elevated); }
.hot-title { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text-primary); word-break: keep-all; overflow-wrap: anywhere; }
.hot-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
/* 중요도 단계 (news_links 기준 9) — 같은 모양, 단계가 오를수록 진하게. ▲ = 최근 RAISED_HOURS 안에 오름 */
.nw-lv { display: inline-block; margin-right: 5px; padding: 0 6px; border-radius: 4px; font-size: 10.5px; font-weight: 700;
  line-height: 16px; vertical-align: 1px; }
.nw-lv.l1 { color: #b45309; background: rgba(245,158,11,0.12); }
.nw-lv.l2 { color: #fff; background: #f59e0b; }
.nw-lv.l3 { color: #fff; background: #dc2626; }
.hot-item.lv2 { box-shadow: inset 3px 0 0 #f59e0b; background: rgba(245,158,11,0.07); }
.hot-item.lv3 { box-shadow: inset 4px 0 0 #dc2626; background: rgba(220,38,38,0.07); }
.hot-item.lv3 .hot-title { font-weight: 800; }
.nw-out { margin-left: 6px; font-size: 11px; color: var(--text-secondary); }
.nw-for { display: inline-block; margin-right: 5px; padding: 0 5px; border-radius: 4px; font-size: 10.5px; font-weight: 700;
  line-height: 16px; color: #1d4ed8; background: rgba(37,99,235,0.1); vertical-align: 1px; }   /* 해외 언론 (news_links.site_label) */
/* 뉴스 탭 타임라인: 왼쪽에 굵은 시각, 끊기지 않는 세로선과 그 위의 점, 오른쪽에 내용 (상자 없음) */
.ntl-item {
  position: relative;
  margin: 0 !important; border: none !important; border-radius: 0 !important;
  padding: 14px 14px 14px 78px !important;
  /* 구분선은 내용 쪽에만 긋는다 — 세로선을 가로지르지 않게 */
  background: linear-gradient(var(--border-subtle), var(--border-subtle)) no-repeat 78px 100% / calc(100% - 92px) 1px !important;
}
.ntl-item::before {                /* 시각 */
  content: attr(data-t);
  position: absolute; left: 8px; top: 14px; width: 44px;
  text-align: right; white-space: pre; line-height: 1.3;
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  font-variant-numeric: tabular-nums; letter-spacing: -0.2px;
}
.ntl-item::after {                 /* 세로선 */
  content: ''; position: absolute; left: 63px; top: 0; bottom: 0; width: 2px;
  background: var(--border-default);
}
.ntl-dot {
  position: absolute; left: 59px; top: 18px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-base); border: 2px solid var(--text-muted); box-sizing: border-box; z-index: 1;
}
.ntl-item.ntl-hot .ntl-dot { border-color: #f59e0b; background: #f59e0b; }   /* 반응이 몰린 글 */
.ntl-day {
  position: relative; padding: 16px 14px 4px 78px;
  font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.3px;
}
.ntl-day::after { content: ''; position: absolute; left: 63px; top: 0; bottom: 0; width: 2px; background: var(--border-default); }
.ntl-day:first-child::after { top: 22px; }
@media (min-width: 768px) { .ntl-item::before { font-size: 15px; } }
/* 탭 버튼 위에 잠깐 뜨는 보기 선택 풍선 (.tab-pop) — 탭과 보기 목록은 JS의 TAB_POP 한 곳 */
.tab-pop {
  position: fixed; z-index: 250;
  display: flex; gap: 4px; padding: 5px;
  background: var(--bg-base); border: 1px solid var(--border-default); border-radius: 12px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.16);
  opacity: 0; pointer-events: none; transform: translate(-50%, 6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.tab-pop.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.tab-pop button {
  border: none; background: none; cursor: pointer; white-space: nowrap;
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  padding: 9px 14px; border-radius: 8px;
}
.tab-pop button.on { background: var(--text-primary); color: var(--bg-base); }

/* 브리핑 탭: 시황 | 일정 보기 */
#tab-briefing[data-view="mkt"] #sch-view, #tab-briefing[data-view="us"] #sch-view, #tab-briefing[data-view="sch"] #mkt-view { display: none; }
#mkt-view { max-width: 560px; margin: 0 auto; padding-bottom: 40px; }
.mk-intro { padding: 14px 14px 10px; border-bottom: 1px solid var(--border-default); background: var(--bg-elevated); }
.mk-intro-t { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; line-height: 1.4; }
.mk-intro-d { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
#mkt-bar { position: sticky; top: 0; z-index: 5; background: var(--bg-base); border-bottom: 1px solid var(--border-default);
  padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.mk-nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.mk-nav button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-default); background: var(--bg-elevated);
  color: var(--text-primary); font-size: 17px; line-height: 1; cursor: pointer; }
.mk-nav button:disabled { opacity: 0.3; cursor: default; }
#sch-nav { gap: 10px !important; padding: 8px 12px; background: var(--bg-base); border-bottom: 1px solid var(--border-default); }
#sch-date { font-size: 14px; font-weight: 700; color: var(--text-primary); text-align: center; }
.sch-pick { position: relative; display: inline-flex; align-items: center; gap: 5px; min-width: 120px; justify-content: center; cursor: pointer; color: var(--text-muted); }
.sch-pick input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }   /* 날짜를 누르면 달력 (10/24 — 날짜 찾기 줄을 합쳤다) */
.sch-today { flex-shrink: 0; white-space: nowrap; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-default); background: var(--bg-elevated); font: inherit; font-size: 12px; font-weight: 700; color: var(--text-secondary); cursor: pointer; }
.sch-more { display: block; margin: 18px auto 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border-default);
  background: var(--bg-elevated); color: var(--text-primary); font-size: 13px; font-weight: 700; cursor: pointer; }
#mkt-date { font-size: 14px; font-weight: 700; color: var(--text-primary); min-width: 120px; text-align: center; }
/* 시황 하루 카드 — 장전·장중·장마감·증권사를 최신이 위인 칸(mk-blk)으로. 있는 칸만 칩(mk-toc)으로 */
.mk-day-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 13px 14px 2px; }
.mk-day > .mk-toc { padding: 8px 14px 10px; }
/* 칸마다 색(--kc 진한 색, --kt 옅은 바탕) — 알약 k-* 색과 같은 계열. 칸은 각자 테두리 상자라 어디서 바뀌는지 바로 보인다 */
.mk-blk { --kc: #6b7280; --kt: rgba(107,114,128,0.08); margin: 12px 10px 0; border: 1px solid var(--border-default);
  border-top: 3px solid var(--kc); border-radius: 12px; overflow: hidden; scroll-margin-top: 70px; }
.mk-blk:last-child { margin-bottom: 10px; }
.mk-blk.b-pre    { --kc: #d97706; --kt: rgba(245,158,11,0.10); }
.mk-blk.b-intra  { --kc: #dc2626; --kt: rgba(239,68,68,0.08); }
.mk-blk.b-close  { --kc: #4f46e5; --kt: rgba(99,102,241,0.09); }
.mk-blk.b-broker { --kc: #059669; --kt: rgba(16,185,129,0.09); }
.mk-blk-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--kt); margin-bottom: 10px; }
.mk-blk-h .mk-kind { background: var(--kc); color: #fff; font-size: 13px; padding: 4px 11px; border-radius: 999px; }
.mk-blk-h .mk-at { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--kc); font-variant-numeric: tabular-nums; }
.mk-blk .mk-quotes { padding: 0 12px 12px; }
.mk-blk .mk-body { border-top: none; padding: 0 12px 14px; }
.mk-toc button[data-part]::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%;
  background: var(--kc, var(--text-muted)); vertical-align: 1px; }
.mk-toc button.c-pre { --kc: #d97706; } .mk-toc button.c-intra { --kc: #dc2626; }
.mk-toc button.c-close { --kc: #4f46e5; } .mk-toc button.c-broker { --kc: #059669; }
#sch-week { padding: 12px 12px 0; }
/* 간밤 미국: S&P500 히트맵 (트레이딩뷰 위젯, 접어 두고 처음 펼칠 때 불러온다 — _usHeat) */
#us-heat { margin: 12px 12px 0; border: 1px solid var(--border-default); border-radius: 14px; background: var(--bg-base); overflow: hidden; }
#tab-briefing:not([data-view="us"]) #us-heat { display: none; }
.bn-next { width: calc(100% - 24px); margin: 16px 12px 18px; }
#tab-briefing:not([data-view="us"]) #bn-to-mkt, #tab-briefing:not([data-view="mkt"]) #bn-to-sch { display: none; }
#us-heat { border-color: rgba(37,99,235,0.28); background: linear-gradient(135deg, rgba(37,99,235,0.07), rgba(16,185,129,0.06)); }
#us-heat summary { list-style: none; cursor: pointer; padding: 12px 12px 12px 14px; display: flex; align-items: center; gap: 12px; }
#us-heat summary::-webkit-details-marker { display: none; }
.uh-ic { flex-shrink: 0; width: 44px; height: 34px; border-radius: 7px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
.uh-ic svg { display: block; width: 100%; height: 100%; }
.uh-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.uh-txt b { font-size: 14.5px; color: var(--text-primary); }
.uh-txt small { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.uh-btn { flex-shrink: 0; padding: 7px 12px; border-radius: 999px; background: var(--text-primary); color: var(--bg-base);
  font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.uh-btn::after { content: ' ▾'; }
#us-heat[open] .uh-on { display: none; }
#us-heat[open] .uh-btn::before { content: '접기'; }
#us-heat[open] .uh-btn { background: var(--bg-elevated); color: var(--text-secondary); }
#us-heat[open] .uh-btn::after { content: ' ▴'; }
#us-heat:not([open]) summary:hover .uh-btn { opacity: 0.85; }
.us-heat-w, .us-heat-note { background: var(--bg-base); }
.us-heat-w { height: 420px; border-top: 1px solid var(--border-default); }
.us-heat-note { padding: 8px 14px 12px; font-size: 11.5px; line-height: 1.5; color: var(--text-muted); }
@media (min-width: 768px) { .us-heat-w { height: 480px; } }
#sch-week:empty { display: none; }
#mkt-list { padding: 12px 12px 0; display: flex; flex-direction: column; gap: 12px; }
.mk-card { border: 1px solid var(--border-default); border-radius: 14px; background: var(--bg-base); overflow: hidden; }
.mk-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: none; background: none;
  cursor: pointer; text-align: left; color: var(--text-primary); }
.mk-kind { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.k-pre { background: rgba(245,158,11,0.16); color: #b45309; }
.k-intra { background: rgba(239,68,68,0.14); color: #dc2626; }
.k-close { background: rgba(99,102,241,0.15); color: #4f46e5; }
.k-broker { background: rgba(16,185,129,0.15); color: #047857; }
.k-week { background: rgba(14,165,233,0.15); color: #0369a1; }
.k-us { background: rgba(37,99,235,0.13); color: #1d4ed8; }
/* 주간 프리뷰 카드 — 핵심(강조 상자) · 날짜(검은 날짜 알약 + 티어·일정 제목·▲▼) · 섹터 흐름 (_mkWeekItem) */
/* 3줄 요약 (briefing_forms.SUMMARY) — 브리핑 맨 위 색 상자. 시황 하루 카드도 각 칸(장전·장중·마감) 안에 그 브리핑의 요약 (10/19) */
.mk-sec.mk-sum { margin-top: 12px; padding: 2px 14px 12px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(16,185,129,0.07)); }
.mk-sec.mk-sum h4 { color: #1d4ed8; }
.mk-sec.mk-sum li { font-weight: 600; }
.mk-sec.mk-sum + .mk-sec { border-top: none; }
b.mk-em { font-weight: 700; background: linear-gradient(transparent 58%, rgba(250,204,21,0.45) 58%); }
.mk-week .wk-key { margin-top: 12px; padding: 2px 14px 12px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, rgba(14,165,233,0.10), rgba(99,102,241,0.08)); }
.mk-week .wk-key h4 { color: #0369a1; }
.mk-week .wk-key + .mk-sec { border-top: none; }
.mk-week .wk-day h4 > span:first-child { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px;
  background: var(--text-primary); color: var(--bg-base); font-size: 12.5px; letter-spacing: 0.3px; }
.mk-week .wk-day ul { gap: 12px; }
.mk-week .wk-day li { padding-left: 0; }
.mk-week .wk-day li::before { display: none; }
.wk-t { display: flex; align-items: baseline; gap: 8px; font-weight: 650; }
.wk-t .brief-tier-badge { font-size: 10.5px; padding: 1px 6px; position: relative; top: -1px; }
.wk-sc { display: block; margin-top: 3px; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
.wk-more { font-size: 12.5px; color: var(--text-muted); }
.wk-lb { font-weight: 700; color: var(--text-primary); }
.mk-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.35; }
.mk-at { flex-shrink: 0; font-size: 12px; color: var(--text-muted); }
.mk-chev { flex-shrink: 0; color: var(--text-muted); transition: transform 0.15s; }
.mk-card.open .mk-chev { transform: rotate(90deg); }
.mk-quotes { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }
.mk-q { font-size: 12px; padding: 4px 9px; border-radius: 8px; background: var(--bg-elevated); color: var(--text-primary); white-space: nowrap; }
.mk-q em { font-style: normal; color: var(--text-secondary); margin-right: 4px; }
.bd-secs { display: grid; grid-template-columns: 1fr; }      /* 기록판 섹터 지도 — 휴대폰: 이름·등락 한 줄 / 얇은 막대 / 대표 종목 (10/20) */
.bd-sec { padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.bd-sec:first-child { border-top: none; padding-top: 2px; }
.bd-top { display: flex; justify-content: space-between; align-items: baseline; }
.bd-top .bd-n { font-size: 14.5px; font-weight: 700; }
.bd-top > b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.bd-bar { display: block; height: 4px; margin: 6px 0 7px; border-radius: 2px; background: var(--bg-elevated); overflow: hidden; }
.bd-bar i { display: block; height: 100%; border-radius: 2px; }
.bd-bar i.up { background: #f87171; } .bd-bar i.dn { background: #60a5fa; }
.bd-st { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 12.5px; }
.bd-st a { color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.bd-st b { font-weight: 600; }
.bd-why { margin-top: 5px; padding: 6px 9px; border-radius: 8px; background: var(--bg-elevated); font-size: 12.5px; line-height: 1.5; color: var(--text-primary); }
@media (min-width: 768px) { .bd-secs { grid-template-columns: 1fr 1fr; column-gap: 28px; } .bd-sec:nth-child(2) { border-top: none; padding-top: 2px; } }
.bd-flow { width: calc(100% - 28px); margin: 0 14px 12px; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }   /* 장마감 확정 수급 */
.bd-flow th, .bd-flow td { padding: 5px 4px; text-align: right; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.bd-flow th:first-child { text-align: left; }
.bd-flow thead th { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.bd-flow tbody th { font-weight: 700; }
.bd-news li { display: flex; gap: 6px; align-items: baseline; }
.bd-views { gap: 10px; }      /* 시장의 시각 — 화자 / 말, 왼쪽 선으로 묶음 */
.bd-views li { display: flex; flex-direction: column; gap: 2px; padding: 0 0 0 10px; border-left: 3px solid #bfdbfe; }
.bd-views li::before { display: none; }
.bd-views li b { font-size: 12.5px; color: #1d4ed8; }
.bd-rows li { display: flex; gap: 8px; align-items: flex-start; padding-left: 0; }   /* 장마감 목표주가·실적 — 표시 · 종목 / 숫자 */
.bd-rows li::before { display: none; }
.bd-dir { flex-shrink: 0; width: 14px; text-align: center; font-weight: 700; color: var(--text-muted); }
.bd-sub { font-size: 12px; color: var(--text-secondary); }
.bd-news li::before { display: none; }
.bd-news { padding-left: 0; }
.bd-t { flex-shrink: 0; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.bd-flag { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: #fee2e2; color: #b91c1c; }   /* [속보]·[단독] — 파이썬이 정한 것만 */
.bd-tag { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--bg-elevated); color: var(--text-secondary); }
a.bd-ev { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-default); text-underline-offset: 3px; }
.bd-evs { font-size: 12px; color: var(--text-secondary); }
.mk-big { margin: 0 14px 12px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 10px; }   /* 대형주 바구니 — 매일 같은 10종목 */
.mk-big-h { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.mk-big-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.mk-big-g span { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; min-width: 0; }
.mk-big-g em { font-style: normal; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 768px) { .mk-big-g { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* 시세 칩 → 트레이딩뷰 미니 차트 (TV_SYMBOL에 있는 것만 버튼) */
button.mk-q.tv { border: none; font: inherit; font-size: 12px; cursor: pointer; }
button.mk-q.tv::after { content: '↗'; margin-left: 3px; font-size: 10px; color: var(--text-muted); }
button.mk-q.tv:hover { box-shadow: inset 0 0 0 1px var(--border-default); }
#upd-pill { position: fixed; top: calc(var(--filter-h, 80px) + 64px); left: 50%; transform: translateX(-50%); z-index: 1500; border: none; border-radius: 999px;
  padding: 8px 16px; background: var(--text-primary); color: var(--bg-base); font-size: 13px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22); cursor: pointer; }
/* 용어 사전 (일정 상세, _glMark) — 옅은 회색 점선 밑줄(용어 범위) + 연한 동그라미 ? 배지, 누르면 말풍선(쉽게 말하면 크게 · 뜻 작게) */
/* 별 뜻 말풍선 — 기준 목록, 갖춘 기준은 체크·진하게 (_starOpen) */
#gl-pop { max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain; }
#gl-pop .sw-more { display: block; width: 100%; margin-top: 10px; padding: 7px 0; border: 1px solid var(--border-subtle); border-radius: 8px;
  background: var(--bg-elevated); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
#gl-pop .sg { margin-top: 10px; }
#gl-pop .sg h5 { margin: 12px 0 4px; font-size: 13px; font-weight: 700; color: var(--text-primary); }
#gl-pop .sg h5:first-child { margin-top: 0; }
#gl-pop .sg p { margin: 2px 0 4px; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }
#gl-pop .sg p.sg-k { color: var(--text-primary); font-weight: 600; }
#gl-pop .sg p.sg-f { margin: 6px 0; padding: 6px 9px; border-radius: 8px; background: var(--bg-elevated); font-size: 12.5px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
#gl-pop .sg p.sg-f small { display: inline; margin: 0; padding: 0; border: none; font-size: 11.5px; font-weight: 400; color: var(--text-muted); }
#gl-pop .sg p.sg-note { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-muted); }
#gl-pop .sg ul { margin: 0; padding-left: 16px; display: grid; gap: 3px; }
#gl-pop .sg li { font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }
#gl-pop .sg li b { display: inline; margin: 0 4px 0 0; font-size: 12.5px; color: var(--text-primary); }
#gl-pop .sw-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; }
#gl-pop .sw-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--text-muted); }
#gl-pop .sw-list li i { flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 11px; font-weight: 800; background: var(--bg-elevated); color: var(--text-muted); }
#gl-pop .sw-list li span b { display: inline; margin: 0 6px 0 0; font-size: 13px; color: inherit; }
#gl-pop .sw-list li.on { color: var(--text-primary); }
#gl-pop .sw-list li.on i { background: #2563eb; color: #fff; }
#gl-pop .sw-list li.on span b { color: var(--text-primary); }
#gl-pop .sw-list.tbl li i { width: 46px; height: auto; border-radius: 0; background: none; color: #D1D5DB; font-size: 12px; letter-spacing: 0; justify-content: flex-start; }
#gl-pop .sw-list.tbl li.on i { background: none; color: #EAB308; }
#gl-pop .sw-list.tbl li.on { font-weight: 700; }
#gl-pop p + p { margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
#gl-pop p em { font-style: normal; font-weight: 800; color: #2563eb; }
#gl-pop .sw-list + small { margin-top: 10px; }
#gl-pop .sw-sum { margin: 2px 0 0; font-size: 13px; color: var(--text-secondary); }
#gl-pop .sw-v2 { gap: 9px; }
#gl-pop .sw-v2 { gap: 6px; }
#gl-pop .sw-v2 li { align-items: center; }
#gl-pop .sw-v2 li span { font-size: 12.5px; }
#gl-pop .sw-v2 li span b { display: inline-block; min-width: 46px; margin: 0 8px 0 0; }
#gl-pop .sw-v2 li:not(.on) span b { color: var(--text-muted); font-weight: 500; }
#gl-pop .sw-exp { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fff7ed; display: grid; gap: 8px; }
#gl-pop .sw-exp p { margin: 0; font-size: 12.5px; line-height: 1.55; color: #7c2d12; }
#gl-pop .sw-exp b { display: block; margin-bottom: 1px; font-size: 12px; color: #9a3412; }
#gl-pop .sw-exp .sw-num { display: block; margin-bottom: 2px; font-weight: 700; color: #9a3412; font-variant-numeric: tabular-nums; }
.st-adj { color: #7c3aed; display: inline-block; }
.st-top > span { text-shadow: 0 0 6px rgba(124,58,237,0.55), 0 0 1px #7c3aed; }     /* 최상급 — ★★★ 보라 빛 (멈춘 표시) */
.st-top.st-shine > span { animation: stGlow 3s ease-in-out infinite; }      /* 상세창 — 은은한 반짝임(빛이 천천히 숨쉬듯) */
.st-top.st-shine > span:nth-child(2) { animation-delay: 0.25s; } .st-top.st-shine > span:nth-child(3) { animation-delay: 0.5s; }
@keyframes stGlow { 0%, 100% { text-shadow: 0 0 4px rgba(124,58,237,0.45); } 50% { text-shadow: 0 0 11px rgba(124,58,237,0.95), 0 0 2px #7c3aed; } }      /* 보라 별 = 데이터 보정 (star_adj.py) */
.st-cut { color: transparent; -webkit-text-stroke: 1px #7c3aed; }
@supports not (-webkit-text-stroke: 1px #000) { .st-cut { color: #c4b5fd; } }
.st-anim.st-cut { animation: stCut 0.6s ease 0.3s both; } .st-anim.st-add { animation: stAdd 0.6s ease 0.3s both; }
@keyframes stCut { 0% { color: #EAB308; -webkit-text-stroke: 0; transform: scale(1); } 50% { transform: scale(1.3); } 100% { color: transparent; -webkit-text-stroke: 1px #7c3aed; transform: scale(1); } }
@keyframes stAdd { 0% { opacity: 0; transform: scale(0.3); } 70% { transform: scale(1.3); } 100% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .st-anim, .st-shine { animation: none !important; } }
.pos-tag { display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 999px; border: 1px solid #c4b5fd; background: #f5f3ff;
  color: #6d28d9; font-size: 10.5px; font-weight: 700; line-height: 1.6; white-space: nowrap; vertical-align: middle; }   /* 자리 표시 (10/24) */
.sw-adj { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-subtle); }
.sw-tn { margin: 8px 0 0; padding: 6px 9px; border-radius: 8px; background: #fff7ed; color: #9a3412; font-size: 12.5px; }
.sw-adj p { margin: 4px 0; }
.sw-adj .sw-adj-n { font-size: 12px; color: var(--text-secondary); }
.star-why { border: none; background: none; padding: 2px 4px; margin: -2px -4px; cursor: pointer; border-radius: 6px; line-height: 1; }
.star-why:hover { background: var(--bg-elevated); }
.star-why .star-i { display: inline-block; margin-left: 4px; font-size: 13px; line-height: 1; color: var(--text-secondary); vertical-align: 1px; }   /* 누르면 별 까닭이 나온다는 표시 (10/25 사용자) */
.star-why:hover .star-i { color: #2563eb; }
.gl-t { cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  text-decoration: underline dotted rgba(100,116,139,0.55); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.gl-t:hover { text-decoration-color: #2563eb; }
.gl-t sup { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; margin-left: 2px; border-radius: 50%;
  background: rgba(37,99,235,0.10); color: rgba(37,99,235,0.75); font-size: 9px; font-weight: 800; line-height: 1; vertical-align: 0.55em; top: 0; }
#gl-pop { position: fixed; z-index: 2100; display: none; max-width: 300px; padding: 12px 14px; border-radius: 12px; background: var(--bg-surface);
  border: 1px solid var(--border-default); box-shadow: 0 10px 28px rgba(0,0,0,0.18); }
#gl-pop.open { display: block; }
#gl-pop b { display: block; font-size: 13px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
#gl-pop p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-primary); }
#gl-pop small { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-subtle); font-size: 12px; line-height: 1.5; color: var(--text-muted); }
/* 지표 공유 (기준 share.py) — 카드 머리 공유 버튼 · 공유 주소로 들어오면 그 카드 반짝 · 미리보기 그림 화면(#snap-frame) */
.sx-share { flex-shrink: 0; width: 30px; height: 30px; border: 1px solid var(--border-default); border-radius: 50%; background: var(--bg-surface);
  color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.sx-share:hover { color: #2563eb; border-color: rgba(37,99,235,0.4); }
.sx-share svg { width: 15px; height: 15px; }
.sx-h-r { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sx-card.share-hit { box-shadow: 0 0 0 3px rgba(37,99,235,0.35), 0 8px 24px rgba(37,99,235,0.15); transition: box-shadow 0.6s; }
#snap-frame { position: fixed; inset: 0; z-index: 99999; background: #EEF1F4; display: grid; grid-template-columns: minmax(0, 1fr) 590px; gap: 36px;
  align-items: center; padding: 30px 48px; }
#snap-frame .snap-l b { display: block; font-size: 22px; font-weight: 800; color: #2563eb; letter-spacing: -0.3px; }
#snap-frame .snap-l h2 { margin: 22px 0 0; font-size: 34px; font-weight: 800; color: #334155; }
#snap-frame .snap-l h1 { margin: 2px 0 12px; font-size: 92px; line-height: 1.05; font-weight: 900; color: #0f172a; letter-spacing: -2px; white-space: nowrap; }
#snap-frame .snap-l h1 span { font-size: 56px; letter-spacing: -1px; }
#snap-frame .snap-l p { margin: 0; font-size: 24px; line-height: 1.5; color: #475569; }
#snap-frame .snap-l em { display: inline-block; margin-top: 26px; font-style: normal; font-size: 22px; font-weight: 700; color: #0f172a;
  padding: 8px 16px; border-radius: 999px; background: #fff; }
#snap-frame .snap-l small { display: block; margin-top: 20px; font-size: 20px; color: #64748b; }
#snap-frame .sx-card { margin: 0; width: 440px; zoom: 1.34; }
#snap-frame .sx-sub-h, #snap-frame .sx-chart, #snap-frame #sx-fut-step, #snap-frame .sx-cr-legend, #snap-frame .sx-note, #snap-frame .sx-share, #snap-frame .gl-t sup,
#snap-frame .sx-cr-verdict, #snap-frame .sx-cr-tiles { display: none !important; }
#snap-frame .gl-t { text-decoration: none; }
#tv-pop { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.45); display: none; align-items: center; justify-content: center; padding: 16px; }
#tv-pop.open { display: flex; }
/* 주요 차트 10개 한 번에 — 전체 화면 (휴대폰 2칸 · PC 5칸) */
.cg-open { flex-shrink: 0; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.cg-open:hover { background: rgba(37,99,235,0.08); }
@media (max-width: 480px) { .cg-btns { flex-direction: column; align-items: stretch; gap: 6px; } }   /* 휴대폰: 버튼 두 개를 위아래로 */
#cg-pop { position: fixed; inset: 0; z-index: 2000; background: rgba(15,23,42,0.45); display: none; align-items: center; justify-content: center; padding: 16px 12px; }
.cg-box { width: 100%; max-width: 1180px; max-height: 100%; display: flex; flex-direction: column; background: #EEF1F4; border-radius: 16px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.28); }
#cg-pop.open { display: flex; }
.cg-h { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border-default); }
.cg-h b { flex: 1; font-size: 16px; font-weight: 800; color: var(--text-primary); }
.cg-x { width: 38px; height: 38px; border: none; background: none; font-size: 18px; color: var(--text-secondary); cursor: pointer; }
.cg-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; min-height: 0; gap: 8px; padding: 10px; align-content: start; }
.cg-tile { background: var(--bg-surface); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.cg-w { height: 210px; }                         /* 이보다 낮으면 위젯이 차트 선을 잘라 낸다 */
.cg-note { margin: 0; padding: 8px 16px 12px; font-size: 11px; line-height: 1.55; color: var(--text-muted); background: var(--bg-surface); border-top: 1px solid var(--border-default); }
.cg-note a { color: var(--text-primary); font-weight: 700; text-decoration: none; margin-left: 4px; }
@media (min-width: 900px) { #cg-pop { padding: 32px; } .cg-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 16px 20px; } .cg-w { height: 230px; } }
.tv-card { width: 100%; max-width: 420px; background: var(--bg-base); border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.tv-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 4px 16px; font-size: 14px; font-weight: 700; color: var(--text-primary); }
.tv-h button { width: 34px; height: 34px; border: none; background: none; font-size: 17px; color: var(--text-secondary); cursor: pointer; }
.tv-w { height: 220px; }
.tv-note { padding: 6px 16px 12px; font-size: 11.5px; line-height: 1.5; color: var(--text-muted); }
.tv-note:empty { display: none; }
/* 트레이딩뷰 제휴 링크 (맨 위 배너와 같은 aff_id) — 그 종목 차트로 바로 */
.tv-go { display: block; margin: 0 12px 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg-elevated); color: var(--text-primary);
  font-size: 13px; font-weight: 700; text-align: center; text-decoration: none; }
.tv-go:hover { background: rgba(37,99,235,0.10); }
.mk-body { display: none; border-top: 1px solid var(--border-default); padding: 4px 14px 14px; }
.mk-card.open .mk-body { display: block; }
.mk-toc { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 12px 0 4px; }
.mk-toc::-webkit-scrollbar { display: none; }
.mk-toc button { flex-shrink: 0; border: 1px solid var(--border-default); background: var(--bg-elevated); color: var(--text-secondary);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.mk-sub { flex-shrink: 0; font-size: 12px; color: var(--text-muted); }
.mk-sec + .mk-sec { border-top: 1px dashed var(--border-default); margin-top: 14px; }
.mk-sec { scroll-margin-top: 130px; }               /* 바로가기로 갈 때 위 날짜·종류 막대에 가리지 않게 */
.mk-src { display: inline-block; font-size: 11px; font-weight: 700; color: var(--text-secondary); background: var(--bg-elevated);
  padding: 1px 6px; border-radius: 5px; margin-right: 6px; vertical-align: 1px; }
.mk-part { display: block; }
/* 간밤 미국 '특징 종목'·'우리 시장 체크포인트' — '이름: 앞 — 뒤'를 제목 / 종목 줄 / 이유 줄로 (_mkLabeled) */
.mk-sec li.lb { padding-left: 0; }
.mk-sec li.lb::before { display: none; }
.lb-t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-weight: 700; }
.lb-s { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; font-size: 13.5px; }
.lb-s > span { white-space: nowrap; }
.lb-r { display: block; margin-top: 3px; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
/* 시황 항목 — 머리말은 굵은 제목 한 번(이어지면 생략), 목표주가·실적은 한 줄 요약형 (_mkList) */
.lb-b { display: block; margin-top: 2px; color: var(--text-primary); }
.lb-b + .lb-b { margin-top: 3px; padding-left: 10px; position: relative; }
.lb-b + .lb-b::before { content: '–'; position: absolute; left: 0; color: var(--text-muted); }
.mk-sec li.lb-cont { margin-top: -3px; }
.mk-sec li.lb > .lb-t + .lb-b, .mk-sec li.lb-cont > .lb-b:first-child { position: relative; padding-left: 12px; }
.mk-sec li.lb > .lb-t + .lb-b::before, .mk-sec li.lb-cont > .lb-b:first-child::before { content: ''; position: absolute; left: 0; top: 0.75em; width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); }
.tg-p { margin-left: auto; font-weight: 700; }
.er-b { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.er-o { background: rgba(220,38,38,0.1); color: #dc2626; }
.er-m { background: var(--bg-elevated); color: var(--text-secondary); }
.er-x { background: rgba(37,99,235,0.1); color: #2563eb; }
.lb-k { display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 700; color: var(--text-muted); }
.mk-part + .mk-part { margin-top: 3px; padding-left: 10px; position: relative; color: var(--text-primary); }
.mk-part + .mk-part::before { content: '–'; position: absolute; left: 0; color: var(--text-muted); }
.mk-sec h4 { margin: 14px 0 6px; font-size: 14px; font-weight: 700; color: var(--text-primary); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mk-who { font-size: 11px; font-weight: 600; color: var(--text-secondary); background: var(--bg-elevated); padding: 2px 7px; border-radius: 6px; }
.mk-sec ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.mk-sec li { position: relative; padding-left: 12px; font-size: 14px; line-height: 1.65; color: var(--text-primary); word-break: keep-all; overflow-wrap: anywhere; }
.mk-sec li::before { content: ''; position: absolute; left: 0; top: 0.75em; width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); }
.mk-up { color: #dc2626; font-weight: 700; }
.mk-dn { color: #2563eb; font-weight: 700; }
a.mk-stock { color: inherit; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: rgba(100,116,139,0.35); text-underline-offset: 3px; }   /* 옅게 — 문장이 밑줄로 덮이지 않게 (10/20) */
.mk-qgrid { flex-basis: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }   /* 시세 4개 이상 줄 — 격자 */
.mk-qgrid .mk-q { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; min-width: 0; text-align: left; white-space: normal; }   /* 두 줄 칸: 이름 / 값·등락 (이름이 잘리지 않게) */
.mk-brs { flex-basis: 100%; display: grid; gap: 8px; padding: 4px 2px 2px; }
.mk-br-t { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.mk-br-bar { height: 6px; margin-top: 4px; border-radius: 3px; background: #2563eb; overflow: hidden; } .mk-br-bar i { display: block; height: 100%; background: #dc2626; }
.mk-qgrid .mk-q { padding: 7px 10px; font-size: 13.5px; font-weight: 600; } .mk-qgrid .mk-q b { font-size: 12.5px; } .mk-qgrid .mk-q b { margin-left: 2px; }
.mk-qgrid .mk-q em { flex-basis: 100%; margin: 0 0 1px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-qgrid button.mk-q.tv::after { margin-left: 0; }
@media (min-width: 768px) { .mk-qgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 768px) { #mkt-view { max-width: 680px; } .mk-sec li { font-size: 15px; } .mk-title { font-size: 16px; } }
@media (min-width: 768px) { .hot-title { font-size: 16px; } .view-bar { justify-content: center; } .view-bar button { flex: 0 1 170px; padding: 7px 0; font-size: 13px; } }
.news-item {
  padding: 12px 14px;
  margin: 8px 10px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: opacity 0.2s;
}
.news-item.read { opacity: 0.38; }
.hot-item.read .hot-title, .hot-item.read .hot-sub { opacity: 0.38; }
.news-item.read .news-text {
  -webkit-line-clamp: 1;
}
.news-item .news-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 10;
  overflow: hidden;
}
.news-item.expanded .news-text {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}
.news-badge-new {
  font-size: 9px; font-weight: 700;
  background: rgba(239,68,68,0.18); color: #f87171;
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0;
}
.news-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.spike-badge { font-size: 10px; color: #F59E0B; font-weight: 600; flex-shrink: 0; }
.news-ch-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  opacity: .85;
}
.news-ch-link:hover { opacity: 1; }
/* 첫 글의 채널명: 누르면 원문으로 간다는 안내 (방문당 한 번) */
.news-ch-link.ch-hint {
  position: relative;
  opacity: 1;
  border-radius: 4px;
  animation: news-ch-pulse 1.5s ease-in-out 4;
}
@keyframes news-ch-pulse {
  0%, 100% { background: transparent; box-shadow: 0 0 0 0 rgba(245,158,11,0); }
  50%      { background: rgba(245,158,11,0.18); box-shadow: 0 0 0 4px rgba(245,158,11,0.18); }
}
.news-ch-tip {
  position: absolute;
  background: rgba(17,24,39,0.66);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  animation: news-ch-tip 6s ease forwards;
}
.news-ch-tip::before {              /* 아래쪽 꼬리 — 채널명을 가리킨다 */
  content: '';
  position: absolute;
  left: 12px;
  top: 100%;
  border: 5px solid transparent;
  border-top-color: rgba(17,24,39,0.66);
}
@keyframes news-ch-tip {
  0%   { opacity: 0; transform: translateY(4px); }
  8%   { opacity: 1; transform: none; }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}
.news-attach {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(128,128,128,.12);
  color: var(--text-sub, #888);
  margin-left: 3px;
  vertical-align: middle;
}
.news-channel {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}
.news-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}
.news-text a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}
.news-text a:active { opacity: 0.7; }
.news-text b { font-weight: 700; }
.news-text i { font-style: italic; }
.news-more-wrap {
  position: relative;
  margin: -48px 10px 12px;
  cursor: pointer;
  text-align: center;
  padding-top: 60px;
}
.news-more-fade {
  position: absolute;
  top: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(to bottom, transparent, var(--bg-base));
  pointer-events: none;
}
.news-more-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 0 8px;
  letter-spacing: 0.03em;
}
.news-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}
.toggle-group { display: none; }
.alpha-placeholder { display: none; }

/* ── Tab 4: 키워드 랭킹 ─────────────────── */
.kw-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}
.kw-section-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.kw-section-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
}
.kw-section-desc { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.site-disclaimer { font-size: 11px; line-height: 1.65; color: var(--text-muted); padding: 20px 16px 28px; word-break: keep-all; }
/* 공통 하단 — 모든 탭 맨 끝 (처리방침·약관·안내·문의 / 운영 / 투자 유의 / 데이터 출처 / ©). 내용은 서버 pages.SITE_FOOT 한 곳(app_page가 site-foot-tpl로 실어 보냄) */
.site-foot { margin-top: 64px; padding: 22px 16px 72px; border-top: 1px solid var(--border-subtle); background: var(--bg-surface, transparent);
  font-size: 12px; line-height: 1.65; color: var(--text-muted); word-break: keep-all; }
.site-foot .sf-in { max-width: 800px; margin: 0 auto; }
.site-foot .sf-brand { font-size: 13px; font-weight: 700; letter-spacing: 0.05em; color: var(--text-secondary); }
.site-foot .sf-brand span { display: block; font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--text-muted); }
.site-foot .sf-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0; }
.site-foot .sf-links a { color: var(--text-secondary); text-decoration: none; font-size: 12.5px; }
.site-foot .sf-links a:hover { text-decoration: underline; }
.site-foot .sf-links a.b { color: var(--text-primary); font-weight: 700; }
.site-foot .sf-op, .site-foot .sf-dis { border-top: 1px solid var(--border-subtle); padding-top: 10px; margin-top: 10px; }
.site-foot .sf-op a { color: var(--text-secondary); text-decoration: none; }
.site-foot .sf-src { margin-top: 10px; font-size: 11px; }
.site-foot .sf-c { margin-top: 8px; font-size: 11px; }
.scenario-note { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
/* 일정 상세 '과거 반응' (_erHtml) — 핵심 한두 줄 → 최근 사례 비교 → 최근 회차 흐름 선(그림 안에 글자 없음)과 세 구간 중앙값 → 지난 반영일 등락 막대. 오름 빨강·내림 파랑 */
.er-box, #er-all { --er-up: #dc2626; --er-dn: #2563eb; --er-up-soft: rgba(220,38,38,0.09); --er-dn-soft: rgba(37,99,235,0.09);
  --er-d0: rgba(245,158,11,0.12); --er-line: #2563eb; --er-fill: rgba(37,99,235,0.08); }
.er-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.er-head .section-label { margin-bottom: 0; }
.er-sub { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.er-few { margin-left: 4px; padding: 1px 6px; border-radius: 5px; background: rgba(245,158,11,0.15); color: #b45309; font-weight: 700; }
.er-tg { display: flex; gap: 5px; margin: 8px 0 4px; flex-wrap: wrap; }
.er-tg button { font: inherit; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); }
.er-tg button[aria-pressed="true"] { background: var(--er-fill); color: var(--er-line); border-color: transparent; }
.er-sum { display: grid; gap: 6px; margin-top: 10px; }
.er-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 14px; line-height: 1.4; }
.er-line .k { color: var(--text-secondary); }
.er-line b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.er-line .tag { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: var(--bg-elevated); color: var(--text-secondary); }
.er-line .tag.hot { background: var(--er-up-soft); color: var(--er-up); }
.er-line .tag.calm { background: var(--er-dn-soft); color: var(--er-dn); }
.er-line .cmp { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.er-win { margin-top: 12px; border: 1px solid var(--border-subtle); border-radius: 12px; overflow: hidden; }
.er-leg { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 8px 10px 0; font-size: 12px; color: var(--text-secondary); }
.er-leg i { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid var(--er-line); vertical-align: middle; margin-right: 4px; }
.er-leg span b { font-weight: 800; font-variant-numeric: tabular-nums; }
.er-leg span small { font-size: 11px; color: var(--text-muted); }
.er-leg .er-gl { font-style: normal; font-weight: 700; color: var(--text-primary); }
.er-bt { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 9px 10px 0; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.er-bt span { font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.er-ax { display: grid; grid-template-columns: minmax(0,40fr) minmax(0,20fr) minmax(0,40fr); font-size: 11.5px; font-weight: 600; color: var(--text-secondary); text-align: center; }
.er-ax span { padding: 4px 0 6px; }
.er-ax span.d0 { background: var(--er-d0); }
.er-rb { position: relative; height: 6px; border-radius: 3px; background: var(--er-dn-soft); margin: 3px 0 2px; }
.er-rb i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--er-up); opacity: .75; }
.er-rb u { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text-primary); }
.er-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.er-win svg { display: block; width: 100%; height: auto; }
.er-cols { display: grid; grid-template-columns: minmax(0,40fr) minmax(0,20fr) minmax(0,40fr); margin-top: 6px; border-top: 1px solid var(--border-subtle); }
.er-col { padding: 9px 10px 10px; min-width: 0; display: grid; gap: 2px; }
.er-col + .er-col { border-left: 1px solid var(--border-subtle); }
.er-col.d0 { background: var(--er-d0); }
.er-col em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.er-col b { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.er-col span { font-size: 12.5px; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.er-col small { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.er-up { color: var(--er-up); } .er-dn { color: var(--er-dn); } .er-flat { color: var(--text-secondary); }
.er-rec { margin-top: 16px; }
.er-rec-t { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.er-rec-t span { font-weight: 500; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.er-rows { display: grid; gap: 6px; margin-top: 8px; }
.er-row { display: grid; grid-template-columns: minmax(0,96px) minmax(0,1fr) 62px; align-items: center; gap: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.er-row .d { display: grid; line-height: 1.25; min-width: 0; }
.er-row .d b { font-weight: 700; font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.er-row .d small { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.er-row .bar { position: relative; height: 12px; }
.er-row .bar::before { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--border-default); }
.er-row .bar i { position: absolute; top: 1px; bottom: 1px; border-radius: 3px; }
.er-row .v { text-align: right; font-weight: 700; }
.er-split { margin-top: 12px; border: 1px solid var(--border-subtle); border-radius: 12px; padding: 10px 10px 8px; }
.er-split-t { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.er-split-t span { font-weight: 500; color: var(--text-muted); font-size: 12px; }
.er-now { margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
.er-now b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.er-cases { display: grid; gap: 6px; margin-top: 8px; }
.er-case { border-top: 1px solid var(--border-subtle); padding: 7px 4px 2px; border-radius: 6px; }
.er-case.on { background: var(--er-d0); }
.er-case em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.er-case-b { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 2px; font-size: 13px; font-variant-numeric: tabular-nums; }
.er-case-b small { font-size: 12px; color: var(--text-muted); }
.er-case-b .v { font-size: 17px; font-weight: 800; white-space: nowrap; }
.er-rows.has-r { gap: 0; }
.er-rows.has-r .er-row { grid-template-columns: minmax(0,1.25fr) minmax(0,1fr) 62px; padding: 7px 0; border-top: 1px solid var(--border-subtle); }
.er-rows.has-r .er-row:first-child { border-top: 0; }
.er-rows.has-r .er-row .d b { white-space: normal; }
.er-row .d b small { font-weight: 500; font-size: 11.5px; color: var(--text-muted); margin-left: 3px; }
.er-row .d .r { white-space: normal; color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.er-more { display: block; width: 100%; margin-top: 4px; padding: 10px 8px; font: inherit; font-size: 13px; font-weight: 600; text-align: center;
  color: var(--accent); background: none; border: 0; border-top: 1px solid var(--border-subtle); cursor: pointer; }
.er-more:hover { background: var(--bg-surface); }
#er-all-ov { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 400; display: none; }
#er-all-ov.open { display: block; }
#er-all { position: fixed; left: 50%; bottom: 0; top: 7vh; width: min(480px, 100%); z-index: 401; display: flex; flex-direction: column;
  transform: translateX(-50%) translateY(100%); visibility: hidden;
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0.25s;
  background: var(--bg-overlay); border: 1px solid var(--border-default); border-bottom: none; border-radius: 8px 8px 0 0; }
#er-all.nores { width: min(400px, 100%); }
#er-all.open { transform: translateX(-50%) translateY(0); visibility: visible; transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1); }
#er-all .ea-head { display: flex; align-items: flex-start; gap: 10px; padding: 2px 16px 10px; }
#er-all .ea-head > div { flex: 1; min-width: 0; }
#er-all .ea-eb { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); }
#er-all .ea-head h3 { font-size: 19px; font-weight: 700; color: var(--text-primary); line-height: 1.3; margin-top: 2px; }
#er-all .ea-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; font-variant-numeric: tabular-nums; }
#er-all .ea-x { font: inherit; font-size: 18px; line-height: 1; width: 32px; height: 32px; border-radius: 16px; border: 0; cursor: pointer;
  background: var(--bg-elevated); color: var(--text-secondary); flex-shrink: 0; }
#er-all .ea-top { padding: 0 16px 2px; }
#er-all .ea-top .er-tg { margin: 0 0 8px; }
#er-all .ea-top .er-tg button small { font-weight: 500; opacity: .75; margin-left: 3px; }
#er-all .ea-top .er-win { margin-top: 0; }
#er-all .ea-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px 40px; }
#er-all col.n { width: 70px; }
#er-all table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
#er-all thead { position: sticky; top: 0; z-index: 1; background: var(--bg-overlay); }
#er-all thead th, #er-all thead td { background: var(--bg-overlay); }
#er-all thead .d0 { background: var(--er-d0); }
#er-all .ea-h th { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-align: right; padding: 9px 4px 6px; }
#er-all .ea-s th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 3px 4px; white-space: nowrap; }
#er-all .ea-s th small { font-weight: 500; color: var(--text-muted); }
#er-all .ea-s td { padding: 3px 4px; border-top: 0; font-size: 12px; font-weight: 500; color: var(--text-muted); }
#er-all .ea-up th { color: var(--text-primary); font-size: 13px; font-weight: 700; padding-top: 8px; }
#er-all .ea-up td { padding-top: 8px; }
#er-all .ea-up td b { display: block; font-size: 18px; font-weight: 800; line-height: 1.2; }
#er-all .ea-up .er-rb { display: block; margin: 4px 0 1px auto; }
#er-all .ea-last th, #er-all .ea-last td { padding-bottom: 9px; border-bottom: 1px solid var(--border-default); }
#er-all th:first-child, #er-all td:first-child { text-align: left; }
#er-all th.d0, #er-all td.d0 { background: var(--er-d0); }
#er-all td { padding: 8px 4px; text-align: right; border-top: 1px solid var(--border-subtle); white-space: nowrap; font-weight: 600; }
#er-all td.d0 { font-weight: 800; }
#er-all td:first-child { white-space: normal; font-weight: 400; }
#er-all td:first-child b { font-weight: 700; color: var(--text-primary); }
#er-all td:first-child small { display: block; font-size: 11.5px; color: var(--text-secondary); margin-top: 1px; }
#er-all tr.ea-yr td { padding: 12px 4px 4px; border-top: 0; font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); background: none; }
/* 일정 상세 아래 구역 '과거 사례 분석' — 위(이 일정: 왜 중요한가·시나리오·종목·차트·기사)와 바탕·머리로 확실히 나눈다. 채울 것이 없으면 숨김 */
/* 일정 상세 — 심리 탭처럼 회색 바탕 위 흰 카드 (10/19). 칸마다 .ev-sec(openSheet), 칸 제목은 .section-label 한 모양.
   나중에 채우는 칸(관련 기사·이어서 보기 .ev-opt, 과거 사례 .ev-react)은 비어 있으면 숨긴다. 휴대폰 시트·PC 패널 둘 다(:has) */
#bottom-sheet:has(.ev-sec), #side-panel:has(.ev-sec) { background: #EEF1F4; }
.sheet-body:has(> .ev-sec) { background: #EEF1F4; padding: 2px 12px 24px; }
.ev-sec { background: #fff; border-radius: 14px; padding: 14px 14px 16px; margin-top: 12px; box-shadow: 0 1px 2px rgba(15,23,42,0.06); }
.ev-sec.ev-top { margin-top: 2px; }
.ev-opt:empty, .ev-react:not(:has(.er-box)) { display: none; }
.ev-sec .section-label { margin: 0 0 10px; font-size: 15px; font-weight: 800; letter-spacing: -0.2px; color: var(--text-primary); }
.ev-sec .section-label small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--text-muted); }
.ev-sec * + .section-label { margin-top: 18px; }
.ev-sec .sheet-code { margin-bottom: 12px; }
.ev-sec .ev-chart-box { margin-top: 14px; }
.ev-sec .next-list { margin-bottom: 0; }
.ev-react .er-win, .ev-react .er-split, .ev-react .rt-cases { background: var(--bg-base); }
.ev-react .rt-cases { padding: 8px 0 2px; border: 1px solid var(--border-subtle); border-radius: 12px; overflow: hidden; }
.rt-cases { margin-top: 10px; }
.er-chart { position: relative; }
.er-wm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--text-primary); opacity: .07; white-space: nowrap; overflow: hidden; }
.er-lead { font-size: 13.5px; font-weight: 700; color: var(--text-primary); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-g { display: grid; grid-template-columns: minmax(0,40fr) minmax(0,20fr) minmax(0,40fr); font-variant-numeric: tabular-nums; }   /* = .er-ax */
.rt-g span { text-align: center; }
.rt-g span.d0 { background: var(--er-d0); }
.rt-key { padding: 0 10px 6px; font-size: 11px; color: var(--text-muted); border-bottom: 1px solid var(--border-subtle); }
.rt-case { padding: 9px 0 8px; border-bottom: 1px solid var(--border-subtle); }
.rt-case:last-child { border-bottom: 0; }
.rt-t { padding: 0 10px; }
.rt-nm { padding: 4px 10px 1px 24px; font-size: 12px; font-weight: 700; color: var(--text-primary); }
.rt-t { display: flex; align-items: baseline; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--text-primary); text-decoration: none; cursor: pointer; }
.rt-t small { font-weight: 500; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.rt-t i { margin-left: auto; font-style: normal; color: var(--text-muted); }
.rt-why { font-size: 12.5px; color: var(--text-secondary); margin: 2px 10px 3px 24px; }
.rt-g { font-size: 13px; padding: 2px 0; }
.rt-g span { font-weight: 600; }
.rt-g span.d0 { font-weight: 800; }
.rt-g.k { font-size: 11.5px; padding-top: 0; }
.rt-g.k span { font-weight: 500; color: var(--text-muted); }
.er-how { margin-top: 14px; font-size: 12.5px; color: var(--text-secondary); }
.er-how summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }
.er-how ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; line-height: 1.5; }
.kw-macro { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 4px 4px; padding: 10px 12px;
  border-radius: 12px; background: var(--bg-elevated); }
.kw-macro-l { font-size: 12px; font-weight: 800; color: var(--text-secondary); margin-right: 4px; }
.kw-macro-c { font-size: 12px; font-weight: 700; color: var(--text-primary); background: var(--bg-base); border: 1px solid var(--border-subtle);
  border-radius: 999px; padding: 3px 9px; }
.kw-macro-c b { margin-left: 4px; color: var(--text-muted); font-weight: 600; }
.kw-divider { height: 1px; background: var(--border-subtle); margin: 8px 16px; }
.kw-empty { padding: 40px 16px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* 급등 */
.kw-spike-list { padding: 0 16px 4px; }
.kw-spike-row {
  display: grid;
  grid-template-columns: 30% 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  margin-bottom: 4px;
  opacity: 0;
  transform: translateY(8px);
  animation: kw-row-in 0.4s ease forwards;
}
.kw-spike-row.kw-top {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.25);
}
@keyframes kw-row-in { to { opacity:1; transform:translateY(0); } }
.kw-spike-kw { font-size: 14px; font-weight: 700; color: var(--text-primary); word-break: keep-all; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kw-sparkline-wrap { display: flex; flex-direction: column; gap: 2px; }
.kw-sparkline { display: flex; align-items: flex-end; gap: 2px; height: 48px; }
.kw-spark-bar {
  width: 5px; border-radius: 2px 2px 0 0;
  background: var(--border-default);
  min-height: 2px;
  transform-origin: bottom; transform: scaleY(0);
  animation: kw-spark-in 0.5s cubic-bezier(0.22,1,0.36,1) forwards;
}
.kw-spark-bar.kw-hot { background: var(--today-color); box-shadow: 0 0 5px rgba(245,158,11,0.45); }
@keyframes kw-spark-in { to { transform: scaleY(1); } }
.kw-spark-times { display: flex; gap: 2px; }
.kw-spark-time {
  width: 5px; font-size: 8px; color: var(--text-tertiary);
  text-align: center; line-height: 1;
  overflow: visible; white-space: nowrap;
}
.kw-spike-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.kw-spike-row.kw-stale .kw-badge, .kw-spike-row.kw-stale .kw-spike-sub { opacity: 0.6; }
.kw-spike-sub { font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kw-badge {
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.kw-badge-surge0 { background: rgba(239,68,68,0.18);  color: #f87171; }
.kw-badge-surge1 { background: rgba(245,158,11,0.18); color: #fbbf24; }
.kw-badge-surge2 { background: rgba(34,197,94,0.18);  color: #4ade80; }
.kw-badge-surge3 { background: rgba(148,163,184,0.18);color: #94a3b8; }
.kw-badge-new    { background: rgba(139,92,246,0.18);  color: #a78bfa; }
.kw-spike-rank { font-size: 10px; font-weight: 700; color: var(--text-muted); }

/* 전체 랭킹 */
/* 랭킹 키워드 상세창 (openKwSheet) — 누를 수 있는 줄·칩 */
#news-rank [data-kw] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
#news-rank .kw-rank-row[data-kw]:active, #news-rank .kw-spike-row[data-kw]:active { background: var(--bg-elevated); }
.kd-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kd-hd h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.4px; color: var(--text-primary); }
.kd-kind { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg-elevated); color: var(--text-secondary); }
.kd-wait { margin: 16px 0; font-size: 13px; color: var(--text-muted); }
.kd-l { margin: 20px 0 8px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.kd-pulse { border: 1px solid var(--border-subtle); border-radius: 12px; padding: 12px 12px 10px; background: var(--bg-surface); }
.kd-state { font-size: 13px; color: var(--text-secondary); }
.kd-state b { color: var(--text-primary); }
.kd-peak { margin-top: 4px; font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.kd-peak em { font-style: normal; color: var(--accent); }
.kd-bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; align-items: end; height: 70px; margin-top: 12px; }
.kd-bars i { display: block; border-radius: 4px 4px 2px 2px; background: rgba(37,99,235,0.28); }
.kd-bars i.pk { background: var(--accent); }
.kd-bars i.td { background: repeating-linear-gradient(135deg, rgba(37,99,235,0.22) 0 4px, transparent 4px 8px); border: 1px dashed rgba(37,99,235,0.5); }
.kd-days { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 4px; font-size: 10.5px; color: var(--text-muted); text-align: center; }
.kd-days .pk { color: var(--accent); font-weight: 700; }
.kd-news { display: flex; flex-direction: column; gap: 8px; }
.kd-nw { display: block; text-decoration: none; color: inherit; border: 1px solid var(--border-subtle); border-radius: 12px; padding: 10px 12px; }
.kd-nw:active { background: var(--bg-elevated); }
.kd-nw em { display: flex; align-items: center; gap: 6px; font-style: normal; font-size: 11.5px; font-weight: 700; color: #047857; }
.kd-nw em s { text-decoration: none; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: rgba(4,120,87,0.12); }
.kd-nw em u { text-decoration: none; margin-left: auto; font-weight: 600; color: var(--text-muted); }
.kd-nw b { display: block; margin-top: 3px; font-size: 14px; line-height: 1.45; font-weight: 700; color: var(--text-primary); word-break: keep-all; }
.kd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kd-chip { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border-default); background: var(--bg-base); color: var(--text-primary); cursor: pointer; text-decoration: none; }
.kd-chip:active { background: var(--bg-elevated); }
.kd-chip.st { border-color: #BFDBFE; background: #EFF6FF; }
.kd-chip span { color: var(--text-muted); margin-left: 3px; }
.kd .kd-st { color: #EAB308; letter-spacing: -1px; margin-left: 4px; }
.kd-find { display: block; margin: 18px auto 0; border: none; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent); cursor: pointer; }
.kd-note { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border-subtle); font-size: 11px; color: var(--text-muted); line-height: 1.6; }
.kw-rank-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1.1fr) minmax(0, 1.6fr) 46px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  border-bottom: 1px solid var(--border-subtle);
  opacity: 0; transform: translateY(4px);
  animation: kw-row-in 0.3s ease forwards;
}
.kw-rank-row:last-child { border-bottom: none; }
.kw-rank-num { font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.kw-rank-num.r1 { color: var(--today-color); }
.kw-rank-num.r2 { color: #94A3B8; }
.kw-rank-num.r3 { color: #B45309; }
.kw-rank-kw { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-rank-track { height: 6px; background: var(--bg-elevated); border-radius: 99px; overflow: hidden; }
.kw-rank-fill { height: 100%; border-radius: 99px; background: #A8B3C4; width: 0; animation: kw-bar-grow 0.6s cubic-bezier(0.22,1,0.36,1) forwards; }
.kw-rank-fill.rf1 { background: var(--today-color); }
.kw-rank-fill.rf3 { background: #6366F1; }
@keyframes kw-bar-grow { to { width: var(--w); } }
.kw-rank-cnt { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-align: right; font-variant-numeric: tabular-nums; padding-right: 4px; }
.kw-rank-cnt.top { color: var(--text-primary); font-weight: 700; }
.kw-rank-delta { font-size: 9px; font-weight: 700; line-height: 1; }
.kw-rank-delta.up   { color: #ef4444; }
.kw-rank-delta.down { color: #3b82f6; }
.kw-rank-delta.new  { color: #a78bfa; font-size: 8px; }
@keyframes kw-rank-flash-up   { 0%{background:rgba(239,68,68,0.12)}  100%{background:transparent} }
@keyframes kw-rank-flash-down { 0%{background:rgba(59,130,246,0.12)} 100%{background:transparent} }
.kw-rank-row.rank-up   { animation: kw-row-in 0.3s ease forwards, kw-rank-flash-up   0.8s ease forwards; }
.kw-rank-row.rank-down { animation: kw-row-in 0.3s ease forwards, kw-rank-flash-down 0.8s ease forwards; }

/* ── 하단 탭바 ──────────────────────────── */
#tab-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--tabnav-h);
  background: var(--bg-base);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  z-index: 100;
}
/* 메뉴 탭 (10/25) — 본문은 다른 탭처럼 밝게, 아래 탭 줄만 짙은 남색(html.mn-on — 탭 줄의 색 이름표만 바꾼다)이고
   칸이 [닫기 · 일정 모음 · 섹터 · 용어 사전 · 설정]으로 바뀐다. 닫기 = 들어오기 전 탭 */
html.mn-on #tab-nav { --bg-base: #0F1E3D; --border-subtle: #0F1E3D; --text-primary: #FFFFFF; --text-muted: #9AA8C2; }
html:not(.mn-on) .tab-btn-menu, html.mn-on #tab-nav .tab-btn { display: none; }
.tab-btn-menu[aria-selected="true"] { color: var(--text-primary); border-top-color: #60A5FA; }
.tab-btn-menu[aria-selected="true"] svg { color: #60A5FA; }
.mn-sec[hidden] { display: none; }
.mn-wrap { max-width: 800px; margin: 0 auto; padding: 4px 16px 32px; }
.mn-h { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--text-secondary);
  letter-spacing: 0.5px; margin: 22px 2px 10px; }
.mn-h a { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); text-decoration: none; letter-spacing: 0; }
.mn-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 768px) { .mn-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mn-tiles a { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: 12px;
  background: var(--bg-surface); color: var(--text-primary); text-decoration: none; }
.mn-tiles a b { font-size: 15px; }
.mn-tiles a small { font-size: 12px; color: var(--text-secondary); }
.mn-nx { margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--border-subtle); font-size: 12.5px; font-style: normal; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.4em; }
.mn-nx i { font-style: normal; font-weight: 800; color: var(--accent); margin-right: 5px; }
.mn-rank { list-style: none; margin: 0; padding: 0; counter-reset: mr; }
.mn-rank a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle); color: var(--text-primary); text-decoration: none; }
.mn-rank li:last-child a { border-bottom: none; }
.mn-rank a::before { counter-increment: mr; content: counter(mr); font-weight: 900; color: var(--accent); text-align: center; }
.mn-rank b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-rank span { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; text-align: right; }
.mn-rank span i { font-style: normal; font-weight: 800; color: var(--text-primary); margin-right: 4px; }
.mn-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 768px) { .mn-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mn-chips a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 4px 10px; border: 1px solid var(--border-subtle); border-radius: 12px;
  background: var(--bg-surface); font-size: 14.5px; font-weight: 700; color: var(--text-primary); text-decoration: none; white-space: nowrap; }
.mn-chips a::before { content: ''; width: 18px; height: 4px; border-radius: 2px; background: var(--sc, var(--theme-etc)); }
.mn-chips a small { font-size: 11.5px; font-weight: 500; color: var(--text-secondary); min-height: 1.3em; }
.mn-group { border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface); overflow: hidden; }
.mn-row { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; margin: 0; padding: 12px 14px;
  border: none; border-bottom: 1px solid var(--border-subtle); background: none; font: inherit; text-align: left; color: var(--text-primary); text-decoration: none; cursor: pointer; }
.mn-group > :last-child { border-bottom: none; }
.mn-row::after { content: '›'; color: var(--text-muted); font-size: 18px; margin-left: auto; padding-left: 8px; }
.mn-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mn-row b { font-size: 15px; }
.mn-row small { font-size: 12.5px; color: var(--text-secondary); }
.mn-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--bg-elevated); color: var(--text-secondary); }
.mn-q { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 0 14px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-surface); color: var(--text-secondary); }
.mn-q input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: inherit; font-size: 16px; padding: 12px 0; color: var(--text-primary); }
.mn-glres { margin-top: 10px; }
.mn-gl { display: block; width: 100%; padding: 12px 14px; border: none; border-bottom: 1px solid var(--border-subtle); background: none; font: inherit; text-align: left; color: var(--text-primary); }
button.mn-gl { cursor: pointer; }
.mn-gl b { font-size: 15px; }
.mn-gl b small { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--text-muted); }
.mn-gl p { margin: 4px 0 0; font-size: 14px; line-height: 1.55; }
.mn-gl p + p { font-size: 13px; color: var(--text-secondary); }
.mn-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); }
.mn-set > span { display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 700; }
.mn-set small { font-size: 12.5px; font-weight: 400; color: var(--text-secondary); }
.mn-seg { flex: none; display: flex; background: var(--bg-elevated); border-radius: 10px; padding: 3px; }
.mn-seg button { border: none; background: transparent; font: inherit; font-size: 13.5px; color: var(--text-secondary); padding: 6px 14px; border-radius: 8px; cursor: pointer; min-height: 34px; }
.mn-seg button[aria-pressed="true"] { background: #2563EB; color: #FFFFFF; font-weight: 700; }
.mn-ios { margin: 8px 2px 0; font-size: 13px; line-height: 1.6; color: var(--text-secondary); background: var(--bg-surface); border-radius: 10px; padding: 10px 12px; }
.mn-hint { margin: 10px 2px 0; font-size: 12.5px; line-height: 1.6; color: var(--text-muted); }
/* 홈 화면 추가 띠 (10/25) — 휴대폰에서 첫 방문부터, 머리줄 바로 아래에 떠 있는 카드(본문을 밀지 않는다). 닫으면 30일 쉼 */
#a2hs { position: fixed; z-index: 310; left: 8px; right: 8px; top: calc(var(--header-h) + 8px); display: flex; align-items: center; gap: 10px;
  padding: 10px 8px 10px 12px; background: #FFFFFF; border: 1px solid var(--border-subtle); border-radius: 14px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.16); animation: a2hs-in 0.25s ease-out; }
#a2hs[hidden] { display: none; }
@keyframes a2hs-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
#a2hs img { flex: none; width: 40px; height: 40px; border-radius: 10px; }
.a2hs-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.a2hs-t b { font-size: 14.5px; color: #111827; }
.a2hs-t span { font-size: 12.5px; line-height: 1.45; color: #6B7280; }
#a2hs-go { flex: none; border: none; border-radius: 999px; background: #2563EB; color: #FFFFFF; font: inherit; font-size: 13.5px; font-weight: 700; padding: 8px 14px; cursor: pointer; }
#a2hs-x { flex: none; border: none; background: none; color: #9CA3AF; font-size: 20px; line-height: 1; padding: 6px; cursor: pointer; }
html.font-l body { zoom: 1.12; }   /* 설정 '글자 크기: 크게' — 화면 전체를 같은 배율로 (10/25) */
.tab-btn, .tab-btn-menu {
  flex: 1;
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  letter-spacing: 0.3px;
  transition: color 0.15s;
  border-top: 2px solid transparent;
}
.tab-btn.active {
  color: var(--text-primary);
  border-top-color: var(--text-primary);
}
.tab-btn[data-tab="tab-main"] svg { width: 22px; height: 22px; }
.tab-btn svg, .tab-btn-menu svg { width: 18px; height: 18px; }
.tab-new-dot {
  position: absolute;
  top: 6px;
  right: calc(50% - 14px);
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid var(--bg-primary, #fff);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}
.tab-new-dot.show {
  opacity: 1;
  transform: scale(1);
}

/* ── 심리지수 탭 ─────────────────────── */
#tab-sentiment { overflow-y: auto; display: none; background: var(--bg-base); }
#tab-sentiment.active { display: block; }
.sx-wrap { max-width: 600px; margin: 0 auto; padding: 16px 12px 40px; display: flex; flex-direction: column; gap: 18px; }
.sx-top { margin-bottom: -2px; }
#tab-sentiment[data-view="kr"] [data-v="gl"], #tab-sentiment[data-view="gl"] [data-v="kr"] { display: none; }
.sx-next { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 4px 0 12px; padding: 16px 18px;
  border: 1px solid rgba(17,24,39,0.08); border-radius: 14px; background: var(--bg-base); color: var(--text-primary);
  font: inherit; text-align: left; cursor: pointer; box-shadow: 0 1px 2px rgba(17,24,39,0.05), 0 4px 14px rgba(17,24,39,0.05); }
.sx-next span { display: flex; flex-direction: column; gap: 3px; }
.sx-next b { font-size: 15px; }
.sx-next small { font-size: 12px; color: var(--text-muted); }
.sx-next i { display: inline-block; font-style: normal; font-size: 22px; color: var(--text-muted); margin-left: 10px; }
/* 이어서 보기 — 처음 화면 가운데쯤 들어와 스크롤이 멈추면 한 번만: 옅은 파란 빛이 세 번 지나가고(약 3초) 화살표가 두 번 살짝 밀린다 (_nextGlint) */
.sx-next { position: relative; overflow: hidden; transition: border-color 0.4s; }
.sx-next::after { content: ''; position: absolute; top: 0; bottom: 0; left: -70%; width: 60%; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent, rgba(59,130,246,0.22), rgba(255,255,255,0.7), rgba(59,130,246,0.22), transparent);
  transform: skewX(-15deg); }
.sx-next.glint { border-color: rgba(37,99,235,0.45); }
.sx-next.glint::after { animation: sxGlint 1.6s ease-in-out 3; }   /* 한 번 1.6초 × 3 ≈ 5초 (10/18 — 1초는 너무 빨랐다) */
.sx-next.glint i { color: #2563eb; animation: sxNudge 0.5s ease-in-out 4.8s 2; }
/* 트리맵 T1 — 처음 보는 T1 칸에만 빛이 세 번 스치고 멈춘다 (_t1Glint, 10/19). 이어서 보기와 같은 빛(sxGlint) */
.cell-event.t1-glint::after { content: ''; position: absolute; top: 0; bottom: 0; left: -70%; width: 60%; pointer-events: none; z-index: 3;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.25), rgba(255,255,255,0.75), rgba(255,255,255,0.25), transparent);
  transform: skewX(-15deg); animation: sxGlint 1.6s ease-in-out 3; }
@media (prefers-reduced-motion: reduce) { .cell-event.t1-glint::after { animation: none; display: none; } }
@keyframes sxGlint { 0% { left: -70%; opacity: 1; } 80% { left: 120%; opacity: 1; } 100% { left: 120%; opacity: 0; } }   /* 끝 20%는 쉼 */
@keyframes sxNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .sx-next.glint::after, .sx-next.glint i { animation: none; } }
.sx-h h3 small { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-left: 4px; white-space: nowrap; }   /* '2026.12물'이 쪼개지지 않게 (공유 버튼이 붙은 뒤 좁아짐) */
.sx-live { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--bg-elevated); color: var(--text-secondary); }
.sx-live.on { background: rgba(220,38,38,0.12); color: #dc2626; }
.sx-live.on::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #dc2626; animation: sxPulse 1.4s ease-in-out infinite; }
@keyframes sxPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.sx-fut-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 6px; }   /* 가격 + 봉 선택 한 줄 (10/24) */
.sx-fut-px { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.sx-fut-px b { font-size: 30px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.sx-fut-px span { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sx-fut-ses { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.sx-fut-ses button { text-align: left; border: 1px solid var(--border-subtle); background: var(--bg-surface); border-radius: 12px; padding: 9px 12px; cursor: pointer; }
.sx-fut-ses button.on { border-color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--text-primary); }
.sx-fut-ses span { display: block; font-size: 11px; color: var(--text-muted); font-weight: 600; }
.sx-fut-ses b { font-size: 16px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sx-fut-ses em { font-style: normal; font-size: 12px; font-weight: 800; margin-left: 5px; }
.sx-top h2 { margin: 2px 4px 4px; font-size: 20px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; }
.sx-top p { margin: 0 4px; font-size: 13px; color: var(--text-secondary); }
/* 회색 판 위 흰 카드 (10/18) — 페이지·카드·카드 안 칸이 같은 밝기라 경계가 흐렸다. 카드 안 회색 칸(bg-elevated)은 그대로 */
#tab-sentiment { background: #EEF1F4; }
.sx-card { background: var(--bg-base); border: 1px solid rgba(17,24,39,0.06); border-radius: 16px; padding: 16px 16px 14px;
  box-shadow: 0 1px 2px rgba(17,24,39,0.05), 0 4px 14px rgba(17,24,39,0.05); }
.sx-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.sx-h h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.2px; }
.sx-h p { margin: 3px 0 0; font-size: 12px; color: var(--text-muted); }
.sx-when { flex-shrink: 0; font-size: 11px; color: var(--text-muted); background: var(--bg-elevated); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.sx-when.bad { background: rgba(220,38,38,0.12); color: #dc2626; font-weight: 700; }
.sx-seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-elevated); border-radius: 10px; }
.sx-seg button { border: none; background: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-secondary); padding: 6px 14px; border-radius: 8px; }
.sx-seg button.on { background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.sx-seg-sm button { font-size: 11px; padding: 4px 9px; }
.sx-sub-h { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 6px; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.sx-chart { display: block; width: 100%; height: auto; overflow: visible; }
#sx-fut-chart { height: 190px; }   /* 선물 — Lightweight Charts 캔버스라 높이를 정해 준다 (10/24) */
.sx-cap { margin: 6px 0 0; font-size: 12px; color: var(--text-secondary); text-align: right; }
.sx-chip-big { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sx-chip-t { background: var(--bg-elevated); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.sx-chip-t .n { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.sx-chip-t b { font-size: 32px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.sx-chip-t b.wait { font-size: 18px; color: var(--text-muted); padding: 8px 0 2px; }
.sx-chip-t small { font-size: 11.5px; color: var(--text-muted); }
.sx-chip-t .lb { font-style: normal; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--bg-base); color: var(--text-secondary); }
.sx-chip-t.hot .lb { color: #dc2626; background: rgba(220,38,38,0.1); } .sx-chip-t.cold .lb { color: #2563eb; background: rgba(37,99,235,0.1); }
.sx-chip-more { display: block; width: 100%; margin-top: 10px; padding: 8px 0; border: 1px solid var(--border-default); border-radius: 10px;
  background: var(--bg-base); font: inherit; font-size: 13px; font-weight: 700; color: var(--text-secondary); cursor: pointer; }
.sx-chip-wait { margin: 4px 0 8px; font-size: 12px; color: var(--text-muted); }
.sx-chip-list { margin-top: 6px; }
.sx-chip-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 58px 48px 30px; gap: 6px; align-items: center; padding: 6px 0;
  border-top: 1px solid var(--border-subtle); font-size: 12.5px; }
.sx-chip-row.hd { border-top: none; font-size: 11px; color: var(--text-muted); }
.sx-chip-row .nm { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sx-chip-row.hd .nm { font-weight: 400; color: var(--text-muted); }
.sx-chip-row .px, .sx-chip-row .ch, .sx-chip-row .sc { text-align: right; font-variant-numeric: tabular-nums; }
.sx-chip-row .sc { font-weight: 800; } .sx-chip-row .sc.hot { color: #dc2626; } .sx-chip-row .sc.cold { color: #2563eb; }
.sx-chip-sp { width: 72px; height: 24px; display: block; }
.sx-chip-na { color: var(--text-muted); }
.sx-note { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--border-subtle); font-size: 11px; color: var(--text-muted); line-height: 1.55; }
.sx-up { color: #dc2626; } .sx-dn { color: #2563eb; }
/* ① 수급 */
.sx-idx { margin: 12px 0 6px; font-size: 13px; color: var(--text-secondary); }
.sx-idx { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 2px; }
.sx-vk-gauge { width: 220px; }
.sx-vk-gauge .sx-gauge-num { margin-top: -54px; }
.sx-vk-gauge .sx-gauge-num b { font-size: 30px; }
.sx-vk-gauge .sx-gauge-num span { margin-top: 2px; font-size: 14px; font-weight: 800; }
.sx-vkc-sub { display: block; margin-top: 8px; text-align: center; font-size: 12px; color: var(--text-muted); }
.sx-vkc-hero { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.sx-vkc-hero b { font-size: 38px; font-weight: 800; letter-spacing: -1px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sx-vkc-hero span { font-size: 16px; font-weight: 800; }
.sx-vkc-hero small { width: 100%; font-size: 12px; color: var(--text-muted); }
.sx-vk { margin-left: auto; font-size: 12px; color: var(--text-muted); background: var(--bg-elevated); border-radius: 999px; padding: 3px 10px; }
.sx-vk b { font-size: 13px !important; margin: 0 2px !important; }
.sx-vk em { font-style: normal; font-weight: 800; }
.sx-idx b { font-size: 18px; color: var(--text-primary); margin-right: 6px; font-variant-numeric: tabular-nums; }
.sx-flow-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.sx-fr { display: grid; grid-template-columns: 46px 1fr 84px; align-items: center; gap: 10px; }
.sx-fr > span:first-child { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.sx-fr-bar { position: relative; height: 14px; }
.sx-fr-bar::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-default); }
.sx-fr-bar i { position: absolute; top: 0; height: 100%; border-radius: 4px; transition: width 0.7s cubic-bezier(0.22,1,0.36,1); width: 0; }
.sx-fr-v { text-align: right; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sx-breadth { margin: 4px 0 2px; }
.sx-bd-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg-elevated); }
.sx-bd-bar i { display: block; height: 100%; transition: width 0.7s cubic-bezier(0.22,1,0.36,1); width: 0; }
.sx-bd-lbl { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sx-bd-lbl small { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-left: 4px; }
/* 섹터 온도 */
.sx-sr { display: grid; grid-template-columns: 64px 1fr 58px; align-items: center; gap: 10px; padding: 9px 4px; margin: 0 -4px;
  border-bottom: 1px solid var(--border-subtle); text-decoration: none; color: inherit; border-radius: 8px; }
.sx-sr:last-child { border-bottom: none; }
.sx-sr:active { background: var(--bg-elevated); }
.sx-sr-n { font-size: 13px; font-weight: 800; color: var(--text-primary); }
.sx-sr-n small { display: block; font-size: 10px; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.sx-sr-mid { min-width: 0; }
.sx-sr-bar { position: relative; height: 8px; }
.sx-sr-bar::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-default); }
.sx-sr-bar i { position: absolute; top: 0; height: 100%; border-radius: 4px; transition: width 0.7s cubic-bezier(0.22,1,0.36,1); width: 0; }
.sx-sr-mv { margin-top: 5px; font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-sr-v { text-align: right; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* ② 공포·탐욕 */
.sx-gauge { position: relative; width: 240px; max-width: 100%; margin: 4px auto 0; }
.sx-gauge svg { display: block; width: 100%; height: auto; }
.sx-gauge-num { text-align: center; margin-top: -2px; }
.sx-gauge-num b { display: block; font-size: 42px; font-weight: 800; line-height: 1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sx-gauge-num span { display: block; margin-top: 4px; font-size: 14px; font-weight: 800; }
.sx-prevs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.sx-prev { background: var(--bg-elevated); border-radius: 10px; padding: 8px 4px; text-align: center; }
.sx-prev b { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sx-prev span { display: block; margin-top: 2px; font-size: 11px; color: var(--text-muted); }
/* ③ 금리 */
.sx-big2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.sx-big2 div { background: var(--bg-elevated); border-radius: 12px; padding: 10px 12px; }
.sx-big2 span { display: block; font-size: 12px; color: var(--text-muted); }
.sx-big2 b { font-size: 22px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sx-big2 em { font-style: normal; font-size: 12px; font-weight: 700; margin-left: 6px; }
.sx-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 4px; font-size: 11px; color: var(--text-secondary); }
.sx-legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 5px; }
.sx-spreads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.sx-sp { border: 1px solid var(--border-subtle); border-radius: 12px; padding: 9px 12px; }
.sx-sp span { display: block; font-size: 12px; color: var(--text-muted); }
.sx-sp b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sx-sp em { font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
.sx-sp em.ok { background: rgba(22,163,74,0.13); color: #15803d; }
.sx-sp em.inv { background: rgba(220,38,38,0.13); color: #dc2626; }
/* ④ 5년 위치 */
.sx-pr { padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.sx-pr:last-child { border-bottom: none; }
.sx-pr-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.sx-pr-top span { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.sx-pr-top small { font-size: 12px; color: var(--text-muted); margin-left: 6px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sx-pr-top b { font-size: 13px; font-weight: 800; }
.sx-pr-track { position: relative; height: 8px; border-radius: 999px; background: linear-gradient(90deg, rgba(37,99,235,0.22), var(--bg-elevated) 50%, rgba(220,38,38,0.22)); }
.sx-pr-track i { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--bg-surface); border: 3px solid; box-sizing: border-box; transition: left 0.7s cubic-bezier(0.22,1,0.36,1); left: 50%; }
.sx-pr-ends { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* 빚투 카드 (sx-cr) — 결론 + 코스피·코스닥 + 세 칸(같은 말) + 코스피 추이. 색: 주의 쪽 = 빨강 (tone은 sentiment.credit_board) */
.sx-cr-gauge { margin-top: 0; }
.sx-cr-gauge { width: 250px; }
.sx-cr-gauge .sx-gauge-num { margin-top: -52px; }
.sx-cr-gauge .sx-gauge-num b { font-size: 30px; letter-spacing: -0.5px; }
.sx-cr-gauge .sx-gauge-num span { margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.sx-cr-verdict { margin: 12px 0 0; padding: 11px 14px; border-radius: 12px; background: var(--bg-elevated); border-left: 4px solid var(--text-muted); }
.sx-cr-verdict b { display: block; font-size: 13.5px; font-weight: 800; line-height: 1.45; color: var(--text-primary); }
.sx-cr-verdict p { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.sx-cr-mk { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.sx-cr-m { border: 1px solid var(--border-subtle); border-radius: 12px; padding: 11px 12px 10px; min-width: 0; }
.sx-cr-m > span { display: block; font-size: 12px; color: var(--text-muted); }
.sx-cr-m > b { display: block; margin-top: 2px; font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.5px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sx-cr-m > p { margin: 3px 0 0; font-size: 11px; line-height: 1.45; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sx-cr-m > p b { color: var(--text-secondary); font-weight: 800; }
.sx-cr-m > p.sx-cr-usual { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border-subtle); }
.sx-cr-m > em small { display: block; margin-top: 1px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.sx-cr-m > em { display: block; margin: 6px 0 10px; font-style: normal; font-size: 12.5px; font-weight: 800; }
.sx-cr-m > small span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-cr-m > small { display: block; margin-top: 8px; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sx-cr-m .sx-pr-ends { flex-wrap: wrap; gap: 0 6px; }
.sx-cr-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sx-cr-tile { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border-subtle); background: var(--bg-base); border-radius: 12px; padding: 10px 10px 9px; }
.sx-cr-tile span { font-size: 12px; color: var(--text-muted); }
.sx-cr-tile b { margin-top: 2px; font-size: 17px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sx-cr-tile small { margin: 1px 0 8px; font-size: 10.5px; line-height: 1.4; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sx-cr-tile em { margin-top: 7px; font-style: normal; font-size: 12px; font-weight: 800; line-height: 1.35; word-break: keep-all; }
.sx-cr-sm { height: 6px; margin-top: auto; }
.sx-cr-sm i { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-width: 2.5px; }
.sx-pr-track.sx-rev { background: linear-gradient(90deg, rgba(220,38,38,0.22), var(--bg-elevated) 50%, rgba(37,99,235,0.22)); }
.sx-cr-note p { margin: 0 0 5px; line-height: 1.6; }
.sx-cr-note p:last-child { margin: 0; }
.sx-cr-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 11px; color: var(--text-muted); }
.sx-cr-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 5px; }
.sx-cr-legend i.band { height: 8px; border: none; background: rgba(107,114,128,0.12); border-radius: 2px; }
/* ⑤ COT */
.sx-cg { margin-top: 4px; }
.sx-cg + .sx-cg { margin-top: 10px; }
.sx-cg > p { margin: 0 0 2px; font-size: 11px; font-weight: 800; color: var(--text-muted); letter-spacing: 0.5px; }
.sx-cr { display: grid; grid-template-columns: 72px 1fr 40px 62px; align-items: center; gap: 8px; padding: 7px 0; }
.sx-cr > span:first-child { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.sx-cr-bar { position: relative; height: 8px; border-radius: 999px; background: var(--bg-elevated); }
.sx-cr-bar::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-default); }
.sx-cr-bar i { position: absolute; top: 0; left: 0; height: 100%; border-radius: 999px; }
.sx-cr-bar::after { z-index: 1; background: var(--text-muted); }
.sx-cr > span:first-child .sx-tag { display: block; width: fit-content; margin: 3px 0 0; }
.sx-cr-v { text-align: right; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sx-cr-x { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.sx-cr-x small { font-size: 10px; font-weight: 700; }
.sx-cr-x svg { width: 60px; height: 16px; display: block; }
.sx-tag { display: inline-block; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; background: var(--bg-elevated); color: var(--text-secondary); }
@media (min-width: 768px) { .sx-wrap { padding-top: 22px; } .sx-gauge { width: 260px; } }

/* ── 호버 툴팁 (데스크탑) + 롱프레스 미리보기 (모바일) ── */
#hover-tip {
  position: fixed;
  z-index: 500;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 9px 13px;
  max-width: 240px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.13);
  pointer-events: none;
  display: none;
  transition: opacity 0.1s;
}
#hover-tip.visible { display: block; }
#hover-tip.mobile-tip {
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%);
  max-width: 280px;
  width: calc(100vw - 48px);
  pointer-events: none;
}
.tip-bar { width: 100%; height: 3px; border-radius: 2px; margin-bottom: 7px; }
.tip-cat { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 5px; opacity: 0.9; }
.tip-title { font-weight: 700; font-size: 16px; color: var(--text-primary); line-height: 1.35; margin-bottom: 4px; }
.tip-meta { font-size: 14px; color: var(--text-secondary); }
.tip-sub { margin: -1px 0 6px; font-size: 13.5px; line-height: 1.45; color: var(--text-secondary); }
.tip-star { color: #EAB308; letter-spacing: -1px; }
.tip-catalyst { font-size: 14px; color: var(--text-secondary); margin-top: 4px; border-top: 1px solid var(--border-subtle); padding-top: 4px; }

/* ── 바텀시트 ───────────────────────────── */
#sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity 0.2s;
}
#sheet-overlay.open { display: block; opacity: 1; }

#bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%; right: auto;
  transform: translateX(-50%) translateY(100%);
  width: min(560px, 100%);
  height: 50vh;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), height 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
#bottom-sheet.open { transform: translateX(-50%) translateY(0); }
#bottom-sheet.full { height: 92vh; height: 92dvh; }   /* 본문을 위로 스크롤하거나 위로 쓸면 커진다 */
.sheet-back { display: flex; align-items: center; gap: 6px; width: 100%; margin: 0 0 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-default); background: var(--bg-elevated, transparent); color: var(--text-secondary); font-size: 12.5px; text-align: left; }
.sheet-back b { flex-shrink: 0; font-size: 15px; line-height: 1; color: var(--text-primary); }
.sheet-back span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border-default);
  border-radius: 2px;
  margin: 10px auto 8px;
  flex-shrink: 0;
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.sheet-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.sheet-meta-tag {
  font-size: 13px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.sheet-dday {
  font-size: 14px;
  font-weight: 700;
  margin-left: auto;
}
.sheet-title {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}
.sheet-sub { margin: 2px 0 8px; font-size: 14.5px; font-weight: 500; line-height: 1.5; color: var(--text-secondary); word-break: keep-all; }
.sheet-code {
  font-size: 16px;
  font-family: monospace;
  color: var(--text-muted);
  margin-bottom: 16px;
  cursor: pointer;
}
.sheet-code:active { color: var(--text-primary); }

.section-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 16px;
}
.why-box { font-size: 15px; line-height: 1.7; color: var(--text-primary); }
/* 복기 탭 (10/19) — 숫자는 또렷하게(상승 빨강·하락 파랑), 결과·평가 글은 연하게 */
#tab-review { overflow-x: hidden; background: var(--bg-surface); }
.tab-lbl { position: relative; }
.tab-beta { position: absolute; left: 100%; top: -5px; margin-left: 1px; font-size: 7.5px; font-weight: 800; letter-spacing: 0.2px; color: #7c3aed; }   /* 복기 탭 베타 표시 */
.rv-wrap { max-width: 760px; margin: 0 auto; padding: 12px 14px 32px; }
.rv-head p { margin: 8px 2px 4px; font-size: 12.5px; color: var(--text-muted); }
.rv-seg { display: flex; gap: 6px; }
.rv-seg button { flex: 1; padding: 9px 0; border: 1px solid var(--border-default); background: var(--bg-base); border-radius: 10px;
  font-size: 14px; font-weight: 700; color: var(--text-secondary); cursor: pointer; }
.rv-seg button.on { background: var(--text-primary); color: var(--bg-base); border-color: var(--text-primary); }
.rv-week { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 12px 0 4px; }
.rv-week b { font-size: 15px; font-weight: 800; color: var(--text-primary); }
.rv-wk { width: 34px; height: 34px; border: 1px solid var(--border-default); border-radius: 50%; background: var(--bg-surface); font-size: 18px; cursor: pointer; color: var(--text-primary); }
.rv-wk:disabled { opacity: 0.3; cursor: default; }
/* 최근 복기 요약 — 기간 한 줄 + 숫자 세 칸(배지 '크게'·'반대로'와 같은 색) + 안내 한 줄 (10/22) */
.rv-sum { margin: 8px 0 10px; padding: 12px 12px 10px; background: var(--bg-base); border: 1px solid rgba(17,24,39,0.06); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(17,24,39,0.04); }
.rv-sum-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.rv-sum-h b { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.rv-sum-h span { font-size: 11.5px; color: var(--text-muted); }
.rv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rv-stat { padding: 8px 4px 7px; border-radius: 10px; background: var(--bg-surface); text-align: center; }
.rv-stat b { display: block; font-size: 20px; font-weight: 800; line-height: 1.15; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.rv-stat span { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); }
.rv-stat small { display: block; font-size: 10.5px; color: var(--text-muted); }
.rv-stat.bg b, .rv-stat.bg span { color: #7c3aed; }
.rv-stat.mx b, .rv-stat.mx span { color: #b45309; }
.rv-stat.zero b { color: var(--text-muted); }
.rv-sum .rv-hint { margin: 10px 2px 0; }
.rv-h { margin: 20px 2px 8px; font-size: 15px; font-weight: 800; color: var(--text-primary); }
.rv-h small { margin-left: 6px; font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
/* 카드 모양은 심리 탭 .sx-card와 같게 — 흰 바탕·옅은 테두리·은은한 그림자 */
.rv-card { background: var(--bg-base); border: 1px solid rgba(17,24,39,0.06); border-radius: 16px; padding: 14px 16px 12px; margin-bottom: 12px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(17,24,39,0.05), 0 4px 14px rgba(17,24,39,0.05); }
.rv-card:hover { border-color: rgba(17,24,39,0.16); }
.rv-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.rv-tag { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.rv-tag.mx { color: #b45309; background: rgba(245,158,11,0.14); }
.rv-tag.bg { color: #fff; background: #7c3aed; }
.rv-title { margin: 4px 0 6px; font-size: 16.5px; font-weight: 800; line-height: 1.35; color: var(--text-primary); word-break: keep-all; }
.rv-top { display: flex; align-items: flex-start; gap: 12px; }
.rv-hd { flex: 1; min-width: 0; }
.rv-big { flex-shrink: 0; text-align: right; }
.rv-big b { display: block; font-size: 22px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.rv-big b.up { color: #dc2626; } .rv-big b.dn { color: #2563eb; }
.rv-big span { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.rv-story { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-default); display: flex; flex-direction: column; gap: 0; }
.rv-l { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 6px 0 14px; }
.rv-l:last-child { padding-bottom: 4px; }
/* 다음 단계로 내려가는 세로선 + 아래 화살표 (마지막 단계에는 없음) */
.rv-l:not(:last-child)::after { content: ''; position: absolute; left: 14px; top: 38px; bottom: 2px; border-left: 2px solid var(--border-default); }
.rv-l:not(:last-child)::before { content: ''; position: absolute; left: 10px; bottom: -4px; border: 5px solid transparent;
  border-top: 7px solid var(--border-default); border-bottom: 0; }
.rv-l .ic { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle); }
.rv-l.px .ic { background: rgba(17,24,39,0.06); }
.rv-l.why .ic { background: rgba(124,58,237,0.10); border-color: rgba(124,58,237,0.18); }
.rv-l em { display: block; font-style: normal; font-size: 12px; font-weight: 800; color: var(--text-secondary); margin: 1px 0 2px; }
.rv-l.px em { color: var(--text-primary); }
.rv-l.why em { color: #7c3aed; }
.rv-l p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); word-break: keep-all; }   /* 줄 수를 묶지 않는다 — 정리·평가가 한 줄·한 문장이라 짧다 */
.rv-l.px p { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.rv-l.px i { font-style: normal; color: var(--text-muted); margin: 0 2px; }
.rv-l.why p { color: var(--text-primary); }
.rv-l small { margin-left: 4px; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.rv-l b.up, .rv-row b.up { color: #dc2626; } .rv-l b.dn, .rv-row b.dn { color: #2563eb; }
.rv-l .na, .rv-row .na { color: var(--text-muted); font-weight: 600; }
.rv-meta small { color: var(--text-muted); }
.rv-l p.full { display: block; -webkit-line-clamp: unset; }
.rv-story.af { margin-top: 2px; padding-top: 0; border-top: none; }
.rv-card + .rv-card { margin-top: 14px; }
.rv-src { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; font-size: 12px; }
.rv-src a { color: var(--text-muted); text-decoration: none; border-bottom: 1px solid var(--border-default); }
.rv-go { margin-left: auto; font-weight: 700; color: var(--text-secondary); }
.rv-more { margin-left: auto; font-weight: 700; color: var(--text-primary); cursor: pointer; }
.rv-more + .rv-go { margin-left: 10px; }
.rv-card.open { border-color: rgba(17,24,39,0.18); }
.rv-chart { margin-top: 10px; padding: 10px 8px 6px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-base); }
.rv-chart-hd { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 4px; font-variant-numeric: tabular-nums; }
.rv-chart-hd b { font-size: 13.5px; color: var(--text-primary); }
.rv-chart-hd span { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.rv-chart-hd small { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.rv-chart-ft { display: flex; align-items: center; gap: 3px; margin: 4px 4px 0; font-size: 11.5px; color: var(--text-muted); }
.rv-chart-ft i { width: 8px; height: 8px; border-radius: 2px; background: #dc2626; } .rv-chart-ft i.dn { background: #2563eb; margin-right: 4px; }
.rv-lwc { height: 280px; }                              /* 10/19 — 200은 납작했다 */
@media (min-width: 768px) { .rv-lwc { height: 340px; } }
.rv-chart-na { padding: 20px 0; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.rv-list { border: 1px solid rgba(17,24,39,0.06); border-radius: 16px; overflow: hidden; background: var(--bg-base);
  box-shadow: 0 1px 2px rgba(17,24,39,0.05), 0 4px 14px rgba(17,24,39,0.05); }
.rv-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 58px 52px; gap: 8px; align-items: center; padding: 11px 12px;
  font-size: 13.5px; cursor: pointer; font-variant-numeric: tabular-nums; }
.rv-row.rk { grid-template-columns: 20px 46px minmax(0, 1fr) 66px 52px; }
.rv-item { border-top: 1px solid var(--border-subtle); }
.rv-item.open { position: relative; z-index: 1; margin: 6px 0; border: 1.5px solid rgba(124,58,237,0.35); border-radius: 12px;
  background: rgba(124,58,237,0.03); box-shadow: 0 2px 10px rgba(124,58,237,0.08); }   /* 펼친 일정 = 한 카드 (10/20 — 어디까지가 이 일정인지) */
.rv-item.open + .rv-item { border-top-color: transparent; }
.rv-list .rv-item.open { border-style: solid; }       /* 같은 날 점선 규칙보다 앞서게 */
.rv-item.open .rv-row { position: relative; }
.rv-item.open .rv-row::after { content: '▲'; position: absolute; top: 6px; right: 8px; font-size: 11px; color: #7c3aed; }   /* 제목 줄을 누르면 닫힘 */
.rv-fold { margin-left: 10px; padding: 3px 10px; border: 1px solid rgba(124,58,237,0.35); border-radius: 12px; background: var(--bg-base);
  font: inherit; font-size: 12px; font-weight: 700; color: #7c3aed; cursor: pointer; }
.rv-dg { display: grid; grid-template-columns: 58px minmax(0, 1fr); border-top: 1px solid var(--border-default); }   /* 같은 날 묶음 — 날짜 칸 하나 (10/24) */
.rv-dc { padding: 12px 0 12px 12px; border-right: 1px solid var(--border-subtle); font-variant-numeric: tabular-nums; }
.rv-dc b { display: block; position: sticky; top: 8px; font-size: 14px; font-weight: 800; color: var(--text-primary); line-height: 1.15; }
.rv-dc small { display: block; font-size: 10.5px; color: var(--text-muted); } .rv-dc .td { font-style: normal; font-weight: 800; color: #7c3aed; }
.rv-db { min-width: 0; } .rv-db > .rv-item:first-child { border-top: none; }
.rv-row.nod { grid-template-columns: minmax(0, 1fr) 58px 52px; padding-left: 8px; }
.rv-row.nod .nod-ac { grid-column: 1 / -1; margin-bottom: -6px; font-size: 10px; color: var(--text-muted); }
.rv-db .rv-item.open { margin: 6px 6px 6px 4px; }
.rv-lh { cursor: default; padding: 8px 12px; background: var(--bg-elevated); font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.rv-row .d b { display: block; font-size: 14px; font-weight: 800; color: var(--text-primary); line-height: 1.15; }
.rv-row .d small { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.rv-row .t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rv-row .t .tt { color: var(--text-primary); font-weight: 600; line-height: 1.35; word-break: keep-all; }   /* 제목은 자르지 않고 줄바꿈 */
.rv-tag.go { color: var(--text-secondary); background: var(--bg-base); border: 1px solid var(--border-default); }   /* 정리 전 줄 — 이 배지만 누르면 일정 상세 (줄은 눌리지 않음, 10/20) */
.rv-item.wait .rv-row { cursor: default; }
.rv-item.wait .rv-tag.go { cursor: pointer; }
.rv-l.plan { cursor: pointer; }                            /* 펼친 칸 '원래 일정'을 누르면 일정 상세 */
.rv-plan-go { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.rv-row .t .tm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rv-row .t .rv-tag { font-size: 10px; padding: 0 5px; }
.rv-row .v { text-align: right; }
.rv-row .v small { display: block; font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.rv-row .rk-n { font-size: 14px; font-weight: 900; color: #7c3aed; text-align: center; }
.rv-row b.up { color: #dc2626; } .rv-row b.dn { color: #2563eb; }
.rv-row .na { color: var(--text-muted); }
.rv-open { padding: 2px 14px 14px; }
.rv-card2 { display: grid; gap: 9px; padding-top: 10px; border-top: 1px dashed var(--border-default); word-break: keep-all; overflow-wrap: anywhere; }
.rv-cc { padding: 10px 12px; border-radius: 10px; background: var(--bg-elevated); }
.rv-cc > b { display: block; font-size: 14.5px; font-weight: 800; color: var(--text-primary); margin-bottom: 2px; }
.rv-cc span { font-size: 12.5px; line-height: 1.6; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.rv-cc .nw { white-space: nowrap; } .rv-cc i { font-style: normal; color: var(--text-muted); }
.rv-cc > b { font-size: 14px; font-weight: 700; line-height: 1.5; margin-bottom: 3px; }
.rv-cc > b .mk-em { display: inline; }   /* 강조 구절은 글줄 안에서만 (10/24 — 줄 전체로 번졌다) */
.rv-side { display: inline-block; margin-bottom: 5px; padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 11.5px; font-weight: 700;
  background: var(--bg-base); color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.rv-side.up { color: #b91c1c; border-color: #fecaca; background: #fef2f2; } .rv-side.down { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.rv-cc.wait > b { color: var(--text-muted); }
.rv-ln { display: grid; grid-template-columns: 44px 1fr; gap: 8px; margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-primary); }
.rv-ln em { font-style: normal; font-size: 13px; font-weight: 800; color: #7c3aed; padding-top: 0; }   /* 왜 = 보라 이름표 (옛 왜? 칸과 같은 색) */
.rv-px .rv-fc i { white-space: nowrap; }
.rv-ln.why { display: block; padding: 11px 13px; border-radius: 10px; background: #f5f3ff; border: 1px solid #ddd6fe; }   /* 왜 = 결론 칸 다음 무게의 칸 (10/24 사용자) */
.rv-ln.why em { display: block; margin-bottom: 3px; font-size: 13px; }
.rv-ln.why span { font-size: 14px; line-height: 1.65; color: var(--text-primary); }
.rv-org { margin-top: 10px; border-top: 1px solid var(--border-subtle); padding-top: 8px; font-size: 13px; line-height: 1.6; color: var(--text-secondary); word-break: keep-all; }
.rv-org summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); list-style: none; }
.rv-org summary::after { content: ' ▾'; } .rv-org[open] summary::after { content: ' ▴'; }
.rv-org p { margin: 6px 0 0; } .rv-org p b { margin-right: 6px; color: var(--text-primary); }
.rv-org p.up b { color: #b91c1c; } .rv-org p.dn b { color: #1d4ed8; }
.rv-open .rv-story { margin-top: 0; padding-top: 8px; border-top: 1px dashed var(--border-default); }
.rv-l p { margin: 0; }
.rv-l p + p { margin-top: 3px; }
.rv-l p.sub { color: var(--text-secondary); font-size: 13px; }
.rv-l p.sc { font-size: 13px; }
.rv-l p.sc.up { color: #b91c1c; } .rv-l p.sc.dn { color: #1d4ed8; }
.rv-l p.na { color: var(--text-muted); }
.rv-l.plan .ic { background: rgba(17,24,39,0.04); }
.rv-l.plan em { color: var(--text-primary); }
.rv-item.wait .tt { color: var(--text-secondary); }
.rv-tag.wt { color: var(--text-muted); background: var(--bg-elevated); border: 1px solid var(--border-subtle); }
.rv-row .v.nx { grid-column: span 2; text-align: right; font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }   /* 종목 없는 일정 — 두 칸 대신 한 줄 (10/20) */
.rv-row .na.wait, .rv-fc .na.wait { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.rv-l em .rel { margin-left: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.rv-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 4px; margin-top: 2px; }   /* 세 칸이 늘 한 줄 */
.rv-fc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px 4px; border-radius: 8px;
  background: var(--bg-elevated); font-variant-numeric: tabular-nums; text-align: center; min-width: 0; }
.rv-fc small { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.rv-fc b { font-size: 14.5px; font-weight: 800; }
.rv-fc b.up { color: #dc2626; } .rv-fc b.dn { color: #2563eb; }
.rv-fc i { font-style: normal; font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.rv-flow .ar { align-self: center; font-weight: 400; font-size: 16px; color: var(--text-muted); }
.rv-item:not(.nd) { border-top-style: dashed; }          /* 같은 날은 점선, 날이 바뀌면 실선 */
.rv-item.nd { border-top: 1px solid var(--border-default); }
.rv-row .d .td { font-style: normal; font-weight: 800; color: #7c3aed; }
.rv-row .d .ac { display: block; font-size: 10px; color: var(--text-muted); }
.rv-older { display: block; width: 100%; margin: 12px 0 0; padding: 11px 0; border: 1px solid var(--border-default); border-radius: 12px;
  background: var(--bg-base); font-size: 13.5px; font-weight: 700; color: var(--text-secondary); cursor: pointer; }
.rv-older:disabled { opacity: 0.6; cursor: default; }
.rv-hint { margin: 2px 2px 8px; font-size: 11.5px; color: var(--text-muted); text-align: center; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.rv-chips button { padding: 6px 12px; border: 1px solid var(--border-default); border-radius: 999px; background: var(--bg-surface);
  font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.rv-chips button.on { background: var(--text-primary); color: var(--bg-base); border-color: var(--text-primary); }
.rv-foot { margin: 22px 2px 0; font-size: 11.5px; line-height: 1.6; color: var(--text-muted); }
@media (max-width: 480px) { .tab-btn, .tab-btn-menu { font-size: 12px; letter-spacing: 0; } }
/* 지난 일정 '그 후' (_afterHtml) — 위 참고용 AI 정리는 연한 상자, 아래 주가 반응은 표 (같은 무게로 읽히지 않게) */
.af-ai { background: var(--bg-surface); border: 1px dashed var(--border-default); border-radius: 10px; padding: 12px 14px; }
.af-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.af-h b { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.af-h small { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.af-ai p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text-secondary); word-break: keep-all; }
.af-src { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; font-size: 12px; }
.af-src span { color: var(--text-muted); }
.af-note { margin: 8px 0 0; font-size: 11px; color: var(--text-muted); }
.af-src a { color: var(--text-secondary); text-decoration: none; border-bottom: 1px solid var(--border-default); }
.af-react table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.af-react th, .af-react td { padding: 7px 4px; text-align: right; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.af-react thead th { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.af-react tbody th { text-align: left; font-weight: 600; color: var(--text-primary); white-space: normal; }
.af-react td.up { color: #dc2626; } .af-react td.dn { color: #2563eb; } .af-react td.af-na { color: var(--text-muted); }
.af-react td small { display: block; font-size: 10.5px; color: var(--text-muted); font-weight: 500; }
.af-react .section-label small { margin-left: 6px; font-weight: 500; letter-spacing: 0; }
.ev-after .af-react { margin-top: 4px; }
/* 왜 중요한가 — 단계 흐름 그림 (_whyHtml): 번호 동그라미를 세로선으로 잇고, 마지막 단계(그래서)는 채운 동그라미·옅은 바탕.
   금액·비율은 형광 칩, 출처는 작은 알약. 화살표가 없는 글은 왼쪽 선 한 문단 */
.wflow { margin-top: 2px; }
.wf-row { position: relative; display: grid; grid-template-columns: 24px 1fr; column-gap: 10px; padding-bottom: 12px; }
.wf-row:last-of-type { padding-bottom: 0; }
.wf-row:not(:last-of-type)::before { content: ''; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px;
  border-radius: 1px; background: linear-gradient(#93c5fd, #dbeafe); }
.wf-dot { width: 24px; height: 24px; box-sizing: border-box; border-radius: 50%; border: 2px solid #93c5fd; background: var(--bg-base);
  color: #2563eb; font-size: 11.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.wf-lab { font-size: 15px; font-weight: 800; letter-spacing: 0; color: #2563eb; line-height: 1.35; margin: 2px 0 4px; }   /* 소제목은 본문(14.5px)보다 크게 (10/24 사용자) */
.wf-txt { font-size: 14.5px; line-height: 1.6; color: var(--text-primary); word-break: keep-all; overflow-wrap: anywhere; }
.wf-row.end .wf-dot { background: #2563eb; border-color: #2563eb; color: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,0.12); }
.wf-row.end .wf-body { background: rgba(37,99,235,0.06); border-radius: 10px; padding: 2px 10px 8px; margin-left: -4px; }
.wf-row.end .wf-txt { font-weight: 600; }
.wf-body.nolab { padding-top: 1px; }   /* 이름표 없는 첫 줄 — 글이 번호 동그라미 높이에 맞게 */
.wf-one { border-left: 3px solid #93c5fd; padding: 2px 0 2px 12px; font-size: 15px; line-height: 1.7; word-break: keep-all; }
.wf-num { font-weight: 700; padding: 0 3px; border-radius: 4px; background: linear-gradient(transparent 55%, rgba(250,204,21,0.45) 55%); }
.wf-chk { margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--border-default); font-size: 12.5px; font-weight: 500; line-height: 1.55; color: var(--text-secondary); }
.wf-chk b { font-weight: 700; color: var(--text-primary); margin-right: 4px; }
.wf-src { display: inline-block; margin-top: 10px; padding: 2px 9px; border-radius: 999px; font-size: 11px; color: var(--text-secondary);
  background: var(--bg-elevated); }
.link-list { display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; }
.link-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "nm go" "why why";   /* 종목명 한 줄, 설명은 그 아래 */
  column-gap: 10px; row-gap: 2px; align-items: center; padding: 9px 12px;
  text-decoration: none; color: inherit; border-top: 1px solid var(--border-subtle); }
.link-row b { grid-area: nm; }
.link-row .ld { font-style: normal; font-weight: 800; margin-right: 6px; white-space: nowrap; }   /* ↑ 좋아짐 빨강 · ↓ 나빠짐 파랑 */
.link-row .ld.up { color: #dc2626; }
.link-row .ld.dn { color: #2563eb; }
.link-row .ld.pm { color: var(--text-secondary); }   /* ± 결과 따라 — 기호는 안 보이고 '바뀌는 것'만 (10/20), 갈림길은 시나리오 */
.link-row span { grid-area: why; }
.link-row i { grid-area: go; }
.link-row:first-child { border-top: none; }
.link-row:hover { background: var(--bg-surface); }
.link-row b { font-weight: 600; font-size: 15px; white-space: nowrap; }
.link-row span { font-size: 14px; line-height: 1.5; color: var(--text-secondary); min-width: 0; }
.link-row i { font-style: normal; color: var(--text-muted); }
/* 관련 종목 — 누르면 그 종목의 ▲·▼ 조건이 줄 아래로 펼쳐진다 (10/22, event_angle.py). 한 번에 하나, 대표(맨 위)는 처음부터 펼침.
   '바뀌는 것'은 줄표 대신 작은 꼬리표로, 이유는 그 뒤에 이어 쓴다 */
.lk-list { border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; }
.lk-row { border-top: 1px solid var(--border-subtle); }
.lk-row:first-child { border-top: none; }
.lk-top { display: block; width: 100%; padding: 11px 12px; text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: none; }
.lk-row.has .lk-top:hover { background: var(--bg-surface); }
/* 펼친 종목 = 종목 줄 + ▲·▼를 테두리 하나로 묶는다 (색을 더 쓰지 않는다 — 빨강·파랑은 방향 몫) */
.lk-row.open { margin: 6px; border: 1.5px solid var(--text-secondary); border-radius: 8px; }
.lk-row.open + .lk-row { border-top: none; }
.lk-row.open .lk-top:hover { background: none; }
.lk-nm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.lk-nm b { font-weight: 600; font-size: 15px; }
.lk-nm small { font-size: 12px; color: var(--text-muted); }
.lk-nm i { margin-left: auto; font-style: normal; color: var(--text-muted); font-size: 13px; transition: transform .15s; }
.lk-row.open .lk-nm i { transform: rotate(180deg); }
.lk-why { margin: 5px 0 0; font-size: 14px; line-height: 1.55; color: var(--text-secondary); }
.lk-tag { display: inline-block; font-style: normal; padding: 0 6px; border-radius: 4px; font-size: 12.5px; font-weight: 600; line-height: 1.7;
  background: var(--bg-surface); color: var(--text-primary); }
.lk-tag.up { color: #dc2626; background: rgba(220, 38, 38, .08); }
.lk-tag.dn { color: #2563eb; background: rgba(37, 99, 235, .08); }
.lk-sc { display: none; padding: 0 12px 12px; }
.lk-row.open .lk-sc { display: block; }
.lk-sc p, .lk-common p { display: grid; grid-template-columns: 30px 1fr; margin: 0 0 6px; padding: 7px 10px; border-radius: 6px; font-size: 14px; line-height: 1.55; }
.lk-sc p.up, .lk-common p.up { background: rgba(220, 38, 38, .06); }
.lk-sc p.dn, .lk-common p.dn { background: rgba(37, 99, 235, .06); }
.lk-common { margin-top: 10px; }
.lk-common-h { margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
/* 화살표 아래 BULL·BEAR를 작은 가로 글씨로 (10/22 — 세로 글씨는 휴대폰에서 읽히지 않아 정석으로) */
.lk-sc p em b, .lk-common p em b { display: block; margin-top: 4px; 
  font-size: 9px; font-weight: 800; letter-spacing: .2px; line-height: 1; }
.lk-sc p em, .lk-common p em { display: flex; flex-direction: column; align-items: center; font-style: normal; font-size: 12px; padding-top: 2px; }
.lk-sc .up em, .lk-common .up em { color: #dc2626; } .lk-sc .dn em, .lk-common .dn em { color: #2563eb; }
.t-sub { margin-left: 6px; font-weight: 400; font-size: .92em; color: var(--text-muted); }
.rv-lb { display: block; margin-bottom: 1px; font-size: 12px; font-weight: 700; }
.bd-why { display: block; margin-top: 1px; font-size: .95em; color: var(--text-secondary); }
.bd-size { margin-left: 4px; padding: 0 6px; border-radius: 4px; background: var(--bg-surface); font-weight: 600; }
#gl-pop .sg h5 small { margin-left: 6px; font-weight: 400; color: var(--text-muted); }
.lk-go { display: inline-block; margin: 2px 0 0 10px; font-size: 13px; color: var(--accent); text-decoration: none; }
.catalyst-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  border-left: 3px solid var(--border-default);
}
.scenario-row {                                  /* 위아래로, 각각 가로로 길게 — 100자 시나리오가 좁은 두 칸에 꺾이지 않게 */
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 6px;
}
.scenario-box {
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.scenario-box.bull { border-left: 3px solid var(--bull); }
.scenario-box.bear { border-left: 3px solid var(--bear); }

.ev-chart-box { margin: 10px 0 2px; }
.ev-chart-hd { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font-size: 13px; color: var(--text-primary); }
.ev-chart-hd b { font-weight: 600; }
.ev-chart-hd .px { font-weight: 600; font-variant-numeric: tabular-nums; }
.ev-chart-hd small { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.ev-chart { position: relative; height: 160px; margin-top: 4px; }
.ev-chart-line { position: absolute; top: 14px; width: 0; border-left: 1.5px dashed #DC2626; pointer-events: none; z-index: 3; display: none; }
.ev-chart-line span { position: absolute; top: -14px; left: 0; transform: translateX(-50%); background: #DC2626; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; padding: 2px 5px; border-radius: 3px; white-space: nowrap; }
.ev-chart-lg { display: flex; gap: 12px; margin-top: 2px; font-size: 11px; color: var(--text-secondary); }
.ev-chart-lg i { display: inline-block; vertical-align: 1px; margin-right: 4px; }
/* 차트 종목 탭 — 차트에 그릴 종목만 바꾼다(페이지 이동은 위 관련 종목 칩). 칩과 모양을 달리한다 */
.ev-chart-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; overflow-x: auto; scrollbar-width: none; }
.ev-chart-tabs::-webkit-scrollbar { display: none; }
.ev-chart-tabs em { flex-shrink: 0; font-style: normal; font-size: 11px; color: var(--text-muted); margin-right: 2px; }
.ev-chart-tabs button { flex-shrink: 0; font-size: 12px; font-weight: 500; line-height: 1.3; padding: 3px 9px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary); -webkit-tap-highlight-color: transparent; }
.ev-chart-tabs button.on { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.ev-chart-lg em { font-style: normal; color: var(--text-muted); }
/* 지난 일정 점을 누르면 그 일정 줄 — 줄을 누르면 그 일정 상세 */
.ev-chart-pick { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.ev-chart-pick:empty { display: none; }
.ev-chart-pick button { display: flex; align-items: baseline; gap: 7px; width: 100%; text-align: left; cursor: pointer; padding: 7px 10px;
  border: 1px solid var(--border-default); border-radius: 8px; background: transparent; color: var(--text-primary); font-size: 12.5px; line-height: 1.35; }
.ev-chart-pick button b { flex-shrink: 0; color: #D97706; font-weight: 600; font-variant-numeric: tabular-nums; }
.ev-chart-pick button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-chart-pick button i { flex-shrink: 0; font-style: normal; color: var(--text-muted); }
/* 눈길 끌기 — 한 번만 은은하게 (계속 깜빡이지 않는다). 지난 일정 줄은 주황, 돌아가기 띠는 파랑 */
@keyframes pick-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes pick-glow { 0% { background: rgba(217,119,6,0.22); border-color: #D97706; } 100% { background: transparent; border-color: var(--border-default); } }
@keyframes back-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); } 50% { box-shadow: 0 0 0 4px rgba(59,130,246,0.22); border-color: #3b82f6; background: rgba(59,130,246,0.08); } }
.ev-chart-pick button.flash { animation: pick-in 0.25s ease-out both, pick-glow 1.1s ease-out 0.15s both; }
.sheet-back.flash { animation: back-pulse 0.9s ease-in-out 0.25s 2; }
@media (prefers-reduced-motion: reduce) {
  .ev-chart-pick button.flash { animation: pick-glow 1.1s ease-out both; }
  .sheet-back.flash { animation: none; border-color: #3b82f6; }
}
.ev-chart-empty { height: 160px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-muted); }
.watchlist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.stock-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid var(--border-default);
  cursor: pointer;
  font-size: 15px;
  border-radius: 2px;
}
.stock-chip:active { background: var(--bg-elevated); }
.chip-name { font-weight: 600; color: inherit; text-decoration: none; }
.chip-name:hover { text-decoration: underline; }
.chip-go { margin-left: 3px; color: var(--text-muted); font-weight: 400; }
.chip-code { font-size: 13px; font-family: monospace; color: var(--text-muted); padding-left: 6px; border-left: 1px solid var(--border-subtle); }

.memo-box {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-top: 6px;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
}

/* ── 데스크탑 글자 크기 업스케일 ────────── */
@media (min-width: 768px) {
  html, body { font-size: 19px; }

  #logo { font-size: 23px; letter-spacing: 3px; }
  #header-tagline { font-size: 15px; }
  #month-label { font-size: 14px; }
  #header { height: var(--header-h); }
  #filter-bar { height: 80px; }
  :root { --header-h: 44px; --filter-h: 80px; --tabnav-h: 56px; }

  .filter-chip { font-size: 16px; padding: 4px 12px; }

  /* ── 세로 단일 컬럼 레이아웃 ── */
  #tab-main.active { display: block; }
  #treemap-left {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
  }
  #treemap-wrap { max-height: 60vh; }
  #desktop-right {
    overflow-y: visible;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0 16px;
  }
  #kw-root { max-width: 800px; margin: 0 auto; }
  /* 스크롤바 자리를 양쪽에 똑같이 잡아, 스크롤되는 탭 본문과 고정된 상단 바의 가운데가 일치하게 한다 */
  .tab-pane { scrollbar-gutter: stable both-edges; }
  /* 상단 바와 하단 탭을 본문 폭(800px)에 맞춰 가운데로. 화면이 좁으면 기본 여백 12px */
  #header, #period-bar, #category-bar, #tab-nav {
    padding-left: max(12px, calc(50% - 400px));
    padding-right: max(12px, calc(50% - 400px));
  }
  #tab-alpha > * { max-width: 800px; width: 100%; margin-left: auto; margin-right: auto; box-sizing: border-box; }
  #tab-briefing > * { max-width: 800px; width: 100%; margin-left: auto; margin-right: auto; box-sizing: border-box; }
  /* 브리핑 검색바 PC 통일 */
  #briefing-search-bar,
  #bss-wrap { padding: 4px 16px; }
  #briefing-date-input,
  #bss-bar { height: 28px; padding: 0 8px !important; font-size: 11px !important; box-sizing: border-box; }
  #bss-bar { gap: 5px; }
  #bss-input { font-size: 11px; }
  #briefing-today-btn,
  #bss-reset-btn { height: 28px !important; padding: 0 10px !important; font-size: 11px !important; box-sizing: border-box; }
  #briefing-search-bar .bss-label,
  #bss-wrap > div:first-child { font-size: 10px !important; margin-bottom: 3px !important; }

  .date-label { font-size: 13px; }
  .theme-label { font-size: 15px; }
  .dot { width: 7px; height: 7px; }

  .date-group-header { font-size: 16px; padding: 20px 16px 10px; }
  .dday-badge { font-size: 15px; padding: 2px 7px; }

  .event-row { height: 50px; padding: 0 6px; gap: 6px; }
  .row-time { width: 32px; }
  .row-cat { font-size: 10.5px; letter-spacing: -0.3px; }
  .row-group-cat { width: 41px; }
  .row-title { font-size: 15px; }
  .row-code { font-size: 15px; }
  .row-catalyst { font-size: 15px; max-width: 260px; }
  .row-dday { font-size: 15px; min-width: 34px; }
  .row-stars > span { font-size: 11px !important; }   /* PC는 D-day가 15px라 별도 조금 크게 */

  .tab-btn, .tab-btn-menu { font-size: 15px; }
  .tab-btn svg, .tab-btn-menu svg { width: 20px; height: 20px; }

  .sheet-title { font-size: 25px; }
  .sheet-sub { font-size: 16px; }
  .sheet-code { font-size: 18px; }
  .section-label { font-size: 14px; }
  .catalyst-box { font-size: 17px; }
  .scenario-box { font-size: 16px; }
  .stock-chip { font-size: 16px; }
  .memo-box { font-size: 16px; }

  /* 핫뉴스 스파크라인 — 데스크탑 확대 */
  .kw-spike-row { padding: 14px 16px; grid-template-columns: 140px 1fr auto; gap: 16px; }
  .kw-spike-kw { font-size: 17px; }
  .kw-spike-sub { font-size: 12px; }
  .kw-sparkline { height: 72px; gap: 3px; }
  .kw-spark-bar { width: 8px; }
  .kw-spark-time { width: 8px; font-size: 9px; }
  .kw-spark-times { gap: 3px; }
  .kw-sparkline-wrap { gap: 4px; }
  .kw-badge { font-size: 11px; padding: 2px 7px; }
  .site-disclaimer { font-size: 13px; }
  .site-foot { font-size: 13px; }
  .site-foot .sf-links a { font-size: 13.5px; }
  .scenario-note { font-size: 12px; }
  .kw-section-label { font-size: 17px; }
  .kw-section-desc, .kw-section-meta { font-size: 13px; }
  .kw-rank-row { grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.5fr) 58px; gap: 12px; padding: 10px 0; }
  .kw-rank-num { font-size: 13px; }
  .kw-rank-kw { font-size: 16px; }
  .kw-rank-cnt { font-size: 14px; }
  .kw-rank-track { height: 7px; }
  .kw-rank-delta { font-size: 11px; }
  .kw-spike-rank { font-size: 12px; }
}

/* ── 사이드 패널 (데스크탑 전용) ──────────── */
#side-panel {
  display: none;
}
@media (min-width: 768px) {
  #side-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    /* 본문(가운데 800px) 바로 오른쪽에 16px 띄워 붙인다: 50% - (400 + 16 + 360).
       화면이 좁아 자리가 없으면(약 1550px 미만) 오른쪽 끝에 붙는다. */
    right: max(0px, calc(50% - 776px));
    width: 360px;
    height: calc(100vh - var(--header-h));
    background: var(--bg-overlay);
    border-left: 1px solid var(--border-default);
    border-right: 1px solid var(--border-default);
    z-index: 201;
    transform: translateX(24px);
    opacity: 0;
    visibility: hidden;
    transition: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  }
  #side-panel.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease;
  }
  .side-panel-header {
    display: flex;
    justify-content: flex-end;
    padding: 10px 12px 0;
    flex-shrink: 0;
  }
  #side-panel-close {
    background: none;
    border: none;
    font-size: 19px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
  }
  #side-panel-close:hover { background: var(--bg-elevated); }
  #side-panel .sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 16px 24px;
  }
  /* 데스크탑에서 바텀시트 숨김 */
  #bottom-sheet, #sheet-overlay { display: none !important; }
}

/* ── Pull-to-refresh ────────────────────── */
#ptr-indicator {
  position: fixed;
  top: var(--header-h);
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: var(--text-primary);
  color: var(--bg-base);
  font-size: 15px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 0 0 8px 8px;
  z-index: 150;
  pointer-events: none;
  transition: transform 0.15s;
}
#ptr-indicator.visible { transform: translateX(-50%) translateY(0); }

/* ── 토스트 ─────────────────────────────── */
#toast {
  position: fixed;
  bottom: calc(var(--tabnav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: #fff;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 4px;
  z-index: 1000;                 /* 메뉴 서랍(950) 위 — 메뉴 안에서 누른 것(메일 복사)의 안내도 보이게 */
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 브리핑 카드 ──────────────────────────── */
#briefing-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 12px 40px;
}
.brief-meta {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  margin-bottom: 20px;
  padding: 0 4px;
}
.brief-section { margin-bottom: 24px; }
.brief-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}
.brief-tier-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 3px;
  color: #fff;
  flex-shrink: 0;
}
.brief-tier-badge.t1 { background: #DC2626; }
.brief-tier-badge.t2 { background: #D97706; }
.brief-tier-badge.t3 { background: #6B7280; }
.brief-run-cnt { font-size: 11px; color: var(--text-secondary); margin-left: auto; }
.brief-upd { font-size: 10px; color: var(--text-tertiary, var(--text-secondary)); margin-bottom: 4px; }
.brief-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.excerpt-box {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 0.5px solid var(--border-default);
  white-space: normal;
  word-break: keep-all;
}
.excerpt-box strong { color: var(--text-primary); font-weight: 600; }
.brief-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-left: 4px solid transparent;
  border-radius: 10px;
  padding: 13px 14px;
  margin-bottom: 10px;
}
.brief-card.t1 { border-left-color: #DC2626; background: rgba(220,38,38,0.04); }
.brief-card.t2 { border-left-color: #D97706; background: rgba(217,119,6,0.03); }
.brief-card.t3 { border-left-color: #9CA3AF; }
/* 브리핑 일정 카드 (_renderBriefingEvents) — 상세창 부품을 한 단계 작게 */
.brief-ev .sheet-meta { margin-bottom: 6px; }
.brief-ev .sheet-meta-tag { font-size: 12px; }
.brief-ev .sheet-dday { font-size: 13px; }
.brief-ev .sheet-title { font-size: 18px; }
.brief-ev .sheet-sub { font-size: 13.5px; margin-bottom: 6px; }
.brief-ev .sheet-code { font-size: 13px; margin-bottom: 8px; }
.brief-ev .why-box { font-size: 14px; }
.brief-ev .link-list { margin-top: 10px; }
.brief-more { display: block; width: 100%; margin-top: 10px; padding: 9px 0; border: 1px solid var(--border-default); border-radius: 8px;
  background: var(--bg-surface); color: var(--text-primary); font-size: 13px; font-weight: 700; cursor: pointer; }
.brief-more:hover { background: var(--bg-elevated); }
.brief-card-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.brief-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
}
.brief-card-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 6px;
  white-space: pre-wrap;
}
/* ── 브리핑 종목검색 ───────────────────────────── */
/* 날짜 input 기본 placeholder 숨김 */
#briefing-date-input::-webkit-datetime-edit-fields-wrapper { color: transparent; }
#briefing-date-input:focus::-webkit-datetime-edit-fields-wrapper,
#briefing-date-input.has-date::-webkit-datetime-edit-fields-wrapper { color: var(--text-primary); }

#briefing-search-bar {
  padding: 10px 12px 8px;
}
#bss-wrap {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-base);
}
#bss-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 6px 10px;
}
#bss-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  min-width: 0;
}
#bss-input::placeholder { color: var(--text-muted); }
#bss-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
#bss-dropdown {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 30;
  overflow: hidden;
}
.bss-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
.bss-item:last-child { border-bottom: none; }
.bss-item:hover, .bss-item:active { background: var(--bg-elevated); }
.bss-item-name { flex: 1; color: var(--text-primary); font-weight: 500; }
.bss-item-code { color: var(--text-muted); font-size: 11px; font-family: monospace; }
.bss-item-cnt  { color: var(--text-secondary); font-size: 11px; }
#bss-chip-wrap {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
#bss-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  padding: 3px 8px 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
#bss-chip button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
#bss-total-label { font-size: 11px; color: var(--text-muted); }
.bss-date-hd {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 14px 14px 6px;
  text-transform: uppercase;
}
.bss-load-more {
  display: block;
  width: calc(100% - 28px);
  margin: 10px 14px 16px;
  padding: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
}
.bss-load-more:hover { background: var(--bg-surface); }
#scroll-top-btn {
  display: none;
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
#scroll-top-btn.visible { display: flex; }
#scroll-top-btn:active { background: var(--bg-surface); }
#fs-btn {
  position: absolute;
  top: 38px;                                  /* 지도 도구 줄(#map-tools, 30px) 아래 지도 오른쪽 위 */
  right: 8px;
  z-index: 30;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0,0,0,0.42);
  border: none;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
#fs-btn:active { background: rgba(0,0,0,0.65); }
/* 지도 도구 줄 — 지도 바로 위 얇은 한 줄. 톱니(보기 설정) 하나만 두고 옵션은 아래로 펼치는 메뉴에 */
#map-tools { position: relative; display: flex; justify-content: flex-end; align-items: center; padding: 4px 8px 0; height: 30px; box-sizing: border-box; }
#map-tags { flex: 1; min-width: 0; position: relative; height: 26px; margin-right: 6px; }   /* 섹터 확대 때 분류·NEW·태그 칩 (그 밖엔 빈칸) */
/* 트리맵 위 한 줄 뉴스 (_mapNews) — 빈칸일 때만. 섹터 확대로 태그 칩이 들어오면 자리를 내준다 */
#map-tags:empty { flex: 0; margin-right: 0; }
#map-news { flex: 1; min-width: 0; height: 26px; margin-right: 6px; display: flex; align-items: center; gap: 6px;
  color: var(--text-primary); text-decoration: none; font-size: 12.5px; cursor: pointer; transition: opacity 0.35s ease; }
#map-news[hidden], #map-tags:not(:empty) + #map-news { display: none; }
#map-news.fade { opacity: 0; }
#map-news .nw-lv { margin-right: 0; flex-shrink: 0; }
#map-news span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#map-news:hover span { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { #map-news { transition: none; } }
/* 분위기 지도 BETA (10/25) — 트리맵 위 [일정 | 분위기]. 타일은 흰 바탕 + 날씨(좋으면 반짝·맑음, 나쁘면 비·큰비, 엇갈리면 구름)
   + 좋음·중립·나쁨 게이지. 섹터 파스텔 색과 겹치지 않게 색칠하지 않는다 */
#map-mode { display: flex; flex-shrink: 0; background: var(--bg-elevated); border-radius: 9px; padding: 2px; margin-right: 8px; }
#map-mode button { border: none; background: transparent; font: inherit; font-size: 12px; color: var(--text-secondary); padding: 3px 9px;
  border-radius: 7px; cursor: pointer; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
#map-mode button[aria-pressed="true"] { background: #2563EB; color: #FFFFFF; font-weight: 700; box-shadow: 0 1px 2px rgba(37,99,235,0.35); }   /* 고른 쪽 = 파란 바탕 (10/25 사용자) */
#map-mode button[aria-pressed="true"] .beta { color: #FFFFFF; background: rgba(255,255,255,0.25); }
#map-mode { order: -1; align-self: center; margin-right: auto; }   /* 뉴스 한 줄이 비어도(도구 줄이 오른쪽 정렬) 왼쪽에 붙어 있게 */
#map-tools > #map-news:not([hidden]), #map-tools > #mood-note:not([hidden]) { margin-left: 0; }   /* 늘 지도 위 왼쪽 첫자리 — 섹터 확대·뉴스 한 줄이 바뀌어도 움직이지 않는다 */
#map-mode .beta { font-size: 8.5px; font-weight: 800; letter-spacing: 0.4px; color: #b45309; background: rgba(245,158,11,0.15); border-radius: 4px; padding: 1px 4px; }
#mood-note { flex: 1; min-width: 0; margin-right: 6px; font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mood-on #map-news, html.mood-on #map-tags, html.mood-on #treemap-wrap { display: none !important; }
#mood-wrap { position: relative; margin: 0 12px; border: 1px solid var(--border-subtle); border-radius: 14px; overflow: hidden; background: var(--bg-elevated);
  height: clamp(420px, calc(100dvh - var(--header-h) - var(--filter-h) - 44px), 640px); }
@media (max-width: 767px) { #mood-wrap { height: auto; max-height: 100vw; aspect-ratio: 1 / 1; } }
.mood-cell { position: absolute; box-sizing: border-box; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-base);
  padding: 8px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; text-align: left;
  font: inherit; color: var(--text-primary); }
.mood-cell.w-sparkle { background: rgba(231,162,58,0.09); border-color: rgba(231,162,58,0.35); }
.mood-cell.w-sun { background: rgba(231,162,58,0.04); }
.mood-cell.w-rain { background: rgba(37,99,184,0.05); }
.mood-cell.w-storm { background: rgba(37,99,184,0.10); border-color: rgba(37,99,184,0.30); }
.mood-cell .mc-name { position: relative; font-weight: 900; line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; }
html.mood-on #fs-btn { display: none !important; }
.mood-cell .mc-word { position: relative; font-size: 12px; font-weight: 700; margin-top: 2px; }
.mood-cell.w-sparkle .mc-word, .mood-cell.w-sun .mc-word { color: #B4312A; }
.mood-cell.w-rain .mc-word, .mood-cell.w-storm .mc-word { color: #2563B8; }
.mood-cell.w-cloud .mc-word { color: var(--text-secondary); }
.mood-cell .mc-gauge { position: relative; display: flex; height: 8px; border-radius: 3px; overflow: hidden; margin-top: auto; }
.mood-cell .mc-fx { position: absolute; inset: 0; pointer-events: none; }
.mood-cell .sp { position: absolute; animation: moodTw 2.6s ease-in-out infinite; }
@keyframes moodTw { 0%, 100% { opacity: 0.2; transform: scale(0.6) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(20deg); } }
.mood-cell .drop { position: absolute; top: -18px; width: 2px; height: 12px; border-radius: 2px; background: #6F98D3; animation: moodFall 1.2s linear infinite; }
@keyframes moodFall { 0% { transform: translateY(0) rotate(14deg); opacity: 0; } 15% { opacity: 0.85; } 100% { transform: translateY(var(--h, 200px)) rotate(14deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mood-cell .sp, .mood-cell .drop { animation: none; opacity: 0.7; } .mood-cell .drop { top: 35%; } }
.mood-empty { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center;
  font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); }
#mood-pop { position: absolute; z-index: 5; width: 240px; max-width: calc(100% - 16px); box-sizing: border-box; background: var(--bg-base); border: 1px solid var(--border-subtle);
  border-radius: 12px; box-shadow: 0 10px 28px rgba(17,24,39,0.18); padding: 12px 14px; font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); }
#mood-pop b { display: block; font-size: 15px; color: var(--text-primary); margin-bottom: 4px; }
#mood-pop .mc-gauge { display: flex; height: 10px; border-radius: 4px; overflow: hidden; margin: 6px 0; }
#view-btn { position: relative; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; border: none; background: transparent;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
#view-btn:hover, #view-btn[aria-expanded="true"] { background: var(--bg-elevated); color: var(--text-primary); }
#legend-btn { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; border: none; background: transparent; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; margin-right: 2px; }
#legend-btn:hover, #legend-btn[aria-expanded="true"] { background: var(--bg-elevated); color: var(--text-primary); }
#map-share { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; border: none; background: transparent; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; margin-left: 2px; }   /* 지도 공유 (10/25, 기준 share.py 'map') */
#map-share:hover { background: var(--bg-elevated); color: var(--text-primary); }
#treemap-wrap.share-hit { box-shadow: 0 0 0 3px rgba(37,99,235,0.35), 0 8px 24px rgba(37,99,235,0.15); transition: box-shadow 0.6s; }
#legend-pop { position: absolute; top: 30px; right: 8px; z-index: 40; width: 236px; padding: 10px 12px; border-radius: 12px;
  background: var(--bg-base); border: 1px solid var(--border-default); box-shadow: 0 8px 24px rgba(0,0,0,0.14); font-size: 12.5px; color: var(--text-primary); }
#legend-pop[hidden] { display: none; }
#legend-pop { max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
/* 범례 섹터 색 표 — THEME_META 한 곳에서 그린다 (_legendSectors) */
.lg-sec { margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--border-default); }
.lg-sec .lh, .lg-sec .lr2 { display: grid; grid-template-columns: 64px repeat(3, 1fr); gap: 3px; align-items: center; }
.lg-sec .lh { font-size: 10px; color: var(--text-secondary); text-align: center; margin-bottom: 3px; }
.lg-sec .lh span:first-child { text-align: left; }
.lg-sec .lh .st { color: #EAB308; letter-spacing: -1px; }       /* 별 = tierStars와 같은 색 */
.lg-sec .lr2 { margin-bottom: 3px; font-size: 11.5px; }
.lg-sec .lr2 i { height: 14px; border-radius: 3px; }
#legend-pop .lr { display: flex; align-items: flex-start; gap: 9px; padding: 4px 0; line-height: 1.4; }
#legend-pop .sw { width: 20px; height: 13px; border-radius: 3px; flex-shrink: 0; margin-top: 2px; }
#legend-pop .mk { width: 20px; flex-shrink: 0; text-align: center; font-size: 12px; }
#legend-pop .nb { display: inline-block; background: #dc2626; color: #fff; font-size: 8px; font-weight: 700; padding: 0 3px; border-radius: 2px; line-height: 1.5; vertical-align: 1px; }
#legend-pop .ds { display: block; font-size: 11px; color: var(--text-secondary); }
#legend-pop .ft { margin: 6px 0 0; padding-top: 7px; border-top: 1px solid var(--border-default); font-size: 11px; color: var(--text-secondary); line-height: 1.5; }
#view-btn i { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: #2563eb; display: none; }
#view-btn.changed i { display: block; }              /* 기본값에서 바뀐 옵션이 있으면 점 */
#view-menu { position: absolute; top: 30px; right: 8px; z-index: 40; min-width: 168px; padding: 5px; border-radius: 12px;
  background: var(--bg-base); border: 1px solid var(--border-default); box-shadow: 0 8px 24px rgba(0,0,0,0.14); }
#view-menu[hidden] { display: none; }
#view-menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; cursor: pointer;
  padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-primary); text-align: left; }
#view-menu button:hover { background: var(--bg-elevated); }
#view-menu button .ck { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border-default); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; }
#view-menu button.on .ck { background: #2563eb; border-color: #2563eb; }
.cell-rise { position: absolute; top: 2px; left: 3px; font-size: 11px; line-height: 1; pointer-events: none; z-index: 2; }
/* 지도 모드(트리맵 전체화면) — html.map-fs. 머리줄·아래 탭·광고·세부 일정을 숨기고 지도가 남은 화면을 채운다.
   기간 줄(#filter-bar)·보기 설정(#map-tools)은 그대로 쓰고, 상세창·섹터 목록은 그 위에 뜬다 (켜고 끄기는 _mapFsSet) */
/* 메인 화면 카드 여백 (10/19) — 옅은 회색 바탕 위에 지도·검색·일정 목록을 흰 둥근 카드로. 휴대폰 좌우 12px, 카드 사이 10px */
#tab-main { background: var(--bg-surface); }
#map-tools { padding-left: 12px; padding-right: 12px; }
#treemap-wrap { width: auto; margin: 0 12px; border: 1px solid var(--border-subtle); border-radius: 14px; overflow: clip; }
#stock-search-wrap, #schedule-list { margin: 10px 12px 0; background: var(--bg-base); border: 1px solid var(--border-subtle); border-radius: 14px; }
#schedule-list { overflow: clip; }
.ss-row { display: flex; align-items: center; gap: 8px; }        /* 검색창 + 별 거르기 버튼 한 줄 */
.ss-row #stock-search-bar { flex: 1; min-width: 0; }
#tier-pick { position: relative; flex-shrink: 0; }
#tier-btn { display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border: 1px solid var(--border-subtle); border-radius: 10px;
  background: var(--bg-elevated); font: inherit; font-size: 13px; font-weight: 700; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
#tier-btn .tp-ic { display: none; }
#tier-btn.on { background: #fef3c7; border-color: #f59e0b; color: #92400e; box-shadow: 0 0 0 2px rgba(245,158,11,0.18); }   /* 거르는 중 — 금색 테두리 */
.tier-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px 9px 16px;
  background: #fffbeb; border-bottom: 1px solid #fcd34d; font-size: 13px; color: #92400e; }
.tier-bar i { font-style: normal; color: #EAB308; letter-spacing: 1px; }
.tier-bar button { flex-shrink: 0; padding: 5px 10px; border: 1px solid #f59e0b; border-radius: 8px; background: #fff;
  font: inherit; font-size: 12.5px; font-weight: 700; color: #92400e; cursor: pointer; }
#tier-btn #tier-btn-l { color: #b45309; } #tier-btn.on #tier-btn-l { color: #92400e; }
#tier-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 232px; padding: 8px; border: 1px solid var(--border-subtle);
  border-radius: 14px; background: var(--bg-base); box-shadow: 0 10px 28px rgba(0,0,0,0.16); }
.tm-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; font-size: 12px; color: var(--text-tertiary, #94a3b8); }
.tm-head button { padding: 3px 9px; border: 1px solid var(--border-subtle); border-radius: 999px; background: none; font: inherit; font-size: 12px;
  font-weight: 700; color: var(--text-secondary); cursor: pointer; }
.tm-head button.on { border-color: #f59e0b; background: #fef3c7; color: #92400e; }                            /* 아무 별도 안 고름 = 전체 */
#tier-menu label { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; font-size: 13.5px; color: var(--text-primary);
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
#tier-menu label:hover { background: var(--bg-elevated); }
#tier-menu input { position: absolute; opacity: 0; pointer-events: none; }
#tier-menu .tm-box { flex-shrink: 0; display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid #cbd5e1; border-radius: 6px;
  background: #fff; transition: background .12s, border-color .12s; }
#tier-menu .tm-box::after { content: ''; width: 5px; height: 10px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: 0; }
#tier-menu input:checked + .tm-box { background: #f59e0b; border-color: #f59e0b; }
#tier-menu input:checked + .tm-box::after { opacity: 1; }
#tier-menu input:focus-visible + .tm-box { box-shadow: 0 0 0 3px rgba(245,158,11,0.3); }
#tier-menu label i { font-style: normal; width: 42px; color: #EAB308; letter-spacing: 1px; }
#tier-menu label b { font-weight: 600; }
#tier-menu .tm-box { border-radius: 50%; }
#tier-menu label i.tm-all { color: var(--text-primary); font-weight: 600; letter-spacing: 0; }
#tier-menu label i { width: auto; margin-right: -4px; }
#tier-menu label b { font-weight: 500; color: var(--text-primary); }
.tier-bar.soft { background: var(--bg-elevated); border-bottom-color: var(--border-subtle); color: var(--text-secondary); padding-top: 6px; padding-bottom: 6px; font-size: 12.5px; }
.tier-bar.soft button { border-color: var(--border-subtle); color: var(--text-secondary); background: var(--bg-base); }
#tier-menu label em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--text-tertiary, #94a3b8); font-variant-numeric: tabular-nums; }
#tier-menu input:checked ~ b { font-weight: 800; }
@media (min-width: 768px) { #stock-search-wrap, #schedule-list { margin-left: 0; margin-right: 0; } }   /* PC는 #desktop-right가 이미 16px 띄운다 */
html.map-fs #treemap-wrap { margin: 0; border: none; border-radius: 0; }
html.map-fs { --header-h: 0px; --tabnav-h: 0px; }
html.map-fs #header, html.map-fs #tab-nav, html.map-fs #ad-bar, html.map-fs #desktop-right,
html.map-fs #treemap-swipe-hint { display: none !important; }
html.map-fs #content { bottom: 0; }
html.map-fs #tab-main { overflow: hidden; }
html.map-fs #treemap-left { max-width: none; }
html.map-fs { --filter-h: 0px !important; }           /* 위 줄은 패널로 옮겨 가고 지도가 화면을 다 쓴다 */
html.map-fs #filter-bar, html.map-fs #map-tools { display: none !important; }
html.map-fs #treemap-wrap { height: 100dvh !important; max-height: none !important; border-bottom: none; }
html.map-fs #fs-btn { top: 8px; }
#map-ctl, #map-panel { display: none; }
html.map-fs #map-ctl { display: flex; align-items: center; gap: 6px; position: absolute; top: 8px; right: 48px; z-index: 31;
  height: 32px; padding: 0 12px; border: none; border-radius: 16px; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
html.map-fs #map-ctl[aria-expanded="true"] { background: rgba(0,0,0,0.75); }
/* 설정 패널 — 지도 위에 얹힌 작은 어두운 반투명 카드. 줄 셋: 기간(나눔 버튼 + ‹ 기간 › 오늘) / 섹터(한 줄 넘겨 보기) / 보기 설정 */
html.map-fs #map-panel:not([hidden]) { display: block; position: absolute; top: 46px; right: 8px; z-index: 32;
  width: min(330px, calc(100vw - 16px)); max-height: calc(100dvh - 58px); overflow-y: auto; padding: 8px;
  background: rgba(17,24,39,0.93); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.10); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,0.30); color: #fff;
  animation: mp-in 0.14s ease-out; transform-origin: top right; }
@keyframes mp-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
#map-panel > div + div { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); }
#map-panel #period-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; height: auto; padding: 2px;
  border: none; border-radius: 9px; background: rgba(255,255,255,0.08); }
#map-panel .period-chip { padding: 5px 0; text-align: center; font-size: 13px; color: rgba(255,255,255,0.62); border-radius: 7px; background: none; }
#map-panel .period-chip.active { background: rgba(255,255,255,0.94); color: #111827; }
#map-panel .chip-default { display: none; }
#map-panel #month-nav { grid-column: 1 / -1; display: flex; align-items: center; gap: 2px; margin: 4px 0 2px; padding: 0 2px; border: none; color: #fff; }
#map-panel #month-nav button { color: rgba(255,255,255,0.85); background: none; }
#map-panel #month-nav button:hover { background: rgba(255,255,255,0.10); }
#map-panel #month-label { flex: 1; font-size: 13.5px; color: #fff; }
#map-panel #today-btn { color: rgba(255,255,255,0.85) !important; border-color: rgba(255,255,255,0.25) !important; }
#map-panel #category-bar { flex-wrap: nowrap; overflow-x: auto; gap: 4px; min-height: 0; padding: 0; }
#map-panel .filter-chip { padding: 5px 10px; font-size: 12.5px; border-radius: 999px; color: rgba(255,255,255,0.72); background: rgba(255,255,255,0.07); }
#map-panel .filter-chip::after { display: none; }
#map-panel .filter-chip.active { color: #111827; background: rgba(255,255,255,0.94); }
#map-panel .new-badge { top: -3px; right: -3px; transform: scale(0.85); }
#map-panel #view-menu { display: flex; gap: 4px; position: static; min-width: 0; padding: 0; border: none; box-shadow: none; background: none; }
#map-panel #view-menu button { flex: 1; width: auto; padding: 6px 8px; font-size: 12px; color: rgba(255,255,255,0.82); border-radius: 8px; background: rgba(255,255,255,0.07); }
#map-panel #view-menu button:hover { background: rgba(255,255,255,0.13); }
#map-panel #view-menu button .ck { width: 14px; height: 14px; border-color: rgba(255,255,255,0.4); }
.bss-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.brief-stocks {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.brief-stock-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
}
.brief-stock-row:active { opacity: 0.7; }
.brief-stock-code {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.brief-stock-name {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: break-word;
}
.brief-empty {
  text-align: center;
  padding: 60px 0 40px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.9;
}
@media (min-width: 768px) {
  .brief-card-title { font-size: 17px; }
  .brief-card-body  { font-size: 15px; }
  .brief-card-date  { font-size: 13px; }
  .brief-stock-code { font-size: 13px; }
  .brief-stock-name { font-size: 13px; }
}

/* ── 일정매매 안내 시트 ──────────────────── */
#info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity 0.2s;
}
#info-overlay.open { display: block; opacity: 1; }

#info-sheet {
  position: fixed;
  top: var(--header-h);
  left: 50%; right: auto;
  transform: translateX(-50%) translateY(-100%);
  width: min(560px, 100%);
  max-height: calc(100dvh - var(--header-h) - var(--tabnav-h));
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 12px 12px;
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
#info-sheet.open { transform: translateX(-50%) translateY(0); }
#info-sheet .sheet-handle {
  width: 36px; height: 4px;
  background: var(--border-default);
  border-radius: 2px;
  margin: 0 auto 10px;
  flex-shrink: 0;
  order: 2;
}
#info-sheet-head {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  order: 1;
}
#info-sheet-body { order: 3; }
#info-sheet-head .info-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--theme-semicon);
  text-transform: uppercase;
  margin-bottom: 2px;
}
#info-sheet-head h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
#info-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 80px;
  -webkit-overflow-scrolling: touch;
}

/* 철학 박스 */
.info-section { padding: 14px 0 12px; border-bottom: 1px solid var(--border-subtle); }
.info-section:last-child { border-bottom: none; }
.info-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.philosophy-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}
.phil-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
}
.phil-icon { font-size: 16px; font-weight: 900; min-width: 16px; padding-top: 1px; }
.phil-icon.bad  { color: var(--bear); }
.phil-icon.good { color: var(--bull); }
.phil-text strong { font-size: 15px; font-weight: 700; color: var(--text-primary); display: block; margin-bottom: 2px; }
.phil-text span   { font-size: 14px; color: var(--text-muted); }
.phil-divider { height: 1px; background: var(--border-subtle); margin: 0 12px; }

/* 타임라인 */
.info-timeline { display: flex; flex-direction: column; gap: 0; padding: 2px 0 0; position: relative; }
.info-timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 10px; bottom: 10px;
  width: 1px;
  background: var(--border-subtle);
}
.tl-row { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; position: relative; }
.tl-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  border: 2px solid var(--bg-overlay);
  position: relative; z-index: 1;
}
.tl-dot.dim    { background: var(--text-muted); }
.tl-dot.mid    { background: var(--theme-semicon); }
.tl-dot.high   { background: var(--bull); }
.tl-main  { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 1px; }
.tl-sub   { font-size: 14px; color: var(--text-muted); line-height: 1.4; }

/* 시나리오 2분할 */
.info-scenario-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.info-sbox { padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: 4px; }
.info-sbox.bull { border-left: 3px solid var(--bull); }
.info-sbox.bear { border-left: 3px solid var(--bear); }
.info-sbox .sl { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.info-sbox.bull .sl { color: var(--bull); }
.info-sbox.bear .sl { color: var(--bear); }
.info-sbox .st { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

/* 3원칙 리스트 */
.info-rule-list { display: flex; flex-direction: column; gap: 6px; }
.info-rule {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}
.info-rule-num { font-size: 14px; font-weight: 900; color: var(--theme-semicon); min-width: 16px; line-height: 1.6; }
.info-rule strong { font-size: 15px; font-weight: 700; color: var(--text-primary); display: block; margin-bottom: 2px; }
.info-rule span   { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

/* 텔레그램 푸터 */
.info-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 0;
}
.info-footer .ft { font-size: 14px; color: var(--text-muted); }
.info-footer a {
  font-size: 15px; font-weight: 700;
  color: var(--theme-semicon);
  text-decoration: none;
}

/* ── 일정 가이드 오버레이 ──────────── */
#sched-guide-overlay.visible { opacity: 1; pointer-events: auto; }
#sched-guide-card 
#sched-guide-card 
#sched-guide-card .sg-info strong { color: rgba(255,255,255,0.9); }
#sched-guide-card .sg-info p { color: rgba(255,255,255,0.55); }
#sched-guide-card 
#sched-guide-overlay.visible 
.sg-info strong { font-size: 13px; font-weight: 700; color: var(--text-primary); display: block; margin-bottom: 3px; }
.sg-info p { font-size: 11.5px; color: var(--text-secondary); line-height: 1.55; margin: 0; }/* 주간 비주얼 */
.gv-wc 
.gv-wc.hot 
.gv-wc span { font-size: 7px; color: var(--text-muted); }
/* 월간 비주얼 */
.gv-dot.faded { background: var(--border-default); }
.gv-dot.empty { background: transparent; }
/* 확인 버튼 */

