/* =========================================================================
   API 투자전략센터 — Site Chrome (GNB + Footer)
   Shared layout for every page.
   ========================================================================= */

/* =====================  GNB  ===================== */
.gnb {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background-color 0.3s var(--ease), border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.gnb.scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--border);
}
.gnb__inner {
  height: 72px; display: flex; align-items: center; gap: 28px;
  width: 100%; max-width: none; margin-inline: 0; padding-inline: var(--gutter-wide);
}

/* logo */
.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo__brand { height: 25px; width: auto; display: block; }
.logo__brand--dark { display: block; }
.logo__brand--light { display: none; }
:root[data-theme="light"] .logo__brand--dark { display: none; }
:root[data-theme="light"] .logo__brand--light { display: block; }
.logo__div { width: 1px; height: 22px; background: var(--border-strong); flex-shrink: 0; }
.logo__service { font-weight: 700; font-size: var(--fs-text-md); line-height: var(--lh-text-md); letter-spacing: -0.03em; color: var(--text); white-space: nowrap; }
/* nav */
.gnb__nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.gnb__item { position: relative; }
.gnb__link {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 15px; border-radius: var(--r-pill);
  font-size: var(--fs-text-md); line-height: var(--lh-text-md); font-weight: 500; color: var(--text-2); white-space: nowrap;
  transition: color 0.2s, background-color 0.2s; cursor: pointer;
}
/* hover 는 글자색만 바꾼다 — 배경 pill 을 깔면 헤더가 무거워진다 */
.gnb__link:hover, .gnb__item:hover > .gnb__link, .gnb__item:focus-within > .gnb__link { color: var(--text); }
.gnb__link.active { color: var(--text); font-weight: 700; }
.gnb__caret { width: 13px; height: 13px; transition: transform 0.28s var(--ease); opacity: 0.7; }
.gnb__item:hover .gnb__caret, .gnb__item:focus-within .gnb__caret { transform: rotate(180deg); opacity: 1; }

/* dropdown / mega panel */
.gnb__panel {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(8px);
  min-width: 230px; padding: 10px;
  /* 떠 있는 패널용 불투명 배경(--surface-solid) — API 키 모달·공지 팝업과 같은 값.
     불투명이라 backdrop-filter는 쓰지 않는다. */
  background: var(--surface-solid);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-float);
  opacity: 0; pointer-events: none;
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
  z-index: 120;
}
.gnb__panel::before { content: ""; position: absolute; bottom: 100%; left: 0; right: 0; height: 14px; }
.gnb__item:hover > .gnb__panel, .gnb__item:focus-within > .gnb__panel {
  opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.gnb__panel--left { left: 0; transform: translateX(0) translateY(8px); }
.gnb__item:hover > .gnb__panel--left, .gnb__item:focus-within > .gnb__panel--left { transform: translateX(0) translateY(0); }
.gnb__panel--mega { display: grid; grid-template-columns: 232px 232px; gap: 6px; }

/* simple dropdown link */
.gnb__panel .drop {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: var(--r-sm);
  font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: 500; color: var(--text-2);
  transition: background-color 0.18s, color 0.18s;
  width: 100%; text-align: left; background: none; border: none; font-family: inherit; cursor: pointer;
}
.gnb__panel .drop:hover { background: var(--surface-2); color: var(--text); }
.gnb__panel .drop:hover .di { border-color: var(--border-glow); }
.gnb__panel .drop .di {
  width: 30px; height: 30px; padding: 7px; box-sizing: border-box;
  border-radius: 9px; background: var(--surface-blue);
  border: 1px solid var(--chip-border); color: var(--accent-prime);
  flex-shrink: 0;
}

/* mega column */
.mega__col { padding: 6px; }
.mega__group {
  display: flex; align-items: center; gap: 9px; padding: 8px 8px 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: 700; color: var(--text); letter-spacing: -0.01em;
}
.mega__group .gi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-blue); border: 1px solid var(--chip-border); color: var(--accent-prime); flex-shrink: 0; }
.mega__group .gi svg { width: 16px; height: 16px; }
.mega__sub {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: var(--r-sm);
  font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: 500; color: var(--text-2);
  transition: background-color 0.18s, color 0.18s, padding-left 0.18s;
}
.mega__sub:hover { background: var(--surface-2); color: var(--text); padding-left: 15px; }
.mega__sub::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--text-inactive); transition: background-color 0.18s; }
.mega__sub:hover::before { background: var(--accent-cyan); box-shadow: 0 0 8px var(--glow-cyan); }

.gnb__spacer { flex: 1; }
.gnb__actions { display: flex; align-items: center; gap: 10px; }

/* 로그인 사용자 칩 — 이름 + 로그인 후 경과 시간 (테마 토글 왼쪽).
   display 는 auth.js가 none/inline-flex 로 직접 제어하므로 여기서 지정하지 않는다. */
.gnb__user {
  align-items: center; gap: 8px; padding: 7px 12px;
  border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface-2);
  font-size: 0.82rem; white-space: nowrap; flex-shrink: 0;
}
.gnb__user-ic { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.gnb__user-name { font-weight: 700; color: var(--text); }
/* 경과 시간은 매초 바뀌므로 고정폭 숫자를 써서 폭이 흔들리지 않게 한다 */
.gnb__user-time {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 0.76rem; font-weight: 600; color: var(--accent-cyan);
  padding-left: 8px; border-left: 1px solid var(--border-strong);
}
/* 헤더가 좁아지면 GNB 버튼들과 함께 접는다 (기어 배지와 같은 기준) */
@media (max-width: 1024px) { .gnb__user { display: none !important; } }

/* API 가이드 드롭다운 — 모든 화면의 GNB 액션 영역과 모바일 드로어에 한 벌씩 놓인다.
   마크업은 fragments/guide_menu.html, 동작은 guide-menu.js. */
.guide-menu { position: relative; flex-shrink: 0; }
/* 모양·타이포·색은 옆의 AI 챗봇 버튼과 같은 .btn-ghost.btn-sm(base.css) — 아이콘 크기만 맞춘다. */
.guide-menu__btn { gap: 7px; }
.guide-menu.open .guide-menu__btn { background: var(--surface-hover); border-color: var(--border-glow); }
.guide-menu__btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.guide-menu__caret { width: 13px !important; height: 13px !important; transition: transform 0.22s var(--ease); }
.guide-menu.open .guide-menu__caret { transform: rotate(180deg); }
.guide-menu__pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 168px;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-float); padding: 6px;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.guide-menu.open .guide-menu__pop { opacity: 1; pointer-events: auto; transform: none; }
.guide-menu__pop button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: var(--r-sm); text-align: left;
  font-size: 0.86rem; font-weight: 600; color: var(--text-2);
  transition: background-color 0.16s, color 0.16s;
}
.guide-menu__pop button:hover { background: var(--surface-2); color: var(--text); }
.guide-menu__pop button svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--accent-cyan); }
/* 드로어 안에서는 다른 액션 버튼과 같이 한 줄을 다 쓴다.
   팝업은 떠 있으면 아래의 AI 챗봇 버튼을 덮으므로, 흐름에 넣어 아래를 밀어낸다. */
.mobile-menu .guide-menu { width: 100%; }
.mobile-menu .guide-menu__pop {
  position: static; min-width: 0; margin-top: 8px;
  display: none; opacity: 1; transform: none;
}
.mobile-menu .guide-menu.open .guide-menu__pop { display: block; }
/* GNB 액션은 1024px 이하에서 드로어로 넘어간다(chrome.css) — 이 버튼도 같이 넘긴다. */
@media (max-width: 1024px) {
  .gnb__actions .guide-menu { display: none; }
}

/* theme toggle */
/* LS_THEME_MANUAL=false(기본) 이면 data-theme-manual 이 없어 버튼이 보이지 않는다 */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  display: none; place-items: center;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text-2); transition: color 0.2s, border-color 0.2s, transform 0.3s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-glow); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
:root[data-theme-manual] .theme-toggle { display: grid; }

/* =====================  SHARED SEARCH FIELD (unified across pages)  ===================== */
.search-field {
  display: flex; align-items: center; gap: 10px;
  width: min(440px, 100%); padding: 5px 5px 5px 18px;
  border-radius: var(--r-pill); border: 1px solid rgba(117,120,125,0.32);
  background: #131415; transition: border-color 0.2s, box-shadow 0.2s;
}
.search-field:focus-within { border-color: #50aaff; box-shadow: 0 0 0 4px rgba(76,125,230,0.3); }
.search-field__ic { width: 18px; height: 18px; color: var(--text-wh); flex-shrink: 0; }
.search-field__input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: var(--fs-input); line-height: var(--lh-input); padding: 11px 0; font-family: var(--font-sans); }
.search-field__input::placeholder { color: var(--text-dim); }
.search-field__clear { width: 34px; height: 34px; border-radius: 50%; display: none; place-items: center; color: var(--text-dim); flex-shrink: 0; transition: color 0.18s, background-color 0.18s; }
.search-field__clear.show { display: grid; }
.search-field__clear:hover { color: var(--text); background: var(--surface-2); }
.search-field__clear svg { width: 16px; height: 16px; }
.search-field__btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-prime); color: var(--on-accent); flex-shrink: 0; transition: transform 0.2s var(--ease); }
.search-field__btn:hover { transform: scale(1.05); }
.search-field__btn svg { width: 18px; height: 18px; color: var(--on-accent); }

/* =====================  SHARED BOARD TABS (notice / library filter)  ===================== */
.board-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 22px; }
.board-tabs::-webkit-scrollbar { display: none; }
/* 모양·색·타이포·모바일 크기 전부 공용 .tab(base.css) 이 준다 — 여기는 치수와 .n 배지만.
   마크업은 class="tab board-tab" 이고 .board-tab 은 JS 훅 겸 국소 오버라이드다.
   활성 색과 hover 를 여기서 다시 선언하지 않는다 — 그러면 공용 pill 과 색이 갈린다. */
.board-tab { padding: 10px 18px; gap: 7px; }
.board-tab .n { font-family: var(--font-sans); font-size: var(--fs-badge); line-height: var(--lh-badge); color: var(--text-inactive); transition: color 0.18s; }
.board-tab.active .n { color: rgba(255, 255, 255, 0.75); }

/* =====================  PAGINATION (공용)  =====================
   공지·자료실·전략스튜디오가 공유한다. 예전엔 세 페이지 CSS 에 같은 블록이
   복제돼 있어 값이 갈렸다 — 원본과 같이 여기 한 곳에서만 정의한다. */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 30px; flex-wrap: wrap; }
.page-btn { width: 38px; height: 38px; padding: 0; border-radius: var(--r-pill); display: grid; place-items: center; font-family: var(--font-sans); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: 500; color: var(--text-2); border: none; background: transparent; transition: color 0.16s, background-color 0.16s; }
/* 활성 버튼에는 hover 를 걸지 않는다(이미 칩 색이라 덧칠되면 탁해진다).
   배경은 숫자 버튼에만 — prev/next 화살표는 글자색만 바뀐다. */
.page-btn:hover:not(:disabled):not(.active) { color: var(--text); }
.page-btn[data-page]:not([data-page="prev"]):not([data-page="next"]):hover:not(.active) { background: var(--surface-2); }
.page-btn.active { color: var(--chip-text); font-weight: 700; background: var(--chip-bg); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn svg { width: 16px; height: 16px; }
.page-ellipsis { color: var(--text-inactive); padding: 0 4px; }

/* =====================================================================
   LIGHT THEME — 액티브 표면은 라이트 테마에서 더 진한 accent-prime 을 쓴다.
   --on-accent 가 이미 흰색이라 아래 규칙은 현재 동어반복이지만,
   테마별로 --on-accent 를 다시 나눌 경우를 대비한 안전장치로 남겨둔다.
   ===================================================================== */
:root[data-theme="light"] .board-tab.active,
:root[data-theme="light"] .sub-tab.active,
:root[data-theme="light"] .api-type button.active,
:root[data-theme="light"] .lang-tab.active,
:root[data-theme="light"] .modal__lang.active,
:root[data-theme="light"] .run-exec,
:root[data-theme="light"] .run-btn,
:root[data-theme="light"] .ctrl-btn--primary,
:root[data-theme="light"] .ctrl-btn--primary:hover,
:root[data-theme="light"] .search-field__btn,
:root[data-theme="light"] .qs-step.active .qs-step__num { color: #fff; }

:root[data-theme="light"] .search-field__btn svg,
:root[data-theme="light"] .ctrl-btn--primary svg { color: #fff; }

:root[data-theme="light"] .board-tab.active .n,
:root[data-theme="light"] .sub-tab.active .b,
:root[data-theme="light"] .api-type button.active .b { color: rgba(255,255,255,0.82); background: rgba(255,255,255,0.18); }

/* =====================  SHARED STEP TABS (guide / start progress nav)  ===================== */
/* 경계선은 border 대신 ::after 를 scaleY(0.5) 로 눌러 반픽셀 헤어라인으로 그린다 */
.gstep-tabs { position: sticky; top: 72px; z-index: 50; background: var(--header-bg); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.gstep-tabs::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--border); transform: scaleY(0.5); transform-origin: bottom; }
.gstep-tabs__inner { display: flex; gap: 4px; }
.gstep-tab { position: relative; padding: 16px 22px; font-size: var(--fs-text-md); line-height: var(--lh-text-md); font-weight: 600; color: var(--text-dim); transition: color 0.2s; display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.gstep-tab::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent-prime); transform: scaleX(0); transition: transform 0.26s var(--ease); }
.gstep-tab:hover { color: var(--text-2); }
.gstep-tab.active { color: var(--text); }
.gstep-tab.active::after { transform: scaleX(1); }
.gstep-tab .gstep-tab__n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-sans); font-size: var(--fs-no); line-height: var(--lh-no); font-weight: 700; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-dim); transition: background-color 0.2s, color 0.2s, border-color 0.2s; flex-shrink: 0; }
.gstep-tab.active .gstep-tab__n { background: var(--accent-prime); border-color: transparent; color: #fff; }
@media (max-width: 640px) {
  .gstep-tabs__inner { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .gstep-tabs__inner::-webkit-scrollbar { display: none; }
  /* 탭이 폭을 나눠 갖고, 라벨은 nowrap 을 풀어 두 줄로 접힌다.
     nowrap 인 채로 두면 세 번째 탭("첫 API 호출")이 화면 밖으로 밀려 잘려 보인다. */
  .gstep-tab { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center;
               padding: 12px 8px; gap: 7px; white-space: normal; word-break: keep-all; }
  .gstep-tab::after { left: 8px; right: 8px; }
}

.btn-bot { gap: 7px; }
.btn-bot .pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-cyan);
  box-shadow: 0 0 0 0 var(--glow-cyan); animation: botPulse 2.2s infinite;
}
@keyframes botPulse {
  0% { box-shadow: 0 0 0 0 rgba(52,225,255,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(52,225,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,225,255,0); }
}

/* hamburger */
.hamburger { display: none; width: 40px; height: 40px; margin-right: -4px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.2s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile drawer */
.mobile-menu {
  position: fixed; inset: 72px 0 0 0; z-index: 99;
  background: var(--bg-2); border-top: 1px solid var(--border);
  padding: 24px var(--gutter); flex-direction: column; gap: 6px;
  transform: translateY(-12px); opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  display: none;
}
.mobile-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.mobile-menu { overflow-y: auto; }

/* mobile: flat link (전략스튜디오 등) */
.m-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px; font-size: var(--fs-title-sub); line-height: var(--lh-title-sub); font-weight: 600;
  color: var(--text); border-bottom: 1px solid var(--border);
}
.m-link:hover { background: var(--surface-2); }

/* mobile: accordion group */
.m-acc { border-bottom: 1px solid var(--border); }
.m-acc__top {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px; font-size: var(--fs-title-sub); line-height: var(--lh-title-sub); font-weight: 600; color: var(--text); text-align: left;
}
.m-acc__top .mc { width: 18px; height: 18px; color: var(--text-dim); transition: transform 0.3s var(--ease); }
.m-acc.open .m-acc__top .mc { transform: rotate(180deg); }
.m-acc__panel { max-height: 0; overflow: hidden; transition: max-height 0.36s var(--ease); }
.m-acc.open .m-acc__panel { max-height: 560px; }
.m-acc__inner { padding: 2px 6px 14px; }

.m-subgroup { margin-top: 6px; }
.m-subgroup__title { display: flex; align-items: center; gap: 8px; padding: 10px 14px 6px; font-size: var(--fs-text-sm); line-height: var(--lh-badge); font-weight: 700; letter-spacing: 0.03em; color: var(--chip-text); text-transform: uppercase; }
.m-acc .m-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px 10px 26px; border-radius: var(--r-sm);
  font-size: 14.5px; line-height: var(--lh-text-md); font-weight: 500; color: var(--text-2); border-bottom: none;
  width: 100%; text-align: left; background: none; border: none; font-family: inherit; cursor: pointer;
}
.m-acc a.m-item::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
.m-acc a.m-item:hover { background: var(--surface-2); color: var(--text); }

.mobile-menu .m-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.mobile-menu .m-actions .btn { width: 100%; }

@media (max-width: 1024px) {
  .gnb__nav, .gnb__actions .btn-bot, .gnb__actions .btn-primary { display: none; }
  .hamburger { display: flex; }
  .mobile-menu { display: flex; }
}

/* =====================  FOOTER  ===================== */
/* simple footer (logo + tagline + copyright) — full-bleed bar */
.footer--simple {
  position: relative; border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding-block: clamp(34px, 4vw, 48px);
}
.footer--simple > .container { max-width: none; padding-inline: var(--gutter-wide); }
.footer--simple__inner { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.footer--simple .logo { pointer-events: auto; }
.footer--simple__tagline { color: var(--text-dim); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); max-width: 520px; }
.footer--simple__bottom {
  width: 100%; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer--simple__bottom small { color: var(--text-inactive); font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); }

.footer {
  position: relative; border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding-block: clamp(56px, 7vw, 88px) 36px;
}
.footer__legal { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__legal a { color: var(--text-dim); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); }
.footer__legal a:hover { color: var(--text); }
/* =====================================================================
   MODAL SHELL — .axm 은 이제 팝업 껍데기(layout/main.html 의 .axm.axpop)만 쓴다.
   API 키 설정 모달은 제거됐다 — 키·토큰은 API가이드 콘솔에서 요청마다 직접 입력한다.
   ===================================================================== */
.axm { position: fixed; inset: 0; z-index: 220; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity 0.26s var(--ease); }
.axm.show { opacity: 1; pointer-events: auto; }
.axm__bd { position: absolute; inset: 0; background: rgba(4,7,14,0.66); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.axm__dialog { position: relative; z-index: 1; width: 460px; max-width: 100%; max-height: 90vh; overflow-y: auto; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-float); transform: translateY(16px) scale(0.98); transition: transform 0.3s var(--ease-out); }
.axm.show .axm__dialog { transform: none; }
@media (max-width: 480px) {
  .axm { padding: 0; align-items: flex-end; }
  .axm__dialog { width: 100%; max-width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; }
}
@media (prefers-reduced-motion: reduce) { .axm, .axm__dialog { transition: none; } }

/* in-page popup fallback (when window.open is blocked) */
/* 껍데기는 "화면을 넘지 않게 하는 상한"과 중앙 정렬만 담당하고, 실제 크기는 내용이 정한다.
   그래서 새 팝업을 추가할 때 이 공통 CSS를 고칠 필요가 없다. */
.axpop__win { position: relative; z-index: 1; max-width: 100%; max-height: 92vh; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-float); border: 1px solid var(--border-strong); transform: translateY(16px) scale(0.98); transition: transform 0.3s var(--ease-out); }
/* iframe 모드는 다른 출처라 내용 높이를 읽을 수 없으므로 기본 크기가 필요하다.
   (열리는 화면이 postMessage로 자기 높이를 알려주면 그때 맞춰줄 수 있다) */
.axpop:not(.axpop--inline) .axpop__win { width: 920px; height: 700px; }
/* 인라인 모드는 우리 DOM이라 내용에 맞출 수 있다 — 크기는 각 팝업의 CSS가 선언한다.
   예) inquiry.css 의 .inq { width: 920px; height: 700px }  /  작은 확인창은 width만 주고 height 생략 */
.axpop--inline .axpop__win { width: auto; height: auto; }
.axm.show .axpop__win { transform: none; }
.axpop__frame { width: 100%; height: 100%; border: 0; display: block; background: #0a0e1a; }
/* 인라인 모드: 서버 프래그먼트를 iframe 없이 이 컨테이너에 주입한다(popup.js가 .axpop--inline 토글).
   같은 출처 화면은 iframe을 쓸 이유가 없다 — 토큰·테마를 그대로 물려받고 부모 API를 직접 쓴다. */
.axpop__body { display: none; width: auto; height: auto; max-height: 92vh; overflow-y: auto; background: var(--bg-2); }
.axpop--inline .axpop__frame { display: none; }
.axpop--inline .axpop__body { display: block; }
.axpop__x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(10,14,26,0.7); border: 1px solid rgba(255,255,255,0.16); color: #fff; }
.axpop__x svg { width: 18px; height: 18px; }
/* 모바일에서는 팝업이 자기 크기를 선언했더라도 화면을 채운다 */
@media (max-width: 480px) {
  .axpop__win { height: 100%; max-height: 100vh; border-radius: 0; }
  .axpop--inline .axpop__win { width: 100%; height: 100%; }
  .axpop--inline .axpop__body { max-height: 100vh; }
}

/* =====================================================================
   TOAST — 동작 완료 피드백(하단 중앙). showToast()가 .toast-stack을 만들어 쌓는다.
   ===================================================================== */
.toast-stack { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: var(--r-pill);
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-float);
  font-size: 0.9rem; font-weight: 600; color: var(--text); white-space: nowrap;
  opacity: 0; transform: translateY(12px); transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast__ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: rgba(43,214,110,0.16); color: #2bd66e; }
.toast__ic svg { width: 13px; height: 13px; }
@media (max-width: 560px) { .toast-stack { bottom: 20px; left: 16px; right: 16px; transform: none; } .toast { width: 100%; justify-content: center; white-space: normal; } }
