/* =========================================================================
   API 투자전략센터 — Notice Popup styles (responsive)
   ========================================================================= */
.npop { position: fixed; inset: 0; height: 100vh; height: 100dvh; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.npop__backdrop { position: absolute; inset: 0; background: rgba(4,7,14,0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.3s var(--ease); }
.npop.show .npop__backdrop { opacity: 1; }

.npop__stack { position: relative; display: grid; align-items: center; justify-items: center; max-width: 100%; max-height: 100%; }

.npop__card {
  position: relative; grid-area: 1 / 1; width: 600px; height: 900px;
  max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  display: none; flex-direction: column; overflow: hidden;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-float);
  opacity: 0; transform: translateY(18px) scale(0.97); transition: opacity 0.32s var(--ease-out), transform 0.32s var(--ease-out);
}
.npop__card.is-current { display: flex; }
.npop.show .npop__card.is-current { opacity: 1; transform: none; }
.npop__card.leaving { opacity: 0; transform: translateY(10px) scale(0.97); transition: opacity 0.24s var(--ease), transform 0.24s var(--ease); }
.npop__card.is-done { display: none; }

/* top accent line removed per request */

.npop__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 18px 0; }
.npop__tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.npop__imp { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); color: #ff5f6e; background: rgba(255,95,110,0.12); border: 1px solid rgba(255,95,110,0.3); }
.npop__imp svg { width: 11px; height: 11px; }
.npop__cat { font-size: var(--fs-badge); line-height: var(--lh-badge); font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill); color: var(--accent-prime); background: rgba(91,168,255,0.12); border: 1px solid rgba(91,168,255,0.28); }
:root[data-theme="light"] .npop__cat { color: #0a4ba0; }
.npop__counter { font-family: var(--font-sans); font-size: var(--fs-badge); line-height: var(--lh-badge); color: var(--text-inactive); margin-left: 2px; }
.npop__x { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--text-dim); flex-shrink: 0; transition: color 0.18s, background-color 0.18s; }
.npop__x:hover { color: var(--text); background: var(--surface-2); }
.npop__x svg { width: 18px; height: 18px; }

.npop__titlebar { padding: 16px 22px 0; flex-shrink: 0; }
.npop__body { padding: 0 22px 6px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.npop__title { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.02em; line-height: var(--lh-h3); margin-bottom: 10px; color: var(--text); }
.npop__text { font-size: var(--fs-text-md); line-height: var(--lh-text-md); color: var(--text-2); }
.npop__date { display: inline-block; margin-top: 14px; font-family: var(--font-sans); font-size: var(--fs-badge); line-height: var(--lh-badge); color: var(--text-inactive); }

.npop__actions { padding: 16px 22px 4px; }
.npop__more { display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: center; padding: 13px 20px; border-radius: var(--r-pill); font-weight: 600; font-size: var(--fs-text-md); line-height: var(--lh-text-md); color: var(--btn-primary-text); background: var(--btn-primary-bg); box-shadow: 0 10px 26px -12px var(--glow-cyan); transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.npop__more:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -14px var(--glow-cyan); }
.npop__more svg { width: 17px; height: 17px; transition: transform 0.2s var(--ease); }
.npop__more:hover svg { transform: translateX(3px); }

.npop__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 22px 18px; margin-top: 8px; }
.npop__today, .npop__close { font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); font-weight: 500; color: var(--text-muted); padding: 8px 4px; transition: color 0.18s; }
.npop__today { position: relative; padding-left: 22px; }
.npop__today::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--border-strong); transition: border-color 0.18s, background-color 0.18s; }
.npop__today:hover { color: var(--text-2); }
.npop__today:hover::before { border-color: var(--accent-cyan); }
.npop__today.is-checked { color: var(--text-2); }
.npop__today.is-checked::before { border-color: var(--accent-cyan); background: var(--accent-cyan); }
.npop__today.is-checked::after { content: ""; position: absolute; left: 5px; top: 50%; margin-top: -3.5px; width: 4px; height: 7px; border: solid var(--btn-primary-text); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.npop__close { font-weight: 600; color: var(--text-2); }
.npop__close:hover { color: var(--text); }

/* responsive: phones — full-width sheet, stack scrolls */
@media (max-width: 480px) {
  .npop { padding: 0; align-items: flex-end; }
  .npop__stack { width: 100%; }
  /* 높이는 dvh — vh 는 사파리 바가 걷힌 큰 뷰포트라 푸터가 바 뒤로 들어간다 */
  .npop__card {
    width: 100%; max-width: 100%;
    height: 88vh; max-height: 88vh; height: 88dvh; max-height: 88dvh;
    border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: none; transform: translateY(40px);
  }
  .npop.show .npop__card.is-current { transform: none; }
  .npop__title { font-size: 1.12rem; }
  .npop__foot { padding-bottom: 22px; }
  .npop__today, .npop__close { min-height: 44px; display: inline-flex; align-items: center; padding: 10px 6px; }
  .npop__close { min-width: 56px; justify-content: flex-end; }
  .npop__today { padding-left: 24px; }
}

/* tablet / short desktop — let the card shrink to fit the viewport */
@media (min-width: 481px) {
  .npop__stack { padding: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .npop__backdrop, .npop__card { transition: none; }
}
