/* 팜시크릿 공통 스타일
 * 헤더 / 푸터 / 팝업(모바일 메뉴 · 검색 popover · SIM 패널) / 글로벌 유틸
 */

/* ═════════════════════════════════════════════
   CSS 변수
   ═════════════════════════════════════════════ */
   :root {
    --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
      system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo',
      'Noto Sans KR', sans-serif;
    --font-display: 'IBM Plex Sans KR', 'Pretendard Variable', Pretendard, sans-serif;
    --font-label: 'IBM Plex Sans', 'IBM Plex Sans KR', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  
    --color-brand: #FE691B;
    --color-brand-dark: #CC4F0E;
    --color-brand-soft: rgba(254, 105, 27, 0.08);
    --color-brand-grad: linear-gradient(135deg, #8A3208 0%, #FE691B 55%, #FFB07A 100%);
  
    --shadow-card-hover: 0 8px 24px rgba(15, 23, 42, 0.08);
  
    --z-gnb: 50;
    --z-sim-panel: 60;
    --z-modal: 100;
  }
  
  /* ═════════════════════════════════════════════
     글로벌 base
     ═════════════════════════════════════════════ */
  html,
  body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  body {
    background: #fff;
    color: #111827;
    font-size: 15px;
    line-height: 1.65;
  }
  a {
    text-decoration: none;
    color: inherit;
  }

  /* ── 전역 포커스 링 (WCAG 2.1 AA 키보드 네비게이션) ── */
  :focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 3px;
    border-radius: 4px;
  }
  /* 입력 필드는 border + box-shadow 방식이므로 outline 제거 */
  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible {
    outline: none;
  }

  /* 폰트 유틸 */
  .font-display { font-family: var(--font-display); letter-spacing: -0.015em; }
  .font-display.text-3xl,
  .font-display.text-4xl,
  .font-display.text-5xl,
  h1.font-display,
  h2.font-display { letter-spacing: -0.025em; }
  
  .font-label {
    font-family: var(--font-label);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
  }
  .font-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .tnum { font-variant-numeric: tabular-nums; }
  .font-accent { font-family: 'Caveat', cursive; font-weight: 700; letter-spacing: 0; }
  
  /* 공통 컨테이너 */
  .ps-container {
    width: 1280px;
    margin-left: auto;
    margin-right: auto;
    max-width: calc(100vw - 26px);
  }
  
  /* 글로벌 유틸 */
  .hidden { display: none !important; }
  .sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .ps-blur {
    filter: blur(3px);
    user-select: none;
    pointer-events: none;
  }

  /* ═════════════════════════════════════════════
     스플래시 — 메인 첫 방문 1회 노출
     ═════════════════════════════════════════════ */
  .ps-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #FE691B;
    background-image:
      radial-gradient(80% 55% at 50% 18%, rgba(255, 200, 150, 0.35) 0%, rgba(255, 160, 100, 0.12) 35%, transparent 70%),
      radial-gradient(120% 80% at 50% 110%, rgba(120, 40, 8, 0.55) 0%, rgba(120, 40, 8, 0) 60%),
      linear-gradient(180deg, #FE7A2E 0%, #F26614 45%, #D8500E 85%, #B84509 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.55s ease;
  }
  .ps-splash.is-fading { opacity: 0; }
  .ps-splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }
  .ps-splash-logo {
    width: 400px;
    max-width: 62vw;
    aspect-ratio: 300 / 35;
    background-color: #fff;
    -webkit-mask: url('../img/pharmsecret_logo.svg') no-repeat center / contain;
            mask: url('../img/pharmsecret_logo.svg') no-repeat center / contain;
    animation: ps-splash-up 1s cubic-bezier(0.17, 0.37, 0.27, 0.86) both;
    animation-delay: 0.25s;
  }
  .ps-splash-slogan {
    font-family: 'Caveat', cursive;
    font-size: 28px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    line-height: 1;
    margin: 0;
    animation: ps-splash-up 1s cubic-bezier(0.22, 0.61, 0.27, 0.86) both;
    animation-delay: 0.65s;
  }
  @keyframes ps-splash-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  html.ps-splash-active,
  html.ps-splash-active body { overflow: hidden; }
  @media (max-width: 640px) {
    .ps-splash-logo {width: 280px;}
    .ps-splash-slogan {font-size: 18px;}
  }

  /* ═════════════════════════════════════════════
     Beta / NEW 메뉴 배지
     ═════════════════════════════════════════════ */
  .ps-beta-badge {
    display: inline-block;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1;
    color: #a855f7;
    transform: rotate(-6deg) translateY(-2px);
    margin-left: 4px;
  }
  
  .ps-menu-beta-wrap {
    position: relative;
    display: inline-block;
    padding-right: 4px;
  }
  .ps-menu-beta {
    position: absolute;
    top: -10px;
    right: -22px;
    display: inline-block;
    font-family: 'Caveat', cursive;
    font-style: normal;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    color: #a855f7;
    transform: rotate(-8deg);
    pointer-events: none;
    letter-spacing: 0.5px;
  }
  
  .ps-menu-new {
    position: absolute;
    top: -7px;
    right: -14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 10px;
    line-height: 1;
    color: #fff;
    background: #ef4444;
    border-radius: 9999px;
    letter-spacing: 0;
    pointer-events: none;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
    animation: ps-menu-new-pulse 2s ease-out infinite;
  }
  @keyframes ps-menu-new-pulse {
    0%   { box-shadow: 0 0 0 0    rgba(239, 68, 68, 0.55); }
    70%  { box-shadow: 0 0 0 7px  rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0    rgba(239, 68, 68, 0); }
  }
  
  /* ═════════════════════════════════════════════
     헤더 — sticky 컨테이너 (top: -80px)
     상단 top_menu(80px)는 화면 위로 사라지고 middle_menu만 상단 고정
     모바일은 top_menu hidden → top: 0
     ═════════════════════════════════════════════ */
  .ps-header {
    position: sticky;
    top: -80px;
    background: #fff;
    z-index: var(--z-gnb);
    isolation: isolate;
  }
  @media (max-width: 767px) {
    .ps-header { top: 0; }
  }

  /* top_menu — sticky 컨테이너 안에서 -80px 만큼 위로 빠지며 사라짐 */
  .ps-top-menu {
    border-bottom: 1px solid #f1f3f5;
    background: #fff;
  }
  .ps-top-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 24px;
  }
  .ps-flex-box {
    display: flex;
    align-items: center;
    gap: 32px;
  }
  
  /* 로고 */
  .ps-logo a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    letter-spacing: -0.02em;
  }
  .ps-logo a > span:first-child {
    display: inline-block;
    width: 215px;
    background: url('../img/pharmsecret_logo.svg') no-repeat left center / contain;
    text-indent: -9999em;
    overflow: hidden;
    white-space: nowrap;
    aspect-ratio: 300 / 37;
  }
  
  /* 브랜드 슬로건 (vertical swiper) */
  .ps-brand-slogan {
    position: relative;
    height: 28px;
    width: 360px;
    max-width: 38vw;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%);
  }
  .ps-brand-slogan .swiper-wrapper { flex-direction: column; }
  .ps-brand-slogan .swiper-slide {
    display: flex !important;
    align-items: center;
    height: 28px;
    line-height: 28px;
    font-family: var(--font-display, 'IBM Plex Sans KR'), 'Pretendard Variable', sans-serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #1f2937;
    white-space: nowrap;
  }
  .ps-brand-slogan .swiper-slide strong { color: var(--color-brand); font-weight: 800; }
  .ps-brand-slogan .swiper-slide em {
    font-style: normal;
    font-weight: 800;
    color: #0f172a;
    background: linear-gradient(180deg, transparent 60%, #fef08a 60%);
    padding: 0 2px;
  }
  .ps-brand-slogan .swiper-slide span { color: #4b5563; font-weight: 500; }
  @media (max-width: 1023px) {
    .ps-brand-slogan { width: 260px; }
    .ps-brand-slogan .swiper-slide { font-size: 14px; }
  }
  
  /* 상단 우측: 회원 메뉴 */
  .ps-top-right {
    display: flex;
    align-items: center;
    gap: 18px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 15px;
    color: #202020;
  }
  .ps-top-right a, .ps-top-right button {
    color: inherit;
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
  }
  .ps-top-right a:hover { color: #111827; }
  
  .ps-top-right-visitor,
  .ps-top-right-member {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .ps-top-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .ps-mypage-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .ps-avatar-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 9999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 600;
  }
  
  /* 알림 dot */
  .ps-notif-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .ps-notif-dot--inline {
    position: static;
    margin-left: 2px;
  }
  
  /* middle_menu — 헤더 sticky로 상단 고정 (Liquid Glass on scroll) */
  .ps-middle-menu {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.28s ease, border-color 0.28s ease,
                box-shadow 0.28s ease, backdrop-filter 0.28s ease;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .is-scrolled .ps-middle-menu,
  .ps-header.is-scrolled .ps-middle-menu {
    background-color: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    backdrop-filter: blur(22px) saturate(180%);
    border-bottom-color: rgba(15, 23, 42, 0.08);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.6) inset,
      0 12px 32px rgba(15, 23, 42, 0.08);
  }
  .ps-middle-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
  .ps-gnb { flex: 1; }
  .ps-gnb > ul {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .ps-gnb-1depth > a {
    display: inline-block;
    padding: 16px 18px;
    font-size: 19px;
    font-weight: 600;
    color: #000;
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: color 0.15s ease;
  }
  .ps-gnb-1depth:first-child > a{
    padding-left: 0;
  }
  .ps-gnb-1depth:first-last > a{
    padding-right: 0;
  }
  .ps-gnb-1depth > a:hover,
  .ps-gnb-1depth.on > a { color: var(--color-brand); }
  .ps-gnb-1depth > a > span { position: relative; }
  .ps-gnb-1depth > a:hover > span::after,
  .ps-gnb-1depth.on > a > span::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -8px;
    height: 3px;
    background: var(--color-brand);
    border-radius: 2px;
  }
  
  /* 메인 라벨 옆 부제 */
  .ps-gnb-with-sub > a { display: inline-flex; align-items: baseline; gap: 8px; }
  .ps-menu-sub {
    font-size: 14px;
    font-weight: 400;
    color: #6b7280;
    letter-spacing: -0.01em;
    white-space: nowrap;
    margin-left: 0.7em;
  }
  .ps-gnb-1depth > a:hover .ps-menu-sub,
  .ps-gnb-1depth.on > a .ps-menu-sub { color: #6b7280; }
  
  /* GNB 1depth — 각 항목 hover/focus 시 자기 하위만 펼침 */
  .ps-has-sub { position: relative; }
  .ps-sub-menu {
    position: absolute;
    top: calc(100% + 0px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 180px;
    padding: 8px 0;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
    z-index: 60;
  }
  .ps-has-sub:hover .ps-sub-menu,
  .ps-has-sub:focus-within .ps-sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
  }
  .ps-sub-menu a {
    padding: 10px 18px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    white-space: nowrap;
    text-align: left;
  }
  .ps-sub-menu a:hover { color: var(--color-brand); font-weight: 600;}

  /* middle_menu 우측 */
  .ps-middle-right {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .ps-icon-btn {
    width: 44px; height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #1f2937;
    background: transparent;
    border: 0;
    cursor: pointer;
  }
  .ps-icon-btn:hover { background: #f3f4f6; }
  
  /* 헤더 우측 핵심 CTA (매물 등록 / 매수 등록) */
  .ps-cta-wrap { display: inline-flex; align-items: center; }
  .ps-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  }
  .ps-cta svg { flex-shrink: 0; }
  .ps-cta--outline {
    background: #fff;
    border: 1px solid #c7d2fe;
    color: #1d4ed8;
  }
  .ps-cta--outline:hover {
    background: #eff6ff;
    border-color: #93c5fd;
  }
  .ps-cta--primary {
    background: var(--color-brand);
    color: #fff;
    border: 1px solid var(--color-brand);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 4px 12px rgba(37, 99, 235, 0.22);
  }
  .ps-cta--primary:hover {
    background: var(--color-brand-dark);
    border-color: var(--color-brand-dark);
  }
  .ps-cta-sub {
    font-family: var(--font-label);
    font-style: normal;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 6px;
    margin-left: 2px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 9999px;
    line-height: 1;
  }
  @media (max-width: 1100px) {
    .ps-cta-sub { display: none; }
    .ps-cta { padding: 0 12px; font-size: 12.5px; }
  }
  @media (max-width: 900px) {
    .ps-middle-right .ps-cta-wrap { display: none; }
  }
  
  /* ═════════════════════════════════════════════
     검색 오버레이 (상단 패널 + 딤 배경, fade in/out)
     ═════════════════════════════════════════════ */
  .ps-search-wrap { position: relative; }
  
  .ps-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    animation: ps-overlay-fade-in 220ms ease-out both;
  }
  .ps-search-overlay.is-closing {
    animation: ps-overlay-fade-out 220ms ease-in both;
  }
  @keyframes ps-overlay-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  @keyframes ps-overlay-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
  }
  
  .ps-search-panel {
    background: #fff;
    width: 100%;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
    padding-bottom: 8px;
    animation: ps-panel-slide-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .ps-search-overlay.is-closing .ps-search-panel {
    animation: ps-panel-slide-out 220ms ease-in both;
  }
  @keyframes ps-panel-slide-in {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  @keyframes ps-panel-slide-out {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(-12px); opacity: 0; }
  }
  
  .ps-search-overlay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 0;
  }
  .ps-search-overlay-logo {
    margin: 0;
    font-size: 0;
    line-height: 1;
  }
  .ps-search-overlay-logo span {
    display: inline-block;
    width: 180px;
    background: url('../img/pharmsecret_logo.svg') no-repeat left center / contain;
    text-indent: -9999em;
    overflow: hidden;
    white-space: nowrap;
    aspect-ratio: 300 / 37;
  }
  
  .ps-search-overlay-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: #111827;
    cursor: pointer;
    border-radius: 9999px;
    transition: background 0.15s ease;
  }
  .ps-search-overlay-close:hover { background: #f3f4f6; }
  
  .ps-search-overlay-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 24px 48px;
  }
  
  .ps-search-overlay-form {
    width: 100%;
    max-width: 720px;
    display: flex;
    align-items: center;
    height: 64px;
    padding: 4px 10px 4px 28px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
  .ps-search-overlay-form:focus-within {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 4px rgba(254, 105, 27, 0.18);
  }
  .ps-search-overlay-form input {
    flex: 1;
    border: 0;
    background: transparent;
    font-size: 17px;
    color: #1f2937;
    outline: none;
    min-width: 0;
    padding-right: 12px;
  }
  .ps-search-overlay-form input::placeholder { color: #9ca3af; }
  
  .ps-search-overlay-submit {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #111827;
    cursor: pointer;
    border-radius: 9999px;
    flex-shrink: 0;
    transition: background 0.15s ease;
  }
  .ps-search-overlay-submit:hover { background: #f3f4f6; }
  
  .ps-search-popular {
    width: 100%;
    max-width: 720px;
    margin-top: 28px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
    justify-content: center;
  }
  .ps-search-popular-label {
    font-size: 14px;
    font-weight: 700;
    color: #4b5563;
    margin-right: 4px;
  }
  .ps-search-popular-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }
  .ps-search-popular-item {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    background: #f3f4f6;
    border: 0;
    border-radius: 9999px;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .ps-search-popular-item:hover {
    background: var(--color-brand);
    color: #fff;
  }
  
  @media (max-width: 640px) {
    .ps-search-overlay-head { padding: 14px 16px 0; }
    .ps-search-overlay-body { padding: 24px 16px 32px; }
    .ps-search-overlay-form {
      height: 56px;
      padding-left: 20px;
    }
    .ps-search-overlay-form input { font-size: 15px; }
    .ps-search-popular {
      margin-top: 20px;
      flex-wrap: nowrap;
      gap: 8px 10px;
      justify-content: flex-start;
      align-items: center;
      overflow: hidden;
    }
    .ps-search-popular-label {
      width: auto;
      text-align: left;
      margin-bottom: 0;
      flex-shrink: 0;
    }
    .ps-search-popular-list {
      flex: 1;
      flex-wrap: nowrap;
      justify-content: flex-start;
      overflow-x: auto;
      scrollbar-width: none;
      -ms-overflow-style: none;
      -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
              mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
      padding-right: 8px;
    }
    .ps-search-popular-list::-webkit-scrollbar { display: none; }
    .ps-search-popular-item { flex-shrink: 0; }
  }
  
  /* ═════════════════════════════════════════════
     모바일 — top_menu 숨김, middle_menu만 노출
     ═════════════════════════════════════════════ */
  @media (max-width: 767px) {
    .ps-top-menu { display: none; }
    .ps-gnb { display: none; }
    .ps-middle-flex {
      height: 56px;
      justify-content: space-between;
    }
    .ps-middle-flex::before {
      content: '팜시크릿';
      color: var(--color-brand);
      font-size: 22px;
      font-weight: 700;
      letter-spacing: -0.02em;
      font-family: var(--font-display);
    }
  }
  
  /* ═════════════════════════════════════════════
     모바일 햄버거 메뉴 (슬라이드 사이드바)
     ═════════════════════════════════════════════ */
  .ps-mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0);
    z-index: var(--z-modal);
    visibility: hidden;
    pointer-events: none;
    transition: background 0.35s ease, visibility 0s linear 0.35s;
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
  }
  .ps-mobile-menu.is-open {
    visibility: visible;
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: background 0.35s ease, visibility 0s,
                -webkit-backdrop-filter 0.35s ease, backdrop-filter 0.35s ease;
  }
  .ps-mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 85vw);
    background: #fff;
    padding: 0 0 32px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translate3d(100%, 0, 0);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.15);
    border-radius: 20px 0 0 20px;
  }

  /* ── CTA 버튼 행 (그리드 2컬럼) ── */
  .ps-mobile-cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px 20px 0;
  }
  .ps-mobile-cta-row--last {
    padding-bottom: 18px;
    border-bottom: 1px solid #f1f3f5;
  }

  /* ── CTA 버튼 ── */
  .ps-mobile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 46px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease,
                border-color 0.15s ease, filter 0.15s ease;
  }
  .ps-mobile-btn--primary {
    background: var(--color-brand);
    color: #fff;
    border-color: var(--color-brand);
  }
  .ps-mobile-btn--primary:hover { filter: brightness(0.95); }

  .ps-mobile-btn--outline-primary {
    background: #fff;
    color: var(--color-brand);
    border-color: var(--color-brand);
  }
  .ps-mobile-btn--outline-primary:hover {
    background: rgba(254, 105, 27, 0.08);
  }

  .ps-mobile-btn--outline {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
  }
  .ps-mobile-btn--outline:hover { background: #f9fafb; }

  .ps-mobile-btn--secondary {
    background: #111827;
    color: #fff;
    border-color: #111827;
  }
  .ps-mobile-btn--secondary:hover { background: #1f2937; }

  .ps-mobile-btn-sub {
    display: inline-block;
    margin-left: 2px;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.9;
  }

  /* ── 섹션 헤더 (SERVICES / 매물 메뉴 등) ── */
  .ps-mobile-section {
    display: block;
    padding: 18px 20px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .ps-mobile-section--mt {
    margin-top: 4px;
    border-top: 1px solid #f1f3f5;
  }

  /* ── 메뉴 링크 ── */
  .ps-mobile-link,
  .ps-mobile-link--sub {
    display: block;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
  }
  .ps-mobile-link--sub {
    font-size: 14px;
    font-weight: 400;
    color: #4b5563;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .ps-mobile-link:hover,
  .ps-mobile-link--sub:hover {
    background: #f9fafb;
    color: var(--color-brand);
  }
  .ps-mobile-link--flex {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .ps-mobile-link.is-active,
  .ps-mobile-link--sub.is-active {
    color: var(--color-brand);
    font-weight: 700;
  }
  .ps-mobile-link .ps-menu-beta,
  .ps-mobile-link--sub .ps-menu-beta {
    position: static;
    transform: none;
    font-size: 11px;
  }
  .ps-mobile-link .ps-menu-new,
  .ps-mobile-link--sub .ps-menu-new {
    position: static;
    width: 16px;
    height: 16px;
    font-size: 9px;
    animation: none;
    box-shadow: none;
  }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel {
    transform: translate3d(0, 0, 0);
  }
  body.ps-no-scroll { overflow: hidden; }

  /* 패널 내부 컨텐츠 래퍼 */
  .ps-mobile-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 20px 32px;
    flex: 1;
  }

  /* 헤드: 로고 + 닫기 */
  .ps-mobile-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 12px 20px;
    border-bottom: 1px solid #f1f3f5;
  }
  .ps-mobile-logo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .ps-mobile-logo {
    display: inline-block;
    width: 120px;
    height: 26px;
    background: url('../img/pharmsecret_logo.svg') no-repeat left center / contain;
    text-indent: -9999em;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
    line-height: 1;
  }
  .ps-mobile-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .ps-mobile-close:hover {
    background: #f3f4f6;
    color: #111827;
  }
  .ps-mobile-close svg { display: block; }

  /* 구분선 */
  .ps-mobile-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0;
    border: 0;
  }

  /* 그룹 (섹션 타이틀 + 2컬럼 그리드) */
  .ps-mobile-group {
    padding: 20px 0 4px;
  }
  .ps-mobile-group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
  }
  .ps-mobile-group-title .ps-menu-beta {
    position: static;
    transform: none;
    font-size: 0.95rem;
  }

  /* 2컬럼 그리드 링크 */
  .ps-mobile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }
  .ps-mobile-grid-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 4px;
    font-size: 15px;
    font-weight: 400;
    color: #374151;
    text-decoration: none;
    transition: color 0.12s ease;
    position: relative;
  }
  .ps-mobile-grid-link:hover { color: #111827; }
  .ps-mobile-grid-link:active { color: var(--color-brand); }

  /* 현재 페이지 활성 링크 */
  .ps-mobile-grid-link.is-active {
    color: var(--color-brand);
    font-weight: 600;
  }

  /* 그리드 내부 Beta/NEW 배지 인라인 */
  .ps-mobile-grid-link .ps-menu-new {
    position: static;
    width: 16px;
    height: 16px;
    font-size: 9px;
    animation: none;
    box-shadow: none;
    flex-shrink: 0;
  }

  /* 모바일 메뉴 내부 Beta/NEW 배지 */
  .ps-mobile-menu .ps-menu-beta {
    position: static;
    transform: none;
    font-size: 1rem;
    margin-left: 6px;
  }
  .ps-mobile-menu .ps-menu-new {
    position: static;
    width: 18px;
    height: 18px;
    font-size: 10px;
    animation: none;
    box-shadow: none;
  }

  /* ── 메뉴 아이템 staggered 등장 애니메이션 ── */
  .ps-mobile-menu-panel > * {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.28s ease, transform 0.28s ease;
  }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > * {
    opacity: 1;
    transform: translateX(0);
  }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(1)  { transition-delay: 0.06s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(2)  { transition-delay: 0.09s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(3)  { transition-delay: 0.12s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(4)  { transition-delay: 0.15s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(5)  { transition-delay: 0.18s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(6)  { transition-delay: 0.20s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(7)  { transition-delay: 0.22s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(8)  { transition-delay: 0.24s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(9)  { transition-delay: 0.26s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(10) { transition-delay: 0.28s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(11) { transition-delay: 0.30s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(12) { transition-delay: 0.32s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(13) { transition-delay: 0.34s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(14) { transition-delay: 0.36s; }
  .ps-mobile-menu.is-open .ps-mobile-menu-panel > *:nth-child(n+15) { transition-delay: 0.38s; }
  
  /* ═════════════════════════════════════════════
     SIM 패널 (개발용 우하단 토글)
     ═════════════════════════════════════════════ */
  .ps-sim-panel {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: var(--z-sim-panel);
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    width: 240px;
  }
  .ps-sim-panel select {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    margin-top: 4px;
  }
  .ps-sim-panel select option {
    background: #0f172a;
    color: #fff;
  }
  .ps-sim-panel .ps-sim-toggle {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
  }
  .ps-sim-panel.collapsed > .ps-sim-body { display: none; }
  .ps-sim-panel.collapsed { width: auto; padding: 10px 14px; }
  /* 모바일에서 처음부터 접힌 상태 + 하단 고정 CTA 위에 표시 */
  @media (max-width: 767px) {
    .ps-sim-panel {
      bottom: 72px;
      right: 8px;
      width: auto;
      padding: 10px 14px;
      font-size: 11px;
    }
    .ps-sim-panel > .ps-sim-body { display: none; }
    .ps-sim-panel > .ps-sim-title { display: none; }
  }
  
  .ps-sim-title {
    font-family: var(--font-label);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #93c5fd;
    font-weight: 600;
    margin-bottom: 8px;
  }
  .ps-sim-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .ps-sim-field { display: block; }
  .ps-sim-label { font-size: 11px; color: #d1d5db; }
  .ps-sim-hint {
    font-size: 10px;
    color: #9ca3af;
    line-height: 1.6;
  }
  
  /* ═════════════════════════════════════════════
     푸터
     ═════════════════════════════════════════════ */
  .ps-footer {
    background: #111827;
    color: #9ca3af;
    margin-top: 40px;
  }
  .ps-footer-grid {
    padding-top: 48px;
    padding-bottom: 48px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    font-size: 14px;
  }
  .ps-footer-title {
    color: #fff;
    font-weight: 600;
    margin-bottom: 12px;
  }
  .ps-footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .ps-footer-list > li + li { margin-top: 8px; }
  .ps-footer-link:hover { color: #fff; }
  
  .ps-footer-bottom { border-top: 1px solid #1f2937; }
  .ps-footer-info {
    padding-top: 24px;
    padding-bottom: 24px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
  }
  .ps-footer-info > p + p { margin-top: 4px; }
  .ps-footer-copy { margin-top: 12px !important; }
  
  @media (min-width: 768px) {
    .ps-footer-grid { grid-template-columns: repeat(4, 1fr); }
  }

  /* ═════════════════════════════════════════════
     상단이동 플로팅 버튼 (전체 페이지 공통 — 모바일 전용)
     · 스크롤 400px↓에서 .is-on 으로 페이드인
     · 글쓰기 FAB(.tk-fab)이 있는 페이지에선 자동으로 그 위로
     ═════════════════════════════════════════════ */
  .ps-top-btn {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 65;
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(255, 255, 255, 0.96);
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14), 0 2px 4px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .ps-top-btn svg { width: 18px; height: 18px; display: block; }
  .ps-top-btn:hover { background: #fff; }
  .ps-top-btn.is-on {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  /* 모바일에서만 노출 */
  @media (max-width: 767px) {
    .ps-top-btn { display: inline-flex; }
    /* 글쓰기 FAB이 같은 페이지에 보일 때 그 위로 */
    body:has(.tk-fab:not(.hidden)) .ps-top-btn { bottom: 70px; }
  }
  