/* static/css/modal.css */

/* ── 유틸리티 ── */
/* 모든 .hidden 요소를 확실히 숨깁니다 */
.stock-modal .hidden {
  display: none !important;
}

/* ── 오버레이 ── */
.stock-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000; /* ★ 여기 값만 테마 모달보다 높게 */
}
.stock-modal.hidden {
  display: none;
}
.stock-modal .modal-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
}

.stock-modal .modal-overlay { z-index: 0; }
.stock-modal .modal-card    { z-index: 1; }

/* ── 카드 스타일 ── */
.stock-modal .modal-card {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 1000px;
  height: 80vh; /* 고정 높이 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── 헤더 (#333d4b) ── */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #333d4b;
  color: #fff;
  flex-shrink: 0;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.4rem;
}
.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s;
}
.modal-close:hover {
  transform: scale(1.2);
}

/* ── 오늘 통계 ── */
.modal-stats {
  display: flex;
  gap: 16px;
  padding: 16px 24px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}
.modal-stats .stat-item {
  flex: 1;
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.modal-stats .stat-label {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 4px;
}
.modal-stats .stat-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333d4b;
}
.modal-stats .stat-value.positive {
  color: #e71909;
}
.modal-stats .stat-value.negative {
  color: #115bcb;
}

/* ── 탭 네비 ── */
.stock-modal .modal-tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
  margin: 0 24px;
}
.stock-modal .modal-tabs .tab-btn {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  font-size: 1rem;
  color: #555;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  border-bottom: 3px solid transparent;
}
.stock-modal .modal-tabs .tab-btn.active {
  color: #333d4b;
  border-bottom-color: rgba(51, 61, 75, 0.7);
  font-weight: 600;
}

/* ── 탭 패널 공통 ── */
.stock-modal .tab-panel {
  flex: 1;
  padding: 16px 24px;
  overflow-y: auto;
}
.stock-modal .tab-panel.hidden {
  display: none;
}

.stock-modal .history-card {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 12px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}
.stock-modal .history-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.stock-modal .history-card .hc-date {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 4px;
}
.stock-modal .history-card .hc-theme {
  font-size: 1rem;
  font-weight: 600;
  color: #333d4b;
  margin-bottom: 6px;
}
.stock-modal .history-card .hc-change {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  background: rgba(255,255,255,0.8);
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.stock-modal .history-card .hc-change.positive {
  color: #e71909;
}
.stock-modal .history-card .hc-change.negative {
  color: #115bcb;
}
.stock-modal .history-card .hc-comment {
  font-size: 0.85rem;
  color: #555;
  margin-top: 8px;
}

/* ── 종목 메모 ── */
.stock-modal .memo-text {
  font-family: Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f7f7;
  padding: 12px;
  border-radius: 6px;
  color: #444;
  margin: 0;
}

/* ── 이미지 (데이터 없을 때) ── */
.stock-modal .image-full {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  height: 100%;
}
.stock-modal .image-full.hidden {
  display: none;
}
.stock-modal .image-full img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

/* ── 차트 컨테이너 ── */
.stock-modal #modal-chart-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-style: italic;
  background: #f0f4f8;
  border-radius: 6px;
  border: 1px dashed #ddd;
}

/* 3) 다른 모달 오버레이들은 이보다 위에서 작동하게 (예: 전체 화면 모달) */
.modal-overlay {
  /* 기존 값에 더 높은 z-index 지정 */
  z-index: 0;
}

/* ── Stock Modal 카드 테두리 ── */
.stock-modal .history-card {
  border: 1px solid #ddd;
}

.stock-modal .history-card:hover {
  border-color: #ccc;
}

/* === 기존 modal.css 하단에 추가 === */

/* 통계: 두 개 컨테이너 유지, 모바일 여백/폰트 최적화 */
.modal-stats {
  display: flex;
  gap: 12px;            /* 16 → 12 */
  padding: 12px 16px;   /* 16 24 → 12 16 */
}
.modal-stats .stat-item {
  min-width: 0;         /* 모바일에서 내용 잘림 방지 */
  align-items: center;
}

/* 왼쪽 카드: 현재가/등락률 세로 배치 */
.modal-stats .stat-item.duo {
  padding: 10px;        /* 살짝 컴팩트 */
}
.modal-stats .stat-item.duo .line-1 {
  /* 현재가(위) — 더 크게 */
  font-size: 1.25rem;   /* 1.2 → 1.25 */
  font-weight: 700;
  line-height: 1.1;
}
.modal-stats .stat-item.duo .line-2 {
  /* 등락률(아래) */
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.1;
}

/* 등락률 색상(아래 줄에 적용) */
.modal-stats #modal-current-change.positive { color: #e71909; }
.modal-stats #modal-current-change.negative { color: #115bcb; }

/* 현재가 색상은 유지(회색) — 필요시 등락 연동하려면 아래 주석 해제
.modal-stats #modal-current-price.positive { color:#e71909; }
.modal-stats #modal-current-price.negative { color:#115bcb; }
*/

/* 모바일 폰트/여백 더 줄이기 */
@media (max-width: 480px) {
  .modal-header { padding: 12px 16px; }
  .modal-header h2 { font-size: 1rem; }

  .modal-stats { gap: 10px; padding: 10px 12px; }
  .modal-stats .stat-item { padding: 10px; }
  .modal-stats .stat-item.duo .line-1 { font-size: 1rem; }
  .modal-stats .stat-item.duo .line-2 { font-size: 0.8rem; }
  .modal-stats .stat-value { font-size: 0.8rem; }
  #modal-today-volume { font-size: 1rem; }
  .stock-modal .modal-tabs { margin: 0 16px; }
  .stock-modal .tab-panel { padding: 12px 16px; }
}

/* === 최신 뉴스 한줄 스트립 === */
.stock-modal #modal-latest-news {
  padding: 8px 24px;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
  font-size: 0.9rem;
  line-height: 1.4;
  flex-shrink: 0; /* 탭 영역과 분리된 고정 높이 */
}
.stock-modal #modal-latest-news a {
  color: #0b5bd3; /* 링크 톤 */
  text-decoration: none;
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stock-modal #modal-latest-news a:hover {
  text-decoration: underline;
}

.stock-modal #tab-news .news-item {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.stock-modal #tab-news .news-item:last-child {
  border-bottom: 0;
}
.stock-modal #tab-news .news-item a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}
.stock-modal #tab-news .news-date {
  font-size: 0.78rem;
  color: #999;
}
.stock-modal #tab-news .news-title {
  font-size: 0.95rem;
  line-height: 1.35;
  word-break: break-word;
}

/* 로딩 표시 */
.stock-modal #tab-news .news-loading {
  text-align: center;
  color: #777;
  padding: 12px 0;
  font-size: 0.9rem;
}

/* 모바일 미세 조정 */
@media (max-width: 480px) {
  .stock-modal #modal-latest-news { padding: 8px 16px; }
  .stock-modal #tab-news .news-title { font-size: 0.92rem; }
}

/* ===== 한 줄 최신 뉴스 배너 ===== */
.stock-modal #modal-latest-news {
  position: relative;
  padding: 12px 24px;
  border-bottom: 1px solid #ddd;
  background: linear-gradient(90deg, #fff7e6 0%, #fff 60%);
  flex-shrink: 0;
}
.stock-modal #modal-latest-news .latest-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ad4e00;
  background: #ffe1b8;
  margin-right: 10px;
}
.stock-modal #modal-latest-news a {
  color: #0b5bd3;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stock-modal #modal-latest-news a .ext {
  opacity: 0.7;
  transition: transform .15s ease, opacity .15s ease;
}
.stock-modal #modal-latest-news a:hover .ext {
  transform: translateX(2px);
  opacity: 1;
}

.stock-modal #tab-news .news-card {
  position: relative;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  padding: 12px 14px 12px 14px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.stock-modal #tab-news .news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  border-color: #d8d8d8;
}
.stock-modal #tab-news .news-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}
.stock-modal #tab-news .nc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.stock-modal #tab-news .nc-date {
  font-size: 0.78rem;
  color: #888;
}
.stock-modal #tab-news .nc-new {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #b80000;
  background: #ffe0e0;
}
.stock-modal #tab-news .nc-title {
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.35;
  color: #222;
  display: -webkit-box;
  -webkit-line-clamp: 2;      /* 두 줄로 자르기 */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stock-modal #tab-news .nc-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.82rem;
  color: #666;
}
.stock-modal #tab-news .nc-open {
  margin-left: auto;
  color: #0b5bd3;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: .85;
  transition: opacity .15s ease, transform .15s ease;
}
.stock-modal #tab-news .news-card:hover .nc-open {
  opacity: 1;
  transform: translateX(1px);
}

/* 로딩 텍스트 */
.stock-modal #tab-news .news-loading {
  text-align: center;
  color: #777;
  padding: 10px 0;
  font-size: 0.9rem;
}

/* 모바일 미세조정 */
@media (max-width: 480px) {
  .stock-modal #modal-latest-news { padding: 10px 16px; }
  .stock-modal #tab-news .news-card { padding: 10px 12px; }
  .stock-modal #tab-news .nc-title { font-size: 0.95rem; }
}

/* 한 줄 뉴스 (상단 배너) */
#modal-latest-news {
  text-align: center;     /* 가운데 정렬 */
  padding: 10px 16px;
  background: #fefefe;
  border-bottom: 1px solid #ddd;
  font-weight: 600;
  font-size: 0.95rem;
}

#modal-latest-news a {
  color: #333d4b;
  text-decoration: none;
}

#modal-latest-news a:hover {
  text-decoration: underline;
}

#modal-latest-news .ext {
  margin-left: 6px;
  font-size: 0.9rem;
  color: #888;
}

/* 한 줄 뉴스 (상단 배너) */
#modal-latest-news {
  text-align: center;
  padding: 10px 16px;
  background: #f9fafc;
  border-bottom: 1px solid #ddd;
  font-weight: 500;
  font-size: 0.95rem;
}

#modal-latest-news .label {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: #333d4b;   /* 어두운 배경 */
  border-radius: 4px;
}

#modal-latest-news a {
  color: #333d4b;
  text-decoration: none;
  font-weight: 600;
}

#modal-latest-news a:hover {
  text-decoration: underline;
}

#modal-latest-news .ext {
  margin-left: 6px;
  font-size: 0.9rem;
  color: #888;
}

#modal-latest-news .time {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: #666;
}

#modal-latest-news {
  text-align: center;
  padding: 10px 16px;
  background: #f9fafc;
  border-bottom: 1px solid #ddd;
  font-size: 0.95rem;
}

#modal-latest-news .label {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: #333d4b;
  border-radius: 4px;
}

#modal-latest-news a {
  color: #333d4b;
  text-decoration: none;
  font-weight: 600;
}

#modal-latest-news a:hover {
  text-decoration: underline;
}

#modal-latest-news .nl-title {
  margin: 0 6px;
}

#modal-latest-news .nl-time {
  font-size: 0.8rem;
  color: #666;
  margin-left: 4px;
}

#modal-latest-news .ext {
  margin-left: 6px;
  font-size: 0.9rem;
  color: #888;
}

#modal-latest-news .nl-time { margin-left: 6px; }

/* ── 종목 메모 카드 ── */
.stock-modal .memo-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 16px;
  border: 1px solid #ddd;
}

.stock-modal .memo-card .memo-header {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333d4b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stock-modal .memo-card .memo-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #444;
  white-space: pre-wrap;
  word-break: break-word;
}

/* === 모바일 최적화 추가 === */
@media (max-width: 480px) {
  /* 탭 버튼 폰트 줄이기 */
  .stock-modal .modal-tabs .tab-btn {
    font-size: 0.85rem;   /* 기존 1rem → 작게 */
    padding: 10px 0;      /* 세로 여백도 살짝 줄임 */
  }

  /* 한줄 뉴스 텍스트 줄이기 */
  #modal-latest-news .nl-title {
    font-size: 0.85rem;   /* 기본보다 작게 */
  }
  #modal-latest-news .nl-time {
    font-size: 0.75rem;   /* 시간도 더 작게 */
  }
}


@media (min-width: 1023px) {

/* ── 테마 이슈: 카드 컨테이너 ── */
.stock-modal .history-cards {
  display: flex;
  flex-direction: column; /* 한 줄에 하나씩 */
  gap: 16px;
  padding: 0 24px;
}

/* ===== 뉴스 탭: 카드 뷰 ===== */
.stock-modal #tab-news .news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0 24px;
  list-style: none;
}
}

@media (max-width: 1023px) {

/* ── 테마 이슈: 카드 컨테이너 ── */
.stock-modal .history-cards {
  display: flex;
  flex-direction: column; /* 한 줄에 하나씩 */
  gap: 16px;
}

/* ===== 뉴스 탭: 카드 뷰 ===== */
.stock-modal #tab-news .news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  list-style: none;
  padding: 0;
}

#modal-latest-news .nl-title {
  margin: 0;
}

.stock-modal #modal-latest-news a {
  gap: 1px;
}
}
/* 분할매매 바로가기 버튼 (종목 모달 헤더 통계 우측) */
.modal-split-btn {
    flex-shrink: 0;
    align-self: center;
    margin-left: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1.5px solid #e71909;
    background: #fff;
    color: #e71909;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    font-family: inherit;
}
.modal-split-btn:hover { background: #fff1f0; }

/* ═══════════════════════════════════════════════════════════
   모바일 모달 = 바텀시트 (≤1023px)
   화면 가운데 카드 → 하단에서 올라오는 시트로.
   손잡이 · 흰 헤더(제목+부제) · 회색 통계 박스 · 세그먼트 탭 ·
   빨간 톤 최신뉴스 · 날짜/테마칩/등락률 한 줄 이슈 카드.
   데스크톱 레이아웃은 그대로 둔다.
   ═══════════════════════════════════════════════════════════ */
.sheet-grab { display: none; }

@media (max-width: 1023px) {
    .stock-modal { align-items: flex-end; }

    .stock-modal .modal-card {
        width: 100%;
        max-width: none;
        height: auto;
        max-height: 88vh;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(11, 14, 19, .2);
    }

    /* 손잡이 */
    .stock-modal .sheet-grab {
        display: block;
        flex: none;
        width: 38px; height: 4px;
        margin: 10px auto 2px;
        border-radius: 99px;
        background: #e0e3e8;
    }

    /* ── 헤더: 흰 배경 + 제목/부제 ── */
    .stock-modal .modal-header {
        background: #fff;
        color: #1b2330;
        align-items: flex-start;
        gap: 10px;
        padding: 8px 16px 12px;
    }
    .stock-modal .modal-head-text { flex: 1; min-width: 0; }
    .stock-modal .modal-header h2 {
        font-size: 1.25rem;
        font-weight: 800;
        letter-spacing: -.02em;
        color: #1b2330;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .stock-modal .modal-sub {
        margin-top: 3px;
        font-size: .8rem;
        color: #8a94a0;
        font-variant-numeric: tabular-nums;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    /* 닫기: 원형 회색 버튼 */
    .stock-modal .modal-close {
        flex: none;
        width: 32px; height: 32px;
        display: flex; align-items: center; justify-content: center;
        padding: 0; line-height: 1;
        border-radius: 50%;
        background: #f2f4f6;
        color: #4e5968;
        font-size: 1.15rem;
    }
    .stock-modal .modal-close:hover { transform: none; background: #e9ebef; }

    /* ── 통계: 회색 라운드 박스 ── */
    .stock-modal .modal-stats {
        background: #fff;
        border-bottom: none;
        gap: 8px;
        padding: 0 16px 12px;
        align-items: stretch;
    }
    .stock-modal .modal-stats .stat-item {
        flex: 1; min-width: 0;
        background: #f4f5f7;
        border: none;
        border-radius: 12px;
        padding: 11px 12px;
        display: flex; flex-direction: column; justify-content: center;
        box-shadow: none;
        text-align: left;
    }
    /* 현재가+등락 칸은 '(+5,300)' 까지 한 줄에 들어가도록 조금 넓게 */
    .stock-modal .modal-stats .stat-item.duo { flex: 1.25; }
    .stock-modal .modal-stats .stat-label {
        font-size: .7rem; color: #8a94a0; font-weight: 600; margin-bottom: 3px;
    }
    .stock-modal .modal-stats .stat-value {
        font-size: 1.05rem; font-weight: 800; color: #1b2330;
        font-variant-numeric: tabular-nums;
    }
    .stock-modal .modal-stats .stat-item.duo .line-1 { font-size: 1.05rem; font-weight: 800; }
    .stock-modal .modal-stats .stat-item.duo .line-2 {
        margin-top: 2px; font-size: .74rem; font-weight: 700;
        font-variant-numeric: tabular-nums;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .stock-modal .modal-stats .line-2.positive { color: #e71909; }
    .stock-modal .modal-stats .line-2.negative { color: #115bcb; }

    /* 오토스텝: 남색 채움 버튼 */
    .stock-modal .modal-split-btn {
        flex: none;
        margin-left: 0;
        padding: 0 12px;
        border: none;
        border-radius: 12px;
        background: #1b2330;
        color: #fff;
        font-size: .78rem;
        font-weight: 700;
    }
    .stock-modal .modal-split-btn:hover { background: #2b3546; }

    /* ── 최신 뉴스: 빨간 톤 라운드 박스 ── */
    .stock-modal #modal-latest-news {
        margin: 0 16px 10px;
        padding: 9px 11px;
        background: #fff5f4;
        border: 1px solid #f6d9d5;
        border-radius: 10px;
        text-align: left;
        font-size: .8rem;
    }
    .stock-modal #modal-latest-news a {
        display: flex; align-items: center; gap: 7px;
        max-width: 100%; white-space: nowrap;
        color: #3f4a58; font-weight: 600;
    }
    .stock-modal #modal-latest-news .label {
        flex: none; margin-right: 0;
        background: none; color: #e71909;
        padding: 0; font-size: .72rem; font-weight: 800;
    }
    .stock-modal #modal-latest-news .nl-title {
        flex: 1; min-width: 0; margin: 0;
        overflow: hidden; text-overflow: ellipsis;
    }
    .stock-modal #modal-latest-news .nl-time,
    .stock-modal #modal-latest-news .ext { flex: none; margin-left: 0; }

    /* ── 탭: 세그먼트 ── */
    .stock-modal .modal-tabs {
        margin: 0 16px 10px;
        padding: 3px;
        gap: 2px;
        background: #f4f5f7;
        border: none;
        border-radius: 12px;
    }
    .stock-modal .modal-tabs .tab-btn {
        flex: 1; min-width: 0;
        padding: 8px 0;
        border-radius: 9px;
        border-bottom: none;
        font-size: .82rem; font-weight: 700; color: #8a94a0;
        white-space: nowrap;
    }
    .stock-modal .modal-tabs .tab-btn.active {
        background: #fff;
        color: #1b2330;
        border-bottom: none;
        box-shadow: 0 1px 3px rgba(27, 35, 48, .1);
    }

    /* ── 탭 패널 / 이슈 카드 ── */
    .stock-modal .tab-panel { padding: 0 16px 16px; }

    /* 차트 탭: #modal-chart-container 는 height:100% 인데, 시트가
       내용에 맞춰 늘어나는 구조(height:auto)에서는 100% 가 auto 로 풀려
       20px 로 눌린다. 모바일에서는 명시적 높이를 준다.
       (전체화면 확대 시에는 .chart-expandable.expanded 의 100vh 가 이긴다) */
    .stock-modal #modal-chart-container {
        height: 46vh;
        min-height: 300px;
    }
    .stock-modal .history-cards { gap: 8px; }

    .stock-modal .history-card {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "date theme change" "body body body";
        align-items: center;
        column-gap: 7px; row-gap: 6px;
        padding: 11px 12px;
        border: 1px solid #eef0f3;
        border-radius: 12px;
        box-shadow: none;
    }
    .stock-modal .history-card:hover { transform: none; box-shadow: none; }
    .stock-modal .history-card .hc-date {
        grid-area: date; margin: 0;
        font-size: .78rem; font-weight: 700; color: #e71909;
        font-variant-numeric: tabular-nums;
    }
    .stock-modal .history-card .hc-theme {
        grid-area: theme; margin: 0; justify-self: start;
        max-width: 100%;
        padding: 2px 7px;
        background: #f4f5f7; border-radius: 6px;
        font-size: .72rem; font-weight: 600; color: #5b6672;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .stock-modal .history-card .hc-change {
        grid-area: change;
        position: static; background: none; padding: 0;
        font-size: .88rem; font-weight: 800;
        font-variant-numeric: tabular-nums;
    }
    .stock-modal .history-card .hc-comment {
        grid-area: body; margin: 0;
        font-size: .82rem; line-height: 1.6; color: #3f4a58;
    }
}

/* 이슈 카드 날짜: PC 는 전체(2026-08-21), 모바일은 MM.DD */
.hc-date .d-short { display: none; }
@media (max-width: 1023px) {
    .hc-date .d-full { display: none; }
    .hc-date .d-short { display: inline; }
}
