/* style.css 3분할 2/3 — 반응형·Phase A/B 모바일 카드·announce·인증 (2026-07-23).
   로드 순서 의무: base → mobile → domain. mobile-cards 결합점 포함 — 경계 이동 금지. */
/* ════════════════════════════
   반응형
════════════════════════════ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .four-col   { grid-template-columns: repeat(2, 1fr); }
  .price-trio { grid-template-columns: repeat(2, 1fr); }
}

/* 태블릿·노트북(1500px 이하) — 덜 중요한 컬럼 숨겨 TOP 15 가로 스크롤 방지
   컨테이너 max-width가 1200px이라 1281~1499px 뷰포트도 실제 테이블 공간은
   1128px. 14컬럼이 빠듯해서 실제 데이터 폭(긴 종목명·정렬 아이콘 포함) 기준
   넘치는 경우가 있어 브레이크포인트 상향. */
@media (max-width: 1500px) {
  .hide-tablet { display: none !important; }
}

/* 햄버거 전환 break point — 1024px 이하에서 nav를 햄버거 메뉴로 전환.
   회원/관리자 메뉴가 8개라 769~1280px 데스크톱에서 폭 초과되어 body 가로 스크롤이
   생기는 문제 해결. iPad 가로(1024px) 이상에서만 nav 풀 노출, 그 이하는 햄버거. */
@media (max-width: 1024px) {
  .menu-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute; top: 54px; left: 0; right: 0;
    background: #2a251e; /* PR1 — 셸 톤 */
    flex-direction: column; padding: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    z-index: 99;
  }
  .main-nav.open { display: flex; }
  .site-header .container { position: relative; }
}

@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hide-mobile { display: none !important; }
  .section { padding: 14px; }

  .stock-header-top { flex-direction: column; }
  .stock-price-block { text-align: left; }
  .stock-big-price { font-size: 24px; }

  .form-row { flex-direction: column; align-items: flex-start; }
  .form-input { width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none !important; }
  .index-bar__items { gap: 12px; }
  .stat-value { font-size: 20px; }
  .price-trio { grid-template-columns: 1fr 1fr; }
  .price-trio-value { font-size: 16px; }
}

/* ── 모바일 회귀 보정 (2026-04-26) ──────────────────────────────────
   사용자 제보: 다크 강제 변환 / 보유 종목 표 가로 스크롤 / 가격갱신 버튼 글자 깨짐.
   - color-scheme: light 메타로 다크 변환 차단(base.html). 여기선 시스템 차원 fallback.
   - 보유 종목 표는 모바일에서 컬럼 추가 압축(현재가·미니바·유형·상태 hide-sm/mobile).
   - body·section 명시 배경으로 다크 강제 변환 추가 보호.
*/
.show-mobile { display: none; }
@media (max-width: 768px) {
  .show-mobile { display: inline; }
}
html, body {
  /* PR1 — 셸 배경. 강제 다크 변환 차단 가드는 유지(명시 hex·color-scheme light) —
     콘텐츠는 .main-content 페이퍼 패널이 라이트 담당 */
  background-color: #232019 !important;
  color-scheme: only light; /* 'only' 격상 (7/12 2차) — auto-dark 강제 opt-out */
  /* Samsung Internet/Edge의 강제 다크 변환 차단 — 일부 환경에서 color-scheme 메타만으로 부족 */
  forced-color-adjust: none;
}
/* 핵심 카드/표/섹션은 색상 자동 변환 차단 + 명시 배경 + 명시 텍스트 색 */
.section, .mypage-card, .pfp-hero, .login-prompt, .signal-item, .ai-box,
.donut-side, .price-trio-card, .analysis-card,
.data-table, .data-table thead, .data-table tbody, .data-table tr,
.toggle-row, .market-badge, .badge,
#alertPreviewBackdrop, #cmpModalBackdrop, .ap-modal, .cmp-modal,
.fb-float-card, .buy-signal-card, .stock-news-card,
.dash-card, .admin-toolbar, .notice-line, .observe-group,
.dash-subnav, .subnav-link,
.dash-greet, .dash-hero--compact, .sentiment-context,
.signal-chips, .sig-chip,
.dm-section, .dm-heatmap-grid, .dm-cell, .dm-tooltip,
.dm-flow-wrap, .dm-flow-key,
.main-content {
  forced-color-adjust: none;
  background-clip: padding-box;
}
/* 표 자체에 라이트 강제 — 다크 변환된 환경에서 검은 배경·검은 글자 회피 */
.data-table { background: #fff !important; color: #1a1a1a !important; }
.data-table th { background: #f4f1e9 !important; color: #6b7280 !important; }
.data-table tbody tr { background: #fff !important; }
.data-table tbody tr:hover { background: #fff0f0 !important; }
/* 섹션/카드 — 흰 배경 + 어두운 텍스트 강제 */
.section, .mypage-card, .pfp-hero, .donut-side {
  background-color: #fff !important;
  color: #1a1a1a !important;
}
/* pfp-hero는 손익에 따라 그라디언트가 들어가 있어 별도 처리: 부모 인라인이 우선 적용되도록 background-color만 안 강제 */
.pfp-hero { background-color: initial !important; }

@media (max-width: 768px) {
  /* 보유 주식 표 — 종목명 컬럼을 sticky-left로 고정 (가로 스크롤 시 안 잘림) */
  .holdings-layout .data-table { font-size: 12.5px; }
  .holdings-layout .data-table th:first-child,
  .holdings-layout .data-table td:first-child {
    position: sticky; left: 0; z-index: 2;
    background: #fff;
    box-shadow: 2px 0 4px -2px rgba(0,0,0,.08);
    min-width: 110px; max-width: 120px;
  }
  .holdings-layout .data-table thead th:first-child {
    background: var(--table-head, #f0f3f8);
  }
  /* 표 padding 축소 — 모바일 전용 */
  .holdings-layout .data-table th,
  .holdings-layout .data-table td {
    padding: 8px 6px;
  }
  /* 도넛 섹션 폭 보정 — 모바일에선 표 아래로 떨어진 뒤 컨테이너 폭 가득 */
  .donut-side { width: 100%; box-sizing: border-box; }
  .donut-side .chart-wrap { height: 200px; max-width: 280px; margin: 0 auto 10px; }

  /* 종목 스크리닝·내 포트폴리오 페이지의 큰 표도 동일 sticky-left 적용 */
  .table-wrap > table.data-table th:first-child,
  .table-wrap > table.data-table td:first-child {
    position: sticky; left: 0; z-index: 2;
    background: #fff;
    box-shadow: 2px 0 4px -2px rgba(0,0,0,.08);
  }
  .table-wrap > table.data-table thead th:first-child {
    background: var(--table-head, #f0f3f8);
  }

  /* 섹션 타이틀 — 모바일에선 줄바꿈 허용 (h2 + 우측 액션 버튼들) */
  .section-title { flex-wrap: wrap; gap: 8px; }
  .section-title h2 { font-size: 16px; }

  /* 보유 종목 비중 도넛 옆 leg ul — 모바일에서 좌측으로 정렬 */
  .donut-list { max-height: 180px; }
}

/* ══════════════════════════════════════════════════════════════════
   Phase A — 반응형 강화 7페이지 (2026-04-26)
   ══════════════════════════════════════════════════════════════════
   stocks/analysis/portfolio/mypage/my-formula/admin/board 모바일 보정.
   DOM 구조 변경 없이 CSS만으로 처리. PC는 영향 없음.
*/
@media (max-width: 768px) {
  /* ── 공통: 컨테이너·섹션 패딩 축소 ─────────────────────────── */
  .container { padding: 0 12px; }
  .section { padding: 12px; margin-bottom: 14px; }
  .section h2 { font-size: 16px; line-height: 1.3; }
  .section h3 { font-size: 14px; }

  /* ── 1. 분석 페이지 (/analysis) ──────────────────────────── */
  /* 진입/손절/목표/R:R 4컬럼 → 모바일 2컬럼 */
  .price-trio { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
  .price-trio-card { padding: 12px 10px 10px; }
  .price-trio-value { font-size: 17px; }
  .price-trio-label { font-size: 10.5px; margin-bottom: 6px; }
  .price-trio-sub { font-size: 11px; margin-top: 4px; }

  /* 종목 헤더 hero — 종목명·가격·뱃지가 한 줄에 안 들어감 */
  .stock-header-top { gap: 8px; }
  .stock-header-name { font-size: 22px; }
  .stock-big-price { font-size: 22px; }
  .grade-chip { font-size: 11px; padding: 3px 8px; margin-left: 0; }

  /* breakdown(예상 수익 분해 등) 가로 막대 - 모바일에서 살짝 축소 */
  .breakdown-item { font-size: 12px; }
  .breakdown-item .b-bar { height: 6px; }

  /* analysis-card grid - 2열 → 1열 */
  .analysis-card { padding: 12px; }
  .analysis-card h3 { font-size: 13px; }

  /* 가격 차트 - 모바일 높이 축소 */
  .chart-wrap.price-chart-wrap { height: 240px; }
  .chart-wrap { height: 180px; }
  .return-chart-wrap { max-height: 280px; }

  /* ── 2. 종목 스크리닝 (/stocks) ──────────────────────────── */
  /* 매수 신호 배너 그리드 - 모바일 1열 */
  .buy-signal-grid { gap: 8px; }
  .buy-signal-card { padding: 10px 12px; }

  /* 필터 영역(.screening-filters) - 모바일에서 폰트·패딩 축소 (wrap 유지) */
  .screening-filters {
    padding: 10px 12px !important; gap: 6px !important;
  }
  .screening-filters .btn { font-size: 11.5px; padding: 4px 9px; }
  .screening-filters input, .screening-filters select {
    font-size: 12.5px; padding: 6px 10px;
  }
  .screening-filters input[id="filterName"],
  .screening-filters input[id="filterCode"] { flex: 1 1 100% !important; min-width: 0 !important; }

  /* 비교 모드 바 - 모바일에선 stack */
  #cmpBar { flex-wrap: wrap; padding: 8px 10px; font-size: 12px; }
  #cmpBar > * { flex-shrink: 0; }

  /* 비교 모달 - 모바일 풀스크린 시트 */
  .cmp-modal { max-width: 100%; max-height: 95vh; border-radius: 10px 10px 0 0; }
  .cmp-table { font-size: 12px; }
  .cmp-table th, .cmp-table td { padding: 6px 6px; }
  .cmp-stock-head { padding: 8px 4px !important; }

  /* ── 3. 내 포트폴리오 (/portfolio) ──────────────────────── */
  /* hero 손익 카드 - 1열 stack */
  .pfp-hero { grid-template-columns: 1fr !important; gap: 12px !important; padding: 14px !important; }
  .pfp-hero-pnl-value { font-size: 24px !important; }
  .pfp-hero-metrics { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pfp-hero-metric-value { font-size: 15px !important; }
  .pfp-hero-metric-label { font-size: 10px !important; }

  /* 보유 종목 표 - 분할 익절 진행 바는 표 외 카드처럼 떨어뜨림 */
  .pfp-table { font-size: 11.5px; }
  .pfp-table th, .pfp-table td { padding: 7px 6px; }
  .pfp-targets-cell { font-size: 10px; }

  /* ── 4. 마이페이지 (/mypage) ──────────────────────────── */
  /* mypage-card 패딩 축소 + ATR 슬라이더 wrap + 박스 overflow 차단 */
  .mypage-card {
    padding: 14px 14px 12px;
    overflow-wrap: break-word; word-break: break-word; min-width: 0;
  }
  .mypage-card-title { font-size: 14px; }
  .mypage-card-desc { font-size: 11.5px; }
  /* 토글 행은 모바일에서 수직 stack — flex-wrap + 자식 폭 100% */
  .toggle-row {
    flex-wrap: wrap !important;
    padding: 10px 12px !important;
    gap: 8px !important;
    min-width: 0;
    box-sizing: border-box;
  }
  .toggle-row > .toggle-row-label {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    max-width: 100%;
  }
  /* 토글 라벨 우측의 control(스위치/select/슬라이더) 그룹 — 한 줄 가득 */
  .toggle-row > .switch,
  .toggle-row > select,
  .toggle-row > div:not(.toggle-row-label) {
    flex: 0 0 auto;
    margin-left: 0;
  }
  .toggle-row-title { font-size: 13px; line-height: 1.4; }
  .toggle-row-desc {
    font-size: 11.5px; line-height: 1.5;
    overflow-wrap: break-word; word-break: break-word;
  }
  /* mypage 카드 안 모든 인라인 슬라이더·input 그룹도 폭 보호 */
  .mypage-card input[type="range"] { max-width: 100%; min-width: 0; flex: 1 1 auto; }
  .mypage-card input[type="date"], .mypage-card select { max-width: 100%; min-width: 0; }

  /* 미리보기 모달 모바일 폭 */
  .ap-modal { max-width: 100%; max-height: 95vh; border-radius: 10px 10px 0 0; }
  .ap-tg-pre { font-size: 11.5px; padding: 10px; }
  .ap-email-frame { min-height: 320px; }

  /* 플로팅 피드백 카드 - 화면 가득 - 이미 처리됨 */

  /* ── 5. 마이공식 (/my-formula) ──────────────────────────── */
  /* 빌더 행: 필드·연산자·값을 모바일에선 wrap (커스텀 셀렉터·기본 셀렉터 모두) */
  .formula-row, .mf-row, .mf-condition-row { flex-wrap: wrap; gap: 6px; }
  .formula-row select, .formula-row input,
  .mf-row select, .mf-row input,
  .mf-condition-row select, .mf-condition-row input {
    min-width: 0; flex: 1 1 calc(50% - 4px);
  }
  .preset-grid, .mf-preset-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .mf-preset { padding: 10px; }

  /* mf-* 카드 박스 폭 보호 — 자식이 부모 폭을 넘지 않도록 */
  .mf-wrap, .mf-card, .mf-active, .mf-builder {
    max-width: 100%; box-sizing: border-box;
    overflow-wrap: break-word;
  }
  .mf-card, .mf-active { padding: 14px; }
  .mf-builder { padding: 12px; }
  /* mf-cond-row 그리드 자식의 min-width: 0 (grid 자식 기본 min-width: auto 회피) */
  .mf-cond-row { gap: 6px !important; }
  .mf-cond-row > select,
  .mf-cond-row > input,
  .mf-cond-row > .mf-remove {
    min-width: 0 !important; max-width: 100%;
  }
  .mf-cond-row select, .mf-cond-row input { font-size: 12.5px; padding: 6px 8px; }
  /* mf-active-row(활성 공식 select + 토글 + 버튼)가 좁은 화면에서 wrap */
  .mf-active-row { flex-wrap: wrap; gap: 8px; }
  .mf-active-row > select { flex: 1 1 100%; min-width: 0; }
  .mf-active-row > a, .mf-active-row > .btn { margin-left: 0 !important; }

  /* ── 6. 관리자 페이지 (/admin/*) ──────────────────────── */
  /* 와이드 표는 모바일에서 가로 스크롤 + sticky-left 유지.
     상단에 "PC 권장" 배너 추가용 클래스. */
  .admin-mobile-warn {
    background: #fef3c7; border: 1px solid #fde68a;
    color: #92400e; border-radius: 8px;
    padding: 10px 14px; font-size: 12px;
    margin-bottom: 12px; display: block;
  }
  .admin-mobile-warn::before { content: "💻 "; }

  /* 관리자 표는 폰트 더 축소 */
  .admin-table .data-table { font-size: 11.5px; }
  .admin-table .data-table th, .admin-table .data-table td { padding: 7px 6px; }

  /* VCP 튜닝 차트 - 모바일에선 폭 보정 */
  .vcp-tuning-chart { max-width: 100%; overflow: hidden; }

  /* ── 7. 게시판 (/board) ──────────────────────────────── */
  /* 본문 announce-* 카드 모바일 패딩 */
  .announce-hero { padding: 20px 16px 16px; }
  .announce-hero h2 { font-size: 18px; }
  .announce-hero p { font-size: 12.5px; }
  .announce-feature-grid { grid-template-columns: 1fr !important; gap: 8px; }
  .announce-feature { padding: 12px; }
  .announce-section { margin: 14px 0 10px; }
  .announce-section h3 { font-size: 14px; }
  .announce-callout { padding: 10px 12px; font-size: 12.5px; }

  /* 게시판 목록 — 제목 셀 nowrap 해제로 자연 줄바꿈 (가로 스크롤 차단) */
  /* th는 nowrap 유지(짧음). td만 normal로 풀어 제목·이름이 줄바꿈되게 함 */
  .data-table td { white-space: normal; word-break: break-word; }
  /* 단, 숫자·뱃지 등 짧은 셀의 mono 셀은 강제 nowrap 유지 */
  .data-table td.mono, .data-table td.ta-c, .data-table td.ta-r {
    white-space: nowrap;
  }
  /* 첫 컬럼(종목명·제목)은 줄바꿈 허용 (sticky-left와 충돌 없음) */
  .data-table td:first-child { white-space: normal; }

  /* 내 포트폴리오·관심 종목 표 — 인라인 min-width 무력화로 가로 스크롤 차단 */
  /* (스크리닝 /stocks의 의도된 와이드 뷰는 영향 받지 않음 — 거긴 인라인 min-width 없음) */
  .pfp-table, .watchlist-table {
    min-width: 0 !important; width: 100% !important;
    table-layout: auto;
  }
  /* 부모 .table-wrap도 인라인 overflow-x를 풀어 가로 스크롤 자체 제거 */
  .pfp-table-wrap, .watchlist-table-wrap {
    overflow-x: visible !important;
  }
  /* 관심 종목 표 — 컬럼별 hide-mobile 클래스로 처리 (nth-child 의존 제거) */

  /* 글쓰기 Quill 에디터 - 모바일 폭 가득 */
  #editor, .ql-container, .ql-toolbar { font-size: 14px; }
  .ql-toolbar { flex-wrap: wrap; }

  /* ── 공통: form-group·form-row 모바일 stack ───────────── */
  .form-group { margin-bottom: 12px; }
  .form-group label { font-size: 12.5px; }
  .form-input { font-size: 14px; padding: 9px 10px; }

  /* ── 공통: 큰 모달 backdrop의 padding 줄여 화면 가득 ────── */
  .ap-backdrop, .cmp-backdrop { padding: 10px; align-items: flex-end; }

  /* ── 공통: 가로 스크롤 인디케이터 thin ───────────── */
  .table-wrap::-webkit-scrollbar { height: 6px; }
  .table-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 3px; }
}

@media (max-width: 480px) {
  /* 매우 좁은 화면(아이폰 SE 등) — 4컬럼 hero metric을 2x2로 */
  .pfp-hero-metrics { grid-template-columns: 1fr 1fr !important; }
  .price-trio-value { font-size: 16px; }
  .stock-header-name { font-size: 19px; }
  .stock-big-price { font-size: 20px; }
  /* 비교 표 - 헤더 종목 셀 텍스트 축소 */
  .cmp-stock-head div:first-child { font-size: 12px !important; }
  .cmp-stock-head div:last-child { font-size: 10px !important; }
}

/* ══════════════════════════════════════════════════════════════════
   Phase B — 모바일 전용 카드 뷰 (2026-04-26)
   ══════════════════════════════════════════════════════════════════
   .mobile-cards 클래스가 붙은 <table>은 모바일에서 표 → 카드 전환.
   PC는 그대로 표 유지. 같은 DOM, CSS-only 분기.

   적용:
   - B-1 dashboard.html  단기 매수 타이밍 TOP 20
   - B-2 my_portfolio.html  보유 종목·관심 종목
   - B-3 stocks.html  종목 스크리닝
*/
@media (max-width: 768px) {
  /* 표 컨테이너 — 가로 스크롤 제거 */
  .mobile-cards-wrap {
    overflow-x: visible !important;
    padding: 0;
  }
  .mobile-cards-wrap .table-scroll-top { display: none !important; }

  /* 표·thead·tbody·tr·td → block 변환 */
  table.mobile-cards,
  table.mobile-cards thead,
  table.mobile-cards tbody,
  table.mobile-cards tr,
  table.mobile-cards td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  /* 헤더(thead)·정렬 가능 컬럼은 카드 뷰에서 숨김 */
  table.mobile-cards thead { display: none !important; }
  /* min-width 인라인 무력화 (my_portfolio의 880/960px 인라인 등) */
  table.mobile-cards { min-width: 0 !important; }

  /* 각 tr을 카드처럼 — 흰 배경, 보더, 패딩, 그림자 */
  table.mobile-cards tbody tr {
    background: #fff !important;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(17,24,39,.04);
    border-bottom: 1px solid #e5e7eb;  /* tr의 td border 덮음 */
  }
  table.mobile-cards tbody tr:last-child { margin-bottom: 0; }
  /* 매수/보유 신호 카드 강조 색 */
  table.mobile-cards tbody tr.buy-signal-row { border-left: 4px solid #16a34a; padding-left: 10px; }
  table.mobile-cards tbody tr.vcp-a-signal-row { border-left: 4px solid #fb923c; padding-left: 10px; }
  table.mobile-cards tbody tr.strong-signal-row { border-left: 4px solid #dc2626; padding-left: 10px; }
  table.mobile-cards tbody tr.vcp-b-signal-row { border-left: 4px solid #facc15; padding-left: 10px; }
  table.mobile-cards tbody tr.my-holding-row { border-left: 4px solid #eab308; padding-left: 10px; }

  /* 각 td → 카드 안 한 줄 */
  table.mobile-cards tbody td {
    border: 0 !important;
    padding: 3px 0 !important;
    text-align: left !important;
    white-space: normal !important;
    background: transparent !important;
    position: static !important; /* sticky-left 해제 */
    box-shadow: none !important;
    min-width: 0 !important; max-width: 100% !important;
    font-size: 12px; /* C안 PR② 판독성 — 실측 값 10px는 터치 권장 최소(12px) 미달 (2026-07-12) */
  }
  /* 빈 td 또는 hide-mobile/hide-sm 가져간 td는 카드에서 자리 안 차지 */
  table.mobile-cards tbody td:empty { display: none; }

  /* td에 data-mobile-label 속성을 주면 ::before로 라벨 표시 */
  table.mobile-cards tbody td[data-mobile-label]::before {
    content: attr(data-mobile-label) " : ";
    color: #6b7280; font-size: 11px; font-weight: 600;
    margin-right: 4px;
  }

  /* 첫 번째 td(순위) — 카드 우상단 작은 뱃지 (dashboard) */
  table.mobile-cards tbody td.rank-num {
    display: inline-block !important; width: auto !important;
    font-size: 10px; font-weight: 700; color: #6b7280;
    background: #f3f4f6; padding: 2px 8px !important;
    border-radius: 99px;
    margin-bottom: 6px;
  }
  table.mobile-cards tbody td.rank-num::before { content: "#"; color: #9ca3af; }

  /* 종목명 td (.stock-name 또는 .stock-name-link 포함) — 큰 글씨 */
  /* dashboard: rank-num + 종목 td(2번째) / portfolio: 종목 td가 1번째 */
  table.mobile-cards tbody td:has(.stock-name),
  table.mobile-cards tbody td:has(.stock-name-link) {
    font-size: 15px; font-weight: 700; color: #111827;
    margin-bottom: 4px;
    padding: 4px 0 !important;
  }
  table.mobile-cards tbody .stock-code { font-size: 11px; color: #9ca3af; font-weight: 400; margin-left: 4px; }
  table.mobile-cards tbody .stock-name { font-weight: 700; }

  /* 가격·등락률 row를 inline 배치 */
  table.mobile-cards tbody td.price-row,
  table.mobile-cards tbody td.change-row {
    display: inline-block !important;
    width: auto !important;
    margin-right: 14px;
  }
  table.mobile-cards tbody td.change-row { font-weight: 700; }

  /* 평가손익 셀 — 카드 우측 큰 글씨 박스 (my_portfolio) */
  table.mobile-cards tbody td.profit-cell {
    background: #f9fafb;
    border-radius: 6px;
    padding: 8px 10px !important;
    margin-top: 6px;
    text-align: right !important;
    font-size: 14px;
  }
  table.mobile-cards tbody td.profit-cell::before {
    content: "평가손익";
    display: block;
    font-size: 10px; color: #6b7280; font-weight: 600;
    text-align: left;
    margin-bottom: 2px;
  }

  /* badge·empty 셀 미니멀 */
  .badge-empty { color: #d1d5db; font-size: 11px; }

  /* 비교 모드 체크박스 셀 (스크리닝) — 카드 우상단 작은 inline */
  table.mobile-cards tbody td.cmp-cell {
    display: inline-block !important;
    width: auto !important; min-width: 0 !important;
    margin-right: 8px;
    padding: 0 !important;
  }
  table.mobile-cards thead .cmp-cell { display: none !important; } /* 헤더는 카드 뷰에서 어차피 숨김 */

  /* 시장 뱃지 셀 — 종목명 옆 inline */
  table.mobile-cards tbody td:has(.market-badge) {
    display: inline-block !important;
    width: auto !important;
    margin-left: 4px;
    padding: 0 !important;
  }
  table.mobile-cards tbody td:has(.market-badge)::before { display: none; }

  /* PEAD·뱃지 등 짧은 td는 inline */
  table.mobile-cards tbody td:has(> .badge) {
    display: inline-block !important;
    width: auto !important;
    margin-right: 8px;
    padding: 0 !important;
  }

  /* 카드 안 a (analysis 링크) — 블록 전체 클릭 가능.
     span 변형 = 비회원 마스킹 행의 앵커 미렌더 대체 (2026-07-23) — 동일 레이아웃 유지 */
  table.mobile-cards tbody tr a.stock-name-link,
  table.mobile-cards tbody tr span.stock-name-link {
    display: block;
    color: inherit;
  }

  /* 진입가/손절가/목표가는 hide-mobile으로 카드에서 안 보이지만, 보이는 것이라면 mini chip 처리 */
  table.mobile-cards tbody td.price-col {
    display: inline-block !important;
    width: auto !important;
    margin-right: 10px;
    font-size: 12px;
  }

  /* admin_users 작업 버튼 그룹 — 카드 너비 안에서 자연스럽게 wrap (좌측 정렬). */
  table.mobile-cards tbody td.admin-user-actions {
    margin-top: 6px;
    padding-top: 6px !important;
    border-top: 1px dashed #e5e7eb !important;
  }
  table.mobile-cards tbody td.admin-user-actions > div {
    justify-content: flex-start !important;
    gap: 6px !important;
  }
}

/* ── 게시판 공지글 디자인 클래스 (announce-*) ───────────────────────────
   _bleach가 인라인 style을 제거하므로 본문은 클래스로만 디자인.
   Claude 자동 공지 등록 + 관리자 수동 공지 모두 재사용. */
.announce-hero {
  background: #eef2ff; /* PR0 — 플랫 */
  border: 1px solid #c7d2fe; border-radius: 14px;
  padding: 28px 28px 24px; margin: 0 0 18px;
  text-align: center;
}
.announce-hero h2 {
  font-size: 22px; font-weight: 800; color: #312e81;
  margin: 0 0 6px;
}
.announce-hero p {
  font-size: 14px; color: #4c1d95; margin: 0;
}
.announce-hero .announce-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  background: #6366f1; color: #fff; padding: 3px 10px;
  border-radius: 99px; letter-spacing: 0.5px; margin-bottom: 12px;
}

.announce-section { margin: 22px 0 14px; }
.announce-section h3 {
  font-size: 15px; font-weight: 700; color: #1f2937;
  display: flex; align-items: center; gap: 8px;
  border-left: 3px solid #6366f1; padding-left: 10px;
  margin: 0 0 10px;
}

.announce-feature-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px; margin: 10px 0;
}
.announce-feature {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 14px;
}
.announce-feature .announce-feature-icon { font-size: 22px; }
.announce-feature .announce-feature-title {
  font-size: 13px; font-weight: 700; color: #111827;
  margin: 6px 0 4px;
}
.announce-feature .announce-feature-desc {
  font-size: 12px; color: #6b7280; line-height: 1.5;
}

.announce-tag-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0;
}
.announce-tag {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 6px;
  background: #eef2ff; color: #4338ca;
}
.announce-tag-success { background: #dcfce7; color: #166534; }
.announce-tag-warn    { background: #fef3c7; color: #92400e; }
.announce-tag-info    { background: #e0f2fe; color: #075985; }

.announce-callout {
  background: #f9fafb; border-left: 4px solid #6366f1;
  border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 12px 0;
}
.announce-callout.warn { background: #fffbeb; border-left-color: #f59e0b; }
.announce-callout.success { background: #f0fdf4; border-left-color: #10b981; }
.announce-callout p { margin: 0; font-size: 13px; line-height: 1.6; color: #374151; }

.announce-step-list {
  list-style: none; padding: 0; margin: 8px 0; counter-reset: announce-step;
}
.announce-step-list li {
  position: relative; padding: 10px 12px 10px 42px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  margin-bottom: 8px; font-size: 13px; color: #374151; line-height: 1.6;
  counter-increment: announce-step;
}
.announce-step-list li:before {
  content: counter(announce-step);
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: #6366f1; color: #fff;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

.announce-footer {
  margin-top: 24px; padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px; color: #9ca3af; text-align: center;
}

.announce-divider {
  height: 1px; border: 0; margin: 22px 0;
  background: linear-gradient(90deg, transparent, #c7d2fe 30%, #c7d2fe 70%, transparent);
}

/* 본문 ul/ol 가독성 */
.announce-section ul,
.announce-section ol { padding-left: 22px; margin: 8px 0; }
.announce-section ul li,
.announce-section ol li { margin: 6px 0; font-size: 13px; line-height: 1.6; color: #374151; }
.announce-section ul li strong,
.announce-section ol li strong { color: #111827; }

/* ── 인증 페이지 ── */
.auth-wrap { display:flex; justify-content:center; align-items:flex-start; padding:40px 16px; }
.auth-card { background:var(--white); border:1px solid var(--border); border-radius:12px; padding:40px; width:100%; max-width:420px; box-shadow:var(--shadow); }
.auth-card-wide { max-width:580px; }
.auth-logo { font-size:24px; font-weight:900; color:var(--primary); text-align:center; margin-bottom:8px; }
.auth-title { font-size:20px; font-weight:700; text-align:center; margin-bottom:4px; }
.auth-subtitle { font-size:13px; color:var(--text-muted); text-align:center; margin-bottom:24px; }
.auth-footer { text-align:center; margin-top:20px; font-size:14px; color:var(--text-muted); }
.auth-footer a { color:var(--primary); font-weight:600; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-group { margin-bottom:16px; }
.form-label { display:block; font-size:13px; font-weight:600; margin-bottom:6px; }
.form-hint { font-weight:400; color:var(--text-muted); font-size:12px; }
.form-input { width:100%; padding:9px 12px; border:1px solid var(--border); border-radius:6px; font-size:14px; box-sizing:border-box; transition:border .2s; }
.form-input:focus { outline:none; border-color:var(--primary); }
.form-input:disabled { background:#f3f4f6; cursor:not-allowed; }
.req { color:var(--up); }
.btn-full { width:100%; justify-content:center; }
.privacy-box { border:1px solid var(--border); border-radius:8px; padding:16px; margin-bottom:20px; }
.privacy-title { font-weight:700; font-size:14px; margin-bottom:10px; }
.privacy-content { font-size:13px; color:var(--text-muted); line-height:1.7; max-height:120px; overflow-y:auto; margin-bottom:12px; }
.privacy-content p { margin:0 0 4px; }
.checkbox-label { display:flex; align-items:center; gap:8px; font-size:14px; cursor:pointer; }
.checkbox-label input[type=checkbox] { width:16px; height:16px; accent-color:var(--primary); cursor:pointer; }
.alert { padding:12px 16px; border-radius:8px; margin-bottom:16px; font-size:14px; }
.alert-error   { background:#fde8e8; color:#991b1b; border:1px solid #fca5a5; }
.alert-success { background:#f0fdf4; color:#166534; border:1px solid #86efac; }

/* 네비게이션 인증 버튼 */
.nav-login   { font-weight:600; }
.nav-logout  { color:var(--text-muted) !important; }
.nav-register { margin-left:4px; }

/* 로그인 유도 배너 */
.login-prompt { display:flex; align-items:center; justify-content:space-between; gap:16px; background:var(--primary-pale); border:1px solid #fca5a5; border-radius:10px; padding:16px 20px; margin-bottom:16px; flex-wrap:wrap; }

/* 탭 바 */
.tab-bar { display:flex; gap:4px; margin-bottom:16px; border-bottom:2px solid var(--border); padding-bottom:0; }
.tab-btn { background:none; border:none; padding:8px 18px; font-size:14px; font-weight:600; cursor:pointer; color:var(--text-muted); border-bottom:2px solid transparent; margin-bottom:-2px; border-radius:6px 6px 0 0; }
.tab-btn.active { color:var(--primary); border-bottom-color:var(--primary); }
.tab-count { background:var(--primary-pale); color:var(--primary); border-radius:10px; padding:1px 7px; font-size:11px; margin-left:4px; }
.tab-panel.hidden { display:none; }

/* 게시판 */
.board-title-link { color:var(--text); text-decoration:none; font-weight:500; }
.board-title-link:hover { color:var(--primary); text-decoration:underline; }
.board-notice-title { font-weight:700; }
.board-content img { max-width:100%; height:auto; border-radius:6px; margin:8px 0; }

/* 토글 스위치 */
.toggle-switch { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.toggle-switch input { opacity:0; width:0; height:0; }
.toggle-slider { position:absolute; cursor:pointer; inset:0; background:#d1d5db; border-radius:24px; transition:.25s; }
.toggle-slider::before { content:''; position:absolute; width:18px; height:18px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.25s; }
.toggle-switch input:checked + .toggle-slider { background:var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform:translateX(20px); }

/* 토글 스위치 (alt 네이밍 — .switch + .slider, mypage/notifications 공용) */
.switch { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.switch input { opacity:0; width:0; height:0; }
.switch .slider {
  position:absolute; cursor:pointer; top:0; left:0; right:0; bottom:0;
  background:#d1d5db; border-radius:24px; transition:.25s;
}
.switch .slider::before {
  content:''; position:absolute; height:18px; width:18px; left:3px; bottom:3px;
  background:#fff; border-radius:50%; transition:.25s;
  box-shadow:0 2px 4px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background:#3b82f6; }
.switch input:checked + .slider::before { transform:translateX(20px); }
.switch input:focus-visible + .slider { box-shadow:0 0 0 3px rgba(59,130,246,.3); }

/* 토글 라인 행 (mypage·notifications 공용) */
.toggle-row {
  display:flex; align-items:center; gap:12px;
  padding:12px 14px;
  border:1px solid #f3f4f6; border-radius:10px;
  transition:background .15s;
}
.toggle-row:hover { background:#f9fafb; }
.toggle-row + .toggle-row { margin-top:8px; }
.toggle-row-label { flex:1; min-width:0; }
.toggle-row-title { display:block; font-size:14px; font-weight:600; color:#1f2937; }
.toggle-row-desc  { display:block; font-size:12px; color:#6b7280; margin-top:2px; line-height:1.45; }

/* 섹션 내부 그룹 타이틀 (공용) */
.mp-group-title {
  font-size:12px; font-weight:700; color:#6b7280;
  text-transform:uppercase; letter-spacing:.5px;
  margin:20px 0 10px;
}
.mp-group-title:first-child { margin-top:0; }

/* 관심 종목 버튼 */
.watch-btn {
  display:inline-flex; align-items:center; gap:5px;
  padding:4px 12px; border-radius:20px;
  border:1.5px solid #d1d5db; background:#f9fafb;
  color:#6b7280; font-size:13px; font-weight:500;
  cursor:pointer; transition:all .2s; vertical-align:middle;
  margin-left:10px;
}
.watch-btn svg { fill:none; stroke:#9ca3af; stroke-width:1.8; transition:all .2s; }
.watch-btn:hover { border-color:#f59e0b; color:#b45309; background:#fffbeb; }
.watch-btn:hover svg { stroke:#f59e0b; }
.watch-btn.active { border-color:#f59e0b; background:#fef3c7; color:#92400e; }
.watch-btn.active svg { fill:#f59e0b; stroke:#f59e0b; }
.watch-btn:active { transform:scale(0.95); }

/* 마이페이지 포트폴리오 */
.portfolio-add-form { background:var(--bg); border-radius:8px; padding:16px; margin-bottom:4px; }
.btn-icon-del { background:none; border:none; color:#c0392b; cursor:pointer; font-size:14px; padding:2px 6px; border-radius:4px; }
.btn-icon-del:hover { background:#fde8e8; }

