/* ==========================================================
   #box-container 내부로 한정된 스타일 (외부 요소 영향 없음)
   ========================================================== */
#box-container { display:inherit !important; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #1f2937; line-height: 1.5; }
#box-container *, #box-container *::before, #box-container *::after { box-sizing: border-box; }
#box-container .is_blind { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* 1. 섹션 컨테이너 */
#box-container .stock_story { position: relative; background: #ffffff; border: none; border-radius: 6px; padding: 10px 3px 5px; margin: 0; width: 100%; box-shadow: none; overflow: visible; }

/* 2. 상단 헤더 */
#box-container .ss-header { display: flex; justify-content: space-between; align-items: center; padding: 0 14px 8px; margin-bottom: 0; border-bottom: none; }
#box-container .ss-title { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: #111827; }
#box-container .ss-title .ic_ststory { display: inline-block; width: 20px; height: 22px; vertical-align: middle; position: relative; top: 2px; background-image: url(https://static.mk.co.kr/2026/css/images/ic_mk2025_view.png); background-size: 240px 240px; background-position: -6px -78px; margin-right: 3px; }
[data-dark=true] #box-container .ss-title .ic_ststory { background-position: -6px -141px; }
#box-container .ss-powered { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; line-height: 1; color: #9ca3af; }
#box-container .ss-powered .ai_logo { display: inline-block; width: 55px; height: 15px; background: url('https://static.mk.co.kr/2022/news/pc/images/l_Perplexity.svg') no-repeat left center; background-size: contain; vertical-align: middle; }

/* 3. Swiper 컨테이너 */
#box-container .ss-swiper { overflow: hidden; padding: 0 4px 4px; }
#box-container .ss-swiper .swiper-slide { width: 85%; height: auto; display: flex; }
#box-container .ss-swiper .swiper-wrapper { height: auto; align-items: stretch; }
@media (max-width: 767px) {
  #box-container .stock_story { padding-left: 0; padding-right: 0; }
  #box-container .ss-header { padding-left: 10px; padding-right: 10px; }
  #box-container .ss-swiper { padding-left: 0; padding-right: 0; }
  #box-container .ss-swiper .swiper-slide { width: 90%; }
  #box-container .insight-card { padding-left: 8px; padding-right: 8px; }
  #box-container .ft_box_text { padding-left: 8px; padding-right: 8px; }
}
@media (min-width: 768px) { #box-container .ss-swiper .swiper-slide { width: 360px; } }
@media (min-width: 1024px) { #box-container .ss-swiper .swiper-slide { width: 400px; } }

/* 3-1. Swiper 네비게이션 화살표 */
#box-container .ss-swiper-wrap { position: relative; }
#box-container .ss-swiper-wrap .swiper-button-prev,
#box-container .ss-swiper-wrap .swiper-button-next {
  display: none; width: 30px; height: 30px;
  border: 1px solid #ccc; border-radius: 3px;
  background: rgba(255,255,255,0.97); color: #333;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: background 0.2s, border-color 0.2s;
}
#box-container .ss-swiper-wrap .swiper-button-prev::after,
#box-container .ss-swiper-wrap .swiper-button-next::after { font-size: 14px; font-weight: 700; }
#box-container .ss-swiper-wrap .swiper-button-prev:hover,
#box-container .ss-swiper-wrap .swiper-button-next:hover { background: #fff; border-color: #9ca3af; }
#box-container .ss-swiper-wrap .swiper-button-prev { left: -40px; }
#box-container .ss-swiper-wrap .swiper-button-next { right: -40px; }
#box-container .ss-swiper-wrap .swiper-button-disabled { display: none !important; }
@media (min-width: 768px) {
  #box-container .ss-swiper-wrap .swiper-button-prev,
  #box-container .ss-swiper-wrap .swiper-button-next { display: flex; }
}

/* 다크모드 화살표 */
[data-dark=true] #box-container .ss-swiper-wrap .swiper-button-prev,
[data-dark=true] #box-container .ss-swiper-wrap .swiper-button-next { background: rgba(42,42,42,0.97); border-color: #555; color: #e5e7eb; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
[data-dark=true] #box-container .ss-swiper-wrap .swiper-button-prev:hover,
[data-dark=true] #box-container .ss-swiper-wrap .swiper-button-next:hover { background: #3a3a3a; border-color: #777; }

/* 4. 인사이트 카드 (공통) */
#box-container .insight-card { position: relative; display: flex; flex-direction: column; width: 100%; background: #ffffff; border: 1px solid #e4e4e4; border-radius: 12px; padding: 10px 10px 5px 10px; transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease; overflow: hidden; height: 100%; }
#box-container .insight-card.card-overseas::before { content: ''; position: absolute; top: 0; right: 0; width: 112px; height: 112px; background: #f3f4f6; border-radius: 9999px; filter: blur(48px); pointer-events: none; z-index: 0; }

/* 5. 카드 헤더 */
#box-container .card-head { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; margin-bottom: 8px; padding-right: 18px; min-height: 36px; }
#box-container .card-head-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
#box-container .card-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
#box-container .card-name { margin: 0; font-size: 21px; font-weight: 700; color: #111827; letter-spacing: -0.4px; line-height: 1.2; }
#box-container .insight-card.card-domestic .card-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#box-container .insight-card.card-overseas .card-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#box-container .card-name.card-name-link { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; cursor: pointer; }
#box-container .card-name-link .card-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: underline; text-decoration-color: rgba(17, 24, 39, 0.45); text-underline-offset: 3px; transition: text-decoration-color 0.2s ease; }
#box-container .card-name-link:hover .card-name-text { text-decoration-color: #111827; }
#box-container .card-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#box-container .card-link-icon { flex-shrink: 0; width: 16px; height: 16px; margin-left: 5px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") no-repeat center; background-size: contain; opacity: 0.75; transition: opacity 0.2s ease; }
#box-container .card-name-link:hover .card-link-icon { opacity: 1; }
#box-container .market-badge { flex-shrink: 0; padding: 2px 6px; font-size: 11px; font-weight: 700; color: #777777; background: #f3f4f6; border-radius: 2px; letter-spacing: 0.3px; }
#box-container .card-sub-row { display: flex; align-items: center; gap: 5px; width: 100%; margin-top: 1px; }
#box-container .card-sub-text { font-size: 13px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#box-container .card-sub-en { font-size: 12px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#box-container .card-sub-ticker { flex-shrink: 0; font-size: 12px; color: #9ca3af; }
#box-container .card-head-right { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
#box-container .card-price { font-size: 15px; font-weight: 700; white-space: nowrap; }
#box-container .card-rate { margin-top: 1px; font-size: 12px; font-weight: 600; white-space: nowrap; }
#box-container .insight-card.card-up .card-price,
#box-container .insight-card.card-up .card-rate { color: #ef4444; }
#box-container .insight-card.card-down .card-price,
#box-container .insight-card.card-down .card-rate { color: #3b82f6; }

/* 6. 설명 영역 (요약본 Quote UI) */
#box-container .card-desc-wrap { position: relative; z-index: 1; display: flex; flex-direction: column; flex-grow: 1; min-height: 0; margin-bottom: 0; }
#box-container .card-desc-quote { padding: 6px 0 6px 6px; background: rgba(249, 250, 251, 0.5); border-left: 2px solid #d1d5db; border-radius: 0; }
#box-container .stock-desc { margin: 0; font-size: 15px; line-height: 1.55; color: #777777; word-break: break-all; }
#box-container .stock-desc.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
#box-container .stock-desc.line-clamp-1 br { display: none; }
#box-container .stock-desc b, #box-container .stock-desc strong { color: #111827; font-weight: 700; }

/* 6-1. 주가 한눈에 보기 + 닫기 버튼 래퍼 */
#box-container .stock-price-btn-wrap { display: none; align-items: center; gap: 6px; margin-top: 3px; }
#box-container .stock-price-btn-wrap.is-visible { display: flex; }

/* 6-2. 주가 한눈에 보기 버튼 */
#box-container .stock-price-btn { display: flex; justify-content: center; align-items: center; gap: 0; padding: 5px 8px; min-width: 0; overflow: hidden; font-size: 14px; font-weight: 700; color: #ffffff; background: #777777; border: 1px solid #777777; border-radius: 6px; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; flex: 1 1 auto; }
#box-container .stock-price-btn:hover { background: #374151; border-color: #374151; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18); }
#box-container .stock-price-btn-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#box-container .stock-price-btn-suffix { flex: 0 0 auto; white-space: nowrap; margin-left: 0.35em; }
#box-container .stock-price-btn .price-arrow { flex: 0 0 auto; display: inline-block; margin-left: 5px; font-size: 14px; line-height: 1; transform: translateY(1px); }

/* 6-3. 닫기 버튼 */
#box-container .stock-desc-collapse-btn { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; padding: 5px 12px; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 6px; cursor: pointer; color: #6b7280; font-size: 14px; font-weight: 700; white-space: nowrap; line-height: 1.5; transition: background 0.2s, border-color 0.2s; }
#box-container .stock-desc-collapse-btn:hover { background: #e5e7eb; border-color: #d1d5db; }
[data-dark=true] #box-container .stock-desc-collapse-btn { background: #2a2a2a; border-color: #3a3a3a; color: #9ca3af; }
[data-dark=true] #box-container .stock-desc-collapse-btn:hover { background: #333; border-color: #555; }

/* 7. 더보기 버튼 */
#box-container .more-btn { display: flex; justify-content: center; align-items: center; gap: 0; margin-top: 3px; padding: 5px 8px; width: 100%; min-width: 0; overflow: hidden; font-size: 14px; font-weight: 700; color: #ffffff; background: #777777; border: 1px solid #777777; border-radius: 6px; cursor: pointer; }
#box-container .more-btn-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#box-container .more-btn-suffix { flex: 0 0 auto; white-space: nowrap; margin-left: 0.35em; }
#box-container .more-btn .caret { flex: 0 0 auto; display: inline-block; margin-left: 5px; line-height: 1; font-size: 14px; transform: translateY(1px); }

/* 8. CTA 버튼 */
#box-container .cta-btn { position: relative; z-index: 1; margin-top: auto; display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 9px 12px; background: #f8f9fa; border: 1px solid #ddd; border-radius: 3px; color: #1f2937; font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease; }
#box-container .insight-card.card-up .cta-btn:hover { background: rgba(254, 242, 242, 0.7); border-color: rgba(239, 68, 68, 0.4); color: #dc2626; }
#box-container .insight-card.card-down .cta-btn:hover { background: rgba(239, 246, 255, 0.7); border-color: rgba(59, 130, 246, 0.4); color: #2563eb; }
#box-container .insight-card.card-overseas .cta-btn:hover,
#box-container .insight-card.card-domestic .cta-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
#box-container .cta-text { margin-right: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#box-container .cta-arrow { flex-shrink: 0; font-size: 17px; line-height: 1; color: #9ca3af; transition: transform 0.25s ease, color 0.25s ease; }
#box-container .cta-btn:hover .cta-arrow { transform: translateX(3px); }
#box-container .insight-card.card-up .cta-btn:hover .cta-arrow { color: #ef4444; }
#box-container .insight-card.card-down .cta-btn:hover .cta-arrow { color: #3b82f6; }
#box-container .insight-card.card-overseas .cta-btn:hover .cta-arrow,
#box-container .insight-card.card-domestic .cta-btn:hover .cta-arrow { color: #777777; }

/* 9. 신고 버튼 */
#box-container .btn-report { position: absolute; top: 0; right: 0; z-index: 2; width: 28px; height: 28px; padding: 0; border: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b2b2b2'%3E%3Cpath d='M14.4 6L14 4H5v15h2v-7h5.6l.4 2h7V6h-5.6z'/%3E%3C/svg%3E") no-repeat center; background-size: 14px; cursor: pointer; opacity: 0.4; transition: opacity 0.2s; }
#box-container .btn-report:hover { opacity: 1; }
[data-dark=true] #box-container .btn-report { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M14.4 6L14 4H5v15h2v-7h5.6l.4 2h7V6h-5.6z'/%3E%3C/svg%3E"); }

/* 10. 신고 모달 */
#box-container .modal_stock_story { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; justify-content: center; align-items: center; z-index: 10000; }
#box-container .modal_stock_story.active { display: flex !important; }
#box-container .modal_stock_story_report { background: #fff; width: 85%; max-width: 320px; padding: 24px; border-radius: 16px; position: relative; }
#box-container .modal_stock_story_report .modal_head .head { font-size: 16px; font-weight: 700; color: #111; margin-bottom: 4px; }
#box-container .modal_stock_story_report .tit_reason { font-size: 16px; font-weight: 700; color: #333; padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid #eee; }
#box-container .modal_stock_story_report .report_reason_item { list-style: none; margin-bottom: 12px; }
#box-container .modal_stock_story_report .lbl_radio { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: #333; }
#box-container .modal_stock_story_report .modal_foot { margin-top: 20px; }
#box-container .modal_stock_story_report .modal_foot a { display: block; text-align: center; background: #2d65f7; color: #fff; text-decoration: none; padding: 12px; border-radius: 8px; font-weight: 700; font-size: 15px; }
#box-container .modal_stock_story_report .btn_close { position: absolute; top: 15px; right: 15px; width: 30px; height: 30px; background: transparent; border: none; cursor: pointer; }
#box-container .modal_stock_story_report .btn_close i { font-size: 0; display: block; width: 20px; height: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23999'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E") no-repeat center; background-size: contain; }
[data-dark=true] #box-container .modal_stock_story_report { background: #252525; color: #e0e0e0; }
[data-dark=true] #box-container .modal_stock_story_report .modal_head .head { color: #fff; }
[data-dark=true] #box-container .modal_stock_story_report .tit_reason { color: #fff; border-bottom-color: #333; }
[data-dark=true] #box-container .modal_stock_story_report .lbl_radio { color: #ccc; }
[data-dark=true] #box-container .modal_stock_story_report .modal_foot a { background: #4a7df9; color: #fff; }

/* 11. 안내 풋터 */
#box-container .ft_box_text { margin: 0; padding: 8px 10px; font-size: 10px !important; color: #9ca3af; background: none; border-radius: 2px; width: 100% !important; text-align: center; }
#box-container .ft_box_text::after { display: none !important; }
#box-container .ft_box_text strong { color: #6b7280; }

/* ==========================================================
   다크모드 (data-dark="true") 대응
   ========================================================== */
[data-dark=true] #box-container .stock_story { background: #121212; border-color: transparent; box-shadow: none; }
[data-dark=true] #box-container .ss-header { border-bottom-color: rgba(255,255,255,0.1); background: none; }
[data-dark=true] #box-container .ss-title { color: #f3f4f6; }
[data-dark=true] #box-container .ss-powered { color: #6b7280; }
[data-dark=true] #box-container .ss-powered .ai_logo { filter: invert(1) brightness(2); }

[data-dark=true] #box-container .insight-card { background: #1e1e1e; }
[data-dark=true] #box-container .insight-card.card-overseas::before { background: rgba(255,255,255,0.05); }
[data-dark=true] #box-container .insight-card.card-up::before { content: ''; position: absolute; top: 0; right: 0; width: 112px; height: 112px; background: rgba(239, 68, 68, 0.08); border-radius: 9999px; filter: blur(48px); pointer-events: none; z-index: 0; }
[data-dark=true] #box-container .insight-card.card-down::before { content: ''; position: absolute; top: 0; right: 0; width: 112px; height: 112px; background: rgba(59, 130, 246, 0.08); border-radius: 9999px; filter: blur(48px); pointer-events: none; z-index: 0; }

[data-dark=true] #box-container .card-name { color: #ffffff; }
[data-dark=true] #box-container .card-name-link .card-name-text { color: inherit; text-decoration-color: rgba(255, 255, 255, 0.45); }
[data-dark=true] #box-container .card-name-link:hover .card-name-text { text-decoration-color: #ffffff; }
[data-dark=true] #box-container .card-link-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E"); opacity: 0.75; }
[data-dark=true] #box-container .card-name-link:hover .card-link-icon { opacity: 1; }
[data-dark=true] #box-container .market-badge { color: #d1d5db; background: rgba(255,255,255,0.1); }
[data-dark=true] #box-container .card-sub-text,
[data-dark=true] #box-container .card-sub-en { color: #9ca3af; }
[data-dark=true] #box-container .card-sub-ticker { color: #6b7280; border-left-color: #777777; }
[data-dark=true] #box-container .insight-card.card-up .card-price,
[data-dark=true] #box-container .insight-card.card-up .card-rate { color: #ef4444; }
[data-dark=true] #box-container .insight-card.card-down .card-price,
[data-dark=true] #box-container .insight-card.card-down .card-rate { color: #60a5fa; }

[data-dark=true] #box-container .card-desc-quote { background: rgba(255,255,255,0.05); border-left-color: #6b7280; }
[data-dark=true] #box-container .stock-desc { color: #d1d5db; }
[data-dark=true] #box-container .stock-desc b,
[data-dark=true] #box-container .stock-desc strong { color: #ffffff; }
[data-dark=true] #box-container .stock-price-btn { color: #ffffff; background: #777777; border-color: #777777; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
[data-dark=true] #box-container .stock-price-btn:hover { background: #374151; border-color: #374151; }
[data-dark=true] #box-container .more-btn { color: #ffffff; background: #777777; border-color: #777777; }

[data-dark=true] #box-container .cta-btn { background: #252525; border-color: #3a3a3a; color: #ffffff; }
[data-dark=true] #box-container .insight-card.card-overseas .cta-btn:hover,
[data-dark=true] #box-container .insight-card.card-domestic .cta-btn:hover { background: #333333; border-color: #555555; }
[data-dark=true] #box-container .insight-card.card-up .cta-btn:hover { background: rgba(127, 29, 29, 0.3); border-color: #991b1b; color: #fca5a5; }
[data-dark=true] #box-container .insight-card.card-down .cta-btn:hover { background: rgba(30, 58, 138, 0.3); border-color: #1e40af; color: #93c5fd; }
[data-dark=true] #box-container .cta-arrow { color: #9ca3af; }
[data-dark=true] #box-container .insight-card.card-up .cta-btn:hover .cta-arrow { color: #fca5a5; }
[data-dark=true] #box-container .insight-card.card-down .cta-btn:hover .cta-arrow { color: #93c5fd; }
[data-dark=true] #box-container .insight-card.card-overseas .cta-btn:hover .cta-arrow,
[data-dark=true] #box-container .insight-card.card-domestic .cta-btn:hover .cta-arrow { color: #ffffff; }

[data-dark=true] #box-container .ft_box_text { background: none; color: #888888; }
[data-dark=true] #box-container .ft_box_text strong { color: #cccccc; }
