/* GO-V logged-in shell — 시안 3단 헤더(다크 / 블랙 메뉴 / 블루 유저바) */

.idx-page.idx-page--logged-in {
  --gov-blue: #1e6fd9;
  --gov-blue-bar: #2b7de9;
  --gov-blue-btn: #4a9fff;
  --gov-blue-deep: #165bb8;
  --gov-yellow: #f2df3a;
  --gov-text: #ffffff;
  --gov-muted: rgba(255, 255, 255, 0.88);
  --gov-line: rgba(255, 255, 255, 0.18);
  --gov-page: #e3e3e3;
  --gov-top: #2a2f38;
  --gov-mid: #000000;
  --gov-content-w: 1200px;
  --gov-content-pad: 12px;
}

/* Logged-in page: light gray surface (풍선 배경 제거) */
.idx-page.idx-page--logged-in {
  background: var(--gov-page);
}

.idx-page.idx-page--logged-in .idx-balloon-bg,
.idx-page.idx-page--logged-in .idx-balloon-bg__item {
  display: none !important;
  animation: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hide legacy topbar when GO-V shell is active */
.idx-page.idx-page--logged-in > .idx-topbar {
  display: none !important;
}

.idx-page.idx-page--logged-in .idx-gov-shell {
  display: block;
}

/* No main banner on logged-in home */
.idx-page.idx-page--logged-in .idx-home > .idx-slide {
  display: none !important;
}

.idx-page.idx-page--logged-in .idx-main-wrap {
  padding-top: 8px;
}

.idx-page.idx-page--logged-in .idx-home {
  padding-top: 0;
}

.idx-gov-shell {
  display: none;
  position: relative;
  z-index: 80;
  flex-shrink: 0;
  background: #000;
  color: #fff;
  font-family: "Noto Sans KR", "Poppins", "Inter", Helvetica, sans-serif;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.idx-gov-shell__inner {
  width: min(var(--gov-content-w, 1200px), 100%);
  margin: 0 auto;
  padding: 0 var(--gov-content-pad, 12px);
  box-sizing: border-box;
}

/* ---- Top strip ---- */
.idx-gov-shell__top {
  background: linear-gradient(180deg, #3a404a 0%, #22262e 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}

.idx-gov-shell__top-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
}

.idx-gov-shell__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
}

.idx-gov-shell__logo-text {
  display: none;
}

.idx-gov-shell__logo-img {
  display: block;
  height: 36px;
  width: auto;
}

.idx-gov-shell__flash {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 360px);
  pointer-events: none;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #cfd3d9;
}

.idx-gov-shell__flash b {
  color: var(--gov-yellow);
}

.idx-gov-shell__flash-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: brightness(0) saturate(100%) invert(86%) sepia(61%) saturate(749%) hue-rotate(359deg) brightness(101%) contrast(94%);
}

.idx-gov-shell__utils {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.idx-gov-shell__util {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s ease;
}

.idx-gov-shell__util:hover {
  background: rgba(255, 255, 255, 0.1);
}

.idx-gov-shell__util img {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* ---- Mid menu (블랙) ---- */
.idx-gov-shell__mid {
  background: #000;
  border-bottom: 0;
}

.idx-gov-shell__menu {
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.idx-gov-shell__item {
  position: relative;
}

.idx-gov-shell__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 14px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  background: transparent;
  font-family: inherit;
  transition: color 0.2s ease, background 0.2s ease;
}

.idx-gov-shell__link:hover,
.idx-gov-shell__item:hover > .idx-gov-shell__link,
.idx-gov-shell__item.is-open > .idx-gov-shell__link {
  color: var(--gov-yellow);
  background: transparent;
}

.idx-gov-shell__plus {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
  line-height: 1;
}

.idx-gov-shell__caret {
  display: none;
}

.idx-gov-shell__drop {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%) translateY(4px);
  min-width: 180px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #1a1d24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 90;
}

.idx-gov-shell__item:hover > .idx-gov-shell__drop,
.idx-gov-shell__item.is-open > .idx-gov-shell__drop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.idx-gov-shell__drop a,
.idx-gov-shell__drop button {
  display: block;
  width: 100%;
  padding: 10px 18px;
  border: 0;
  background: transparent;
  color: #e8eef7;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.idx-gov-shell__drop a:hover,
.idx-gov-shell__drop button:hover {
  background: rgba(43, 125, 233, 0.28);
  color: #fff;
}

/* ---- Bottom user bar (블루) ---- */
.idx-gov-shell__bottom {
  background: var(--gov-blue-bar);
  border-bottom: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.idx-gov-shell__bottom-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  flex-wrap: nowrap;
}

.idx-gov-shell__user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
  z-index: 1;
}

.idx-gov-shell__level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
  min-width: 36px;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: #f5d76e;
  color: #111;
  font: 800 12px/1 "Noto Sans KR", Helvetica, sans-serif;
  box-sizing: border-box;
}

.idx-gov-shell__level-label,
.idx-gov-shell__level-num {
  color: inherit;
  font: inherit;
}

.idx-gov-shell__user-name {
  font: 800 17px/1.25 "Noto Sans KR", Helvetica, sans-serif;
  color: #fff;
  letter-spacing: -0.02em;
}

.idx-gov-shell__user-name b {
  color: var(--gov-yellow);
  font-weight: 800;
}

.idx-gov-shell__stats {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 13px;
  color: #fff;
  z-index: 0;
  pointer-events: none;
}

.idx-gov-shell__stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  pointer-events: auto;
}

.idx-gov-shell__stat-label {
  color: #fff;
}

.idx-gov-shell__stat-label::after {
  content: " :";
}

.idx-gov-shell__stat-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 800;
}

.idx-gov-shell__stat b {
  color: var(--gov-yellow);
  font-size: 15px;
  font-weight: 800;
}

.idx-gov-shell__stat-value span {
  font-size: 14px;
  font-weight: 700;
}

.idx-gov-shell__stat img {
  width: 14px;
  height: 14px;
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(86%) sepia(61%) saturate(749%) hue-rotate(359deg) brightness(101%) contrast(94%);
}

.idx-gov-shell__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  z-index: 1;
}

.idx-gov-shell__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.idx-gov-shell__btn:hover {
  filter: none;
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.idx-gov-shell__btn img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.idx-gov-shell__btn--exchange {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.idx-gov-shell__btn-label {
  display: none;
}

.idx-gov-shell__burger {
  display: none;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.idx-gov-shell__burger span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #fff;
  border-radius: 2px;
}

/* Keep flex scroll chain — do NOT switch layout to block */
@media (min-width: 1025px) {
  .idx-page.idx-page--logged-in .idx-aside,
  .idx-page.idx-page--logged-in .idx-drawer-backdrop {
    display: none !important;
  }

  .idx-page.idx-page--logged-in .idx-layout {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .idx-page.idx-page--logged-in .idx-main-wrap {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .idx-page.idx-page--logged-in .idx-bottombar {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  .idx-gov-shell__flash {
    display: none;
  }

  .idx-gov-shell__burger {
    display: inline-block;
  }

  .idx-gov-shell__mid {
    display: none;
  }

  .idx-gov-shell__utils {
    gap: 0;
  }

  .idx-gov-shell__bottom-row {
    gap: clamp(6px, 1.6vw, 14px);
    padding: 9px clamp(8px, 2.2vw, 16px);
    flex-wrap: nowrap;
    justify-content: center;
    box-sizing: border-box;
  }

  .idx-gov-shell__stats {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    order: unset;
    width: auto;
    flex: 0 1 auto;
    max-width: none;
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(5px, 1.4vw, 12px);
    pointer-events: auto;
    min-width: 0;
  }

  .idx-gov-shell__stat {
    white-space: nowrap;
    gap: 2px;
    font-size: clamp(11px, 2.85vw, 14px);
  }

  .idx-gov-shell__stat span:not(b) {
    font-size: clamp(11px, 2.85vw, 14px);
  }

  .idx-gov-shell__stat b {
    font-size: clamp(11px, 3vw, 15px);
  }

  .idx-page.idx-page--logged-in .idx-aside {
    display: block;
  }

  .idx-page.idx-page--logged-in .idx-layout {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .idx-page.idx-page--logged-in .idx-main-wrap {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---- Home GO-V thumb grid ---- */
.idx-gov-feed {
  display: none;
  width: min(var(--gov-content-w, 1200px), 100%);
  margin: 0 auto;
  padding: 16px var(--gov-content-pad, 12px) 28px;
  box-sizing: border-box;
}

.idx-page.idx-page--logged-in .idx-gov-feed {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.idx-page.idx-page--logged-in .idx-feed {
  display: none !important;
}

.idx-gov-feed__tile {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 1px solid #d5d9e0;
  background: #fff;
  cursor: pointer;
  border-radius: 0;
  overflow: hidden;
  text-align: left;
  font: inherit;
  color: inherit;
  box-shadow: 0 1px 2px rgba(20, 40, 70, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.idx-gov-feed__tile:hover {
  transform: none;
  border-color: #c5cad3;
  box-shadow: 0 2px 8px rgba(15, 40, 70, 0.08);
}

.idx-gov-feed__media {
  display: block;
  line-height: 0;
  /* PNG 회색 프레임과 맞춤 — 소프트 그림자/라운드 잔상 방지 */
  background: #ededed;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
}

.idx-gov-feed__media img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  border-radius: 0;
  image-rendering: auto;
}

.idx-gov-feed__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 11px 14px 12px;
  box-sizing: border-box;
  background: #fff;
  border-top: 0;
}

.idx-gov-feed__name {
  flex: 1 1 auto;
  min-width: 0;
  color: #222;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-decoration: none;
  word-break: keep-all;
}

.idx-gov-feed__go {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e31c23;
  box-shadow: none;
  border: none;
  position: relative;
}

.idx-gov-feed__go::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 52%;
  width: 7px;
  height: 7px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
  transform: translate(-60%, -50%) rotate(45deg);
}

@media (max-width: 900px) {
  .idx-page.idx-page--logged-in .idx-gov-feed {
    grid-template-columns: 1fr;
  }

  .idx-gov-feed__name {
    font-size: 14px;
  }

  .idx-gov-feed__meta {
    min-height: 46px;
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .idx-page.idx-page--logged-in .idx-gov-feed {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 8px 20px;
  }

  .idx-gov-feed__name {
    font-size: 13px;
  }

  .idx-gov-feed__go {
    width: 24px;
    height: 24px;
  }

  .idx-gov-feed__go::after {
    width: 6px;
    height: 6px;
  }
}

.idx-gov-shell__flash .flash-text {
  font-size: 14px;
  line-height: 25px;
  text-align: center;
  letter-spacing: 3px;
  animation: idx-gov-flash 1.2s ease-in-out infinite;
}

@keyframes idx-gov-flash {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* Footer — GO-V brand (핑크/퍼플 → 블루) */
.idx-page.idx-page--logged-in .idx-ft__nex {
  color: #03a4ed;
}

.idx-page.idx-page--logged-in .idx-ft__rest {
  color: #fe3f40;
}

.idx-page.idx-page--logged-in .idx-ft__hi {
  color: #03a4ed;
}

.idx-page.idx-page--logged-in .idx-ft {
  background: #1a2332;
  border-top-color: rgba(3, 164, 237, 0.25);
}

.idx-page.idx-page--logged-in .idx-ft__txt {
  color: rgba(255, 255, 255, 0.88);
}

.idx-page.idx-page--logged-in .idx-ft__toggle {
  border-color: rgba(3, 164, 237, 0.35);
  background: #243044;
}

.idx-page.idx-page--logged-in .idx-ft__toggle-ico {
  border-right-color: #03a4ed;
  border-bottom-color: #03a4ed;
}
