/*
Theme Name: KRW Today
Theme URI: https://krw.today
Author: fx-now
Author URI: https://krw.today
Description: 달러/원 환율 실시간 분석 서비스
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fx-now
*/

/* ===================================
   1. CSS Custom Properties (Design Tokens)
   =================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;300;400;500;700;900&display=swap');

:root {
  /* — Brand Color Tokens — */
  --color-abyss: #0A1628;
  /* 주요 배경 (가장 어두운 네이비) */
  --color-live: #00C896;
  /* 액센트 (Teal — 라이브 인디케이터) */
  --color-deep: #0F2640;
  /* 보조 배경 (카드, 사이드바) */
  --color-fall: #E24B4A;
  /* 상승/경고 (Red-coral) */
  --color-mist: #8BA8C4;
  /* 뮤트 텍스트 (Steel blue) */

  /* — Color Palette (Dark Mode First) — */
  --fx-bg-primary: var(--color-abyss);
  /* #0A1628 */
  --fx-bg-secondary: #0d1e35;
  /* Abyss ↔ Deep 중간 */
  --fx-bg-card: var(--color-deep);
  /* #0F2640 */
  --fx-bg-card-hover: #163050;
  /* Deep보다 약간 밝게 */
  --fx-border: rgba(139, 168, 196, 0.15);
  /* Mist 기반 테두리 */
  --fx-border-light: rgba(139, 168, 196, 0.25);

  --fx-text-primary: #eceae6;
  --fx-text-secondary: var(--color-mist);
  /* #8BA8C4 */
  --fx-text-muted: rgba(139, 168, 196, 0.75);

  --fx-accent: var(--color-live);
  /* #00C896 */
  --fx-accent-hover: #00dfa8;
  /* Live 밝게 */
  --fx-accent-glow: rgba(0, 200, 150, 0.18);

  /* 한국 주식시장 관행: 상승=빨강, 하락=파랑 */
  --fx-red: var(--color-fall);
  /* #E24B4A (상승/경고) */
  --fx-red-bg: rgba(226, 75, 74, 0.12);
  --fx-blue: #3b82f6;
  /* 하락 */
  --fx-blue-bg: rgba(59, 130, 246, 0.12);
  --fx-amber: #f59e0b;
  --fx-amber-bg: rgba(245, 158, 11, 0.12);

  /* — Typography — */
  --fx-font-kr: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --fx-font-sans: 'Inter', var(--fx-font-kr);
  --fx-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --fx-font-size-xs: 0.75rem;
  --fx-font-size-sm: 0.8125rem;
  --fx-font-size-base: 0.875rem;
  --fx-font-size-lg: 1rem;
  --fx-font-size-xl: 1.25rem;
  --fx-font-size-2xl: 1.5rem;
  --fx-font-size-3xl: 2rem;

  /* — Spacing — */
  --fx-gap-xs: 4px;
  --fx-gap-sm: 8px;
  --fx-gap-md: 8px;
  --fx-gap-lg: 16px;
  --fx-gap-xl: 24px;
  --fx-gap-2xl: 32px;

  /* — Radius — */
  --fx-radius-sm: 6px;
  --fx-radius-md: 6px;
  --fx-radius-lg: 14px;
  --fx-radius-full: 9999px;

  /* — Transitions — */
  --fx-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --fx-transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* — Shadows — */
  --fx-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --fx-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --fx-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --fx-shadow-glow: 0 0 20px var(--fx-accent-glow);

  /* — Layout — */
  --fx-header-height: 56px;
  --fx-timeline-width: 380px;
}


/* ===================================
   2. Reset & Base
   =================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--fx-font-sans);
  font-size: var(--fx-font-size-base);
  color: var(--fx-text-primary);
  background: var(--fx-bg-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

a {
  color: var(--fx-accent);
  text-decoration: none;
  transition: color var(--fx-transition);
}

a:hover {
  color: var(--fx-accent-hover);
}

/* ===================================
   3. App Layout
   =================================== */
#fx-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* — Header — */
.fx-header {
  height: var(--fx-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  background: var(--fx-bg-secondary);
  border-bottom: 1px solid var(--fx-border);
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}

.fx-header__top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fx-gap-xl);
  flex: 1;
}

.fx-header__logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.fx-header__logo a {
  display: flex;
  align-items: center;
  position: relative;
  pointer-events: auto;
}

.fx-logo-dot {
  position: absolute;
  right: 10.5%;
  bottom: 10.5%;
  width: 9.1%;
  height: 9.1%;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  animation: fx-logo-dot-blink 2s infinite ease-in-out;
  box-shadow: 0 0 8px #fff;
}

@keyframes fx-logo-dot-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

body.logged-in .fx-header__logo {
  display: none;
}

.fx-header__logo img {
  height: 44px;
  width: auto;
}

.fx-header__logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--fx-accent), #818cf8);
  border-radius: var(--fx-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.fx-header__rate {
  display: flex;
  align-items: center;
  gap: var(--fx-gap-xl);
}

.fx-header__rate-main {
  display: flex;
  align-items: center;
  gap: var(--fx-gap-md);
}

.fx-header__rate-value {
  font-family: var(--fx-font-mono);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  animation: fx-neon-pulse 2s infinite ease-in-out;
}

@keyframes fx-neon-pulse {

  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 2px var(--fx-accent));
    color: #fff;
  }

  50% {
    opacity: 0.2;
    filter: drop-shadow(0 0 8px var(--fx-accent));
  }
}

.fx-header__rate-change {
  display: flex;
  align-items: center;
  gap: var(--fx-gap-xs);
  padding: 4px;
  font-family: var(--fx-font-mono);
  font-size: var(--fx-font-size-sm);
  font-weight: 600;
}

.fx-header__rate-change.up {
  color: var(--fx-red);
}

.fx-header__rate-change.down {
  color: var(--fx-blue);
}

/* Peer Rates */
.fx-header__peer-rates {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--fx-border);
  padding-left: var(--fx-gap-md);
  gap: 1px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-radius: 0;
}

.fx-header__peer-rates:hover {
  background: rgba(255, 255, 255, 0.05);
}

.fx-peer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--fx-font-mono);
  font-size: 10px;
  line-height: 1.2;
}

.fx-peer-item__label {
  color: var(--fx-text-muted);
  width: 22px;
  font-weight: 700;
  font-size: 9px;
}

.fx-peer-item__value {
  color: var(--fx-text-secondary);
  width: 38px;
  text-align: right;
}

.fx-peer-item__diff {
  width: 42px;
  text-align: right;
  font-weight: 600;
}

.fx-peer-item__diff.up {
  color: var(--fx-red);
}

.fx-peer-item__diff.down {
  color: var(--fx-blue);
}

/* Peer Rates Popup Overlay */
.fx-header__peer-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--fx-bg-secondary);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--fx-gap-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 1px solid var(--fx-border-light);
}

.fx-header__peer-popup.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fx-header__peer-popup-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 30px 0;
  max-width: 1000px;
  width: 100%;
  justify-items: center;
  align-items: center;
}

.fx-popup-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fx-popup-item.is-main {
  grid-column: span 3;
  padding-bottom: 20px;
  /* border-bottom: 1px solid var(--fx-border); */
  width: 100%;
  margin-bottom: 10px;
}

.fx-popup-item__label {
  font-size: 11px;
  font-weight: 800;
  color: var(--fx-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fx-popup-item__value {
  font-family: var(--fx-font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--fx-text-primary);
  line-height: 1;
}

.fx-popup-item.is-main .fx-popup-item__value {
  font-size: 4rem;
  color: #fff;
  filter: drop-shadow(0 0 15px var(--fx-accent-glow));
}

.fx-popup-item__diff {
  font-family: var(--fx-font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.fx-popup-item.is-main .fx-popup-item__diff {
  font-size: 1.5rem;
}

.fx-popup-item__diff.up {
  color: var(--fx-red);
}

.fx-popup-item__diff.down {
  color: var(--fx-blue);
}

.fx-popup-item__chart {
  margin-top: 15px;
  width: 80px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.fx-popup-item.is-main .fx-popup-item__chart {
  width: 300px;
  height: 60px;
}

.fx-popup-item__chart svg {
  overflow: visible;
}

.fx-popup-item__chart path {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.fx-header__peer-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--fx-text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fx-header__peer-popup-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fx-text-primary);
}

/* Account Popup Modal */
.fx-header__account-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--fx-bg-secondary);
  backdrop-filter: blur(20px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fx-header__account-modal.active {
  opacity: 1;
  visibility: visible;
}

.fx-header__account-modal-content {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 40px 20px;
  animation: modalContentIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalContentIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.fx-account-popup-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fx-account-popup-inner .fx-account-info {
  margin-bottom: 8px;
  text-align: center;
}

.fx-account-popup-inner .fx-dropdown__item {
  width: 100%;
  justify-content: center;
  font-size: 16px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

/* 스마트폰 가로모드(Landscape)에서 팝업을 portrait 방향으로 강제 회전 */
@media screen and (max-width: 900px) and (orientation: landscape) {
  .fx-header__peer-popup.active {
    /* 화면 전체를 세로 방향으로 90도 회전
       width/height를 교환하여 portrait 화면 크기로 채움 */
    width: 100vh;
    /* 실제 portrait 시 높이 = landscape의 뷰포트 높이 */
    height: 100vw;
    /* 실제 portrait 시 너비 = landscape의 뷰포트 너비 */
    transform: rotate(-90deg) translateX(-100%);
    transform-origin: top left;
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
  }
}

.fx-account-popup-inner .fx-dropdown__item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.fx-account-popup-inner .fx-dropdown__divider {
  margin: 8px 0;
  opacity: 0.5;
}

@media (max-width: 768px) {
  .fx-header__peer-popup-content {
    max-width: 100%;
    gap: 20px 0;
  }

  .fx-popup-item.is-main .fx-popup-item__value {
    font-size: 3rem;
  }

  .fx-popup-item.is-main .fx-popup-item__chart {
    width: 200px;
    height: 50px;
  }

  .fx-popup-item__value {
    font-size: 1.5rem;
  }

  .fx-popup-item__diff {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .fx-header__peer-popup-content {
    padding-right: 0;
  }

  .fx-popup-item.is-main .fx-popup-item__value {
    font-size: 2.4rem;
  }

  .fx-popup-item__value {
    font-size: 1.1rem;
  }

  .fx-popup-item__diff {
    font-size: 0.75rem;
  }

  .fx-popup-item__chart {
    width: 60px;
    margin-top: 10px;
  }

  .fx-popup-item.is-main .fx-popup-item__chart {
    width: 150px;
  }
}

.fx-header__clock {
  display: flex;
  align-items: center;
  gap: var(--fx-gap-sm);
  background: var(--fx-bg-primary);
  padding: 5px 6px;
  border-radius: var(--fx-radius-sm);
  border: 1px solid var(--fx-border);
  margin-left: auto;
  margin-right: var(--fx-gap-xl);
}

.fx-header__clock-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--fx-accent);
  background: var(--fx-accent-glow);
  padding: 1px 4px;
  border-radius: 2px;
}

.fx-header__clock-time {
  font-family: var(--fx-font-mono);
  font-size: var(--fx-font-size-sm);
  font-weight: 600;
  color: var(--fx-text-secondary);
  min-width: 65px;
}

.fx-header__controls {
  display: flex;
  align-items: center;
  gap: var(--fx-gap-md);
}

/* — Interval Toggle — */
.fx-interval-toggle {
  display: flex;
  background: var(--fx-bg-primary);
  border-radius: var(--fx-radius-sm);
  padding: 2px;
  border: 1px solid var(--fx-border);
}

.fx-interval-toggle__btn {
  padding: 4px 14px 6px;
  border: none;
  background: none;
  color: var(--fx-text-secondary);
  font-family: var(--fx-font-sans);
  font-size: var(--fx-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--fx-transition);
  border-radius: 4px;
}

a#tv-attr-logo {
  display: none;
}

/* Hide mobile-only buttons by default */
.fx-header__btn-chart-toggle,
.fx-chart__mobile-header {
  display: none;
}

.fx-interval-toggle__btn.active {
  background: var(--fx-bg-card);
  color: var(--fx-accent);
  /* box-shadow: var(--fx-shadow-glow); */
}

.fx-interval-toggle__btn:hover:not(.active) {
  color: var(--fx-text-primary);
  background: var(--fx-bg-card);
}

/* — Dropdown System — */
/* — Join Link — */
.fx-header__join-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.fx-header__join-link {
  background: none;
  border: none;
  color: var(--fx-text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 5px 10px;
  transition: all var(--fx-transition);
  opacity: 0.8;
}

.fx-header__join-link:hover {
  color: var(--fx-text-primary);
  opacity: 1;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .fx-header__join-wrap {
    position: absolute;
    top: 15px;
    right: 80px;
    /* Login 버튼 왼쪽 */
    margin-left: 0;
    z-index: 310;
  }
}

.fx-dropdown {
  position: relative;
  margin-left: 10px;
}

.fx-interval-dropdown {
  margin-left: 0;
}

.fx-interval-dropdown .fx-dropdown__trigger {
  border: none;
  background: none;
  padding: 4px 10px 6px;
  gap: 4px;
}

.fx-interval-dropdown .fx-dropdown__trigger span {
  min-width: 18px;
  text-align: center;
}

.fx-interval-dropdown .fx-dropdown__menu {
  min-width: 60px;
  left: -4px;
  transform: translateY(-10px);
}

.fx-interval-dropdown.active .fx-dropdown__menu {
  transform: translateY(0);
}

.fx-interval-dropdown .fx-dropdown__item {
  text-align: center;
  font-size: var(--fx-font-size-xs);
  font-weight: 600;
  padding: 6px 12px;
}

.fx-interval-dropdown .fx-dropdown__item.active {
  color: var(--fx-accent);
  background: rgba(255, 255, 255, 0.05);
}

.fx-dropdown__trigger {
  background: var(--fx-bg-primary);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-sm);
  color: var(--fx-text-secondary);
  font-family: var(--fx-font-sans);
  font-size: var(--fx-font-size-xs);
  font-weight: 600;
  padding: 5px 12px 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--fx-transition);
}

.fx-dropdown__trigger:hover {
  border-color: var(--fx-accent);
  color: var(--fx-text-primary);
}

.fx-dropdown__trigger svg {
  opacity: 0.7;
  transition: transform var(--fx-transition);
}

.fx-dropdown.active .fx-dropdown__trigger svg {
  transform: rotate(180deg);
}

.fx-dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 140px;
  background: rgba(16, 28, 42, 0.95);
  border: 1px solid var(--fx-border-light);
  border-radius: var(--fx-radius-md);
  backdrop-filter: blur(12px);
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--fx-shadow-glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.fx-dropdown.active .fx-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fx-dropdown__menu--right {
  left: auto;
  right: 0;
}

.fx-dropdown__item {
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--fx-text-secondary);
  font-family: var(--fx-font-sans);
  font-size: var(--fx-font-size-sm);
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--fx-transition);
  display: block;
}

.fx-dropdown__item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--fx-accent);
}

.fx-dropdown__item.active {
  color: var(--fx-accent);
  font-weight: 700;
}

.fx-dropdown__item--danger {
  color: #ff4d4d !important;
}

.fx-dropdown__item--danger:hover {
  background: rgba(255, 77, 77, 0.1) !important;
}

.fx-dropdown__divider {
  height: 1px;
  background: var(--fx-border);
  margin: 6px 0;
}

/* — Account Button & Info — */
.fx-account-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fx-bg-primary);
  border: 1px solid var(--fx-border);
  color: var(--fx-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--fx-transition);
}

.fx-account-btn:hover {
  border-color: var(--fx-accent);
  color: var(--fx-accent);
  box-shadow: var(--fx-shadow-glow);
}

.fx-account-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.fx-account-info__name {
  font-size: 24px;
  font-weight: 700;
  color: var(--fx-text-primary);
}

.fx-account-info__sub {
  font-size: 18px;
  color: var(--fx-accent);
  text-transform: uppercase;
  font-weight: 800;
  margin-top: 2px;
}

/* — Main Content — */
.fx-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* — Chart Area — */
.fx-chart {
  flex: 1;
  position: relative;
  border-right: 1px solid var(--fx-border);
  min-width: 0;
  overflow: hidden;
}

.fx-chart__legend {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  /* font-family: var(--fx-font-mono); */
  background: rgba(10, 14, 23, 0.7);
  padding: 8px 8px 8px 12px;
  border-radius: var(--fx-radius-sm);
  border: 1px solid var(--fx-border);
  backdrop-filter: blur(4px);
}

#fx-dxy-sync {
  pointer-events: auto;
}

.fx-chart__legend-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fx-font-size-xs);
  white-space: nowrap;
}

.fx-chart__legend-symbol {
  font-weight: 800;
  color: var(--fx-text-primary);
  margin-right: var(--fx-gap-sm);
}

.fx-chart__legend-symbol small {
  font-size: 10px;
  color: var(--fx-accent);
  background: var(--fx-accent-glow);
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 600;
  margin-left: 4px;
}

.fx-chart__legend-time {
  color: var(--fx-text-primary);
  font-weight: 700;
  margin-right: var(--fx-gap-sm);
  padding-right: var(--fx-gap-sm);
  border-right: 1px solid var(--fx-border);
}

.fx-chart__legend-label {
  color: var(--fx-text-muted);
}

.fx-chart__legend-val {
  color: var(--fx-text-secondary);
  font-weight: 600;
  min-width: 65px;
}

.fx-chart__sync-btn {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #eab308;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
  margin-left: 4px;
}

.fx-chart__sync-btn:hover {
  background: rgba(234, 179, 8, 0.25);
  border-color: rgba(234, 179, 8, 0.5);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.2);
}

.fx-chart__sync-btn:active {
  transform: scale(0.95);
}

.fx-chart__container {
  width: 100%;
  height: calc(100% - 38px);
  /* Leave space for KDI widget header (38px) */
  transition: height var(--fx-transition-slow);
}

.fx-chart.kdi-expanded .fx-chart__container {
  height: calc(100% - 158px);
  /* 38px (header) + 120px (chart) */
}

/* — Timeline Panel — */
.fx-timeline {
  width: var(--fx-timeline-width);
  display: flex;
  flex-direction: column;
  background: var(--fx-bg-secondary);
  flex-shrink: 0;
}

.fx-timeline__header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 15px 10px;
  border-bottom: 1px solid var(--fx-border);
  flex-shrink: 0;
}

.fx-timeline__header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-timeline__header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.fx-news-sentiment {
  display: flex;
  align-items: center;
  gap: 0px;
  position: relative;
}

.fx-news-sentiment__help-btn {
  background: none;
  border: none;
  padding: 4px;
  color: var(--fx-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 0.5;
  margin-left: -2px;
}

.fx-news-sentiment__help-btn:hover {
  color: var(--fx-accent);
  opacity: 1;
}

.fx-news-sentiment .label {
  font-size: 10px;
  font-weight: 800;
  color: var(--fx-text-muted);
  letter-spacing: -0.02em;
}

.fx-news-sentiment .value {
  font-family: var(--fx-font-mono);
  font-size: 20px;
  font-weight: 900;
  color: var(--fx-red);
  margin-left: 5px;
  margin-right: 7px;
}

.fx-timeline__title {
  font-size: var(--fx-font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fx-text-secondary);
}

.fx-timeline__list {
  flex: 1;
  overflow-y: auto;
  padding: var(--fx-gap-md);
  scroll-behavior: smooth;
}

/* — News Summary Box — */
.fx-news-summary {
  margin: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 0;
  overflow: hidden;
  display: none;
  box-shadow: 0 5px 5px rgb(0 0 0 / 45%);
  z-index: 9;
  /* Hidden by default until loaded */
  transition: all var(--fx-transition);
}

.fx-news-summary.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

.fx-news-summary__header {
  padding: 18px 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  position: relative;
}

.fx-news-summary__header:hover {
  background: rgba(59, 130, 246, 0.1);
}

.fx-news-summary__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--fx-accent);
  text-transform: uppercase;
  letter-spacing: 0;
}

.fx-news-summary__label::before {
  content: "8시간 요약";
  background: var(--fx-accent);
  color: var(--fx-bg-primary);
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 9px;
  margin-right: 2px;
}

.fx-news-summary__date {
  font-family: var(--fx-font-mono);
  font-size: 10px;
  opacity: 0.8;
  color: var(--fx-text-secondary);
}

.fx-news-summary__title {
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  color: var(--fx-text-primary);
  line-height: 1.5;
  word-break: keep-all;
}

.fx-news-summary__toggle-icon {
  position: absolute;
  top: 15px;
  right: 16px;
  font-size: 10px;
  color: var(--fx-text-muted);
}

/* Custom scrollbar */
.fx-timeline__list::-webkit-scrollbar {
  width: 5px;
}

.fx-timeline__list::-webkit-scrollbar-track {
  background: transparent;
}

.fx-timeline__list::-webkit-scrollbar-thumb {
  background: var(--fx-border);
  border-radius: var(--fx-radius-full);
}

/* ===================================
   4. News Card
   =================================== */
.fx-news-card {
  background: #101c2a !important;
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--fx-transition);
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}

.fx-news-card.is-read:not(.expanded) {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
  opacity: 0.5;
}

.fx-news-card.is-read:not(.expanded) .fx-news-card__title {
  color: var(--fx-text-muted);
}



.fx-news-ad {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--fx-border);
  border-radius: var(--fx-radius-md);
  padding: 20px;
  margin-bottom: 10px;
  text-align: center;
  position: relative;
}

.fx-news-ad::before {
  content: "AD";
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 9px;
  font-weight: 700;
  color: var(--fx-text-muted);
  opacity: 0.5;
}

.fx-news-card:hover {
  background: var(--fx-bg-card-hover);
  border-color: var(--fx-border-light);
}

.fx-news-card.highlighted {
  border-color: var(--fx-accent);
  box-shadow: var(--fx-shadow-glow);
  animation: fx-highlight-pulse 1.5s ease-in-out 3;
}

.fx-news-card.blinking {
  animation: fx-blink-bg 0.5s ease-in-out infinite;
}

@keyframes fx-highlight-pulse {

  0%,
  100% {
    box-shadow: var(--fx-shadow-glow);
  }

  50% {
    box-shadow: 0 0 30px var(--fx-accent-glow), 0 0 60px rgba(59, 130, 246, 0.1);
  }
}

@keyframes fx-blink-bg {

  0%,
  100% {
    background: var(--fx-bg-card);
    border-color: transparent;
  }

  50% {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--fx-accent);
  }
}

.fx-news-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--fx-gap-sm);
}

.fx-news-card__rate {
  font-family: var(--fx-font-mono);
  color: var(--fx-text-muted);
  font-weight: 500;
  font-size: 12px;
}

.fx-news-card:not(.is-read) .fx-news-card__rate {
  animation: fx-neon-pulse 2s infinite ease-in-out;
}

.fx-news-card__score {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--fx-font-mono);
  font-size: 11px;
  font-weight: 800;
  line-height: 15px;
  padding: 3px 3px 3px 8px;
  border-radius: 3px;
  transition: all var(--fx-transition);
}

.fx-news-card__score[data-impact="UP"] {
  color: var(--fx-red);
}

.fx-news-card__score[data-impact="DOWN"] {
  color: var(--fx-blue);
}

.fx-news-card__score[data-impact="NEUTRAL"] {
  color: var(--fx-text-muted);
}

.fx-news-card__unread-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--fx-text-muted);
  border-radius: 2px;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  margin-left: 2px;
}

.filter-read .fx-news-card__unread-btn {
  display: flex;
}

.fx-impact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  line-height: 1;
  font-size: 14px;
  font-weight: 900;
  color: var(--fx-bg-card);
  border-radius: 2px;
  margin-left: 3px;
}

.fx-impact-icon.neutral {
  font-size: 10px;
}

.fx-impact-icon.up {
  color: #ef4444;
  /* 상승(달러 강세) - 빨간색 배경 */
}

.fx-impact-icon.down {
  color: var(--fx-blue);
  /* 하락(달러 약세) - 파란색 배경 */
}

.fx-impact-icon.neutral {
  color: var(--fx-text-muted);
}

.fx-news-card__time {
  font-family: var(--fx-font-kr);
  font-size: 11px;
  color: var(--fx-text-muted);
}

.fx-news-card__flag {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-right: 2px;
}

.fx-news-card__lang {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.fx-news-card__lang.en {
  background: rgba(59, 130, 246, 0.15);
  color: var(--fx-accent);
}

.fx-news-card__lang.ko {
  background: rgba(245, 158, 11, 0.15);
  color: var(--fx-amber);
}

.fx-news-card__title {
  font-family: var(--fx-font-kr);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin: 8px 0;
  color: var(--fx-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-right: 55px;
  word-break: keep-all;
}

.fx-news-card.expanded .fx-news-card__title {
  -webkit-line-clamp: unset;
}

.fx-news-card.expanded {
  background: var(--fx-bg-card-hover);
  border-color: #253f5f;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px var(--fx-accent-glow);
  transform: translateY(-2px);
  z-index: 10;
}

.fx-news-card__summary {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

.fx-news-card.expanded .fx-news-card__summary {
  display: block;
  animation: fadeIn 0.3s ease;
}

.fx-news-card__summary p {
  color: #d1d5db;
  line-height: 1.7;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  margin-bottom: 0;
}

.fx-news-card__btn-close {
  background: transparent;
  border: 1px solid var(--fx-border);
  color: var(--fx-text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--fx-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--fx-transition);
}

.fx-news-card__btn-close:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--fx-text-secondary);
  color: var(--fx-text-primary);
}

.fx-news-card__btn-close span {
  font-size: 10px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fx-news-card__btn-link {
  display: inline-block;
  margin-top: 15px;
  padding: 6px 15px;
  border: 1px solid var(--fx-accent);
  color: var(--fx-accent) !important;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.fx-news-card__btn-link:hover {
  opacity: 0.9;
}

.fx-news-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 11px;
}

/* 5. Loading States */
.fx-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--fx-gap-lg);
  height: 100%;
  color: var(--fx-text-muted);
}

.fx-loading__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--fx-border);
  border-top-color: var(--fx-accent);
  border-radius: 50%;
  animation: fx-spin 0.8s linear infinite;
}

@keyframes fx-spin {
  to {
    transform: rotate(360deg);
  }
}

.fx-news-filter {
  display: flex;
  background: var(--fx-bg-primary);
  padding: 3px;
  border-radius: var(--fx-radius-sm);
  border: 1px solid var(--fx-border);
}

.fx-news-filter__btn {
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: var(--fx-text-muted);
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--fx-transition);
  font-family: var(--fx-font-sans);
}

.fx-news-filter__btn.active {
  background: var(--fx-bg-card);
  color: var(--fx-accent);
  box-shadow: var(--fx-shadow-sm);
}

.fx-news-filter__btn:hover:not(.active) {
  color: var(--fx-text-secondary);
}

/* Logic for hiding neutral news and low-level news in TOP filter */
.fx-timeline__list.hide-neutral .fx-news-card[data-impact="NEUTRAL"],
.fx-timeline__list.hide-neutral .fx-news-card[data-level="1"],
.fx-timeline__list.hide-neutral .fx-news-card[data-level="2"] {
  display: none;
}

/* Logic for showing only read news */
.fx-timeline__list.filter-read .fx-news-card[data-is-read="false"] {
  display: none;
}

/* — AI Brief Copy Button — */
.fx-btn-ai-brief {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--fx-border);
  background: var(--fx-bg-primary);
  color: var(--fx-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--fx-transition);
  position: relative;
}

.fx-btn-ai-brief svg {
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.fx-btn-ai-brief:hover {
  background: var(--fx-accent-glow);
  border-color: var(--fx-accent);
  color: var(--fx-accent);
  box-shadow: 0 0 8px var(--fx-accent-glow);
}

.fx-btn-ai-brief.copied {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #22c55e;
}

/* Tooltip */
.fx-btn-ai-brief::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  background: var(--fx-bg-card);
  color: var(--fx-text-primary);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: var(--fx-radius-sm);
  border: 1px solid var(--fx-border);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}

/* ===================================
   6. KDI (KRW Divergence Index) Widget
   =================================== */
.fx-kdi-widget {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: rgba(18, 17, 16, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--fx-border);
  transition: all var(--fx-transition-slow);
}

.fx-kdi-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  gap: 12px;
  min-height: 38px;
}

.fx-kdi-widget__title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-kdi-widget__label {
  font-family: var(--fx-font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--fx-accent);
  background: rgba(167, 139, 250, 0.12);
  padding: 2px 7px;
  border-radius: 3px;
}

.fx-kdi-widget__value {
  font-family: var(--fx-font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--fx-text-primary);
  min-width: 60px;
}

.fx-kdi-widget__signal {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--fx-radius-full);
  letter-spacing: 0.02em;
  display: none;
}

.fx-kdi-widget__signal[data-signal="DIVERGE_UP"] {
  display: inline-block;
  background: var(--fx-red-bg);
  color: var(--fx-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.fx-kdi-widget__signal[data-signal="STRONG_DIVERGE_UP"] {
  display: inline-block;
  background: var(--fx-red);
  color: #fff;
  animation: fx-kdi-pulse 1.5s infinite;
}

.fx-kdi-widget__signal[data-signal="DIVERGE_DOWN"] {
  display: inline-block;
  background: var(--fx-blue-bg);
  color: var(--fx-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.fx-kdi-widget__signal[data-signal="STRONG_DIVERGE_DOWN"] {
  display: inline-block;
  background: var(--fx-blue);
  color: #fff;
  animation: fx-kdi-pulse 1.5s infinite;
}

.fx-kdi-widget__signal[data-signal="NORMAL"] {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fx-text-muted);
  border: 1px solid var(--fx-border);
}

@keyframes fx-kdi-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* Controls */
.fx-kdi-widget__controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fx-kdi-widget__slider-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fx-kdi-widget__slider-label {
  font-family: var(--fx-font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--fx-text-muted);
  white-space: nowrap;
}

.fx-kdi-widget__slider-label span {
  color: var(--fx-text-secondary);
  font-weight: 700;
}

.fx-kdi-widget__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 45px;
  height: 4px;
  background: var(--fx-border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.fx-kdi-widget__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fx-accent);
  border: 2px solid rgba(167, 139, 250, 0.4);
  cursor: pointer;
  transition: all var(--fx-transition);
}

.fx-kdi-widget__slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.5);
}

.fx-kdi-widget__reset-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--fx-bg-primary);
  color: var(--fx-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--fx-transition);
  flex-shrink: 0;
  margin-right: 8px;
}

.fx-kdi-widget__reset-btn:hover {
  background: rgba(167, 139, 250, 0.15);
  border-color: var(--fx-accent);
  color: var(--fx-accent);
}

.fx-kdi-widget__toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--fx-border);
  background: var(--fx-bg-primary);
  color: var(--fx-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--fx-transition);
  flex-shrink: 0;
}

.fx-kdi-widget__toggle-btn:hover {
  background: rgba(167, 139, 250, 0.15);
  border-color: var(--fx-accent);
  color: var(--fx-accent);
}

.fx-kdi-widget__toggle-btn.active {
  background: rgba(167, 139, 250, 0.2);
  border-color: var(--fx-accent);
  color: var(--fx-accent);
}

/* Chart wrap */
.fx-kdi-widget__chart-wrap {
  position: relative;
  height: 0;
  overflow: hidden;
  transition: height var(--fx-transition-slow);
}

.fx-kdi-widget__chart-wrap.expanded {
  height: 150px;
  border-top: 1px solid var(--fx-border);
}

.fx-kdi-widget__chart {
  width: 100%;
  height: 100%;
}

/* σ Band Labels */
.fx-kdi-widget__bands {
  position: absolute;
  top: 0;
  right: 6px;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  padding: 4px 0;
}

.fx-kdi-widget__band-label {
  font-family: var(--fx-font-mono);
  font-size: 8px;
  font-weight: 600;
  color: var(--fx-text-muted);
  opacity: 0.5;
}

/* ===================================
   7. Responsive
   =================================== */
@media (max-width: 1024px) {
  :root {
    --fx-timeline-width: 340px;
  }
}

@media (max-width: 768px) {
  .fx-main {
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    position: relative;
  }

  .fx-header {
    padding: 8px 16px;
    height: auto;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    z-index: 300;
  }

  body.logged-in .fx-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .fx-header.collapsed {
    gap: 0;
    padding-bottom: 4px;
  }

  .fx-header.collapsed .fx-header__controls {
    max-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    border: none;
    overflow: hidden;
  }

  .fx-header__clock {
    display: none;
  }

  body.logged-in .fx-header__top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  #fx-account-dropdown {
    position: absolute;
    top: 8px;
    right: 16px;
    margin: 0 !important;
    z-index: 310;
  }

  .fx-header__rate {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-right: 48px;
  }

  .fx-header__controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--fx-bg-primary);
    border: 1px solid var(--fx-border);
    padding: 2px;
    border-radius: var(--fx-radius-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 100px;
  }

  .fx-interval-toggle {
    flex: 2;
    display: flex;
    background: none;
    border: none;
    padding: 0;
  }

  .fx-interval-toggle__btn {
    flex: 1;
    padding: 6px 0;
    text-align: center;
    border-radius: 4px;
    font-size: 11px;
  }



  .fx-chart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background: var(--fx-bg-primary);
    z-index: 200;
    border-right: none;
    border-bottom: 1px solid var(--fx-border);
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .fx-chart.active {
    transform: translateY(0);
    visibility: visible;
  }

  .fx-timeline {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .fx-timeline__list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* KDI widget mobile adjustments */
  .fx-kdi-widget__slider-group,
  .fx-kdi-widget__reset-btn {
    display: none;
  }

  .fx-kdi-widget__header {
    padding: 6px 12px;
  }

  .fx-kdi-widget__value {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  :root {
    --fx-gap-xl: 12px;
  }

  .fx-header {
    padding: 8px 12px;
  }

  .fx-header__rate {
    padding-top: 6px;
  }

  .fx-header__rate-label {
    display: block;
    font-size: 0.75rem;
    color: var(--fx-text-muted);
  }

  .fx-header__rate-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #FFEB3B;
  }

  .fx-chart {
    height: 300px;
  }

  .fx-chart__legend {
    display: none;
  }

  .fx-news-card {
    padding: 12px 10px;
  }

  .fx-timeline__header {
    padding: 10px 12px 10px 8px;
    background: var(--fx-bg-primary);
    border-bottom: 1px solid var(--fx-border);
  }

  .fx-header__btn-chart-toggle {
    width: 100%;
    justify-content: center;
  }
}

/* KDI Help Button & Modal */
.fx-kdi-widget__signal-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fx-kdi-widget__help-btn {
  background: none;
  border: none;
  padding: 4px;
  color: var(--fx-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.fx-kdi-widget__help-btn:hover {
  background: var(--fx-bg-card-hover);
  color: var(--fx-accent);
  opacity: 1;
}

/* Modal System */
.fx-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.fx-modal.active {
  display: flex;
}

.fx-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.fx-modal__container {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #05080d;
  /* border: 1px solid var(--fx-border-light); */
  border-radius: 0 !important;
  box-shadow: 0 0px 120px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fx-modal__header {
  padding: 16px 0px;
  margin: 0 20px;
  /* background: var(--fx-bg-secondary); */
  border-bottom: 1px solid var(--fx-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fx-modal__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fx-text-primary);
  margin: 0;
}

.fx-modal__close {
  background: none;
  border: none;
  color: var(--fx-text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}

.fx-modal__body {
  padding: 24px 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.fx-guide-section {
  margin-bottom: 24px;
}

.fx-guide-section:last-child {
  margin-bottom: 0;
}

.fx-guide-section h4 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  color: var(--fx-accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-guide-section p {
  margin: 0 0 12px 0;
  font-size: 0.875rem;
  color: var(--fx-text-secondary);
  line-height: 1.6;
}

.fx-guide-note {
  padding: 12px;
  background: var(--fx-bg-secondary);
  border-radius: 0;
  font-style: italic;
  border-left: 3px solid var(--fx-accent);
}

.fx-guide-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fx-guide-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.8125rem;
  color: var(--fx-text-secondary);
  line-height: 1.5;
}

.fx-guide-list li .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.fx-guide-list li .dot.normal {
  background: var(--fx-accent);
}

.fx-guide-list li .dot.up {
  background: #ef4444;
}

.fx-guide-list li .dot.down {
  background: #3b82f6;
}

.fx-guide-list li strong {
  color: var(--fx-text-primary);
  display: block;
  margin-bottom: 2px;
  min-width: 55px;
}

/* ===================================
   8. Summary Report Styling (Modern Report)
   =================================== */
#fx-summary-modal .fx-modal__container {
  max-width: 650px;
  height: 100%;
  background: #fdfdfd;
  /* Light paper-like background for report */
  color: #1a1a1a;
  border-radius: 3px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

#fx-summary-modal .fx-modal__header {
  background: #f8f9fa;
  border-bottom: none;
  padding: 25px 40px 15px 40px;
  margin: 0;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

#fx-summary-modal .fx-modal__title {
  font-family: var(--fx-font-kr);
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.03em;
  line-height: 1.25;
  word-break: keep-all;
  margin-right: 20%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left center;
}

/* Scrolled state */
#fx-summary-modal.is-scrolled .fx-modal__header {
  padding-top: 15px;
  padding-bottom: 10px;
  margin: 0;
  background: rgba(248, 249, 250, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgb(81 115 107 / 31%);
}

#fx-summary-modal.is-scrolled .fx-modal__title {
  font-size: 1.1rem;
  line-height: 1.35;
  margin: 5px 50px 10px 0;
}

#fx-summary-modal .fx-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
}

/* Floating Share Button */
.fx-modal__share {
  position: absolute;
  bottom: 28px;
  right: 30px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--fx-accent);
  color: #ffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fx-modal__share:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.fx-modal__share:active {
  transform: scale(0.95);
}

.fx-modal__share svg {
  stroke-width: 2.5;
}

/* Mobile: Move button slightly to not overlap with safe areas or content */
@media (max-width: 640px) {
  .fx-modal__share {
    bottom: 25px;
    right: 25px;
    width: 48px;
    height: 48px;
  }
}

#fx-summary-modal .fx-modal__close::before,
#fx-summary-modal .fx-modal__close::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 1px;
  background-color: #000;
}

#fx-summary-modal .fx-modal__close::before {
  transform: rotate(45deg);
}

#fx-summary-modal .fx-modal__close::after {
  transform: rotate(-45deg);
}

#fx-summary-modal .fx-modal__close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

#fx-summary-modal .fx-modal__body {
  word-break: keep-all;
  padding: 20px 45px 40px;
  max-height: 85vh;
  line-height: 1.8;
}

.fx-news-summary__modal-date {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--fx-font-mono);
  font-size: 11px !important;
  color: #71717a !important;
  margin-bottom: 35px !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid #e4e4e7;
  padding-bottom: 15px;
}

.fx-news-summary__modal-date::before {
  content: "";
  display: block;
  width: 15px;
  height: 1px;
  background: #71717a;
}

.fx-news-summary__modal-content {
  font-size: 15px;
  color: #27272a;
}

.fx-news-summary__modal-content p {
  margin-bottom: 24px;
}

.fx-news-summary__modal-content p.trend-summary {
  font-size: 1.1em;
  font-weight: 500;
}

.fx-news-summary__modal-content h2 {
  margin-top: 48px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4e4e7;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a1a1a;
}

.fx-news-summary__modal-content h2:first-child {
  margin-top: 0;
}

.fx-news-summary__modal-content strong {
  color: #09090b;
  font-weight: 700;
}

/* Bullet points in report */
.fx-news-summary__modal-content ul,
.fx-news-summary__modal-content ol {
  margin-bottom: 28px;
  padding-left: 20px;
  color: var(--fx-accent);
}

.fx-news-summary__modal-content li {
  /* margin-bottom: 14px; */
  position: relative;
}

.related_news_link li {
  list-style: decimal-leading-zero;
  padding: 6px 10px;
  background-color: #eaeaea;
  background: linear-gradient(90deg, rgb(240 240 240) 0%, rgb(242 242 242 / 40%) 100%);
  border-radius: 3px;
  margin-bottom: 2px;
  margin-left: 10px;
  font-size: 12px;
  color: #484848;
  word-break: keep-all;
}

.related_news_link li a {
  font-size: 14px;
  line-height: 1.25;
  color: #008f6c;
  font-weight: 500;
  margin-right: 5px;
}

.additional_news_link li a {
  color: #008f6c;
  margin-right: 5px;
}

.fx-news-summary__modal-content h3,
.fx-news-summary__modal-content h4 {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 40px 0 18px 0;
  padding-left: 12px;
  border-left: 4px solid var(--fx-accent);
  line-height: 1.5;
  word-break: keep-all;
}

.fx-news-summary__modal-content h3:first-child,
.fx-news-summary__modal-content h4:first-child {
  margin-top: 0;
}

/* Footer of the report */
.fx-news-summary__report-footer {
  margin-top: 50px;
  padding-top: 25px;
  border-top: 1px dashed #e4e4e7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-read .fx-news-card__score-label {
  display: none;
}

.filter-read .fx-news-card__score {
  background: transparent;
  padding: 0;
}

.fx-news-summary__ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f4f4f5;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #52525b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.fx-news-summary__ai-badge svg {
  color: var(--fx-accent);
}

.fx-news-summary__report-stamp {
  font-family: var(--fx-font-mono);
  font-size: 10px;
  font-weight: 600;
  color: #a1a1aa;
  text-transform: uppercase;
}

/* Mobile adjustments for report */
@media (max-width: 640px) {
  #fx-summary-modal .fx-modal__container {
    max-width: 100%;
    margin: 0;
    height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  #fx-summary-modal .fx-modal__header {
    padding: 20px 20px 15px;
    flex-shrink: 0;
  }

  #fx-summary-modal .fx-modal__body {
    padding: 20px 20px 80px;
    /* 하단 짤림 방지용 여백 추가 */
    max-height: none;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #fx-summary-modal .fx-modal__title {
    font-size: 1.15rem !important;
    margin-right: 15% !important;
    line-height: 1.25 !important;
  }


}

/* ===================================
   DXY Sync 설정 Modal
   =================================== */
#fx-dxy-sync-modal .fx-modal__container,
.fx-dxy-modal__container {
  max-width: 400px;
  width: 92%;
}

.fx-dxy-modal__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fx-dxy-modal__desc {
  font-size: 12px;
  color: var(--fx-text-muted);
  line-height: 1.7;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid rgba(234, 179, 8, 0.4);
  border-radius: 0 var(--fx-radius-sm) var(--fx-radius-sm) 0;
}

/* 실시간 값 표시 영역 */
.fx-dxy-modal__live {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(234, 179, 8, 0.06);
  border: 1px solid rgba(234, 179, 8, 0.2);
  border-radius: var(--fx-radius-sm);
}

.fx-dxy-modal__live-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.fx-dxy-modal__live-label {
  font-size: 10px;
  color: var(--fx-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fx-dxy-modal__live-val {
  font-family: var(--fx-font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #eab308;
}

.fx-dxy-modal__live-sep {
  font-size: 14px;
  color: var(--fx-text-muted);
  flex-shrink: 0;
}

.fx-dxy-modal__apply-live {
  flex-shrink: 0;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: #eab308;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--fx-radius-sm);
  cursor: pointer;
  transition: all var(--fx-transition);
  white-space: nowrap;
}

.fx-dxy-modal__apply-live:hover {
  background: rgba(234, 179, 8, 0.25);
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.2);
}

/* 앵커값 입력 필드 */
.fx-dxy-modal__fields {
  display: flex;
  gap: 12px;
}

.fx-dxy-modal__field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fx-dxy-modal__field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fx-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fx-dxy-modal__input {
  width: 100%;
  background: var(--fx-bg-primary);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-sm);
  color: var(--fx-text-primary);
  font-family: var(--fx-font-mono);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 10px;
  transition: border-color var(--fx-transition);
  -moz-appearance: textfield;
}

.fx-dxy-modal__input::-webkit-inner-spin-button,
.fx-dxy-modal__input::-webkit-outer-spin-button {
  opacity: 0.4;
}

.fx-dxy-modal__input:focus {
  outline: none;
  border-color: rgba(234, 179, 8, 0.5);
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.1);
}

/* 민감도 슬라이더 */
.fx-dxy-modal__sensitivity {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-sm);
}

.fx-dxy-modal__sensitivity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fx-dxy-modal__sensitivity-header label {
  font-size: 12px;
  font-weight: 700;
  color: var(--fx-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.fx-dxy-modal__sensitivity-val {
  font-family: var(--fx-font-mono);
  font-size: 18px;
  font-weight: 800;
  color: #eab308;
  min-width: 40px;
  text-align: right;
}

.fx-dxy-modal__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--fx-border);
  outline: none;
  cursor: pointer;
}

.fx-dxy-modal__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eab308;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.5);
  cursor: pointer;
  transition: box-shadow var(--fx-transition);
}

.fx-dxy-modal__slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.7);
}

.fx-dxy-modal__sensitivity-desc {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--fx-text-muted);
}

.fx-dxy-modal__sensitivity-desc .center {
  color: rgba(234, 179, 8, 0.7);
}

.fx-dxy-modal__formula {
  font-size: 11px;
  color: var(--fx-text-muted);
  font-style: italic;
  text-align: center;
  margin-top: 2px;
}

/* 버튼 영역 */
.fx-dxy-modal__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
  border-top: 1px solid var(--fx-border);
}

.fx-dxy-modal__btn-reset {
  background: none;
  border: 1px solid var(--fx-border);
  color: var(--fx-text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--fx-radius-sm);
  cursor: pointer;
  transition: all var(--fx-transition);
}

.fx-dxy-modal__btn-reset:hover {
  border-color: var(--fx-border-light);
  color: var(--fx-text-secondary);
}

.fx-dxy-modal__btn-cancel {
  background: none;
  border: 1px solid var(--fx-border);
  color: var(--fx-text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--fx-radius-sm);
  cursor: pointer;
  transition: all var(--fx-transition);
}

.fx-dxy-modal__btn-cancel:hover {
  border-color: var(--fx-border-light);
}

.fx-dxy-modal__btn-apply {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #eab308;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 22px;
  border-radius: var(--fx-radius-sm);
  cursor: pointer;
  transition: all var(--fx-transition);
}

.fx-dxy-modal__btn-apply:hover {
  background: rgba(234, 179, 8, 0.25);
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.25);
}

@media (max-width: 640px) {
  .fx-dxy-modal__fields {
    flex-direction: column;
  }

  .fx-dxy-modal__live {
    flex-wrap: wrap;
  }
}

/* PWA Install Guide */
.fx-pwa-guide {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 9999;
  width: calc(100% - 32px);
  max-width: 420px;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
  opacity: 0;
}

.fx-pwa-guide.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.fx-pwa-guide__content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fx-pwa-guide__icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: var(--fx-bg-primary);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fx-pwa-guide__icon img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.fx-pwa-guide__info {
  flex: 1;
}

.fx-pwa-guide__title {
  margin: 0 0 2px 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.fx-pwa-guide__desc {
  margin: 0;
  font-size: 12px;
  color: var(--fx-text-muted);
  line-height: 1.4;
}

.fx-pwa-guide__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-pwa-guide__btn-install {
  background: var(--fx-accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 6px 12px 8px;
  font-family: var(--fx-font-kr);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.fx-pwa-guide__btn-install:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.fx-pwa-guide__btn-close {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fx-text-muted);
  border: none;
  border-radius: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.fx-pwa-guide__btn-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* iOS Specific Guide Style */
.fx-pwa-guide.is-ios .fx-pwa-guide__btn-install {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  pointer-events: auto;
  /* iOS는 클릭 시 alert 가이드 노출을 위해 auto로 변경 */
}

@media (max-width: 480px) {
  .fx-pwa-guide {
    bottom: 16px;
    width: calc(100% - 20px);
    padding: 12px;
  }

  .fx-pwa-guide__icon {
    width: 44px;
    height: 44px;
  }

  .fx-pwa-guide__title {
    font-size: 14px;
  }

  .fx-pwa-guide__desc {
    font-size: 11px;
  }
}

/* Popup Interval Toggle */
.fx-popup-interval-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 100px;
  margin: 20px auto 0;
  grid-column: 1 / -1;
  border: 1px solid var(--fx-border);
  width: fit-content;
}

.fx-popup-interval-btn {
  padding: 6px 10px;
  min-width: 48px;
  border: none;
  background: transparent;
  color: var(--fx-text-muted);
  font-size: 14px;
  font-weight: 700;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--fx-transition);
}

.fx-popup-interval-btn.active {
  background: var(--fx-accent);
  color: #fff;
  box-shadow: 0 0 10px var(--fx-accent-glow);
}

.fx-popup-interval-btn:hover:not(.active) {
  color: var(--fx-text-primary);
}

@media (max-width: 480px) {
  .fx-popup-interval-btn {
    padding: 5px 15px;
    font-size: 13px;
  }
}

/* ===================================
   15. News Summary Chart
   =================================== */
.fx-summary-chart {
  width: 100%;
  height: 250px;
  margin: 24px 0;
  background: var(--color-abyss);
  border-radius: var(--fx-radius-md);
  border: 1px solid var(--fx-border-light);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.fx-summary-chart__loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: var(--fx-font-size-xs);
  color: var(--fx-text-muted);
  background: var(--fx-bg-primary);
  z-index: 5;
}

.fx-summary-chart__loading .spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(139, 168, 196, 0.1);
  border-top-color: var(--fx-accent);
  border-radius: 50%;
  animation: fx-spin 0.8s linear infinite;
}

@keyframes fx-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .fx-summary-chart {
    height: 200px;
    margin: 16px 0;
  }
}

.original-source {
  display: inline-block;
  font-size: 0.7rem;
  color: rgb(91 123 153 / 75%);
  vertical-align: middle;
  line-height: 1.25em;
  background: rgba(139, 168, 196, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

/* Advanced Settings Toggle */
.fx-modal__advanced-toggle-wrapper {
  margin: 15px 0 5px;
  text-align: right;
}

.fx-modal__advanced-toggle {
  background: none;
  border: none;
  color: var(--fx-accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 5px 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.fx-modal__advanced-toggle:hover {
  opacity: 1;
}

/* ===================================
   12. Landing Page (General User)
   =================================== */
.fx-landing {
  flex: 1;
  overflow-y: auto;
  background: var(--fx-bg-primary);
  padding: var(--fx-gap-2xl) var(--fx-gap-xl);
  scroll-behavior: smooth;
}

.fx-landing__container {
  max-width: 1200px;
  margin: 0 auto;
}

.fx-landing__hero {
  text-align: center;
  /* margin-bottom: var(--fx-gap-2xl); */
  padding: var(--fx-gap-2xl) 0;
}

.fx-landing__title {
  font-size: var(--fx-font-size-3xl);
  font-weight: 900;
  color: #fff;
  margin-bottom: var(--fx-gap-md);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, var(--fx-text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fx-landing__subtitle {
  font-size: var(--fx-font-size-lg);
  color: var(--fx-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.fx-post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--fx-gap-xl);
  margin-bottom: var(--fx-gap-2xl);
}

.fx-post-card {
  background: #101c2a;
  border: 1px solid var(--fx-border);
  border-radius: 10px;
  overflow: hidden;
  transition: all var(--fx-transition);
  position: relative;
}

.fx-post-card:hover {
  transform: translateY(-4px);
  background-color: var(--fx-bg-card);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: var(--fx-shadow-lg), 0 0 20px rgba(0, 200, 150, 0.1);
}

.fx-post-card__link {
  display: block;
  padding: var(--fx-gap-xl);
  height: 100%;
}

.fx-post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--fx-gap-sm);
  margin-bottom: var(--fx-gap-md);
}

.fx-post-card__badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--fx-accent);
  background: var(--fx-accent-glow);
  padding: 2px 8px;
  border-radius: var(--fx-radius-sm);
  text-transform: uppercase;
}

.fx-post-card__date {
  font-size: 11px;
  font-weight: 700;
  color: var(--fx-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fx-post-card__title {
  font-size: var(--fx-font-size-xl);
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--fx-gap-md);
  line-height: 1.4;
  word-break: keep-all;
}

.fx-post-card__excerpt {
  font-size: var(--fx-font-size-base);
  color: var(--fx-text-secondary);
  margin-bottom: var(--fx-gap-lg);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fx-post-card__footer {
  margin-top: auto;
}

.fx-post-card__readmore {
  font-size: var(--fx-font-size-sm);
  font-weight: 600;
  color: var(--fx-accent);
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.fx-post-card:hover .fx-post-card__readmore {
  opacity: 1;
}

.fx-post-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--fx-gap-2xl);
  background: var(--fx-bg-card);
  border: 1px dashed var(--fx-border);
  border-radius: var(--fx-radius-lg);
  color: var(--fx-text-muted);
}

.fx-pagination {
  display: flex;
  justify-content: center;
  gap: var(--fx-gap-sm);
  margin-top: var(--fx-gap-2xl);
}

.fx-pagination .page-numbers {
  padding: 5px 12px;
  background: var(--fx-bg-card);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-sm);
  color: var(--fx-text-secondary);
  font-size: 11px;
  font-weight: 600;
  transition: all var(--fx-transition);
}

.fx-pagination .page-numbers:hover {
  background: var(--fx-bg-card-hover);
  border-color: rgba(59, 130, 246, 0.3);
}

.fx-pagination .page-numbers.current {
  background: var(--fx-text-muted);
  color: var(--fx-bg-primary);
  /* border-color: var(--fx-accent); */
}

/* Mobile Adjustments for Landing */
@media (max-width: 768px) {
  .fx-landing {
    padding: var(--fx-gap-xl) var(--fx-gap-md);
  }

  .fx-landing__title {
    font-size: var(--fx-font-size-2xl);
  }

  .fx-post-list {
    grid-template-columns: 1fr;
  }
}

.fx-header__btn-login {
  background: var(--fx-text-muted);
  color: var(--fx-bg-primary);
  padding: 6px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  transition: all var(--fx-transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.fx-header__btn-login:hover {
  background: var(--fx-accent-hover);
  box-shadow: var(--fx-shadow-glow);
  color: var(--fx-bg-primary);
  transform: translateY(-1px);
}

/* General User Header Adjustments (Non-Logged In) */
body:not(.logged-in) .fx-header__peer-rates {
  display: none !important;
}

@media (max-width: 768px) {
  body:not(.logged-in) .fx-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 16px !important;
  }

  body:not(.logged-in) .fx-header__top-row {
    margin: 0 !important;
    flex: 1;
  }

  body:not(.logged-in) .fx-header__rate {
    flex-direction: row !important;
    align-items: center !important;
  }

  body:not(.logged-in) .fx-header__controls {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* General User Rate Change: 2 lines */
/* Rate Change: 2 lines for all users */
.fx-header__rate-change {
  gap: 6px;
}

#fx-rate-diff {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  justify-content: center;
}

#fx-rate-diff span:last-child {
  font-size: 9px;
  opacity: 0.8;
}

/* Login Button Specific Styles */
.fx-account-btn.is-login-btn {
  background: #0d6266;
  background: linear-gradient(166deg, rgba(13, 98, 102, 1) 0%, rgba(0, 200, 150, 1) 100%);
  color: #0d1e35;
  border-radius: 4px;
  padding: 5px 12px 3px;
  font-size: 12px;
  font-weight: 700;
  width: auto;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--fx-accent-glow);
  border: none;
  transition: background 0.3s;
}

.fx-account-btn.is-login-btn:hover {
  background: #00C896;
}

/* Login Modal Styles */
.fx-login-modal__container {
  max-width: 360px !important;
}

.fx-login-form {
  padding: var(--fx-gap-md) 0;
}

.fx-login-form__field {
  margin-bottom: var(--fx-gap-lg);
}

.fx-login-form__field label {
  display: block;
  font-size: 13px;
  color: var(--fx-text-secondary);
  margin-bottom: 6px;
}

.fx-login-form__field input {
  width: calc(100% - 2px);
  font-family: var(--fx-font-sans);
  font-variant-numeric: tabular-nums;
  padding: 12px 0;
  background: transparent;
  border: none !important;
  border-radius: none;
  color: #fff;
  font-size: 48px;
  text-align: center;
  letter-spacing: -4px;
  /* 글자 사이는 더 쫀쫀하게 */
  word-spacing: -1px;
  /* 마디 사이 공백만 5px 추가 */
  animation: fx-neon-pulse 2s infinite ease-in-out;
  transition: all 0.2s;
}

/* 숫자 입력 필드 상하 화살표 제거 */
.fx-login-form__field input::-webkit-outer-spin-button,
.fx-login-form__field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.fx-login-form__field input[type=number] {
  -moz-appearance: textfield;
}

.fx-login-form__field input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

.fx-login-form__submit {
  width: 100%;
  padding: 14px;
  background: var(--fx-accent);
  color: var(--fx-bg-primary);
  border: none;
  border-radius: var(--fx-radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: var(--fx-gap-md);
}

.fx-login-form__submit:hover {
  background: var(--fx-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--fx-shadow-glow);
}

.fx-login-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.fx-login-form__message {
  font-size: 13px;
  margin: 10px 0;
  min-height: 20px;
  text-align: center;
}

.fx-login-form__message.error {
  color: #ff4d4d;
}

.fx-login-form__message.success {
  color: var(--fx-accent);
}

/* Multi-step Login UI */
.fx-login-steps {
  position: relative;
}

.fx-login-step {
  display: none;
  animation: fx-fade-in 0.3s ease;
}

.fx-login-step.active {
  display: block;
}

@keyframes fx-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fx-login-form__agreement {
  margin: 15px 0;
  font-size: 12px;
  color: var(--fx-text-muted);
}

.fx-login-form__agreement label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.fx-login-form__agreement input {
  margin-top: 2px;
}

.fx-login-form__agreement a {
  color: var(--fx-accent);
  text-decoration: underline;
}

.fx-login-form__help {
  font-size: 11px;
  color: var(--fx-text-muted);
  margin-top: 8px;
}

.fx-login-form__back {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--fx-text-muted);
  font-size: 12px;
  margin-top: 15px;
  cursor: pointer;
  text-decoration: underline;
}

.fx-login-form__back:hover {
  color: var(--fx-text-secondary);
}

.fx-login-form__reset-request {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--fx-text-muted);
  font-size: 11px;
  margin-top: 12px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.fx-login-form__reset-request:hover {
  opacity: 1;
  text-decoration: underline;
}

#fx-policy-modal .fx-modal__container {
  max-width: 650px;
  background: #fdfdfd;
  color: #1a1a1a;
  border-radius: 3px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

#fx-policy-modal .fx-modal__header {
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  padding: 25px 40px 15px 40px;
}

#fx-policy-modal .fx-modal__title {
  color: #1a1a1a;
  font-weight: 900;
  letter-spacing: -0.5px;
}

#fx-policy-modal .fx-modal__close {
  color: #888;
  top: 25px;
  right: 25px;
}

.fx-policy-content {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
  max-height: 65vh;
  overflow-y: auto;
  padding: 0 40px 30px 40px;
}

.fx-policy-content h2 {
  font-size: 19px;
  color: #000;
  margin: 35px 0 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
}

.fx-policy-content h2::before {
  content: "";
  display: block;
  width: 4px;
  height: 20px;
  background: var(--fx-accent);
}

#fx-policy-modal .fx-modal__badge {
  background: var(--fx-red-bg);
  color: var(--fx-red);
  font-weight: 800;
  border: none;
}

#fx-policy-modal .fx-modal__meta {
  color: #666;
  font-weight: 500;
  border-top: 1px solid #eee;
  margin-top: 15px;
  padding-top: 10px;
}

.fx-policy-content p {
  margin-bottom: 18px;
}

/* Custom Scrollbar */
.fx-policy-content::-webkit-scrollbar {
  width: 5px;
}

.fx-policy-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

.fx-policy-content::-webkit-scrollbar-thumb {
  background: var(--fx-accent);
  border-radius: 10px;
}

/* Hide rate change on very small screens */
@media (max-width: 500px) {
  body:not(.logged-in) #fx-rate-change {
    display: none !important;
  }
}

/* Logo Blinking Dot */
.fx-header__logo-dot {
  position: absolute;
  bottom: 6px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--fx-accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--fx-accent);
  z-index: 10;
  pointer-events: none;
}

/* Blinking Animation */
.fx-blink {
  animation: fx-blink-anim 0.8s ease-in-out;
}

@keyframes fx-blink-anim {

  0%,
  100% {
    opacity: 1;
    filter: brightness(1);
  }

  50% {
    opacity: 0.4;
    filter: brightness(1.5);
  }
}

#fx-rate-value.fx-blink {
  color: var(--fx-accent);
  text-shadow: 0 0 15px rgba(0, 255, 157, 0.4);
}

/* Join Modal Styles */
#fx-join-modal .fx-modal__container {
  max-width: 480px;
}

.fx-guide-section {
  margin-bottom: 24px;
}

.fx-guide-section h4 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-guide-section h4::before {
  content: "";
  display: block;
  width: 3px;
  height: 14px;
  background: var(--fx-accent);
  border-radius: 2px;
}

.fx-guide-section p {
  font-size: 14px;
  color: var(--fx-text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.fx-guide-list {
  list-style: none;
  padding: 0;
}

.fx-guide-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--fx-text-secondary);
  margin-bottom: 10px;
}

.fx-guide-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--fx-accent);
  font-weight: 900;
}

.fx-guide-list li strong {
  color: var(--fx-text-primary);
  font-weight: 700;
}

.fx-guide-note {
  font-style: italic;
}