/**
 * 통합헤더(L14) 5+1 메가메뉴 — 기기 4단계 SSOT
 * phone-sm ≤480 · phone-lg 481–768 · tablet 769–1024 · desktop ≥1025
 * 샘플 SSOT: tools/samples/menu_layout_5plus1_demo.html
 */

/* ── 통합헤더 셸 (s1+s2+s3 교체) ── */
.uh-site-header {
  --uh-brand: #dc2626;
  --c-brand: #dc2626;
  --c-text: #0f172a;
  --c-muted: #64748b;
  --c-line: #e2e8f0;
  --c-panel: #fff;
  background: var(--c-panel);
  border-bottom: 1px solid var(--c-line);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky-header, 1900);
}

.uh-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  min-height: 56px;
  overflow: visible;
}

.uh-logo {
  text-decoration: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.15;
  min-width: 0;
}

.uh-logo-mark {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.uh-logo-img,
.uh-logo-mark picture,
.uh-logo-mark img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
}

.uh-logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--uh-brand, #dc2626);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg, 18px);
  font-weight: 700;
}

.uh-logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.uh-logo-title {
  font-size: var(--fs-lg, 18px);
  font-weight: 700;
  color: var(--uh-brand, #dc2626);
  white-space: nowrap;
}

.uh-logo-sub {
  font-size: var(--fs-xs, 14px);
  font-weight: 500;
  color: var(--c-muted, #64748b);
  margin-top: 2px;
}

.uh-header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.uh-search-wrap {
  display: none;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.uh-search-wrap input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--c-line, #e2e8f0);
  border-radius: 8px;
  font-size: var(--fs-base, 16px);
  font-family: inherit;
}

.uh-search-btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--uh-brand, #dc2626);
  color: #fff;
  font-size: var(--fs-sm, 15px);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.uh-search-btn--icon {
  min-width: 44px;
  padding: 0;
}

.uh-search-icon-fb {
  font-size: var(--fs-lg, 18px);
  line-height: 1;
}

.uh-auth-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.uh-tool-auth--register {
  display: inline-flex;
}

.uh-tool-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border: 1px solid var(--c-line, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  font-size: var(--fs-sm, 15px);
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  cursor: pointer;
}

.uh-tool-btn--primary {
  background: var(--uh-brand, #dc2626);
  border-color: var(--uh-brand, #dc2626);
  color: #fff;
}

/* 지역포털 3종 선택 — yeosu/suncheon/gwangyang (지역축 전용, 14허브 GNB 와 분리) */
.uh-region-dd {
  position: relative;
  flex-shrink: 0;
}

.uh-region-dd-trigger {
  gap: 6px;
  padding-right: 10px;
}

.uh-region-dd-caret {
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
  transition: transform 0.2s;
}

.uh-region-dd:hover .uh-region-dd-caret,
.uh-region-dd:focus-within .uh-region-dd-caret,
.uh-region-dd.is-open .uh-region-dd-caret {
  transform: translateY(2px) rotate(180deg);
}

.uh-region-dd-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  margin-top: 6px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--c-line, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: var(--z-dropdown, 9990);
  display: none;
}

.uh-region-dd-menu::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 18px;
  background: transparent;
  pointer-events: auto;
}

.uh-region-dd:hover .uh-region-dd-menu,
.uh-region-dd:focus-within .uh-region-dd-menu,
.uh-region-dd.is-open .uh-region-dd-menu {
  display: block;
  animation: uhRegionFadeIn 0.15s ease-out;
}

.uh-region-dd.is-open .uh-region-dd-menu[hidden] {
  display: block;
}

@keyframes uhRegionFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.uh-region-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

.uh-region-dd-item:hover {
  background: #f1f5f9;
}

.uh-region-dd-item.is-active {
  background: #eff6ff;
}

.uh-region-dd-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--uh-region-color, #64748b) 12%, transparent);
  color: var(--uh-region-color, #64748b);
  font-size: var(--fs-base, 16px);
}

.uh-region-dd-name {
  font-size: var(--fs-sm, 15px);
  font-weight: 700;
  color: var(--c-text, #0f172a);
}

.uh-mypage-icon {
  display: none;
}

.uh-btn-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--c-line, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  font-size: var(--fs-md, 17px);
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  margin-left: 4px;
}

.uh-nav-slot {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  width: 100%;
  overflow: visible;
}

.uh-rnb-root {
  width: 100%;
}

/* ── 데스크톱 5+1 메가 GNB ── */
.uh-gnb-primary {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: clamp(2px, 0.35vw, 6px);
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap !important;
  align-items: center;
  width: 100%;
  background: transparent;
  overflow: visible;
}

.uh-gnb-li {
  position: relative;
  flex: 0 0 auto;
}

/* 트리거 ↔ 패널 사이 hover 끊김 방지 */
.uh-gnb-li::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}

.uh-gnb-trigger {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 clamp(8px, 1.1vw, 14px);
  border: none;
  background: transparent;
  font-size: var(--fs-md, 17px);
  font-weight: 600;
  color: var(--c-text, #0f172a);
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  font-family: inherit;
}

.uh-gnb-trigger::after {
  content: "";
  margin-left: 6px;
  border: 5px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
}

.uh-gnb-primary[data-nav-fit="compact"] .uh-gnb-trigger {
  padding: 0 8px;
  font-size: var(--fs-sm, 15px);
  min-height: 40px;
}

.uh-gnb-primary[data-nav-fit="compact"] .uh-gnb-trigger::after {
  margin-left: 4px;
  border-width: 4px;
}

.uh-gnb-primary[data-nav-fit="scroll"] {
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.uh-gnb-primary[data-nav-fit="scroll"]::-webkit-scrollbar {
  display: none;
}

.uh-gnb-trigger:hover,
.uh-gnb-trigger[aria-expanded="true"],
.uh-gnb-li.is-active > .uh-gnb-trigger {
  background: #fef2f2;
  color: var(--uh-brand, #dc2626);
}

.uh-mega-panel {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0;
  min-width: min(640px, 92vw);
  max-width: min(900px, 96vw);
  background: var(--c-panel, #fff);
  border: 1px solid var(--c-line, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  padding: 20px;
  z-index: var(--z-global-dd, 2100);
}

.uh-mega-panel[hidden] {
  display: none !important;
}

.uh-mega-panel.is-open {
  display: block !important;
}

.uh-mega-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.uh-mega-grid--tablet {
  grid-template-columns: repeat(3, 1fr);
}

.uh-mega-col-title {
  margin: 0 0 8px;
  font-size: var(--fs-md, 17px);
  font-weight: 700;
}

.uh-mega-col-title a {
  color: var(--uh-brand, #dc2626);
  text-decoration: none;
}

.uh-mega-col-title a:hover {
  text-decoration: underline;
}

.uh-mega-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.uh-mega-l2 {
  margin: 0;
  padding: 0;
}

.uh-mega-l2 > a {
  display: block;
  padding: 6px 0;
  font-size: var(--fs-sm, 15px);
  font-weight: 600;
  color: var(--c-text, #0f172a);
  text-decoration: none;
}

.uh-mega-l2 > a:hover {
  color: var(--uh-brand, #dc2626);
}

.uh-mega-l3-list {
  list-style: none;
  margin: 0 0 4px;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--c-line, #e2e8f0);
}

.uh-mega-l3-list a {
  display: block;
  padding: 4px 0;
  font-size: var(--fs-sm, 15px);
  color: var(--c-muted, #64748b);
  text-decoration: none;
}

.uh-mega-l3-list a:hover {
  color: var(--uh-brand, #dc2626);
}

.uh-mega-home {
  display: inline-block;
  margin-top: 8px;
  font-size: var(--fs-sm, 15px);
  font-weight: 600;
  color: var(--uh-brand, #dc2626);
  text-decoration: none;
}

/* ── 태블릿 필 + 시트 ── */
.uh-nav-pills-wrap {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.uh-nav-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent);
}

.uh-nav-pills::-webkit-scrollbar {
  display: none;
}

.uh-nav-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 clamp(10px, 1.4vw, 14px);
  border: 1px solid var(--c-line, #e2e8f0);
  border-radius: 999px;
  background: var(--c-panel, #fff);
  font-size: var(--fs-sm, 15px);
  font-weight: 600;
  color: var(--c-text, #0f172a);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.uh-nav-pill.is-active,
.uh-nav-pill[aria-expanded="true"],
.uh-nav-pill:hover {
  background: var(--uh-brand, #dc2626);
  border-color: var(--uh-brand, #dc2626);
  color: #fff;
}

.uh-tablet-sheet {
  display: none;
  width: 100%;
  padding: 0 0 12px;
  background: var(--c-panel, #fff);
  border-bottom: 1px solid var(--c-line, #e2e8f0);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.uh-tablet-sheet[hidden] {
  display: none !important;
}

.uh-tablet-sheet.is-open {
  display: block !important;
}

/* ── 2행 헤더 셸 (모바일 1행 · 데스크탑 확대 2행) ── */
.uh-header-row--gnb {
  display: none;
}

.uh-header-gnb-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.uh-uh-expand {
  display: none;
}

/* ── 기기 티어 표시 ── */
html[data-device-tier="desktop"] .l14-unified-header,
html[data-device-tier="desktop"] .uh-site-header,
html[data-device-tier="tablet"] .l14-unified-header,
html[data-device-tier="tablet"] .uh-site-header,
#layout-header.layout-header-l14 .l14-unified-header {
  overflow: visible;
}

html[data-device-tier="desktop"] .uh-nav-pills-wrap,
html[data-device-tier="desktop"] .uh-tablet-sheet {
  display: none !important;
}

/* tablet·desktop GNB — row2 uh-gnb-primary (nav-pills 폐기) */
html[data-device-tier="tablet"] .uh-gnb-primary,
html[data-device-tier="desktop"] .uh-gnb-primary {
  display: flex !important;
}

html[data-device-tier="tablet"] .uh-nav-pills-wrap {
  display: none !important;
}

/* legacy standard_tools 제거 — 검색·확장은 gateway_tools uh-uh-expand */

/* ── 데스크탑 보기(layout-desktop) — 물리 뷰포트 무관 · 모바일 SSOT 확대 1행+2행 GNB ── */
html.layout-desktop {
  .uh-header-row--top .uh-header-inner {
    max-width: 1280px;
    padding: 0 20px;
    gap: 12px;
    min-height: 56px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
  }

  .uh-header-row--top .uh-logo {
    flex: 0 0 auto;
    min-width: 0;
    gap: 10px;
  }

  .uh-header-row--top .uh-logo-text {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 0;
    min-width: 0;
  }

  .uh-header-row--top .uh-logo-title {
    font-size: var(--fs-lg, 18px);
    font-weight: 700;
    white-space: nowrap;
  }

  .uh-header-row--top .uh-logo-sub {
    display: none;
  }

  .uh-header-tools--gateway {
    display: flex !important;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0;
    justify-content: flex-start;
    align-items: center;
  }

  .uh-gw-tools-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
  }

  .uh-gw-sep {
    display: none;
  }

  .uh-platform-dd,
  .uh-account-dd,
  .uh-gw-auth {
    flex-shrink: 0;
  }

  .uh-platform-dd {
    position: relative;
  }

  .uh-account-dd {
    position: relative;
  }

  .uh-platform-dd > summary,
  .uh-account-dd > summary {
    list-style: none;
  }

  .uh-platform-dd > summary::-webkit-details-marker,
  .uh-account-dd > summary::-webkit-details-marker {
    display: none;
  }

  .uh-header-tools--gateway .uh-tool-btn,
  .uh-platform-trigger,
  .uh-account-trigger,
  .uh-gw-login,
  .uh-gw-admin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: #3c4043;
    font-size: var(--fs-sm, 15px);
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
  }

  .uh-platform-trigger:hover,
  .uh-account-trigger:hover,
  .uh-gw-login:hover,
  .uh-gw-admin:hover {
    background: #f1f3f4;
  }

  .uh-platform-dd[open] .uh-platform-trigger,
  .uh-account-dd[open] .uh-account-trigger {
    color: #1a73e8;
    background: #e8f0fe;
  }

  .uh-platform-trigger--active:not(:hover) {
    color: #1a73e8;
    font-weight: 600;
  }

  .uh-platform-dd--has-scope .uh-platform-trigger--active {
    color: #1a73e8;
  }

  .uh-platform-label {
    max-width: 9em;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .uh-gw-login,
  .uh-gw-admin {
    color: #1a73e8;
  }

  .uh-platform-caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #5f6368;
    flex-shrink: 0;
  }

  .uh-platform-dd[open] .uh-platform-caret,
  .uh-account-dd[open] .uh-platform-caret {
    border-top-color: #1a73e8;
  }

  .uh-uh-expand {
    display: inline-flex !important;
  }

  .uh-gw-register.uh-uh-expand {
    display: none !important;
  }

  .uh-gw-search-form {
    flex: 1 1 auto;
    min-width: 160px;
    max-width: 480px;
    margin-left: auto;
    display: flex !important;
    align-items: center;
    position: relative;
  }

  .uh-gw-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .uh-gw-search-input {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 16px;
    border: 1px solid #dadce0;
    border-radius: 24px;
    background: #fff;
    color: #202124;
    font-size: var(--fs-sm, 15px);
    font-family: inherit;
    line-height: 1.2;
  }

  .uh-gw-search-input:hover {
    border-color: #bdc1c6;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.12);
  }

  .uh-gw-search-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 1px 6px rgba(26, 115, 232, 0.24);
  }

  .uh-uh-expand.uh-gw-search,
  .uh-uh-expand.uh-gw-register {
    display: none !important;
  }

  /* 플랫폼 — gw-g-dd-panel 동형 앵커 패널 (모바일 풀스크린 모달 아님) */
  .uh-platform-dd-layer {
    display: none;
  }

  .uh-platform-dd[open] .uh-platform-dd-layer {
    display: block;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    z-index: calc(var(--z-sticky-header, 1900) + 20);
    width: min(440px, 92vw);
    pointer-events: auto;
  }

  .uh-platform-dd-backdrop {
    display: none !important;
  }

  .uh-platform-dd-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(72vh, 560px);
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(60, 64, 67, 0.18);
    overflow: hidden;
  }

  .uh-platform-dd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 10px;
    border-bottom: 1px solid #e8eaed;
    flex-shrink: 0;
  }

  .uh-platform-dd-head-title {
    margin: 0;
    font-size: var(--fs-md, 17px);
    font-weight: 700;
    color: #202124;
  }

  .uh-platform-dd-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    font-size: var(--fs-lg, 18px);
    line-height: 1;
  }

  .uh-platform-dd-close:hover,
  .uh-platform-dd-close:focus-visible {
    background: #f1f3f4;
    color: #202124;
  }

  .uh-platform-dd-body {
    overflow-y: auto;
    padding: 4px 0 12px;
    -webkit-overflow-scrolling: touch;
  }

  .uh-platform-dd-title {
    margin: 0;
    padding: 12px 16px 8px;
    font-size: var(--fs-sm, 15px);
    font-weight: 600;
    color: #5f6368;
    letter-spacing: 0.01em;
  }

  .uh-platform-list {
    margin: 0;
    padding: 0 12px 10px;
    list-style: none;
  }

  .uh-platform-list--regions,
  .uh-platform-list--integration {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0 12px 12px;
  }

  .uh-platform-list--scroll {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 0 12px 12px;
    -webkit-overflow-scrolling: touch;
  }

  .uh-platform-item {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: var(--fs-sm, 15px);
    font-weight: 500;
    color: #202124;
    text-decoration: none;
    line-height: 1.3;
    text-align: left;
  }

  .uh-platform-item--chip {
    padding: 10px 8px;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
  }

  .uh-platform-item.is-on,
  .uh-platform-item:hover,
  .uh-platform-item:focus-visible {
    background: #e8f0fe;
    color: #1a73e8;
    border-color: #d2e3fc;
    text-decoration: none;
  }

  .uh-account-dd-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: calc(var(--z-sticky-header, 1900) + 20);
    min-width: 220px;
    max-width: 280px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(60, 64, 67, 0.18);
    padding: 6px 0;
  }

  .uh-account-dd-user {
    margin: 0;
    padding: 10px 16px 6px;
    font-size: var(--fs-sm, 15px);
    font-weight: 600;
    color: #202124;
    border-bottom: 1px solid #f1f3f4;
  }

  .uh-account-dd-item {
    display: block;
    padding: 10px 16px;
    font-size: var(--fs-sm, 15px);
    color: #3c4043;
    text-decoration: none;
    line-height: 1.3;
  }

  .uh-account-dd-item:hover,
  .uh-account-dd-item:focus-visible {
    background: #f1f3f4;
    text-decoration: none;
  }

  .uh-account-dd-item--logout {
    color: #d93025;
    border-top: 1px solid #f1f3f4;
  }

  body.uh-gw-platform-lock {
    overflow: auto;
  }

  .uh-logo-img,
  .uh-logo-mark picture,
  .uh-logo-mark img {
    width: 160px;
    height: 40px;
    max-height: 40px;
    border-radius: 0;
  }

  .uh-logo-icon {
    width: auto;
    min-width: 120px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
  }

  .uh-header-row--gnb {
    display: block;
    border-top: 1px solid #e8eaed;
    background: #fff;
  }

  .uh-header-gnb-inner {
    max-width: 1280px;
    padding: 0 8px;
  }

  .uh-header-row--gnb .uh-nav-slot {
    width: 100%;
  }

  .uh-header-row--gnb .uh-gnb-primary {
    display: flex !important;
    justify-content: space-between;
    align-items: stretch;
    width: 100%;
    gap: 0;
    min-height: 48px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .uh-header-row--gnb .uh-gnb-li {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }

  .uh-header-row--gnb .uh-gnb-li::after {
    height: 8px;
  }

  .uh-header-row--gnb .uh-gnb-trigger {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    padding: 0 10px;
    font-size: var(--fs-sm, 15px);
    font-weight: 600;
    color: #3c4043;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
  }

  .uh-header-row--gnb .uh-gnb-trigger::after {
    margin-left: 4px;
    border-width: 4px;
    opacity: 0.7;
  }

  .uh-header-row--gnb .uh-gnb-trigger:hover,
  .uh-header-row--gnb .uh-gnb-trigger[aria-expanded="true"],
  .uh-header-row--gnb .uh-gnb-li.is-active > .uh-gnb-trigger {
    background: transparent;
    color: var(--uh-brand, #dc2626);
    border-bottom-color: var(--uh-brand, #dc2626);
  }

  .uh-header-row--gnb .uh-gnb-primary[data-nav-fit="compact"] .uh-gnb-trigger {
    padding: 0 6px;
    font-size: var(--fs-sm, 15px);
    min-height: 48px;
  }

  .uh-header-row--gnb .uh-nav-pills-wrap {
    display: none !important;
  }

  .uh-header-row--gnb .uh-mega-panel {
    left: 50%;
    transform: translateX(-50%);
    min-width: min(720px, 94vw);
  }

  .uh-btn-hamburger {
    display: none !important;
  }

  .uh-header-tools--standard {
    display: none !important;
  }
}

/* 좁은 물리 화면 + 데스크탑 보기 — IA 유지·밀도만 축소 (모바일로 되돌리지 않음) */
@media (max-width: 768px) {
  html.layout-desktop .uh-header-row--top .uh-header-inner {
    padding: 0 8px;
    gap: 4px;
  }

  html.layout-desktop .uh-header-row--top .uh-logo-title {
    max-width: 5em;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--fs-sm, 15px);
  }

  html.layout-desktop .uh-gw-search-form {
    min-width: 64px;
    max-width: min(128px, 34vw);
  }

  html.layout-desktop .uh-header-row--gnb .uh-gnb-primary {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  html.layout-desktop .uh-header-row--gnb .uh-gnb-li {
    flex: 0 0 auto;
  }

  html.layout-desktop {
    overflow-x: clip;
  }

  html.layout-desktop .uh-site-header {
    max-width: 100vw;
    overflow-x: clip;
  }
}

/* 강제 모바일 보기 — 물리 뷰포트 무관 · 데스크탑 확대 요소 차단 */
html.layout-mobile .uh-uh-expand.uh-gw-search-form,
html.layout-mobile .uh-uh-expand.uh-gw-admin,
html.layout-mobile .uh-gw-search-form.uh-uh-expand {
  display: none !important;
}

html.layout-mobile .uh-header-row--gnb {
  display: none !important;
}

html.layout-mobile .uh-btn-hamburger {
  display: inline-flex !important;
}

html.layout-mobile .uh-mobile-tabbar {
  display: flex !important;
}

html.layout-mobile body {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
}

/* ── 모바일 통합헤더 크롬 (drawer + tabbar) — 샘플 SSOT ── */
.uh-mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 3000);
  background: rgba(15, 23, 42, 0.4);
}

.uh-mobile-drawer.is-open {
  display: block;
}

.uh-mobile-drawer[hidden]:not(.is-open) {
  display: none !important;
}

.uh-drawer-panel {
  position: fixed;
  display: flex;
  flex-direction: column;
  background: var(--c-panel, #fff);
  overflow: hidden;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12);
}

.uh-drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  border-bottom: 1px solid var(--c-line, #e2e8f0);
  background: var(--c-panel, #fff);
}

.uh-drawer-head-title {
  margin: 0;
  font-size: var(--fs-lg, 18px);
  font-weight: 700;
}

.uh-drawer-close {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0 auto;
  padding: 0;
  border: 1px solid var(--c-line, #e2e8f0);
  border-radius: 50%;
  background: var(--c-panel, #fff);
  color: var(--c-text, #0f172a);
  cursor: pointer;
  font-family: inherit;
}

.uh-drawer-close:focus-visible {
  outline: 2px solid var(--uh-brand, #dc2626);
  outline-offset: 2px;
}

.uh-drawer-close-icon {
  font-size: var(--fs-md, 17px);
  line-height: 1;
}

.uh-drawer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}

.uh-drawer-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.uh-drawer-quick a {
  padding: 8px 12px;
  border: 1px solid var(--c-line, #e2e8f0);
  border-radius: 8px;
  font-size: var(--fs-sm, 15px);
  font-weight: 600;
  text-decoration: none;
  color: inherit;
}

.uh-drawer-sec-title {
  margin: 0 0 8px;
  font-size: var(--fs-sm, 15px);
  font-weight: 700;
  color: var(--c-muted, #64748b);
}

.uh-drawer-region-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.uh-drawer-region {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  font-size: var(--fs-base, 16px);
  font-weight: 600;
}

.uh-drawer-region.is-active {
  background: #eff6ff;
}

.uh-drawer-region:hover {
  background: #f1f5f9;
}

.uh-accordion-item {
  border-bottom: 1px solid var(--c-line, #e2e8f0);
}

.uh-accordion-item--l2,
.uh-accordion-item--l3 {
  border-bottom: none;
}

.uh-accordion-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border: none;
  background: transparent;
  font-size: var(--fs-md, 17px);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.uh-accordion-item--l1 > .uh-accordion-trigger {
  color: var(--c-text, #0f172a);
  font-size: var(--fs-md, 17px);
  font-weight: 700;
}

.uh-accordion-item--l1 > .uh-accordion-trigger[aria-expanded='true'] {
  color: var(--uh-brand, #dc2626);
}

.uh-acc-label {
  flex: 1;
  min-width: 0;
}

.uh-acc-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  border: 1px solid var(--c-line, #e2e8f0);
  border-radius: 4px;
  position: relative;
  color: var(--c-muted, #64748b);
}

.uh-acc-icon::before,
.uh-acc-icon::after {
  content: '';
  position: absolute;
  background: currentColor;
  border-radius: 1px;
}

.uh-acc-icon::before {
  width: 10px;
  height: 2px;
}

.uh-acc-icon::after {
  width: 2px;
  height: 10px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.uh-accordion-trigger[aria-expanded='true'] .uh-acc-icon::after {
  transform: scaleY(0);
  opacity: 0;
}

.uh-accordion-trigger--l2 {
  font-size: var(--fs-base, 16px);
  font-weight: 600;
  color: #334155;
  padding-left: 12px;
}

.uh-accordion-trigger--l3 {
  font-size: var(--fs-sm, 15px);
  font-weight: 500;
  color: var(--c-muted, #64748b);
  padding-left: 24px;
}

.uh-accordion-body {
  display: none;
  padding: 0 0 8px;
}

.uh-accordion-body--l1 {
  padding-left: 0;
}

.uh-accordion-body--l2 {
  padding-left: 16px;
}

.uh-accordion-body--l3 {
  padding-left: 28px;
}

.uh-accordion-body.is-open {
  display: block;
}

.uh-drawer-link,
.uh-accordion-body a {
  display: block;
  padding: 8px 0;
  font-size: var(--fs-base, 16px);
  color: var(--c-text, #0f172a);
  text-decoration: none;
}

.uh-drawer-link--l2 {
  padding-left: 12px;
  font-size: var(--fs-base, 16px);
  font-weight: 600;
  color: #475569;
}

.uh-drawer-link--l3 {
  padding-left: 24px;
  font-size: var(--fs-sm, 15px);
  font-weight: 500;
  color: var(--c-muted, #64748b);
}

.uh-drawer-portal-home {
  font-weight: 700;
  color: var(--uh-brand, #dc2626);
}

.uh-accordion-body--l2 .uh-drawer-portal-home {
  font-size: var(--fs-base, 16px);
}

.uh-accordion-body--l3 .uh-drawer-link--l2 {
  font-weight: 600;
  color: #475569;
}

/* 드로어 계층 메뉴 — 현재 선택(활성) 부각 */
.uh-accordion-item--l1 > .uh-accordion-trigger.is-active {
  color: var(--uh-brand, #dc2626);
  background: #fef2f2;
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
  box-shadow: inset 3px 0 0 var(--uh-brand, #dc2626);
}

.uh-accordion-trigger--l2.is-active,
.uh-accordion-trigger--l3.is-active {
  box-shadow: inset 3px 0 0 var(--uh-brand, #dc2626);
}

.uh-accordion-trigger--l2.is-active {
  color: var(--uh-brand, #dc2626);
  font-weight: 700;
  background: #fff1f2;
  border-radius: 8px;
}

.uh-accordion-trigger--l3.is-active {
  color: #b91c1c;
  font-weight: 600;
  background: #fef2f2;
  border-radius: 6px;
}

.uh-drawer-link.is-active,
.uh-drawer-portal-home.is-active {
  color: var(--uh-brand, #dc2626);
  font-weight: 700;
  background: #fff1f2;
  border-radius: 8px;
  padding-left: 12px;
  padding-right: 8px;
  box-shadow: inset 3px 0 0 var(--uh-brand, #dc2626);
}

.uh-drawer-link--l3.is-active {
  color: #b91c1c;
  font-weight: 600;
  background: #fef2f2;
  font-size: var(--fs-sm, 15px);
}

.uh-mobile-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-sticky-header, 1900);
  background: var(--c-panel, #fff);
  border-top: 1px solid var(--c-line, #e2e8f0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.uh-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 6px 4px;
  border: none;
  background: transparent;
  font-size: var(--fs-xs, 14px);
  color: var(--c-muted, #64748b);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.uh-tab-item.is-active {
  color: var(--uh-brand, #dc2626);
  font-weight: 700;
}

body.uh-lock {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

html[data-device-tier="phone-sm"] .l14-shell,
html[data-device-tier="phone-lg"] .l14-shell {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
}

html[data-device-tier="phone-sm"] .uh-logo-sub,
html[data-device-tier="phone-lg"] .uh-logo-sub {
  display: none;
}

html[data-device-tier="phone-sm"] .uh-search-wrap--full,
html[data-device-tier="phone-lg"] .uh-search-wrap--full {
  display: none !important;
}

html[data-device-tier="phone-sm"] .uh-region-dd,
html[data-device-tier="phone-lg"] .uh-region-dd {
  display: none;
}

html[data-device-tier="phone-lg"] .uh-tool-auth--register {
  display: none;
}

/* 모바일 — 스카이(뷰포트 상단) position:fixed · 본문은 --uh-sticky-bottom 스페이서 */
html[data-device-tier="phone-sm"] .uh-site-header,
html[data-device-tier="phone-lg"] .uh-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: 0;
}

html[data-device-tier="phone-sm"] .l14-unified-header,
html[data-device-tier="phone-lg"] .l14-unified-header {
  min-height: var(--uh-sticky-bottom, 56px);
}

/* 관문 모바일헤더 SSOT — 전 페이지 공통 (gateway.css @779px 동형) */
html.layout-mobile .uh-header-tools--standard {
  display: none !important;
}

html.layout-mobile .uh-logo-text {
  display: none !important;
}

html.layout-mobile body {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
}

html[data-device-tier="phone-sm"],
html[data-device-tier="phone-lg"] {
  scroll-padding-top: var(--uh-sticky-bottom, 56px);
}

html[data-device-tier="phone-sm"] .uh-header-inner,
html[data-device-tier="phone-lg"] .uh-header-inner {
  overflow: hidden;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  align-items: center;
}

html[data-device-tier="phone-lg"] .uh-search-wrap--compact input {
  width: min(100px, 28vw);
}

html[data-device-tier="phone-lg"] .uh-search-wrap--compact {
  display: flex !important;
}

html[data-device-tier="phone-lg"] .uh-search-wrap--compact input {
  width: 120px;
}

html[data-device-tier="phone-lg"] .uh-search-wrap--compact .uh-search-btn-text {
  display: none;
}

html[data-device-tier="phone-sm"] .uh-tool-auth--register {
  display: none;
}

html[data-device-tier="phone-sm"] .uh-auth-links .uh-tool-auth {
  padding: 0 10px;
  font-size: var(--fs-xs, 14px);
}

html[data-device-tier="phone-sm"] .uh-mypage-text,
html[data-device-tier="phone-lg"] .uh-mypage-text {
  display: none;
}

html[data-device-tier="phone-sm"] .uh-mypage-icon,
html[data-device-tier="phone-lg"] .uh-mypage-icon {
  display: inline;
}

html[data-device-tier="phone-sm"] .uh-logo,
html[data-device-tier="phone-lg"] .uh-logo {
  padding: 0;
  gap: 0;
  line-height: 0;
}

html[data-device-tier="phone-sm"] .uh-logo-mark,
html[data-device-tier="phone-lg"] .uh-logo-mark {
  padding: 0;
  line-height: 0;
}

html[data-device-tier="phone-sm"] .uh-btn-hamburger,
html[data-device-tier="phone-lg"] .uh-btn-hamburger {
  display: inline-flex !important;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 6px;
  font-size: var(--fs-base, 16px);
}

html[data-device-tier="phone-sm"] .uh-mobile-drawer,
html[data-device-tier="phone-lg"] .uh-mobile-drawer {
  display: none;
}

html[data-device-tier="phone-sm"] .uh-mobile-drawer.is-open,
html[data-device-tier="phone-lg"] .uh-mobile-drawer.is-open {
  display: block;
}

html[data-device-tier="phone-sm"] .uh-mobile-tabbar,
html[data-device-tier="phone-lg"] .uh-mobile-tabbar {
  display: flex;
}

html[data-device-tier="phone-sm"] .uh-drawer-panel {
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  max-height: min(92vh, calc(100dvh - env(safe-area-inset-top, 0px) - 12px));
  border-radius: 16px 16px 0 0;
}

html[data-device-tier="phone-lg"] .uh-drawer-panel {
  right: 0;
  top: 0;
  bottom: 0;
  left: auto;
  width: min(360px, 92vw);
  height: 100%;
  max-height: none;
  border-radius: 0;
}

html[data-device-tier="phone-sm"] .uh-nav-slot,
html[data-device-tier="phone-lg"] .uh-nav-slot {
  display: none !important;
}
