@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

/* ═══════════════════════════════════════════════════════════════════
   디자인 토큰 (UI/UX 진단보고서 4-1)
   ───────────────────────────────────────────────────────────────────
   색상 변수는 40개나 정의돼 있었는데 타이포·간격은 0개라 "절반만 체계화"
   상태였다. 실측 결과 폰트 크기가 29종(11.5·12.5·13.5처럼 0.5px 단위로
   흩어짐)이라 어떤 텍스트가 더 중요한지 눈으로 구분되지 않았다.
   → 0.5px 사이즈를 전부 스케일에 스냅하고, 앞으로 쓸 토큰을 정의한다.
   ═══════════════════════════════════════════════════════════════════ */
:root {
  /* 타이포 8단계 — 본문 13px 기준, 캡션 11px 하한(그 이하는 가독성 불가) */
  --fs-2xs: 11px;   /* 캡션·힌트 (반드시 명암비 4.5 이상 색과 함께) */
  --fs-xs:  12px;   /* 보조 정보 */
  --fs-sm:  13px;   /* 본문 기본 */
  --fs-md:  14px;   /* 강조 본문 */
  --fs-lg:  15px;   /* 소제목 */
  --fs-xl:  17px;   /* 카드 제목 */
  --fs-2xl: 22px;   /* 섹션 제목 */
  --fs-3xl: 26px;   /* 페이지 제목 */
  /* 간격 4의 배수 8단계 */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  --bg: #06070f;
  --text: #eef1f8;
  --text2: #c7cfe4;
  --muted: #9aa3ba;
  /* ⚠️ #626b85는 어두운 배경에서 명암비 3.62:1로 WCAG AA(4.5) 미달인데 11~12px
     캡션에 쓰이고 있었다(실측 14곳). 4.87:1이 되도록 밝혔다 — --muted(7.96:1)보다는
     여전히 어두워 시각적 위계는 유지된다.
     ⚠️ 2026-08-21 재조정: 그 4.87:1은 순수 페이지 배경(#06070f) 기준이었다. UI/UX
     검증보고서 6-2 — 카드 안에 카드가 중첩되면 반투명 --card(rgba(255,255,255,.04))가
     겹겹이 쌓여 실제 배경이 더 밝아지고(1겹 #101119·2겹 #191a22·3겹 #212229), 그 위에서는
     같은 색이 4.56 → 4.31 → 4.09로 떨어져 중첩이 2단만 돼도 AA 미달이 났다(실측
     11px 텍스트 6건). 카드 중첩 자체를 항상 2단 이하로 지키는 게 근본 해결이지만,
     색상값도 3단 중첩까지 견디도록 한 단계 더 밝혔다(3겹 기준 5.44:1). */
  --dim: #8f97ae;
  --card: rgba(255, 255, 255, .04);
  --surface: rgba(255, 255, 255, .03);
  --surface2: rgba(255, 255, 255, .06);
  --track: rgba(255, 255, 255, .07);
  --border: rgba(255, 255, 255, .08);
  --border-glow: rgba(139, 92, 246, .4);
  --topbar: rgba(8, 10, 20, .6);
  --pop: rgba(18, 21, 36, .96);
  --accent: #8b5cf6;
  --accent2: #22d3ee;
  --grad: linear-gradient(120deg, #6366f1, #8b5cf6 45%, #22d3ee);
  --grad-soft: linear-gradient(120deg, rgba(99,102,241,.18), rgba(34,211,238,.14));
  --up: #ff4d6d;
  --down: #4d8dff;
  --green: #2ee6a6;
  --amber: #ffb020;
  --gold: linear-gradient(135deg, #ffd76a, #ff9d2f);
  --silver: linear-gradient(135deg, #dfe6f2, #9fb0c9);
  --bronze: linear-gradient(135deg, #e6a76a, #b26a33);
  --orb: .45;
  /* 점수·판단 색 — JS가 style="color:..."로 직접 박던 하드코딩 hex를 변수로 옮겼다.
     인라인에 var(--sc-good)처럼 "변수 참조"를 넣으면 테마를 바꿀 때 브라우저가
     알아서 다시 해석하므로, 다시 렌더링하지 않아도 색이 따라온다(UI/UX 진단보고서
     5장 — 라이트 모드에서 등급칩·판단배지가 명암비 1.7:1로 안 읽히던 문제). */
  --sc-excellent: #2ecc71;  --sc-good: #4f8cff;  --sc-fair: #f5a623;  --sc-poor: #ff4d4d;
  --vd-strong-buy: #17c98b; --vd-buy: #2ee6a6;   --vd-watch-buy: #a8e6c8;
  --vd-accumulate: #f5c518; --vd-hold: #4f8cff;  --vd-watch-sell: #f0b23c;
  --vd-reduce: #f5a623;     --vd-sell: #ff4d6d;  --vd-none: #9aa3ba;
  /* 게이지(canvas) 텍스트 — 다크 배경 전용으로 하드코딩돼 있어 라이트 모드에서
     "종합점수 86"과 등급 문자가 육안으로 거의 안 읽혔다(보고서 5장 실측). */
  --gauge-text: #e6e9f0;  --gauge-sub: #8a93a6;  --gauge-track: #1f2635;
  --accent-text: #a78bfa;   /* 4.26 → 6.1 (본문용 밝은 보라) */
}
/* ═══════════════════════════════════════════════════════════════════
   라이트 모드 (UI/UX 진단보고서 5장 — 명암비 미달 82건)
   ───────────────────────────────────────────────────────────────────
   ⚠️ 보고서는 원인을 "라이트 모드가 CSS 변수를 덮어쓰지 않는다"로 봤지만
   실측해 보니 그건 사실이 아니다 — body.light가 --text/--bg 등을 정상적으로
   덮어쓰고 있었다. 진짜 원인은 따로 있었다:
   **의미색(--up/--down/--green/--amber/--accent)이 어두운 배경 전용으로
   튜닝된 채 라이트 모드에서 그대로 흰 배경 위에 올라간 것**이다.
   실측 명암비: --green 1.32:1, 등급색 1.70:1, --up 2.62:1, --down 2.61:1,
   --amber 1.74:1, --accent 3.46:1 (전부 AA 기준 4.5 미달, 89개 요소).
   → 아래에서 라이트 모드용 어두운 변형으로 교체한다. 이 변수들은 CSS에서
   거의 전부 color:(텍스트)로만 쓰이고 배경은 rgba() 리터럴을 따로 쓰므로
   변수만 바꿔도 배경·차트가 깨지지 않는다(사용처 전수 확인함).
   ═══════════════════════════════════════════════════════════════════ */
body.light {
  --bg: #eef1f7;
  --text: #10131c;
  --text2: #33405a;
  --muted: #566079;
  /* #8790a3는 흰 배경에서 2.62:1 — 12곳의 캡션이 전부 미달이었다 → 5.22:1 */
  --dim: #5c6479;
  --card: rgba(255, 255, 255, .72);
  --surface: rgba(15, 22, 45, .04);
  --surface2: rgba(15, 22, 45, .07);
  --track: rgba(15, 22, 45, .09);
  --border: rgba(15, 22, 45, .11);
  --border-glow: rgba(139, 92, 246, .45);
  --topbar: rgba(255, 255, 255, .72);
  --pop: rgba(255, 255, 255, .98);
  --grad-soft: linear-gradient(120deg, rgba(99,102,241,.12), rgba(34,211,238,.10));
  /* 의미색 — 흰 배경에서 AA(4.5:1)를 통과하는 어두운 변형.
     괄호 안은 #eef1f7 배경 기준 실측 명암비. */
  /* ⚠️ 여유를 두고 잡을 것 — 같은 색이라도 --surface(rgba(15,22,45,.04)) 위에 올라가면
     배경이 살짝 어두워져 명암비가 0.3~0.4 떨어진다. 실제로 4.73으로 계산했던 --up이
     카드 안에서 4.37로 측정돼 미달이었다. 아래 값은 전부 5.3 이상으로 잡았다. */
  --up: #c2183a;      /* 상승/빨강  2.62 → 5.32 */
  --down: #1257d6;    /* 하락/파랑  2.61 → 5.53 */
  --green: #076b41;   /* 긍정/초록  1.32 → 5.82 */
  --amber: #8a5800;   /* 주의/노랑  1.74 → 5.34 */
  --accent: #6d28d9;  /* 강조/보라  3.46 → 6.28 */
  --accent2: #0b5f76; /* 링크·KOSPI배지 청록 1.72 → 6.37 (보고서가 짚은 항목) */
  /* 점수·판단 색 라이트 변형 — 등급칩(1.70:1)·판단배지(1.32:1)가 안 읽히던 문제 */
  --sc-excellent: #076b41;  --sc-good: #1257d6;  --sc-fair: #8a5800;  --sc-poor: #b3182b;
  --vd-strong-buy: #04603e; --vd-buy: #076b41;   --vd-watch-buy: #2a6f52;
  --vd-accumulate: #725600; --vd-hold: #1257d6;  --vd-watch-sell: #8a5800;
  --vd-reduce: #8a5800;     --vd-sell: #c2183a;  --vd-none: #566079;
  --gauge-text: #10131c;  --gauge-sub: #5c6479;  --gauge-track: #d7dceb;
  --accent-text: #6d28d9;
  --orb: .2;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* ⚠️ 모바일에서 화면이 좌우로 흔들리는 버그(사용자 지적) — 원인은 .info-dot 툴팁
   (.tooltip-pop)이 트리거 아이콘 위치에 따라 뷰포트 오른쪽 밖으로 튀어나가는데,
   visibility:hidden 상태에서도 레이아웃 공간은 그대로 차지해 페이지가 항상 33px 가로로
   넘쳤던 것. 넘친 상태로 세로 스크롤하면 터치 관성이 가로로도 살짝 튕겨 "흔들림"으로
   느껴진다. 어떤 요소가 앞으로 또 화면 밖으로 삐져나가도 페이지 자체는 절대 가로로
   스크롤되지 않게 html/body에 안전장치를 건다(근본 원인은 .tooltip-pop도 별도 수정). */
/* ⚠️ 여기에 body를 함께 넣으면 안 된다. body에 overflow-x를 주면 overflow-y가 auto로
   계산되면서 body 자체가 "스크롤 컨테이너"가 되고, 그 안의 position:sticky 요소가
   전부 동작하지 않는다(종목상세 sticky 탭바가 화면 밖으로 밀려나던 실제 원인).
   가로 넘침 차단은 html 하나로 충분하다. */
html { overflow-x: hidden; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Pretendard Variable", -apple-system, "Malgun Gothic", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.01em;
  transition: background .3s, color .3s;
  /* 한글은 띄어쓰기가 없으면 브라우저가 글자 사이 아무 데서나 줄을 바꾼다("당신이"가
     "당신 / 이."로 끊기는 등, 진단리포트 지적사항). 공백에서만 줄바꿈하도록 강제한다. */
  word-break: keep-all;
}
a { color: var(--accent2); text-decoration: none; }
.hidden { display: none !important; }
b { font-weight: 700; }

/* ---------- animated background ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(1200px 800px at 80% -10%, rgba(99,102,241,.10), transparent 60%),
              radial-gradient(900px 700px at 0% 100%, rgba(34,211,238,.09), transparent 55%), var(--bg); }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--orb); animation: float 18s ease-in-out infinite; }
.bg-orbs span:nth-child(1) { width: 420px; height: 420px; background: #6d5cf6; top: -80px; left: 8%; }
.bg-orbs span:nth-child(2) { width: 360px; height: 360px; background: #22d3ee; top: 20%; right: 4%; animation-delay: -6s; }
.bg-orbs span:nth-child(3) { width: 380px; height: 380px; background: #a855f7; bottom: -100px; left: 40%; animation-delay: -12s; }
@keyframes float { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-40px) translateX(24px); } }
/* 진단(2026-09-01, 모바일 체감속도) — filter:blur(90px)는 CSS 속성 중 가장 무거운
   축에 속하는데, position:fixed 배경이라 스크롤할 때마다 매 프레임 다시 합성해야 한다.
   데스크톱 GPU는 무리 없지만 중저가 모바일 기기에서는 스크롤 버벅임·배터리 소모의
   실질적 원인이 된다. 시각 효과(흐린 원)는 그대로 두고 애니메이션만 모바일에서 끈다. */
@media (max-width: 640px) {
  .bg-orbs span { animation: none; }
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px;
  background: var(--topbar);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px) saturate(160%);
  transition: transform .25s ease;
}
/* 모바일 헤더 축소(진단리포트 지적사항 — 로고행·검색창·탭 3줄이 화면의 22%를 항상 차지).
   아래로 스크롤하면 숨기고 위로 스크롤하면 다시 보인다(static/app.js의 scroll 리스너,
   720px 이하에서만 동작). */
.topbar.topbar-hide { transform: translateY(-100%); }
/* div → button으로 바꿨다(키보드 접근·스크린리더 이름). 버튼 기본 스타일은 제거하고
   기존 모양을 그대로 유지한다. */
.logo { font-size: var(--fs-2xl); font-weight: 800; white-space: nowrap; cursor: pointer; letter-spacing: -.02em;
  background: none; border: none; padding: 0; color: var(--text); font-family: inherit; }
.logo span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.main-nav { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.main-nav button { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--muted); border: none; padding: 8px 15px; border-radius: 9px; font-size: var(--fs-sm); font-weight: 700; transition: .16s; white-space: nowrap; }
.main-nav button > .i { width: 15px; height: 15px; vertical-align: 0; }
.main-nav button:hover { color: var(--text); }
.main-nav button.active { background: var(--grad); color: #fff; box-shadow: 0 3px 12px rgba(99,102,241,.35); }
.search-wrap { position: relative; flex: 0 1 560px; max-width: 560px; margin-right: auto; }
#search-input {
  width: 100%; padding: 11px 18px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; color: var(--text); font-size: var(--fs-md); font-family: inherit;
  transition: .2s;
}
#search-input::placeholder { color: var(--dim); }
#search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(139,92,246,.12); }
.search-wrap.pulse-hint #search-input { animation: search-hint-pulse .85s ease; }
@keyframes search-hint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0); border-color: var(--border); }
  30% { box-shadow: 0 0 0 5px rgba(139,92,246,.35); border-color: var(--accent); }
}
.dropdown {
  position: absolute; top: 50px; left: 0; right: 0;
  background: var(--pop); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; z-index: 60;
  box-shadow: 0 20px 50px rgba(0,0,0,.4); backdrop-filter: blur(20px);
}
.dropdown div { padding: 11px 18px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: .12s; }
.dropdown div:hover { background: var(--grad-soft); }
.dropdown small { color: var(--muted); }

button { cursor: pointer; font-family: inherit; }
.ghost-btn {
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 16px; font-size: var(--fs-sm); white-space: nowrap; transition: .2s;
}
.ghost-btn:hover { color: var(--text); border-color: var(--border-glow); box-shadow: 0 0 20px rgba(139,92,246,.15); }
.ghost-btn.small { padding: 6px 11px; font-size: var(--fs-xs); border-radius: 9px; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- auth ---------- */
.auth-area { display: flex; align-items: center; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-chip #user-email { font-size: var(--fs-xs); color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-tabs { display: flex; gap: 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.auth-tab { flex: 1; background: transparent; border: none; color: var(--muted); padding: 8px; border-radius: 8px; font-size: var(--fs-sm); font-weight: 600; transition: .15s; }
.auth-tab.active { background: var(--grad); color: #fff; }
.auth-benefits { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.auth-benefits-title { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.auth-benefits ul { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.auth-benefits li { font-size: var(--fs-sm); font-weight: 600; }
.icon-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 11px; font-size: var(--fs-lg); line-height: 1; transition: .2s; color: var(--text); }
.icon-btn:hover { border-color: var(--border-glow); transform: translateY(-1px); }
.primary-btn {
  background: var(--grad); color: #fff; border: none;
  border-radius: 12px; padding: 12px 24px; font-size: var(--fs-md); font-weight: 700;
  box-shadow: 0 8px 24px rgba(99,102,241,.35); transition: .2s;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(99,102,241,.5); }
.primary-btn:disabled { opacity: .55; cursor: wait; transform: none; }

/* ---------- landing / hero ---------- */
.landing { max-width: 1080px; margin: 0 auto; padding: 20px 18px 70px; }
.hero { text-align: center; padding: 66px 10px 40px; }
.hero-badge {
  display: inline-block; font-size: var(--fs-sm); font-weight: 600; color: var(--text2);
  background: var(--grad-soft); border: 1px solid var(--border);
  padding: 7px 16px; border-radius: 30px; margin-bottom: 22px;
}
.hero h1 { font-size: 52px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 20px; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: var(--fs-xl); margin-bottom: 0; }

/* ---------- favorites (관심종목, 전용 /watchlist 탭에서만 씀 — 홈에서는 제거됨) ---------- */
.fav-summary { font-size: var(--fs-sm); font-weight: 600; color: var(--text2); background: var(--grad-soft); border: 1px solid var(--border-glow); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.fav-stale { font-size: var(--fs-xs); color: var(--muted); background: rgba(245,166,35,.08); border: 1px solid rgba(245,166,35,.3); border-radius: 12px; padding: 9px 14px; margin-bottom: 10px; }
.fav-stale button { margin-left: 4px; }
.fav-cmp-bar { font-size: var(--fs-xs); color: var(--muted); padding: 0 4px 10px; }
.fav-table { display: flex; flex-direction: column; gap: 6px; }
.fav-row { display: grid; grid-template-columns: 22px 70px 1.6fr 64px 1fr 84px 132px; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; }
.fav-row:not(.fav-row-head) { background: var(--surface); cursor: pointer; transition: background .12s; }
.fav-row:not(.fav-row-head):hover { background: var(--surface2); }
.fav-row-head { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; padding: 0 14px; }
.fav-check { accent-color: var(--accent); cursor: pointer; }
.fav-judge { font-size: var(--fs-sm); font-weight: 800; }
.fav-name-col { display: flex; flex-direction: column; gap: 1px; overflow: hidden; min-width: 0; }
.fav-name { font-size: var(--fs-md); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-name-col small { font-size: var(--fs-2xs); color: var(--muted); }
.fav-change { font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; margin-top: 2px; }
.fav-memo { font-size: var(--fs-xs); color: var(--text2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.fav-tag { font-size: var(--fs-2xs); font-weight: 600; color: var(--accent2); background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 1px 7px; }
.fav-score { font-size: var(--fs-sm); font-weight: 800; text-align: center; }
.fav-price-col { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-width: 0; }
.fav-price { font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.fav-rate { font-size: var(--fs-xs); font-weight: 700; }
.fav-upside { font-size: var(--fs-sm); font-weight: 700; text-align: right; }
.fav-na { font-size: var(--fs-xs); color: var(--dim); }
.fav-row-actions { display: flex; align-items: center; gap: 5px; justify-self: end; }
.fav-icon-btn, .fav-x { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface2); border: none; color: var(--muted); font-size: var(--fs-2xs); cursor: pointer; }
.fav-icon-btn:hover { color: var(--text); }
.fav-icon-btn.on { color: var(--accent2); border: 1px solid var(--accent); background: rgba(139,92,246,.15); }
.fav-x:hover { background: var(--down); color: #fff; }

/* ---------- 내 포트폴리오 (홈 위젯) ---------- */
.mypf-board { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 22px 26px; backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(0,0,0,.18); margin-bottom: 20px; }
.mypf-board h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; }
.mypf-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mypf-cta p { color: var(--muted); font-size: var(--fs-md); max-width: 480px; }
.mypf-headline { font-size: var(--fs-md); font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.mypf-list { display: flex; flex-direction: column; gap: 8px; }
.mypf-action { transition: .16s; }
.mypf-action:hover { transform: translateX(4px); cursor: pointer; }
.mypf-ok { padding: 14px 16px; border-radius: 14px; background: rgba(46,230,166,.08); border: 1px solid rgba(46,230,166,.3); font-size: var(--fs-sm); font-weight: 600; }
.mypf-warn-list { display: flex; flex-direction: column; gap: 6px; }
.mypf-warn-item { padding: 10px 14px; border-radius: 12px; background: rgba(245,166,35,.08); border: 1px solid rgba(245,166,35,.3); font-size: var(--fs-sm); font-weight: 600; }
.mypf-more { margin-top: 8px; font-size: var(--fs-xs); color: var(--muted); }
.mypf-foot { margin-top: 14px; text-align: right; }

/* ---------- 오늘의 AI 투자기회 ---------- */
.today-board { background: var(--card); border: 1px solid var(--accent); border-radius: 22px; padding: 26px; backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(0,0,0,.22), 0 0 30px rgba(139,92,246,.12); margin-bottom: 20px; }
.today-board h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; }
.today-sub-h { font-size: var(--fs-lg); font-weight: 800; margin: 22px 0 12px; color: var(--muted); }

.today-pick-card { position: relative; margin: 16px 0; padding: 22px 24px; border-radius: 18px; background: var(--grad-soft); border: 1px solid var(--border-glow); }
.today-pick-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 800; letter-spacing: .04em; }
.today-pick-fav { position: absolute; top: 18px; right: 20px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: var(--fs-xl); line-height: 1; cursor: pointer; transition: .16s; }
.today-pick-fav:hover { transform: scale(1.08); border-color: var(--border-glow); }
.today-pick-fav.on { color: #f5c518; border-color: #f5c518; background: rgba(245,197,24,.12); }
.today-pick-head { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 16px; row-gap: 4px; margin-top: 6px; padding-right: 46px; }
.today-pick-name { font-size: var(--fs-2xl); font-weight: 900; }
.today-pick-name small { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; margin-left: 6px; }
.today-pick-meta { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 14px; row-gap: 4px; }
.today-pick-price { font-size: var(--fs-xl); font-weight: 800; }
.today-pick-score { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.today-pick-verdict { font-size: var(--fs-md); font-weight: 800; }
/* 2026-08-20 — "상승여력" 박스만 2줄(밸류에이션 기준 + 애널리스트 목표가 기준)이라
   align-items:start를 쓰면 그 박스만 커 보이고 나머지 3개는 짧아 크기가 들쭉날쭉했다
   (사용자 지적: "4개 상자박스 다 똑같은 크기로 맞춰"). 다시 stretch(기본값)로 네 박스
   높이를 통일하고, 짧은 내용은 flex로 세로 가운데 정렬해 빈 공간이 안 어색하게 한다. */
.today-pick-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0 4px; }
.today-pick-stats div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.today-pick-stats label { display: block; color: var(--muted); font-size: var(--fs-2xs); margin-bottom: 4px; }
.today-pick-stats span { font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.today-pick-btn { margin-top: 14px; width: 100%; }

/* ⚠️ "AI가 오늘 주목한 이유"와 "적정주가는 어떻게 나왔나"가 각각 풀폭으로 쌓여 섹션 전체가
   너무 길었다(사용자 지적: "칸을 너무 많이 차지해") — 같은 선상(2열)에 나란히 배치해
   세로 높이를 절반 가까이 줄인다. 카드 자체의 padding/줄간격도 함께 소폭 정리. */
.today-cols { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 8px; }
.today-cols > .today-why, .today-cols > .today-valuation { flex: 1 1 0; min-width: 0; margin: 0; }
@media (max-width: 720px) { .today-cols { flex-direction: column; } }

.today-why { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.today-why-title { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.today-why-intro { font-size: var(--fs-sm); line-height: 1.55; margin-bottom: 10px; }
.today-why-row { display: flex; justify-content: space-between; padding: 6px 4px; font-size: var(--fs-sm); border-bottom: 1px solid var(--border); }
.today-why-row:last-of-type { border-bottom: none; }
.today-why-name { font-weight: 600; }
.today-why-dir { font-weight: 800; }
/* 하드코딩 hex(#2ee6a6/#ff4d6d)는 라이트 모드에서 명암비 1.32:1이었다 → 변수로 교체 */
.today-why-row.dir-strong-up .today-why-dir, .today-why-row.dir-up .today-why-dir { color: var(--green); }
.today-why-row.dir-flat .today-why-dir { color: var(--muted); }
.today-why-row.dir-down .today-why-dir, .today-why-row.dir-strong-down .today-why-dir { color: var(--up); }
.today-why-warn { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: rgba(245,166,35,.1); border: 1px solid rgba(245,166,35,.3); color: #f5a623; font-size: var(--fs-xs); font-weight: 700; }

.today-valuation { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.today-val-title { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.today-val-summary { font-size: var(--fs-sm); line-height: 1.55; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.today-val-row { display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; font-size: var(--fs-xs); border-bottom: 1px solid var(--border); }
.today-val-row:last-child { border-bottom: none; }
.today-val-label { font-weight: 700; color: var(--muted); font-size: var(--fs-xs); }
.today-val-text { font-weight: 600; }
.today-val-row.warn .today-val-text { color: var(--amber); }

/* 지금 사기 좋은 종목 TOP5 — 판단/종목/현재가/상승여력/사유 5열 (기존엔 종합점수·현재가
   순서가 뒤섞여 있었고 사유가 종목명 아래 좁게 끼어 있었다는 지적으로 정리) */
.today-table { display: flex; flex-direction: column; gap: 6px; }
.today-row { display: grid; grid-template-columns: 84px 1.2fr 92px 76px 1.6fr; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; }
.today-row:not(.today-row-head) { background: var(--surface); border: 1px solid transparent; cursor: pointer; transition: .16s; }
.today-row:not(.today-row-head):hover { background: var(--grad-soft); border-color: var(--border-glow); transform: translateX(4px); }
.today-row-picked:not(.today-row-head) { border-color: var(--accent); background: var(--grad-soft); }
.today-row-head { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; padding: 0 14px; }
.today-judge { font-size: var(--fs-sm); font-weight: 800; min-width: 0; }
.today-name { font-size: var(--fs-md); font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-price { font-size: var(--fs-sm); text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 0; }
.today-upside { font-size: var(--fs-sm); text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 0; }
.today-reason { font-size: var(--fs-xs); font-weight: 600; color: var(--accent-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- ranking board ---------- */
.rank-board { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 26px; backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(0,0,0,.22); }
.rank-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.rank-head h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; }
.rank-sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
#rank-updated { color: var(--dim); margin-left: 6px; }
.rank-market { display: flex; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.rank-market button { background: transparent; color: var(--muted); border: none; padding: 7px 16px; border-radius: 9px; font-size: var(--fs-sm); font-weight: 700; transition: .16s; white-space: nowrap; }
.rank-market button.active { background: var(--grad); color: #fff; box-shadow: 0 3px 12px rgba(99,102,241,.35); }
.rank-filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.rank-filters button { background: var(--surface); color: var(--muted); border: 1px solid var(--border); padding: 6px 13px; border-radius: 20px; font-size: var(--fs-xs); transition: .15s; }
.rank-filters button:hover { color: var(--text); }
.rank-filters button.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(99,102,241,.4); }

.theme-board { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 26px; backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(0,0,0,.22); margin-bottom: 20px; }
.theme-board h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; }
.theme-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.theme-chips button { background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 9px 16px; border-radius: 22px; font-size: var(--fs-sm); font-weight: 600; transition: .15s; }
.theme-chips button:hover { border-color: var(--border-glow); }
.theme-chips button.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(99,102,241,.4); }
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-loading { display: flex; align-items: center; gap: 12px; justify-content: center; color: var(--muted); padding: 40px 0; font-size: var(--fs-md); }
.rank-row { display: grid; grid-template-columns: 46px 1.6fr 1fr 84px 1fr; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 14px; cursor: pointer; background: var(--surface); border: 1px solid transparent; transition: .16s; }
.rank-row:hover { background: var(--grad-soft); border-color: var(--border-glow); transform: translateX(4px); }
.rank-num { font-size: var(--fs-xl); font-weight: 800; text-align: center; color: var(--muted); }
.rank-num.top { color: #0a0c18; border-radius: 10px; padding: 5px 0; font-size: var(--fs-lg); }
.rank-num.g1 { background: var(--gold); } .rank-num.g2 { background: var(--silver); } .rank-num.g3 { background: var(--bronze); }
.rank-info .rank-name { font-size: var(--fs-lg); font-weight: 700; }
.rank-info .rank-sector { font-size: var(--fs-xs); color: var(--dim); margin-top: 2px; }
.rank-price { text-align: right; }
.rank-price .p { font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-price .r { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.rank-score-chip { font-size: var(--fs-lg); font-weight: 800; text-align: center; padding: 6px 0; border-radius: 10px; font-variant-numeric: tabular-nums; }
.rank-tail { text-align: right; }
.rank-grade { font-size: var(--fs-sm); font-weight: 800; }
.rank-upside { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-bar { height: 5px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: 6px; }
.rank-bar i { display: block; height: 100%; border-radius: 3px; }
.rank-more-btn {
  margin-top: 4px; width: 100%; padding: 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-size: var(--fs-sm); font-weight: 600; transition: .18s;
}
.rank-more-btn span { color: var(--accent2); }
.rank-more-btn:hover { color: var(--text); border-color: var(--border-glow); background: var(--grad-soft); }
.rank-more-btn.collapse { color: var(--dim); }

/* ---------- 스크리너 ---------- */
.scr-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
/* ⚠️ 실제로 잡은 버그(모바일 UX 재점검): min-width:0이 없으면 그리드 아이템이 콘텐츠의
   최소 크기 아래로 줄어들지 않는 CSS Grid 기본 동작 때문에, select/input이 트랙 폭보다
   넓게 요구해 트랙 전체가 늘어나며 화면 밖으로 넘쳤다(375px 화면에서 바디 폭이 455px까지
   벌어져 가로 스크롤이 생기는 게 실제로 재현됨). 그리드 아이템과 내부 폼 요소 모두
   min-width:0 + width:100%로 트랙 폭을 넘지 않게 강제한다.*/
.scr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.scr-field label { font-size: var(--fs-xs); color: var(--muted); }
.scr-field input, .scr-field select {
  width: 100%; min-width: 0; box-sizing: border-box;
  padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: var(--fs-sm); font-family: inherit;
}
.scr-field input:focus, .scr-field select:focus { outline: none; border-color: var(--accent); }
.scr-field.scr-check { justify-content: flex-end; padding-bottom: 10px; }
.scr-field.scr-check label { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--text2); cursor: pointer; }
.scr-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.scr-count { font-size: var(--fs-lg); color: var(--text); font-weight: 700; }
.scr-extra { color: var(--muted); }
.scr-judge { font-size: var(--fs-xs); font-weight: 700; margin-left: 6px; }
.scr-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.scr-preset-chip { background: var(--surface2); border: 1px solid var(--border); color: var(--text2); border-radius: 20px; padding: 8px 16px; font-size: var(--fs-sm); font-weight: 600; transition: .15s; }
.scr-preset-chip:hover { border-color: var(--accent); color: var(--text); background: var(--grad-soft); }
@media (max-width: 640px) {
  /* 라벨이 길어("목표가 상승여력(%) ≥" 등) 2열은 여전히 빡빡해서 1열로 바꾼다. */
  .scr-form { grid-template-columns: 1fr; }
  .scr-field.scr-check { justify-content: flex-start; padding-bottom: 0; }
  #screener-view .scr-actions { flex-direction: column; align-items: stretch; }
  #screener-view .scr-actions button { width: 100%; }
  #screener-view .scr-count { text-align: center; }
  /* 스크리너 결과 행에 넣은 PER·ROE 부가정보는 모바일에서는 숨겨 랭킹표와 같은 높이로
     맞춘다(안 그러면 sector·code·PER·ROE가 한 줄에 다 안 들어가 줄바꿈되며 행이 들쭉날쭉
     길어짐 — 실제로 재현됨). */
  .rank-row .scr-extra { display: none; }
}

/* ---------- toast ---------- */
.app-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: var(--pop); border: 1px solid var(--border-glow); border-radius: 14px;
  padding: 12px 20px; font-size: var(--fs-sm); font-weight: 600; color: var(--text);
  box-shadow: 0 12px 40px rgba(0,0,0,.35); z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; max-width: 90vw;
}
.app-toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 오류는 색으로 구분 — 브라우저 alert()를 토스트로 통일하면서 "실패"가 성공 안내와
   똑같이 보이면 안 되기 때문(UI/UX 진단보고서 7장: alert 9건과 토스트 7건 혼재). */
.app-toast.err { border-color: var(--up); color: var(--up); }
.app-toast[role="alert"] { pointer-events: auto; }

/* ---------- loading ---------- */
.loading { text-align: center; }
.spinner { width: 46px; height: 46px; margin: 0 auto 18px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.sm { width: 22px; height: 22px; margin: 0; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- skeleton (UI/UX 검증보고서 6장, 2026-08-21) ---------- */
.skel { background: linear-gradient(90deg, var(--surface2) 25%, var(--surface) 37%, var(--surface2) 63%); background-size: 400% 100%; animation: skel-shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes skel-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skel-page { max-width: 1080px; margin: 0 auto; padding: 22px 16px 70px; text-align: left; }
.skel-header-row { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.skel-logo { width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0; }
.skel-header-lines { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.skel-line { height: 16px; }
.skel-line.h24 { height: 24px; }
.skel-line.w40 { width: 40%; }
.skel-line.w60 { width: 60%; }
.skel-card { margin-bottom: 18px; }
.skel-card.h90 { height: 90px; }
.skel-card.h140 { height: 140px; }
.skel-card.h220 { height: 220px; }
.skel-row { height: 64px; margin-bottom: 8px; }

/* ---------- report ---------- */
.report { max-width: 1080px; margin: 0 auto; padding: 22px 16px 70px; }
.back-btn { background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 12px; padding: 9px 16px; font-size: var(--fs-sm); margin-bottom: 16px; transition: .2s; }
.back-btn:hover { color: var(--text); border-color: var(--border-glow); transform: translateX(-3px); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 24px 26px; margin-bottom: 18px; backdrop-filter: blur(14px); box-shadow: 0 8px 30px rgba(0,0,0,.2); transition: border-color .25s, box-shadow .25s; animation: rise .5s ease both; }
/* 종목상세 탭 — 자료가 너무 많다는 지적에 따라 "종합"만 기본 노출하고 나머지는 탭 뒤로 */
.detail-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px; margin-bottom: 18px; overflow-x: auto; }
.detail-tabs button { background: transparent; color: var(--muted); border: none; padding: 10px 16px; border-radius: 10px; font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; flex-shrink: 0; transition: .16s; min-height: 44px; }
.detail-tabs button:hover { color: var(--text); }
.detail-tabs button.active { background: var(--grad); color: #fff; box-shadow: 0 3px 12px rgba(99,102,241,.35); }
.tab-hide { display: none; }
.card:hover { border-color: rgba(139,92,246,.28); box-shadow: 0 12px 42px rgba(99,102,241,.14); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card h2, .card h3 { font-size: var(--fs-xl); font-weight: 700; margin-bottom: 15px; }
.card h2 .hint, .card h3 .hint { color: var(--dim); font-weight: 400; font-size: var(--fs-xs); margin-left: 8px; }
small.hint { display: block; color: var(--dim); font-weight: 400; font-size: var(--fs-2xs); margin-top: 3px; letter-spacing: normal; text-transform: none; }
.card h2 small.hint, .card h3 small.hint { display: inline; margin-top: 0; }
.card h2 .info-dot, .card h3 .info-dot { margin-left: 6px; vertical-align: middle; }
.hint-p { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 12px; }
.hint-p code { background: var(--surface2); padding: 1px 6px; border-radius: 5px; font-size: var(--fs-xs); }

/* ---------- verdict banner (한줄평) ---------- */
.verdict-banner { display: flex; align-items: center; gap: 14px; background: var(--grad-soft); border: 1px solid var(--border-glow); border-radius: 18px; padding: 18px 24px; margin-bottom: 18px; animation: rise .5s ease both; }
.vb-icon { font-size: var(--fs-2xl); }
.vb-label { font-size: var(--fs-xs); font-weight: 800; color: var(--muted); letter-spacing: .04em; margin-bottom: 4px; }
.verdict-banner .opinion-head { font-size: var(--fs-xl); font-weight: 700; line-height: 1.55; margin: 0; }

/* ---------- combined action (진단리포트 2026-08-31 4번) ---------- */
.combined-action { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 18px; margin-bottom: 18px; }
.combined-action.ca-conflict { border-color: rgba(255,176,32,.4); background: rgba(255,176,32,.05); }
.ca-headline { font-size: var(--fs-md); font-weight: 700; margin: 0 0 10px; }
.ca-rows { display: flex; flex-direction: column; gap: 6px; }
.ca-row { display: flex; align-items: baseline; gap: 10px; font-size: var(--fs-sm); }
.ca-tag { flex: 0 0 76px; font-size: var(--fs-2xs); font-weight: 700; color: var(--muted);
  background: var(--surface2); border-radius: 8px; padding: 2px 8px; text-align: center; }

/* ---------- stock header ---------- */
.stock-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; }
.stock-title { display: flex; align-items: center; gap: 15px; }
#stock-logo { width: 52px; height: 52px; border-radius: 14px; background: #fff; object-fit: contain; padding: 4px; box-shadow: 0 0 0 1px var(--border); }
.stock-title h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stock-title small { color: var(--muted); font-weight: 400; font-size: var(--fs-md); }
.stock-title em { font-style: normal; font-size: var(--fs-xs); color: var(--accent2); border: 1px solid rgba(34,211,238,.4); border-radius: 7px; padding: 2px 8px; }
.fav-btn { background: none; border: none; font-size: var(--fs-2xl); color: var(--dim); line-height: 1; padding: 0 2px; transition: .15s; }
.fav-btn:hover { transform: scale(1.15); }
.fav-btn.on { color: #ffd76a; }
.cmp-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); border-radius: 10px; padding: 6px 12px; font-size: var(--fs-xs); font-weight: 600; transition: .15s; min-height: 44px; display: inline-flex; align-items: center; }
.cmp-btn:hover { color: var(--text); border-color: var(--border-glow); }
.watch-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); border-radius: 10px; padding: 6px 12px; font-size: var(--fs-xs); font-weight: 600; transition: .15s; min-height: 44px; display: inline-flex; align-items: center; }
.watch-btn:hover { color: var(--text); border-color: var(--border-glow); }
.watch-btn.on { background: rgba(139,92,246,.15); border-color: var(--accent); color: var(--text); }
.watch-msg { font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; max-width: 480px; }
.stock-overview-line { font-size: var(--fs-sm); color: var(--dim); margin-top: 4px; }
.price-basis-note { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }

/* ---------- compare ---------- */
.compare-tray { position: fixed; bottom: 0; left: 0; right: 0; z-index: 80; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 20px; background: var(--pop); border-top: 1px solid var(--border); backdrop-filter: blur(18px); box-shadow: 0 -8px 30px rgba(0,0,0,.3); }
.cmp-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cmp-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 6px 10px 6px 12px; font-size: var(--fs-sm); font-weight: 600; }
.cmp-chip i { width: 9px; height: 9px; border-radius: 50%; }
.cmp-chip b { cursor: pointer; color: var(--muted); font-size: var(--fs-2xs); }
.cmp-chip b:hover { color: var(--up); }
.cmp-actions { display: flex; gap: 8px; }
.cmp-radar-row { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; justify-content: center; }
.cmp-legend { display: flex; flex-direction: column; gap: 10px; min-width: 200px; }
.cmp-leg { display: flex; align-items: center; gap: 9px; font-size: var(--fs-md); font-weight: 600; }
.cmp-leg i { width: 12px; height: 12px; border-radius: 3px; }
.cmp-leg span { flex: 1; }
td.cmp-best { color: var(--green); font-weight: 800; background: rgba(46,230,166,.08); }
.cmp-pick-card { text-align: center; border: 1px solid var(--accent); box-shadow: 0 0 30px rgba(139,92,246,.12); }
.cmp-pick-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.cmp-pick-name { font-size: var(--fs-3xl); font-weight: 900; }
.cmp-pick-reason { font-size: var(--fs-sm); color: var(--muted); margin-top: 6px; }
.live-row { display: flex; align-items: baseline; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.live-price { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.live-change { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }
.badge { font-size: var(--fs-2xs); padding: 4px 11px; border-radius: 20px; background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.badge.src { background: rgba(46,230,166,.12); color: var(--green); border-color: rgba(46,230,166,.28); }
.header-score { display: flex; align-items: center; gap: 16px; }
.grade { font-size: 48px; font-weight: 900; line-height: 1; filter: drop-shadow(0 0 12px currentColor); }
.grade-desc { color: var(--muted); font-size: var(--fs-sm); text-align: center; margin-top: 4px; }

/* ---------- 매수 매력도 요약 ---------- */
.highlight-card { border: 1px solid var(--accent); box-shadow: 0 0 30px rgba(139,92,246,.12); }
.ai-verdict-box { text-align: center; padding: 22px 12px 26px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.ai-verdict-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 700; letter-spacing: .02em; margin-bottom: 8px; }
.ai-verdict-main { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ai-verdict-emoji { font-size: 48px; line-height: 1; }
.ai-verdict-tier { font-size: 42px; font-weight: 900; letter-spacing: -.02em; }
/* 판단 신뢰도는 hl-grid의 5번째 항목으로 통합되어 별도 라인은 더 이상 안 씀(마크업 하위호환용으로 클래스만 유지) */
.ai-verdict-confidence { font-size: var(--fs-sm); color: var(--muted); margin-top: 6px; font-weight: 600; }
.ai-verdict-box .hl-grid { margin: 20px 0 0; }
.hl-cats { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.hl-cat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-xs); font-weight: 600; cursor: default; }
.hl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; opacity: .8; }
.hl-head h3 { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.hl-head #hl-score { font-size: var(--fs-lg); font-weight: 800; color: var(--text); }
.hl-badge { font-size: var(--fs-md); width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface2); border: 1px solid var(--border); flex-shrink: 0; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; align-items: start; }
.hl-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; text-align: center; }
.hl-item label { color: var(--muted); font-size: var(--fs-2xs); display: flex; align-items: center; justify-content: center; gap: 3px; margin-bottom: 5px; }
.hl-item div { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.hl-why h4 { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.hl-discount { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 14px; color: var(--muted); }

/* 정보 아이콘 + 클릭/포커스 툴팁 (예: 판단 신뢰도 설명) */
.info-dot { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--border); font-size: var(--fs-2xs); font-style: normal; cursor: help; color: var(--muted); flex-shrink: 0; }
/* ⚠️ 모바일 화면 흔들림 재발(2026-09-01, 사용자 지적) — 122행 주석이 "html에 안전장치를
   걸었다"고 했지만 근본 원인(.tooltip-pop이 visibility:hidden 상태에서도 레이아웃 폭을
   차지)은 안 고쳐진 채 남아 있었다. 실측: 아이콘이 화면 오른쪽에 가까운 카드(예: 상승여력
   경고, 신호 일치도)에서 220px 폭 툴팁이 뷰포트 밖으로 튀어나가 document.documentElement.
   scrollWidth가 항상 실제 폭보다 20~30px 크게 잡혔다 — html의 overflow-x:hidden이 실제
   가로 스크롤은 막아도, iOS 관성 스크롤은 이 "화면 밖 여분 공간"에 반응해 미세하게
   좌우로 튕긴다. visibility 대신 display:none을 기본값으로 둬서(펼쳐지지 않은 상태에서는
   레이아웃에 아예 존재하지 않게) 근본적으로 없앤다 — 대신 페이드 트랜지션은 포기한다. */
.info-dot .tooltip-pop {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 220px; max-width: min(220px, calc(100vw - 32px)); padding: 10px 12px; border-radius: 10px;
  background: var(--pop); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,.25);
  color: var(--text); font-size: var(--fs-xs); font-weight: 500; line-height: 1.5; text-align: left;
  pointer-events: none; z-index: 20; display: none;
}
.info-dot:hover .tooltip-pop, .info-dot:focus .tooltip-pop, .info-dot.open .tooltip-pop { display: block; }
.hl-why-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hl-why-col h4 { font-size: var(--fs-sm); margin-bottom: 8px; color: var(--muted); }
.hl-reasons { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.hl-reasons li { font-size: var(--fs-sm); padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.hl-reasons li.good { border-color: rgba(46,230,166,.3); background: rgba(46,230,166,.06); }
.hl-reasons li.bad { border-color: rgba(255,77,109,.3); background: rgba(255,77,109,.06); }
@media (max-width: 640px) {
  .hl-why-split { grid-template-columns: 1fr; }
}

/* 4줄 요약 (진단리포트 2026-08-31 UX 2번) */
.quad-summary { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.qs-row { display: flex; align-items: baseline; gap: 12px; }
.qs-label { flex: 0 0 84px; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.qs-verdict { font-size: var(--fs-lg); font-weight: 700; }
.qs-next { font-size: var(--fs-sm); }
.qs-list { list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-sm); }
@media (max-width: 640px) {
  .qs-row { flex-direction: column; gap: 4px; }
  .qs-label { flex: none; }
}

.hl-advanced summary { cursor: pointer; font-size: var(--fs-sm); color: var(--muted); font-weight: 600;
  padding: 10px 2px; user-select: none; }
.hl-advanced summary::-webkit-details-marker { display: none; }
.hl-advanced[open] summary { margin-bottom: 8px; }

/* ---------- opinion ---------- */
.opinion-head { font-size: var(--fs-lg); font-weight: 600; margin-bottom: 12px; line-height: 1.6; }
.opinion-points { list-style: none; margin-bottom: 18px; }
.opinion-points li { color: var(--text2); font-size: var(--fs-md); padding: 6px 0 6px 22px; position: relative; }
.opinion-points li::before { content: "▸"; position: absolute; left: 4px; color: var(--accent2); }
.radar-row { display: flex; gap: 30px; align-items: center; flex-wrap: wrap; }
.category-bars { flex: 1; min-width: 270px; }
.cat-bar { margin-bottom: 11px; }
.cat-bar .cat-label { display: flex; justify-content: space-between; font-size: var(--fs-sm); margin-bottom: 5px; }
.cat-bar .cat-label b { color: var(--muted); font-weight: 500; }
.cat-track { height: 9px; background: var(--track); border-radius: 5px; overflow: hidden; }
.cat-fill { height: 100%; border-radius: 5px; transition: width .8s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 12px currentColor; }
.cat-note { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }

/* ---------- targets ---------- */
.target-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.target-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; text-align: center; }
.target-box label { color: var(--muted); font-size: var(--fs-xs); display: block; margin-bottom: 8px; }
.target-price { font-size: var(--fs-3xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.target-upside { font-size: var(--fs-sm); margin-top: 5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.verdict { font-size: var(--fs-2xl); font-weight: 800; }
.verdict.buy { color: var(--up); } .verdict.accumulate { color: var(--amber); }
.verdict.hold { color: var(--muted); } .verdict.avoid { color: var(--down); }
.timing-comment { font-size: var(--fs-md); color: var(--text2); background: var(--surface); padding: 14px 18px; border-radius: 14px; border-left: 3px solid var(--accent); margin-bottom: 14px; }
.entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.entry-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-align: center; }
.entry-item label { color: var(--muted); font-size: var(--fs-2xs); display: block; }
.entry-item div { font-size: var(--fs-xl); font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; }
.entry-item.buy { background: rgba(46,230,166,.09); border-color: rgba(46,230,166,.3); }
.entry-item.buy div { color: var(--green); }
.entry-item.sell { background: rgba(255,77,109,.09); border-color: rgba(255,77,109,.3); }
.entry-item.sell div { color: var(--up); }

/* 적정 매수가 */
.fair-buy-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; margin-top: 20px; margin-bottom: 14px; }
.fb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.fb-label { font-weight: 700; font-size: var(--fs-md); }
.fb-sub { font-size: var(--fs-xs); color: var(--muted); }
.fb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fb-item { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 13px; text-align: center; }
.fb-item label { color: var(--muted); font-size: var(--fs-xs); display: block; }
.fb-item label small { opacity: .8; }
.fb-price { font-size: var(--fs-xl); font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.fb-upside { font-size: var(--fs-xs); margin-top: 4px; }
.fb-item.cons { border-color: rgba(46,230,166,.35); }
.fb-item.cons .fb-price { color: var(--green); }
.fb-item.base { border-color: var(--accent); }
.fb-item.opt { border-color: rgba(255,77,109,.3); }

/* 가격별 투자전략 — 얇은 막대에 점만 찍고, 라벨은 아래 범례로 분리해 자연스럽게 줄바꿈.
   화면 폭에 상관없이 가로 스크롤도, 라벨 겹침 계산도 필요 없다(폰·태블릿 깨짐 지적 수정). */
.price-ladder { margin-top: 18px; }
.pl-bar { position: relative; height: 6px; border-radius: 3px; background: var(--track); margin: 0 8px 18px; }
.pl-dot {
  position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 2px solid var(--card); box-sizing: border-box;
}
.pl-dot.pl-buy { background: #2ee6a6; }
.pl-dot.pl-partial { background: #f5c518; }
.pl-dot.pl-target { background: var(--dim); }
.pl-dot.pl-current { width: 16px; height: 16px; background: var(--accent); box-shadow: 0 0 0 4px rgba(139,92,246,.22); z-index: 2; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.pl-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); white-space: nowrap; }
.pl-legend-item b { color: var(--text2); font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--dim); }
.pl-legend-item.pl-buy .pl-legend-dot { background: #2ee6a6; }
.pl-legend-item.pl-partial .pl-legend-dot { background: #f5c518; }
.pl-legend-item.pl-current { color: var(--accent-text); font-weight: 800; }
.pl-legend-item.pl-current b { color: var(--accent-text); }
.pl-legend-item.pl-current .pl-legend-dot { background: var(--accent); }

.buy-plan-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; margin-top: 14px; }
.buy-plan-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
/* ⚠️ 실제로 잡은 버그(모바일): "1,840,800원"처럼 끊어질 지점이 없는 긴 문자열이 그리드
   아이템의 최소 콘텐츠 크기를 밀어올려, min-width:0이 없으면 트랙 전체가 화면 밖으로
   넘친다(스크리너 폼과 같은 원인 — 375px에서 body 폭이 429px까지 벌어지는 게 실제로
   재현됨). 아이템에 min-width:0을, 안에서도 줄바꿈이 안 되면 글자 단위로라도 끊기게
   overflow-wrap:anywhere를 안전장치로 둔다. */
.buy-stage { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 13px; text-align: center; min-width: 0; }
.buy-stage-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 700; }
/* --accent(#8b5cf6)를 12px 본문색으로 쓰면 다크 배경에서 4.26:1로 AA 미달이라
   텍스트 전용 변형(--accent-text)을 따로 둔다. 브랜드 보라(테두리·배경)는 그대로. */
.buy-stage-pct { color: var(--accent-text); font-weight: 800; }
.buy-stage-price { font-size: var(--fs-xl); font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.buy-stage.is-reached { border-color: #2ee6a6; background: rgba(46,230,166,.08); }
.buy-stage-status { font-size: var(--fs-2xs); margin-top: 8px; font-weight: 700; }
.buy-stage-status.reached { color: var(--green); }
.buy-stage-status.pending { color: var(--muted); font-weight: 500; }
.buy-plan-reached-note {
  background: rgba(46,230,166,.12); border: 1px solid rgba(46,230,166,.35); color: #2ee6a6;
  border-radius: 10px; padding: 9px 13px; font-size: var(--fs-sm); font-weight: 700; margin-bottom: 10px;
}
.buy-plan-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.buy-plan-footer div { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; text-align: center; }
.buy-plan-footer label { display: block; color: var(--muted); font-size: var(--fs-2xs); margin-bottom: 4px; }
.buy-plan-footer span { font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.fb-upside.up { color: var(--green); }
.fb-upside.down { color: var(--up); }

/* ---------- chart ---------- */
.chart-controls { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-controls button {
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  border-radius: 9px; padding: 6px 14px; font-size: var(--fs-xs); font-weight: 600; transition: .15s;
}
.chart-controls button:hover { color: var(--text); border-color: var(--border-glow); }
.chart-controls button.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 3px 12px rgba(99,102,241,.35); }
.chart-wrap { position: relative; }
#chart-container { height: 440px; }
/* 고급 차트 기법 오버레이(2026-08-19 벤치마킹: Anchored VWAP·Liquidity Sweep·Volume
   Profile) — 캔들 위에 그리는 AVWAP선·유동성 스윕 마커는 lightweight-charts 자체 API로
   그리지만, 볼륨 프로파일(가격대별 거래량 히스토그램)은 그 라이브러리에 없는 기능이라
   좌표를 직접 계산해 별도 canvas로 얹는다. */
.chart-overlay-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.ovl-toggle {
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  border-radius: 9px; padding: 6px 12px; font-size: var(--fs-xs); font-weight: 600; transition: .15s;
  opacity: .55;
}
.ovl-toggle:hover { color: var(--text); border-color: var(--border-glow); }
.ovl-toggle.active { opacity: 1; border-color: var(--accent); color: var(--text); background: var(--grad-soft); }
#vp-overlay { position: absolute; top: 0; right: 0; pointer-events: none; z-index: 4; }
/* 크로스헤어에 따라 갱신되는 OHLC 정보 박스(TradingView류 차트의 표준 UX) — 값 없이 색점+범례만
   있던 예전보다 "지금 이 캔들이 얼마였는지"를 바로 알 수 있어 훨씬 완성도 있어 보인다. */
.chart-ohlc-legend {
  position: absolute; top: 10px; left: 12px; z-index: 5; max-width: calc(100% - 24px);
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: var(--pop); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 12px; font-size: var(--fs-xs); font-variant-numeric: tabular-nums;
  backdrop-filter: blur(10px); box-shadow: 0 6px 20px rgba(0,0,0,.22); pointer-events: none;
}
.chart-ohlc-legend .ol-name { font-weight: 800; font-size: var(--fs-sm); color: var(--text); }
.chart-ohlc-legend .ol-item { color: var(--muted); }
.chart-ohlc-legend .ol-item b { font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-ohlc-legend .ol-item b.up { color: var(--up); }
.chart-ohlc-legend .ol-item b.down { color: var(--down); }
.chart-ohlc-legend .ol-chg.up { color: var(--up); font-weight: 800; }
.chart-ohlc-legend .ol-chg.down { color: var(--down); font-weight: 800; }
@media (max-width: 640px) {
  .chart-ohlc-legend { font-size: var(--fs-2xs); gap: 7px; padding: 6px 9px; }
  .chart-ohlc-legend .ol-name { font-size: var(--fs-xs); }
}
.chart-legend { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.lg { font-size: var(--fs-xs); color: var(--muted); padding-left: 18px; position: relative; }
.lg::before { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 3px; border-radius: 2px; }
.lg.ma20::before { background: #ffb020; } .lg.ma60::before { background: #2ee6a6; }
.lg.ma120::before { background: #a855f7; } .lg.target::before { background: #ff4d6d; }
.lg.support::before { background: #4d8dff; } .lg.resist::before { background: #9aa3ba; }
.lg.buy::before { background: #2ee6a6; } .lg.sell::before { background: #ff4d6d; }
.lg.avwap-hi::before { background: #ff6b9d; } .lg.avwap-lo::before { background: #22d3ee; }
.lg.avwap-ytd::before { background: #f5c518; }
.lg.sweep::before { content: none; } .lg.sweep { padding-left: 0; }

/* ---------- tech ---------- */
.tech-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tech-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 13px; text-align: center; }
.tech-item label { font-size: var(--fs-2xs); color: var(--muted); display: block; }
.tech-item div { font-size: var(--fs-xl); font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; }
.signal-list { list-style: none; }
.signal-list li { padding: 8px 0 8px 28px; position: relative; font-size: var(--fs-md); color: var(--text2); }
.signal-list li::before { position: absolute; left: 2px; }
.signal-list li.bull::before { content: "🟢"; } .signal-list li.bear::before { content: "🔴"; }
.signal-list li.warn::before { content: "🟡"; }
.signal-list li.neutral::before, .signal-list li.info::before { content: "⚪"; }

.cns-warn {
  margin: 8px 0 14px; padding: 10px 14px; border-radius: 10px;
  background: rgba(255, 176, 32, .12); border: 1px solid rgba(255, 176, 32, .35);
  color: var(--amber); font-size: var(--fs-sm); line-height: 1.5;
}

/* ---------- metrics ---------- */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; }
.metric label { font-size: var(--fs-2xs); color: var(--muted); display: block; }
.metric div { font-size: var(--fs-xl); font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.metric small { color: var(--dim); font-weight: 400; font-size: var(--fs-2xs); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 500; }
th:first-child, td:first-child { text-align: left; }
tbody tr { transition: background .12s; } tbody tr:hover { background: var(--surface); }
td.pos { color: var(--up); } td.neg { color: var(--down); }

/* 보유 종목 표(#pf-holdings-table) 전용 모바일 카드형 — 결함 리포트 2026-09-18 8장:
   375px 화면에서 10개 열짜리 표가 실제 폭 1,001px라 3.2배 가로 스크롤이 필요했다.
   매일 확인하는 화면이 매번 좌우로 밀어야 다 보인다면 습관이 안 생긴다는 지적.
   tableHTML()이 각 td에 실어두는 data-label(헤더 텍스트)로 라벨을 만든다 — 이 표만
   card로 접고, 다른 tableHTML() 표(재무제표·동종업계 비교 등)는 기존 가로 스크롤
   그대로 둔다(열이 훨씬 많거나 숫자 비교가 핵심이라 카드형이 오히려 불리함). */
@media (max-width: 640px) {
  #pf-holdings-table table, #pf-holdings-table thead, #pf-holdings-table tbody,
  #pf-holdings-table th, #pf-holdings-table td, #pf-holdings-table tr { display: block; }
  #pf-holdings-table thead { display: none; }
  #pf-holdings-table tbody tr {
    border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px;
    padding: 4px 14px; background: var(--surface);
  }
  #pf-holdings-table td {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px;
    border-bottom: 1px dashed var(--border); padding: 9px 0; white-space: normal; text-align: right;
  }
  /* 평가손익 셀의 환차손익 분리 표기(<small>)는 값 밑으로 온전히 한 줄 내려서 보여준다 —
     좁은 폭에서 라벨·값과 한 줄에 끼면 결함 리포트가 지적한 것과 같은 가독성 문제가 재발한다. */
  #pf-holdings-table td small.hint { flex-basis: 100%; text-align: right; }
  #pf-holdings-table td:last-child { border-bottom: none; }
  #pf-holdings-table td::before {
    content: attr(data-label); color: var(--muted); font-size: var(--fs-xs); font-weight: 600;
    text-align: left; flex: 0 0 auto;
  }
  #pf-holdings-table td[data-label=""]::before { content: none; }
  #pf-holdings-table td[data-label=""] { justify-content: flex-end; gap: 8px; }
  #pf-holdings-table td[data-label="종목"] {
    font-weight: 700; font-size: var(--fs-md); justify-content: flex-start;
  }
  #pf-holdings-table td[data-label="종목"]::before { content: none; }
}

/* ---------- research / news ---------- */
.research-list, .news-list { display: flex; flex-direction: column; gap: 10px; }
.research-item, .news-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 17px; transition: .15s; }
.research-item:hover, .news-item:hover { border-color: var(--border-glow); background: var(--surface2); }
.research-item .r-top, .news-item .n-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.research-item b, .news-item b { font-size: var(--fs-md); font-weight: 600; }
.news-item a { color: var(--text); } .news-item a:hover { color: var(--accent2); }
.r-meta, .n-meta { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.r-preview, .n-body { color: var(--muted); font-size: var(--fs-sm); margin-top: 7px; }
.senti-tag { font-size: var(--fs-2xs); border-radius: 12px; padding: 3px 9px; margin-right: 8px; font-weight: 600; }
.senti-tag.positive { background: rgba(255,77,109,.14); color: var(--up); }
.senti-tag.negative { background: rgba(77,141,255,.14); color: var(--down); }
.senti-tag.neutral { background: var(--surface2); color: var(--muted); }
.senti-tag.irrelevant { background: rgba(255,176,32,.14); color: #ffb020; }
.news-item.news-irrelevant { opacity: .6; }
.n-evidence { font-size: var(--fs-2xs); color: var(--muted); margin-top: 4px; }

/* ---------- AI ---------- */
.ai-report { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin-top: 14px; font-size: var(--fs-md); color: var(--text2); }
.ai-report h1, .ai-report h2, .ai-report h3 { margin: 14px 0 8px; color: var(--text); }
.ai-report ul, .ai-report ol { margin: 6px 0 10px 22px; } .ai-report li { margin: 3px 0; }
.ai-report p { margin: 6px 0; } .ai-report em { color: var(--text); font-style: italic; }
.ai-report code { background: var(--surface2); padding: 1px 5px; border-radius: 5px; font-size: var(--fs-xs); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(3,4,10,.6); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(6px); }
.modal-box { background: var(--pop); border: 1px solid var(--border); border-radius: 20px; padding: 28px; width: 440px; max-width: 92vw; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal-box h3 { margin-bottom: 10px; font-size: var(--fs-xl); }
.modal-box label { font-size: var(--fs-xs); color: var(--muted); display: block; margin: 12px 0 5px; }
.modal-box input[type=text], .modal-box input[type=password] { width: 100%; padding: 10px 13px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: inherit; }
.modal-box textarea { width: 100%; padding: 10px 13px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: inherit; font-size: var(--fs-sm); resize: vertical; }
.check-row { display: flex !important; align-items: center; gap: 8px; margin-top: 14px !important; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.kis-msg { font-size: var(--fs-sm); margin-top: 12px; color: var(--amber); }
.watch-alert-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.watch-alert-row { display: flex !important; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--text2); font-weight: 500; margin: 0 !important; cursor: pointer; }
.watch-alert-row small.hint { margin-left: 2px; }
.watch-alert-input { width: 84px; padding: 5px 8px !important; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; font-size: var(--fs-xs); margin-left: auto; }

.disclaimer { color: var(--dim); font-size: var(--fs-xs); text-align: center; margin-top: 28px; line-height: 1.7; }

@media (max-width: 720px) {
  .hero { padding: 40px 6px 30px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: var(--fs-md); }
  .live-price { font-size: var(--fs-3xl); }
  .topbar { flex-wrap: wrap; padding: 12px 14px; gap: 8px 10px; }
  .logo { font-size: var(--fs-xl); }
  /* ⚙ 실시간 시세 버튼은 라벨 텍스트를 숨기고 아이콘만 남겨 헤더 1행에 logo·테마·auth와
     같이 들어가게 한다(라벨까지 다 보이면 폭이 넘쳐 항상 자기 혼자 한 줄을 차지했었음). */
  .kis-label { display: none; }
  #kis-btn { padding: 8px 10px; }
  /* 마켓 브리핑 탭 추가로 모바일 메뉴가 5→6개가 되면서, flex:1(버튼이 100% 폭을 균등
     분할)로는 더 이상 안 맞았다 — white-space:nowrap(기본 규칙, 181행) 때문에 각 버튼의
     최소 폭이 "줄바꿈 없는 전체 텍스트 폭"으로 고정돼 flex-shrink가 그 밑으로 못 줄이고,
     합계가 화면 폭을 넘겨 html의 overflow-x:hidden 안전장치를 뚫고도(133행 주석 참고)
     터치 관성으로 좌우로 살짝 튕기는 "화면이 움직이는" 느낌을 만들었다. 균등분할 대신
     .detail-tabs(494행)와 같은 가로 스크롤 탭바로 바꿔 넘치는 폭을 nav 안에 가둔다. */
  .main-nav {
    order: 3; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav button { flex: 0 0 auto; padding: 9px 12px; font-size: var(--fs-xs); }
  .search-wrap { order: 2; flex: 1 1 auto; }
  .card { padding: 18px 16px; }
  .rank-board, .today-board { padding: 18px 16px; }
  .rank-row { grid-template-columns: 34px 1.5fr 70px 1fr; gap: 8px; padding: 12px 12px; }
  /* fav-row와 동일한 이유(min-content가 좁은 칸을 눌러버리는 grid 버그, 위 참고)로
     5칸을 억지로 한 줄에 넣는 대신 이름/가격 위, 사유/상승여력 아래 2줄로 나눈다. */
  .today-row {
    grid-template-columns: 60px 1fr auto;
    grid-template-areas: "judge name price" "judge reason upside";
    row-gap: 4px; column-gap: 8px; padding: 10px 12px;
  }
  .today-row-head { display: none; }
  .today-judge { grid-area: judge; align-self: center; }
  .today-name { grid-area: name; white-space: normal; }
  .today-price { grid-area: price; }
  .today-upside { grid-area: upside; }
  .today-reason { grid-area: reason; }
  /* ⚠️ 5개 고정폭 컬럼(체크박스·판단·종목·가격·액션)을 375px 폭에 욱여넣었더니, 가격 텍스트가
     줄바꿈 안 되는 min-content 때문에 자기 몫보다 넓게 트랙을 차지해 종목명 칸이 거의 0에
     가깝게 눌렸다(사용자 지적: "종목명이 제대로 안나옴", 실측 42px). 좁은 화면에서 한 줄에
     다 넣는 대신 이름 위, 가격/액션 아래로 2줄 카드형 레이아웃으로 바꿔 이름에 넉넉한 폭을 준다. */
  .fav-row-head { display: none; }
  /* ⚠️ 판단 배지가 메모·태그 아래 맨 밑에 깔리고, 가격은 (이름칸이 변동내역·메모·
     태그로 길어지는 만큼) 세로 중앙에 붕 떠 이름과 안 붙어 보이던 문제(사용자
     지적: "즐겨찾기 부분이 이상해"). 판단을 이름 바로 위로 올려 데스크톱과 같은
     순서(체크→판단→이름)로 맞추고, 가격은 그 두 줄 옆에 상단 정렬로 붙인다. */
  .fav-row {
    grid-template-columns: 22px 1fr auto;
    grid-template-areas: "check judge price" "check name price" "check actions actions";
    row-gap: 4px; column-gap: 10px; padding: 12px;
  }
  .fav-cell-check { grid-area: check; align-self: start; padding-top: 2px; }
  .fav-judge { grid-area: judge; align-self: end; font-size: var(--fs-sm); }
  .fav-name-col { grid-area: name; align-self: start; }
  .fav-price-col { grid-area: price; align-self: start; padding-top: 1px; }
  .fav-row-actions { grid-area: actions; justify-self: end; align-self: center; margin-top: 2px; }
  .fav-row .fav-hide-mobile { display: none; }
  .rank-price { display: none; }
  .rank-num { font-size: var(--fs-md); }
  .rank-info .rank-name { font-size: var(--fs-md); }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .metric { padding: 10px; }
  .metric div { font-size: var(--fs-lg); }
  .metric small { display: none; }
  .stock-header { flex-direction: column; align-items: flex-start; }
  .header-score { align-self: stretch; justify-content: center; }
  .hero-badge { font-size: var(--fs-xs); }
  .verdict-banner { padding: 15px 18px; }
  .verdict-banner .opinion-head { font-size: var(--fs-md); }
  .mypf-cta { flex-direction: column; align-items: stretch; }
  .mypf-cta button { width: 100%; }
  .buy-stage { padding: 9px 6px; }
  .buy-stage-price { font-size: var(--fs-sm); }
  .buy-stage-status { font-size: var(--fs-2xs); }
}

/* ---------- 기술 점수 4축 분해 바 ---------- */
.tech-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin: 4px 0 14px; }
.tp-bar { display: flex; align-items: center; gap: 9px; font-size: var(--fs-xs); }
.tp-label { flex: 0 0 44px; color: var(--muted); }
.tp-label.wide { flex: 0 0 62px; }
.tp-track { flex: 1; height: 7px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.tp-track i { display: block; height: 100%; border-radius: 4px; transition: width .5s ease; }
.tp-val { flex: 0 0 30px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 고급 차트 분석 ---------- */
.pro-head { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; margin-bottom: 16px; }
.pro-score-box { text-align: center; padding: 14px 10px; background: var(--surface2); border-radius: 12px; border: 1px solid var(--border); }
.pro-score-box label { display: block; font-size: var(--fs-xs); color: var(--muted); margin-bottom: 4px; }
.pro-score { font-size: 30px; font-weight: 800; line-height: 1.15; }
.pro-stage { font-size: var(--fs-xs); margin-top: 5px; line-height: 1.35; }
.pro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 10px; margin-bottom: 14px; }
/* 자산시장 8개가 auto-fit이면 화면 폭에 따라 5+3처럼 마지막 줄이 어중간하게 남는다는
   지적 — 데스크톱은 4×2로 고정해 항상 꽉 찬 사각형 그리드가 되게 한다. */
@media (min-width: 900px) {
  .pro-grid-assets { grid-template-columns: repeat(4, 1fr); }
}
.pro-item { padding: 11px 13px; background: var(--surface2); border-radius: 10px; border: 1px solid var(--border); }
.pro-item label { display: block; font-size: var(--fs-2xs); color: var(--muted); margin-bottom: 3px; }
.pro-item .pro-val { font-size: var(--fs-xl); font-weight: 700; margin-bottom: 2px; }
.pro-item small { font-size: var(--fs-2xs); color: var(--muted); line-height: 1.35; display: block; }
.pro-item .spark { vertical-align: middle; margin-left: 6px; }
/* 마켓 브리핑 한줄평 — today-pick-card와 같은 "AI 강조" 톤(그라디언트+글로우 테두리)을
   재사용해 홈의 오늘의 PICK과 시각적으로 같은 급의 정보임을 알린다. */
#market-commentary-card { background: var(--grad-soft); border: 1px solid var(--border-glow); border-radius: 18px; }
#market-commentary-text { font-size: var(--fs-lg); font-weight: 600; color: var(--text); margin-bottom: 0; line-height: 1.5; }

/* ── 마켓 브리핑 게이지 — "극단적 저평가 ← … → 극단적 고평가" 스펙트럼을 트랙 위 마커
   위치로 표현한다(버핏지수류 시각화 요청 반영). 트랙 색은 기본적으로 축의 낮은 값(파랑)
   →높은 값(빨강) 고정 그라디언트다 — 지표마다 "낮다/높다"가 좋고나쁨을 뜻하는 방향이
   달라서(VIX는 낮을수록 과열 신호) 색 자체에 "좋다/나쁘다" 의미를 담지 않고, 현재 구간
   라벨(.gauge-cur)이 그 해석을 텍스트로 알려주는 게 원칙이다. 다만 "낮을수록 위험"인
   지표(금리차 등, .reverse)는 이 원칙을 예외로 두고 색을 반전한다 — 안전한 쪽이
   빨간색으로 보이는 게 오독 위험이 라벨 텍스트로 상쇄되는 정도를 넘는다는 지적 반영. */
.gauge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 6px; }
.gauge-card { padding: 14px 16px; background: var(--surface2); border-radius: 12px; border: 1px solid var(--border); }
.gauge-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.gauge-title { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.gauge-cur { font-size: var(--fs-xs); font-weight: 800; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.gauge-value { font-size: var(--fs-xl); font-weight: 800; margin-bottom: 8px; }
.gauge-track { position: relative; height: 8px; border-radius: 5px; margin-bottom: 5px;
  background: linear-gradient(90deg, #3b82f6 0%, #22c55e 30%, #eab308 55%, #f97316 75%, #ef4444 100%); }
.gauge-track.reverse { background: linear-gradient(90deg, #ef4444 0%, #f97316 25%, #eab308 50%, #22c55e 75%, #3b82f6 100%); }
.gauge-marker { position: absolute; top: -4px; width: 3px; height: 16px; border-radius: 2px;
  background: var(--text); box-shadow: 0 0 0 2px var(--surface2); transform: translateX(-50%); }
.gauge-ends { display: flex; justify-content: space-between; font-size: var(--fs-2xs); color: var(--muted); }
/* 눈금자 — 구간 경계값 4개(0/25/50/75%, 트랙 마커와 동일한 축)를 숫자로 찍는다.
   "저평가~고평가 텍스트 대신 실제 경계 숫자를 보고 싶다"는 요청 반영. */
.gauge-ticks { position: relative; height: 14px; font-size: var(--fs-2xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.gauge-tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.gauge-na { color: var(--muted); font-size: var(--fs-sm); }
/* 밸류에이션 5개가 auto-fit(minmax 220px)이면 대개 4열까지만 차서 오른쪽에 빈 칸이
   하나 남는다는 지적 — 넓은 화면에서는 5열로 고정해 한 줄에 꽉 채운다. */
@media (min-width: 1180px) {
  #market-valuation-gauges { grid-template-columns: repeat(5, 1fr); }
}

/* 종합 시장온도 히어로 — 개별 게이지보다 큰 트랙+숫자로 눈에 먼저 들어오게 한다.
   한국/미국 온도 카드 2장을 나란히 두는 컨테이너(.temp-dual-grid) + 각 카드 공통 스타일
   (.temp-card, 예전엔 #market-temp-card 단일 카드였다가 한국/미국 분리로 클래스화). */
.temp-dual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 720px) {
  .temp-dual-grid { grid-template-columns: 1fr; gap: 14px; }
}
.temp-card { background: var(--grad-soft); border: 1px solid var(--border-glow); border-radius: 18px; margin-bottom: 0; }
.temp-hero { margin: 6px 0 10px; }
.temp-num-wrap { text-align: center; margin-bottom: 10px; }
.temp-num { font-size: 52px; font-weight: 900; line-height: 1; }
.temp-num-label { font-size: var(--fs-md); font-weight: 700; color: var(--muted); margin-top: 4px; }
.temp-track { position: relative; height: 14px; border-radius: 8px;
  background: linear-gradient(90deg, #3b82f6 0%, #22c55e 30%, #eab308 55%, #f97316 75%, #ef4444 100%); margin-bottom: 6px; }
.temp-marker { position: absolute; top: -5px; width: 5px; height: 24px; border-radius: 3px;
  background: var(--text); box-shadow: 0 0 0 3px var(--surface); transform: translateX(-50%); }
.temp-ends { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); margin-bottom: 14px; }
.temp-subgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.temp-sub-item { padding: 10px 12px; background: var(--surface2); border-radius: 10px; border: 1px solid var(--border); }
.temp-sub-item label { display: block; font-size: var(--fs-2xs); color: var(--muted); margin-bottom: 3px; }
.temp-sub-item .temp-sub-val { font-size: var(--fs-lg); font-weight: 800; }
.confluence-box { margin-bottom: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-glow); }
.confluence-title { font-size: var(--fs-sm); font-weight: 700; margin-bottom: 10px; }
.confluence-title small.hint { display: block; font-weight: 400; margin-top: 3px; }
/* flex-wrap 행 — fav-row/today-row에서 겪은 grid min-content 트랙 버그(가격처럼 줄바꿈
   안 되는 텍스트가 옆 칸을 밀어내는 문제) 방지 위해 고정 grid 대신 유연한 flex 사용 */
.confluence-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 4px; font-size: var(--fs-xs); border-bottom: 1px solid var(--border); }
.confluence-row:last-child { border-bottom: none; }
.confluence-price { font-weight: 800; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.confluence-row.up .confluence-price, .confluence-row.up .confluence-type { color: var(--up); }
.confluence-row.down .confluence-price, .confluence-row.down .confluence-type { color: var(--down); }
.confluence-type { font-weight: 700; }
.confluence-score { color: var(--muted); }
.confluence-sources { color: var(--text2); flex-basis: 100%; font-size: var(--fs-xs); }
.pro-details { margin-bottom: 12px; }
.pro-details summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 600; padding: 8px 0; color: var(--text); }
.pro-details summary span { color: var(--muted); font-weight: 500; }
.tt-list { list-style: none; padding: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 5px; }
.tt-list li { font-size: var(--fs-xs); padding: 4px 0; }
.tt-list li.no { color: var(--muted); }

/* ---------- 밸류에이션 분석 ---------- */
.val-band { background: var(--grad-soft); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.vb-main { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.vb-col { display: flex; flex-direction: column; gap: 2px; }
.vb-col label { font-size: var(--fs-2xs); color: var(--muted); }
.vb-col b { font-size: var(--fs-2xl); font-weight: 800; }
.vb-col.ratio b { font-size: var(--fs-2xl); }
.vb-vs { font-size: var(--fs-sm); color: var(--muted); font-weight: 700; }
.vb-note { margin-top: 9px; font-size: var(--fs-sm); font-weight: 600; }
.peer-per { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.peer-per .pp { font-size: var(--fs-xs); padding: 5px 11px; border-radius: 20px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); }
.peer-per .pp.self { background: var(--grad-soft); color: var(--text); border-color: var(--accent); font-weight: 700; }

.backtest-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.bt-head { font-weight: 700; font-size: var(--fs-md); margin-bottom: 10px; }
.bt-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.bt-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--fs-sm); background: var(--surface2); border-radius: 10px; padding: 9px 13px; }
.bt-year { font-weight: 700; min-width: 44px; }
.bt-per { color: var(--muted); }
.bt-arrow { color: var(--muted); font-size: var(--fs-xs); margin-left: auto; }
.bt-ret { font-weight: 800; font-size: var(--fs-md); min-width: 60px; text-align: right; }
.bt-summary { display: flex; gap: 20px; padding-top: 10px; border-top: 1px solid var(--border); }
.bt-sum-item label { font-size: var(--fs-2xs); color: var(--muted); display: block; margin-bottom: 3px; }
.bt-sum-item b { font-size: var(--fs-xl); font-weight: 800; }
.val-check { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.vc-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 4px 8px; align-items: center; padding: 9px 12px; background: var(--surface2); border-radius: 10px; border: 1px solid var(--border); }
.vc-row.no { border-color: rgba(255,176,32,.32); }
.vc-item { font-size: var(--fs-sm); font-weight: 600; }
.vc-verdict { font-size: var(--fs-sm); font-weight: 700; }
.vc-detail { grid-column: 2 / -1; font-size: var(--fs-2xs); color: var(--muted); }

@media (max-width: 640px) {
  .tech-parts { grid-template-columns: 1fr; }
  .pro-head { grid-template-columns: 1fr; }
  .tt-list { grid-template-columns: 1fr; }
  .vb-main { gap: 12px; }
  .vb-col b { font-size: var(--fs-xl); }
}

/* ---------- 차트 통합 섹션 ---------- */
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-tf { display: inline-flex; gap: 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.chart-tf button { background: transparent; border: none; color: var(--muted); padding: 6px 14px; border-radius: 7px; font-size: var(--fs-sm); font-weight: 600; transition: .15s; }
.chart-tf button.active { background: var(--grad); color: #fff; }
.chart-sub-head { font-size: var(--fs-lg); font-weight: 700; margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid var(--border); }
.chart-sub-head .hint { font-weight: 400; font-size: var(--fs-xs); color: var(--muted); }

/* 재무 지표 추이 색상 */
.fin-good { color: var(--up); font-weight: 600; }
.fin-bad { color: var(--down); font-weight: 600; }

/* ---------- 내 포트폴리오 ---------- */
/* 종목 추가를 보유종목 카드 안에 묶는다 — 별도 카드로 떨어져 있던 걸 붙였다.
   테이블이 있을 때만 구분선을 그어 시각적으로 "추가 구역"임을 표시한다. */
.pf-add-inline { margin-top: 18px; }
#pf-holdings-table-wrap:not(.hidden) + .pf-add-inline { padding-top: 18px; border-top: 1px solid var(--border); }
.pf-add-inline h4 { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.pf-add-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.pf-search-wrap { position: relative; flex: 1 1 260px; min-width: 200px; }
#pf-search-input {
  width: 100%; padding: 11px 15px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); font-size: var(--fs-md); font-family: inherit;
}
#pf-search-input:focus { outline: none; border-color: var(--accent); }
#pf-shares, #pf-price {
  width: 130px; padding: 11px 15px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); font-size: var(--fs-md); font-family: inherit;
}
#pf-price { width: 170px; }
.pf-total { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.pf-total label { font-size: var(--fs-sm); color: var(--muted); }
.pf-total b { font-size: var(--fs-3xl); font-weight: 900; }
.pf-pnl { font-size: var(--fs-lg); font-weight: 700; }
.pf-pnl .hint { font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
.pf-cash { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pf-cash label { font-size: var(--fs-sm); color: var(--muted); }
.pf-cash b { font-size: var(--fs-lg); font-weight: 800; }
.pf-cash input { width: 160px; }
.pf-grade-hero { margin: 4px 0 16px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.pf-grade-label { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.pf-grade-main { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pf-grade-emoji { font-size: var(--fs-3xl); line-height: 1; }
.pf-grade-score { font-size: 32px; font-weight: 900; letter-spacing: -.02em; }
.pf-grade-score small { font-size: var(--fs-lg); font-weight: 700; color: var(--muted); margin-left: 2px; }
.pf-grade-desc { font-size: var(--fs-lg); font-weight: 800; }
.pf-grade-penalty { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.pf-exp-warn { color: #ffb020; font-weight: 600; }
.upside-flag { cursor: help; font-size: .85em; }
.pf-edit-input { width: 90px; max-width: 100%; padding: 5px 7px; border-radius: 8px; border: 1px solid var(--accent); background: var(--surface); color: var(--text); font-size: var(--fs-sm); }
.pf-today { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.pf-today span { font-weight: 800; }

.pf-rebalance-list { display: flex; flex-direction: column; gap: 16px; }
.pf-rebal-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.pf-rebal-name { font-size: var(--fs-md); font-weight: 800; margin-bottom: 10px; }
.pf-rebal-bar-row { display: grid; grid-template-columns: 38px 1fr 46px; align-items: center; gap: 10px; margin-bottom: 5px; }
.pf-rebal-bar-label { font-size: var(--fs-xs); color: var(--muted); }
.pf-rebal-track { height: 9px; background: var(--surface2); border-radius: 5px; overflow: hidden; }
.pf-rebal-fill { height: 100%; }
.pf-rebal-fill.cur { background: var(--muted); opacity: .6; }
.pf-rebal-fill.target { background: var(--grad); }
.pf-rebal-pct { font-size: var(--fs-xs); font-weight: 700; text-align: right; }
.pf-rebal-note { font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; }
.pf-rebal-action { font-size: var(--fs-sm); color: var(--text); font-weight: 700; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.pf-rebal-budget { font-size: var(--fs-sm); color: var(--green); background: rgba(46,230,166,.1); border: 1px solid rgba(46,230,166,.3); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.pf-rebal-budget.warn { color: var(--amber); background: rgba(255,176,32,.1); border-color: rgba(255,176,32,.35); }

.pf-holding-trends { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.pf-holding-trends-title { font-size: var(--fs-md); font-weight: 700; margin-bottom: 10px; }
.pf-holding-trend-list { display: flex; flex-direction: column; gap: 8px; }
.pf-holding-trend-row { display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 10px; background: var(--surface); flex-wrap: wrap; }
.pf-ht-name { flex: 1 1 140px; font-size: var(--fs-sm); font-weight: 600; min-width: 120px; }
.pf-ht-spark { flex: 0 0 auto; }
.pf-ht-nums { flex: 1 1 180px; display: flex; align-items: center; gap: 10px; font-size: var(--fs-xs); color: var(--text2); justify-content: flex-end; }
.pf-ht-nums b { font-size: var(--fs-sm); }
.pf-ht-empty { flex: 1 1 auto; font-size: var(--fs-xs); text-align: right; }
.pf-warnings { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.pf-warnings li { font-size: var(--fs-sm); padding: 9px 13px; border-radius: 10px; background: rgba(255,166,77,.1); border: 1px solid rgba(255,166,77,.3); }
.pf-warnings li.pos { background: rgba(46,230,166,.08); border-color: rgba(46,230,166,.3); }
.pf-sector-bars { display: flex; flex-direction: column; gap: 10px; }
.pf-sector-row { display: grid; grid-template-columns: 110px 1fr 50px; align-items: center; gap: 12px; }
.pf-sector-name { font-size: var(--fs-sm); font-weight: 600; }
.pf-sector-track { height: 10px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.pf-sector-fill { height: 100%; background: var(--grad); }
.pf-sector-pct { font-size: var(--fs-sm); font-weight: 700; text-align: right; }
.pf-exposure-row { margin-bottom: 6px; }
.pf-exposure-row summary { cursor: pointer; list-style: none; }
.pf-exposure-row summary::-webkit-details-marker { display: none; }
.pf-exposure-detail { margin: 6px 0 4px 0; padding-left: 14px; font-size: var(--fs-xs); color: var(--text2); }
.pf-exposure-detail li { margin-bottom: 2px; }
.pf-metrics-note { margin-top: 4px; }

@media (max-width: 640px) {
  .pf-add-row { flex-direction: column; }
  .pf-search-wrap, #pf-shares, #pf-price, #pf-add-btn { width: 100%; flex: none; }
}

/* ---------- 오늘의 진단 / 위험탐지 / 실질노출 / 상관관계 ---------- */
.pf-actions-summary { font-size: var(--fs-md); color: var(--text2); margin-bottom: 14px; }
.pf-actions-list { display: flex; flex-direction: column; gap: 10px; }
.pf-action-card { border-radius: 14px; padding: 12px 16px; border: 1px solid var(--border); background: var(--surface); }
.pf-action-red { border-color: rgba(255,77,109,.4); background: rgba(255,77,109,.07); }
.pf-action-yellow { border-color: rgba(255,166,77,.4); background: rgba(255,166,77,.07); }
.pf-action-green { border-color: rgba(46,230,166,.4); background: rgba(46,230,166,.07); }
.pf-action-head { font-size: var(--fs-md); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-action-detail { font-size: var(--fs-sm); color: var(--text2); }
.pf-ack-btn { margin-left: auto; }
.pf-action-acked { opacity: .6; }
.pf-actions-acked-wrap { margin-top: 16px; }
.pf-actions-acked-wrap summary { cursor: pointer; font-size: var(--fs-sm); color: var(--muted); }
.pf-actions-acked-wrap .pf-actions-list { margin-top: 10px; }
.pf-todo-wrap { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.pf-todo-wrap h4 { font-size: var(--fs-md); font-weight: 700; margin-bottom: 8px; }
.pf-todo-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.pf-todo-list li { font-size: var(--fs-sm); font-weight: 600; }

.pf-risk-list { display: flex; flex-direction: column; gap: 10px; }
.pf-risk-item { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); padding: 10px 14px; border-radius: 12px; background: rgba(255,77,109,.06); border: 1px solid rgba(255,77,109,.25); }
.pf-risk-tag { font-weight: 700; white-space: nowrap; color: var(--down); }
.pf-risk-detail { color: var(--text2); }

.corr-table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.corr-table th, .corr-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--border); }
.corr-table th { color: var(--muted); font-weight: 600; }
.corr-table th:first-child, .corr-table td:first-child { text-align: left; font-weight: 600; color: var(--text); }
.corr-table td.corr-high { color: var(--down); font-weight: 700; }
.corr-table td.corr-low { color: var(--up); }
.pf-scenario-input { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pf-scenario-input label { font-size: var(--fs-sm); color: var(--muted); }
.pf-scenario-input input { width: 160px; }
.pf-scenario-table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.pf-scenario-table th, .pf-scenario-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pf-scenario-table th { color: var(--muted); font-weight: 600; }
.pf-scenario-table th:first-child, .pf-scenario-table td:first-child { text-align: left; font-weight: 700; color: var(--text); }
.pf-scenario-table td:last-child { text-align: left; white-space: normal; min-width: 180px; }
.pf-scenario-table tr.pf-scenario-infeasible td { color: var(--amber); }

/* ---------- 이상징후 탐지 ---------- */
.anomaly-board { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 26px; backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(0,0,0,.22); margin-bottom: 20px; }
.anomaly-board h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; }
.anomaly-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 16px; }
.anomaly-card { border-radius: 16px; padding: 16px 18px; cursor: pointer; transition: .15s; border: 1px solid var(--border); background: var(--surface); }
.anomaly-card:hover { transform: translateY(-2px); border-color: var(--border-glow); }
.anomaly-card.bull { border-color: rgba(46,230,166,.35); background: rgba(46,230,166,.06); }
.anomaly-card.bear { border-color: rgba(255,77,109,.35); background: rgba(255,77,109,.06); }
.an-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.an-tag { font-size: var(--fs-xs); font-weight: 700; padding: 3px 9px; border-radius: 20px; background: var(--surface2); }
.an-name { font-weight: 700; font-size: var(--fs-md); }
.an-score { margin-left: auto; font-weight: 800; font-size: var(--fs-md); }
.an-reasons { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.an-reasons li { font-size: var(--fs-xs); color: var(--text2); padding-left: 14px; position: relative; }
.an-reasons li::before { content: "·"; position: absolute; left: 2px; color: var(--muted); }

/* ---------- 점수 백테스트 ---------- */
.bt-board { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 26px; backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(0,0,0,.22); margin-bottom: 20px; }
.bt-board h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; }
.bt-empty { margin-top: 14px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text2); font-size: var(--fs-sm); line-height: 1.6; }
.bt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.bt-period { border-radius: 16px; padding: 16px 18px; border: 1px solid var(--border); background: var(--surface); }
.bt-period-label { font-weight: 800; font-size: var(--fs-md); margin-bottom: 10px; }
.bt-period-label small { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.bt-period-locked { display: flex; flex-direction: column; opacity: .55; }
.bt-period-locked-msg { color: var(--muted); font-size: var(--fs-xs); text-align: center; padding: 14px 0; }
.bt-row { display: grid; grid-template-columns: 34px 56px 1fr 1fr; align-items: center; gap: 6px; padding: 7px 0; font-size: var(--fs-xs); border-top: 1px solid var(--border); }
.bt-row:first-child { border-top: none; }
.bt-grade { font-weight: 800; }
.bt-n { color: var(--muted); }
.bt-ret.up, .bt-excess.up { color: var(--up); font-weight: 700; }
.bt-ret.down, .bt-excess.down { color: var(--down); font-weight: 700; }
.bt-win { color: var(--muted); }
.bt-excess { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--muted); }
/* 등급 요약(수익률·승률)만 있고 정작 어떤 종목인지 안 보인다는 지적 — 등급 행 바로
   아래 수익률 상위 종목을 칩으로 붙인다(app/backtest.py가 등급당 최대 10개 제공). */
.bt-stocks { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 0 8px; }
.bt-stock { font-size: var(--fs-2xs); padding: 2px 8px; border-radius: 20px; background: var(--surface2); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.bt-stock.up { color: var(--up); }
.bt-stock.down { color: var(--down); }
.bt-stock-more { font-size: var(--fs-2xs); padding: 2px 8px; color: var(--dim); }

/* 진단리포트(2026-08-31) 7번 — MDD·변동성·샤프·거래비용·매칭실패 고지, 최소기준
   미달 경고, 계산방식 공개. */
.bt-detail { grid-column: 1 / -1; font-size: var(--fs-2xs); color: var(--muted); padding: 0 0 4px; }
.bt-early-warning { background: rgba(255,176,32,.1); border: 1px solid rgba(255,176,32,.35);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; font-size: var(--fs-sm); line-height: 1.6; }
.bt-methodology { margin-top: 14px; font-size: var(--fs-xs); color: var(--muted); }
.bt-methodology summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.bt-methodology ul { margin: 8px 0 0 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.6; }

/* ---------- footer ---------- */
.site-footer { text-align: center; padding: 28px 16px 20px; color: var(--dim); font-size: var(--fs-xs); font-weight: 500; }
.footer-disclaimer { max-width: 640px; margin: 0 auto 10px; line-height: 1.6; color: var(--dim); }
.footer-links a { color: var(--dim); text-decoration: underline; }
.footer-links a:hover { color: var(--muted); }
.hl-disclaimer { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); color: var(--dim); font-size: var(--fs-xs); line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════════
   접근성 (UI/UX 진단보고서 6장)
   ───────────────────────────────────────────────────────────────────
   실측 결과 :focus-visible 규칙 0개 · outline:none 3건 · aria 0개 ·
   44px 미만 터치 타깃 18개 · prefers-reduced-motion 대응 0건이었다.
   ═══════════════════════════════════════════════════════════════════ */

/* 1) 키보드 포커스 링 — Tab으로 이동해도 지금 어디에 있는지 안 보여 키보드만으로는
   사용이 불가능했다. :focus-visible이라 마우스 클릭 시에는 링이 뜨지 않는다. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
/* outline:none을 걸어둔 입력 3곳은 box-shadow로 대체 표시하고 있었는데, 키보드
   사용자에게도 확실히 보이도록 포커스 링을 되살린다. */
#search-input:focus-visible, .scr-field input:focus-visible,
.scr-field select:focus-visible, #pf-search-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* 2) 터치 타깃 — 애플·구글 가이드라인 모두 44~48px를 권장한다.
   ⚠️ "보이는 크기는 두고 ::after로 히트 영역만 44px로 넓히는" 흔한 기법은 여기서
   그대로 쓰면 안 된다. 관심종목 행의 아이콘 3개는 24px + gap 5px(피치 29px)라
   44px 히트 영역끼리 15px씩 겹쳐, 실제로는 DOM 순서상 뒤에 있는 버튼(=삭제 ✕)이
   위로 올라와 오조작이 오히려 늘어난다. 밀집 구간은 실제 크기를 키우고 간격을
   벌리는 쪽으로, 주변에 여백이 있는 단독 버튼만 히트 영역 확장을 쓴다. */
.fav-row-actions { gap: 10px; }
.fav-icon-btn, .fav-x { width: 34px; height: 34px; font-size: var(--fs-sm); }
/* 삭제(✕)는 나머지 아이콘과 같은 간격으로 붙어 있어 오조작 위험이 있었다(보고서 7장)
   — 한 칸 더 떼어 놓는다. */
.fav-x { margin-left: 6px; }

/* 단독 버튼 — 좌우에 여백이 있어 히트 영역을 넓혀도 이웃을 가리지 않는다. */
.icon-btn, .ghost-btn.small, .today-pick-fav, .fav-btn { position: relative; }
.icon-btn::after, .ghost-btn.small::after, .today-pick-fav::after, .fav-btn::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px; min-height: 44px;
  width: 100%; height: 100%;
}
/* ★는 종목명 옆 버튼들과 나란히 있어, 넓힌 히트 영역이 이웃을 덮지 않도록 간격 확보 */
.fav-btn { margin: 0 6px; }

/* 3) 모션 민감 사용자 — transition 34건·keyframes 4건이 전원에게 그대로 적용됐다.
   운영체제에서 "동작 줄이기"를 켠 사용자에게는 애니메이션을 사실상 끈다. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}

/* 4) 스크린리더 전용 텍스트 — 아이콘만 있는 버튼에 이름을 붙일 때 사용 */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 5) 반응형 — 미디어쿼리가 720/640px 두 개뿐이라 768~1200px 태블릿 구간과 1440px
   이상 대형 화면 처리가 없어, 넓은 모니터에서는 좌우 여백만 늘어났다. */
@media (min-width: 1600px) {
  .landing, .report, .compare-view, #portfolio-view, #screener-view { max-width: 1560px; }
}

/* 태블릿 (UI/UX 검증보고서 5장, 2026-08-21) — 예전엔 640px/720px(모바일)·1600px(와이드)
   뿐이라 721~1599px(아이패드 세로 768px 포함)가 전부 데스크톱 레이아웃 그대로였다.
   ⚠️ 모바일 브레이크포인트의 카드형(grid-template-areas) 레이아웃을 그대로 재사용하지
   않는다 — 태블릿은 폭이 충분한데 억지로 여러 줄 카드로 쌓으면 오히려 더 엉성해
   보인다(실기기 확인은 못 함, 시각적 과대추정 방지 차원의 판단). 대신 데스크톱과 같은
   한 줄 grid를 유지하되 칸 폭만 줄여 5열이 좁은 폭에 눌리는 것만 완화한다. */
@media (max-width: 1024px) and (min-width: 721px) {
  .rank-row { grid-template-columns: 40px 1.4fr 90px 1fr; gap: 10px; padding: 12px 14px; }
  .today-row { grid-template-columns: 70px 1fr 80px 68px 1.2fr; gap: 8px; }
  .fav-row { grid-template-columns: 20px 60px 1.3fr 56px 1fr 76px 110px; gap: 8px; padding: 10px 12px; }
}

/* ═══════════════════════════════════════════════════════════════════
   종목상세 sticky 탭바 + 요약바 (UI/UX 진단보고서 3-2 — 이번 점검 최대 구조 결함)
   ───────────────────────────────────────────────────────────────────
   탭바가 y=1,742px(2.4화면 아래)에 있고 sticky도 아니라서, 탭을 바꾸려면
   매번 스크롤해 내려가 탭을 찾고 클릭한 뒤 다시 위치를 찾아야 했다.
   종목 하나 보는 동안 이 동작을 대여섯 번 반복하게 된다는 지적.
   ═══════════════════════════════════════════════════════════════════ */
.detail-sticky {
  position: sticky;
  /* 상단바(.topbar)가 sticky top:0·z-index:50이라 그 아래에 붙여야 가리지 않는다.
     높이는 반응형으로 달라지므로 app.js가 --topbar-h를 실측해 넣어준다. */
  top: var(--topbar-h, 62px);
  z-index: 30;
  margin: 0 -16px 18px;
  padding: 10px 16px 0;
  background: var(--topbar);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.detail-sticky .detail-tabs { margin-bottom: 10px; }
/* 실제로 상단에 "붙은" 상태에서만 그림자와 요약줄을 보여준다 — 평상시엔 평범한 탭바. */
.detail-sticky.pinned { border-bottom-color: var(--border); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.sticky-summary { display: none; }
.detail-sticky.pinned .sticky-summary {
  display: flex; align-items: baseline; gap: 10px;
  padding: 0 4px 8px; min-width: 0; overflow: hidden; white-space: nowrap;
}
.ss-name { font-weight: 800; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; }
.ss-price { font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.ss-chg { font-weight: 700; font-size: var(--fs-xs); }
.ss-score { font-size: var(--fs-xs); color: var(--muted); margin-left: auto; flex-shrink: 0; }
.ss-verdict { font-size: var(--fs-xs); font-weight: 800; flex-shrink: 0; }
@media (max-width: 720px) {
  /* 모바일에선 상단바가 스크롤 시 숨으므로(.topbar-hide) 탭바를 화면 맨 위에 붙인다 */
  .detail-sticky { top: 0; }
  .ss-score { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   홈 3영역 재편 (UI/UX 진단보고서 3-1)
   ───────────────────────────────────────────────────────────────────
   로그인 홈이 5,101px(일곱 화면)이었고, 여덟 개 섹션이 우선순위 없이 평면으로
   나열돼 "내가 지금 확인할 것"과 "둘러볼 것"이 섞여 있었다.
   내 투자 → 오늘의 발견 → 둘러보기 세 영역으로 나누고, 둘러보기 영역은
   접을 수 있게 해 기본 높이를 줄인다.
   ═══════════════════════════════════════════════════════════════════ */
.home-group { margin-bottom: 8px; }
.home-group-label {
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .06em;
  color: var(--dim); text-transform: none;
  padding: 0 4px 8px; margin-top: 26px;
  display: flex; align-items: center; gap: 8px;
}
.home-group-label::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.home-group:first-of-type .home-group-label { margin-top: 8px; }

/* 접을 수 있는 섹션 — 제목줄 자체가 토글 버튼이다. */
.sec-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; padding: 0 0 4px; cursor: pointer;
  color: var(--text); font-family: inherit; text-align: left;
}
.sec-toggle-title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; }
.sec-toggle-note { font-size: var(--fs-xs); color: var(--dim); font-weight: 600; }
.sec-toggle-icon {
  margin-left: auto; font-size: var(--fs-lg); color: var(--muted);
  transition: transform .2s; flex-shrink: 0;
}
.sec-toggle[aria-expanded="false"] .sec-toggle-icon { transform: rotate(-90deg); }
.sec-toggle[aria-expanded="false"] + .sec-body { display: none; }
.sec-toggle:hover .sec-toggle-icon { color: var(--text); }

/* "더 보기" — 목록을 상위 N개만 보여주고 나머지를 접을 때 */
.sec-more {
  display: block; width: 100%; margin-top: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 14px; font-size: var(--fs-xs); font-weight: 700; color: var(--muted);
  font-family: inherit; cursor: pointer; transition: .18s;
}
.sec-more:hover { color: var(--text); border-color: var(--border-glow); }
@media (max-width: 720px) {
  .sec-toggle-title { font-size: var(--fs-xl); }
  .sec-toggle-note { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   관심종목 전용 페이지 (/watchlist) — UI/UX 진단보고서 3-1·7장
   홈 카드엔 5개만 나오고 정렬·필터가 없어 "갈 곳이 없으니 모든 기능이
   홈으로 몰린다"는 지적을 받았다.
   ═══════════════════════════════════════════════════════════════════ */
/* 섹션 제목 옆 "전체보기 →" */
.sec-link {
  background: none; border: none; padding: 0; margin-left: 10px;
  font-family: inherit; font-size: var(--fs-xs); font-weight: 700;
  color: var(--accent2); cursor: pointer; vertical-align: middle;
}
.sec-link:hover { text-decoration: underline; }

.wl-controls { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 6px; }
.wl-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.wl-label {
  font-size: var(--fs-2xs); font-weight: 800; color: var(--dim);
  min-width: 30px; letter-spacing: .04em;
}
.wl-chip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 13px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted);
  font-family: inherit; cursor: pointer; transition: .16s; white-space: nowrap;
}
.wl-chip:hover { color: var(--text); border-color: var(--border-glow); }
.wl-chip.active { background: var(--grad); color: #fff; border-color: transparent; font-weight: 700; }
@media (max-width: 720px) {
  .wl-controls { gap: 6px; }
  .wl-group { gap: 5px; }
  .wl-chip { padding: 5px 10px; font-size: var(--fs-2xs); }
}

/* ═══════════════════════════════════════════════════════════════════
   인라인 SVG 아이콘 (UI/UX 진단보고서 4-3)
   ───────────────────────────────────────────────────────────────────
   이모지는 운영체제·브라우저마다 모양과 색이 달라 디자인 톤을 통제할 수 없고,
   스크린리더가 "차트 증가 이모지"처럼 그대로 읽는다. 화면 골격(네비·섹션 제목·
   아이콘 버튼)만 SVG로 교체했다 — 🟢🔴 판단 티어처럼 색으로 상태를 전달하는
   것들은 선형 아이콘으로 바꾸면 정보가 줄어 그대로 뒀다.
   ═══════════════════════════════════════════════════════════════════ */
.i {
  width: 1em; height: 1em;
  vertical-align: -0.14em;
  flex-shrink: 0;
  /* stroke=currentColor라 글자색·테마를 그대로 따라간다 */
  color: inherit;
}
/* 섹션 제목의 아이콘은 본문보다 살짝 작게 — 이모지보다 SVG가 시각적으로 커 보인다 */
h2 > .i, h3 > .i, .sec-toggle-title > .i { width: .92em; height: .92em; opacity: .85; }
.home-group-label > .i { width: 1.05em; height: 1.05em; }
.logo > .i { width: .95em; height: .95em; color: var(--accent2); }
.icon-btn > .i { width: 1.05em; height: 1.05em; display: block; }
