/* ============================================================
   📱 PPA WEB 모바일 리디자인 v5 — 앱 스타일 전면 개편
   ============================================================
   ⚠️ 이 파일은 style.css 이후에 로드됩니다.
   데스크톱(>768px)에서는 전혀 작동하지 않습니다.
   ============================================================ */

@media (max-width: 768px) {

  /* ============================================================
     LAYER 0: 디자인 토큰 & 리셋
     ============================================================ */
  :root {
    /* ── Stitch Design Tokens ── */
    --m-bg: #f9f9ff;
    --m-bg-card: #FFFFFF;
    --m-bg-features: linear-gradient(180deg, #f3f3fb 0%, #ededf5 100%);
    --m-text: #191c21;
    --m-text-sub: #424751;
    --m-text-light: #727783;
    --m-brand: #003976;
    --m-accent: #1e5dae;
    --m-danger: #ba1a1a;
    --m-radius-card: 24px;
    --m-radius-btn: 12px;
    --m-radius-pill: 999px;
    --m-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.03);
    --m-shadow-lg: 0 8px 32px rgba(0, 50, 100, 0.10);
    --m-header-h: 56px;
    --m-bnav-h: 60px;
    --m-side-pad: 16px;
    /* ── Stitch 추가 토큰 ── */
    --m-surface-container: #ededf5;
    --m-surface-container-high: #e7e8ef;
    --m-surface-container-highest: #e1e2e9;
    --m-outline-variant: #c2c6d3;
    --m-primary-container: #0050a0;
    --m-primary-fixed: #d6e3ff;
    --m-secondary: #546067;
    --m-secondary-container: #d8e4ed;
    --m-error-container: #ffdad6;
  }

  html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
  }

  body {
    background: var(--m-bg) !important;
    color: var(--m-text) !important;
    padding-bottom: calc(var(--m-bnav-h) + env(safe-area-inset-bottom, 0px)) !important;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  body.drawer-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    touch-action: none;
  }

  body.features-open {
    overflow: hidden !important;
  }

  .container {
    padding-left: var(--m-side-pad) !important;
    padding-right: var(--m-side-pad) !important;
  }

  /* ============================================================
     LAYER 0.5: Material Symbols 아이콘 정중앙 보정
     ============================================================
     Material Symbols 폰트는 기본 line-height·baseline 때문에
     flex 컨테이너 내에서도 좌측 하부로 미세하게 밀리는 현상이 있음.
     아래 규칙으로 아이콘을 정확히 정중앙에 배치합니다.
     ============================================================ */
  .material-symbols-outlined {
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    text-rendering: optimizeLegibility;
  }

  /* ============================================================
     LAYER 1: PC 요소 숨김 / 모바일 요소 표시
     ============================================================ */
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .mobile-only.mobile-sub-header {
    display: flex !important;
  }

  .hero-particles,
  .hero-scroll-indicator,
  .floating-widget-container,
  .promo-slider {
    display: none !important;
  }

  /* 모바일 플로팅 버튼(위로 가기) 재배치 - 네비게이션 및 챗봇과 안 겹치도록 */
  #scrollTopBtn {
    bottom: 90px !important;
    right: 16px !important;
    width: 44px !important;
    height: 44px !important;
  }

  /* 챗봇 모바일 플로팅 버튼 위치 최적화 (위로 가기 버튼 아래, 하단 네비게이션 위) */
  .chatbot-toggle-btn {
    position: fixed !important;
    bottom: 96px !important;
    right: 16px !important;
    width: 52px !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 9998 !important;
    /* 모바일 하단 네비보다는 아래, 창보다는 위 */
  }

  .chatbot-toggle-btn img {
    width: 100% !important;
    height: 100% !important;
  }

  .chatbot-toggle-btn .chatbot-icon-close {
    width: 52px !important;
    height: 52px !important;
    padding: 12px !important;
  }

  .chatbot-badge {
    top: 0px !important;
    right: 0px !important;
    font-size: 0.6rem !important;
    padding: 3px 6px !important;
  }

  /* 모바일 챗봇 창을 중앙 팝업 형태로 변경 */
  .chatbot-window {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 400px;
    height: 70vh !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 10002 !important;
    /* 팝업 성격이므로 가장 위에 */
    border-radius: 20px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
  }

  .chatbot-window.open {
    transform: translate(-50%, -50%) scale(1) !important;
  }

  /* 데스크톱 네비·메가 드롭다운 숨기기 */
  .nav-menu,
  .mega-dropdown {
    display: none !important;
  }

  /* 서브페이지 모바일 헤더 고정 (스크롤 시 상단 유지) */
  #mobileRoot > header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
  }

  #mobileRoot > main {
    padding-top: 56px !important;
  }

  /* ============================================================
     LAYER 2: 모바일 헤더 (투명→블러 전환)
     ============================================================ */
  header#mainHeader {
    height: var(--m-header-h) !important;
    min-height: unset !important;
    background: transparent !important;
    transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
  }

  header#mainHeader.scrolled {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06) !important;
  }

  .header-inner {
    height: var(--m-header-h) !important;
    padding: 0 12px !important;
  }

  header .logo {
    gap: 4px;
  }

  header .logo img {
    height: 22px !important;
  }

  header .logo>div {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
  }

  header .logo span:first-child {
    font-size: 0.92rem !important;
    font-weight: 800;
    color: #fff;
    transition: color 0.3s;
  }

  header .logo .logo-sub {
    display: block !important;
    font-size: 0.55rem !important;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s;
    line-height: 1.2;
  }


  header.scrolled .logo span:first-child {
    color: var(--m-text) !important;
  }

  header.scrolled .logo .logo-sub {
    color: var(--m-text-sub);
  }

  /* 헤더 유틸리티 */
  .header-util {
    display: flex !important;
    gap: 0;
    align-items: center;
    margin-left: auto;
    margin-right: 0;
  }

  .header-util .senior-mode-toggle {
    display: none !important;
  }

  .header-util .search-trigger {
    display: none !important; /* 모바일에서는 인라인 검색바 사용 */
  }

  header.scrolled .header-util .search-trigger {
    color: var(--m-text);
  }

  .header-util .mobile-only {
    display: flex !important;
    width: 36px !important;
    height: 36px !important;
    padding: 6px !important;
    color: #fff;
    transition: color 0.3s;
  }

  header.scrolled .header-util .mobile-only {
    color: #1e3a8a;
  }

  /* 햄버거 버튼 */
  .menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #fff;
    z-index: 10001;
    transition: color 0.3s;
  }

  header.scrolled .menu-toggle {
    color: #1e3a8a;
  }

  /* ============================================================
     LAYER 3: 히어로 섹션
     ============================================================ */
  .hero {
    min-height: 52vh !important;
    max-height: 64vh;
  }

  .hero-content {
    padding: 80px 16px 60px !important;
    text-align: center;
  }

  .hero h1 {
    font-size: clamp(1.3rem, 5.5vw, 1.7rem) !important;
    line-height: 1.4 !important;
    word-break: keep-all;
    letter-spacing: -0.5px;
    color: #fff;
  }

  .hero-desc {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    word-break: keep-all;
    margin-top: 12px !important;
    padding: 0 12px;
  }

  .hero-badge {
    display: none !important;
  }

  .hero-bg-img {
    object-position: 60% center !important;
  }

  /* ============================================================
     LAYER 3.5: 모바일 인라인 검색바
     ============================================================ */
  .mobile-inline-search {
    position: relative;
    margin-bottom: 16px;
  }

  .mobile-search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 80, 160, 0.1);
    border-radius: var(--m-radius-pill);
    padding: 10px 16px;
    gap: 10px;
    box-shadow: 0 2px 12px rgba(0, 50, 100, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .mobile-search-bar:focus-within {
    border-color: var(--m-brand);
    box-shadow: 0 2px 16px rgba(0, 80, 160, 0.12);
  }

  .mobile-search-icon {
    flex-shrink: 0;
    color: var(--m-text-sub);
  }

  .mobile-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--m-text);
    outline: none;
    min-width: 0;
  }

  .mobile-search-bar input::placeholder {
    color: var(--m-text-sub);
    font-weight: 400;
  }

  .mobile-search-clear {
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--m-text-sub);
  }

  /* 추천 태그 */
  .mobile-search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 4px 4px;
  }

  .ms-tag {
    padding: 6px 14px;
    background: rgba(0, 80, 160, 0.06);
    border: 1px solid rgba(0, 80, 160, 0.1);
    border-radius: var(--m-radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--m-brand);
    cursor: pointer;
    transition: all 0.15s;
  }

  .ms-tag:active {
    background: var(--m-brand);
    color: #fff;
  }

  /* 인라인 검색 결과 드롭다운 */
  .mobile-search-results {
    background: var(--m-bg-card);
    border-radius: var(--m-radius-card);
    box-shadow: 0 8px 32px rgba(0, 50, 100, 0.10);
    margin-top: 8px;
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-search-results a {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background 0.15s;
  }

  .mobile-search-results a:active {
    background: rgba(0, 80, 160, 0.04);
  }

  .mobile-search-results .result-cat {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--m-brand);
    background: rgba(0, 80, 160, 0.06);
    padding: 2px 8px;
    border-radius: var(--m-radius-pill);
    margin-bottom: 4px;
  }

  .mobile-search-results .result-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--m-text);
    margin-bottom: 2px;
  }

  .mobile-search-results .result-desc {
    display: block;
    font-size: 0.78rem;
    color: var(--m-text-sub);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .mobile-search-results mark {
    background: rgba(0, 80, 160, 0.12);
    color: var(--m-brand);
    border-radius: 2px;
    padding: 0 2px;
  }

  .mobile-search-no-results {
    text-align: center;
    padding: 24px 16px;
    color: var(--m-text-sub);
    font-size: 0.85rem;
  }

  .mobile-search-no-results p {
    margin: 0 0 4px;
    font-weight: 600;
  }

  /* ============================================================
     LAYER 4: 모바일 마스터 보드 (홈 화면 카드들)
     ============================================================ */

  /* SMP / REC 카드 */
  .mobile-price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  .mobile-price-card {
    background: var(--m-bg-card);
    border-radius: var(--m-radius-card);
    padding: 16px 14px;
    box-shadow: var(--m-shadow);
    border: none;
  }

  .mobile-price-card .price-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--m-text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-family: inherit;
  }

  .mobile-price-card .price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
  }

  .mobile-price-card .price-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--m-brand);
    line-height: 1;
    font-family: inherit;
  }

  .mobile-price-card .price-value-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
  }

  .mobile-price-card .price-value-row span:first-child {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--m-brand);
    line-height: 1;
  }

  .mobile-price-card .price-unit {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--m-text-light);
    font-family: inherit;
  }

  /* 부서별 업무 카드 */
  .mobile-dept-card {
    background: var(--m-bg-card);
    border-radius: var(--m-radius-card);
    padding: 20px;
    box-shadow: var(--m-shadow);
    margin-bottom: 20px;
  }

  .mobile-dept-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--m-text);
    margin: 0 0 14px 0;
  }

  .dept-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .dept-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    border-radius: var(--m-radius-btn);
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    min-height: 80px;
  }

  .dept-item.dept-left {
    background: rgba(0, 80, 160, 0.06);
    border: 1px solid rgba(0, 80, 160, 0.12);
  }

  .dept-item.dept-right {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
  }

  .dept-item .dept-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--m-text);
    margin-bottom: 4px;
    word-break: keep-all;
  }

  .dept-item .dept-desc {
    font-size: 0.75rem;
    color: var(--m-text-sub);
    line-height: 1.4;
  }

  .dept-item .dept-desc small {
    font-size: 0.68rem;
    color: var(--m-text-light);
  }

  .dept-item:active {
    transform: scale(0.97);
  }

  /* 공지 리스트 카드 */
  .mobile-notice-card {
    background: var(--m-bg-card);
    border-radius: var(--m-radius-card);
    padding: 20px;
    box-shadow: var(--m-shadow);
    margin-bottom: 20px;
  }

  .mobile-notice-card .notice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
  }

  .mobile-notice-card .notice-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--m-text);
    margin: 0;
  }

  .mobile-notice-card .notice-header a {
    font-size: 0.8rem;
    color: var(--m-accent);
    text-decoration: none;
    font-weight: 600;
  }

  .mobile-notice-card .notice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    text-decoration: none;
  }

  .mobile-notice-card .notice-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .mobile-notice-card .notice-title {
    font-size: 0.88rem;
    color: var(--m-text);
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
  }

  .mobile-notice-card .notice-date {
    font-size: 0.75rem;
    color: var(--m-text-light);
    flex-shrink: 0;
  }

  .mobile-notice-card .notice-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--m-radius-pill);
    margin-right: 8px;
    flex-shrink: 0;
  }

  /* 센터 정보 카드 */
  .mobile-center-card {
    background: var(--m-bg-card);
    border-radius: var(--m-radius-card);
    padding: 20px;
    box-shadow: var(--m-shadow);
    margin-bottom: 20px;
  }

  .mobile-center-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--m-text);
    margin: 0 0 14px 0;
  }

  .mobile-center-card .center-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.85rem;
    color: var(--m-text-sub);
  }

  .mobile-center-card .center-row:last-child {
    border-bottom: none;
  }

  .mobile-center-card .center-row a {
    color: var(--m-brand);
    font-weight: 600;
    text-decoration: none;
  }

  .mobile-center-card .center-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    background: rgba(0, 80, 160, 0.06);
  }

  .mobile-center-card .center-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
  }

  .mobile-center-card .center-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border-radius: var(--m-radius-btn);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    min-height: 48px;
    transition: all 0.2s;
  }

  .center-action-btn.btn-mail {
    background: rgba(0, 80, 160, 0.06);
    color: var(--m-brand);
    border: 1px solid rgba(0, 80, 160, 0.15);
  }

  .center-action-btn.btn-call {
    background: var(--m-brand);
    color: #fff;
    border: none;
  }

  /* 관련 사이트 */
  .mobile-sites-section {
    margin-bottom: 24px;
  }

  .mobile-sites-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--m-text);
    margin: 0 0 12px 0;
  }

  .mobile-sites-scroll {
    display: flex;
    overflow: hidden;
    scrollbar-width: none;
    padding-bottom: 4px;
    position: relative;
    width: 100%;
  }

  .mobile-sites-scroll::-webkit-scrollbar {
    display: none;
  }

  .mobile-sites-inner {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    padding-right: 10px;
    animation: sitesMarquee 20s linear infinite;
  }

  @keyframes sitesMarquee {
    0% {
      transform: translateX(0);
    }

    100% {
      transform: translateX(-100%);
    }
  }

  .mobile-sites-scroll:hover .mobile-sites-inner,
  .mobile-sites-scroll:active .mobile-sites-inner {
    animation-play-state: paused;
  }

  .mobile-site-chip {
    flex-shrink: 0;
    padding: 10px 16px;
    background: var(--m-bg-card);
    border-radius: var(--m-radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--m-text-sub);
    text-decoration: none;
    box-shadow: var(--m-shadow);
    white-space: nowrap;
    border: 1px solid rgba(0, 80, 160, 0.06);
    transition: all 0.2s;
    min-height: 40px;
    display: flex;
    align-items: center;
  }

  .mobile-site-chip:active {
    background: var(--m-brand);
    color: #fff;
  }

  /* ============================================================
     LAYER 5: 하단 네비게이션 — Stitch Frosted Glass
     ============================================================ */
  .mobile-bottom-nav {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--m-bnav-h, 60px);
    background: rgba(255, 255, 255, 0.90) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 24px 24px 0 0 !important;
    border-top: none !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05) !important;
    display: flex !important;
    align-items: center;
    justify-content: space-around;
    z-index: 9999;
    padding: 0 8px;
    padding-bottom: max(6px, env(safe-area-inset-bottom, 0));
  }

  .mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 8px;
    text-decoration: none;
    color: var(--m-text-light);
    font-size: 11px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    border-radius: 16px;
  }

  .mobile-bottom-nav .nav-item svg {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    display: block;
  }

  /* Material Symbols in bottom nav */
  .mobile-bottom-nav .nav-item .material-symbols-outlined {
    font-size: 24px;
    line-height: 1;
  }

  .mobile-bottom-nav .nav-item.active {
    color: var(--m-brand);
    background: var(--m-primary-fixed);
  }

  .mobile-bottom-nav .nav-item.active svg {
    stroke-width: 2.2;
  }

  .mobile-bottom-nav .nav-item.nav-center {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    padding: 6px 8px;
    font-family: inherit;
  }

  .mobile-bottom-nav .nav-item.nav-center svg {
    width: 26px;
    height: 26px;
  }

  .mobile-bottom-nav .nav-item:active {
    opacity: 0.7;
    transform: scale(0.92);
  }

  /* bottom-nav-item 지원용 (필요 시) */
  .mobile-bottom-nav .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--m-text-light, #666);
    font-size: 0.6rem;
    font-weight: 600;
    text-decoration: none;
    flex: 1;
  }

  .mobile-bottom-nav .bottom-nav-item.active {
    color: var(--m-brand, #0050a0);
  }

  /* 서브페이지 Pill Tab Bar — Fixed 고정 (헤더 바로 아래) */
  /* body overflow-x:hidden이 sticky를 파괴하므로 fixed 방식 사용 */
  .m-sticky-tabs {
    position: fixed !important;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 49;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: none;
  }

  /* 스페이서 div가 공간을 확보하므로 padding-top 불필요 */

  /* stitch-bottom-nav (JS 동적 생성) */
  .stitch-bottom-nav .stitch-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: #72787e;
    padding: 4px 12px;
    font-weight: 500;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .stitch-bottom-nav .stitch-nav-item.active {
    color: #003976;
    font-weight: 700;
    background: rgba(0, 57, 118, 0.08);
    border-radius: 16px;
    padding: 6px 14px;
  }

  .stitch-bottom-nav .stitch-nav-item:active {
    opacity: 0.7;
    transform: scale(0.92);
  }

  /* JS 터치 피드백 — 모바일에서 :active보다 확실한 시각적 반응 */
  .stitch-bottom-nav .stitch-nav-item.touching {
    opacity: 0.7;
    transform: scale(0.92);
    background: rgba(0, 57, 118, 0.10);
    border-radius: 16px;
    transition: all 0.1s ease;
  }

  .stitch-bottom-nav .stitch-nav-center.touching {
    transform: scale(0.88);
    box-shadow: 0 2px 6px rgba(0, 57, 118, 0.25);
  }

  .stitch-bottom-nav .stitch-nav-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #003976, #0050a0);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    margin-top: -18px;
    box-shadow: 0 4px 12px rgba(0, 57, 118, 0.35);
    cursor: pointer;
    padding: 0;
  }

  /* ============================================================
     LAYER 6: 전체기능 오버레이 (블루/화이트 테마 복구)
     ============================================================ */
  .features-overlay {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--m-bg); /* Stitch: #f9f9ff */
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 0;
  }

  .features-overlay.open {
    display: block !important;
    transform: translateY(0);
  }

  .features-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(249, 249, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 16px 16px 12px;
    text-align: center;
    border-bottom: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }

  .features-header .features-back {
    position: absolute;
    left: 12px;
    top: 16px;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    cursor: pointer;
    border-radius: 50%;
  }

  .features-header .features-back:active {
    background: rgba(0, 0, 0, 0.05);
  }

  .features-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--m-text);
    margin: 0 0 4px 0;
  }

  .features-header .features-hint {
    font-size: 0.75rem;
    color: var(--m-text-sub);
    margin: 0;
  }

  /* 메뉴 검색 */
  .features-search {
    padding: 8px 16px 16px;
  }

  .features-search input {
    width: 100%;
    padding: 14px 18px 14px 44px;
    border: none;
    border-radius: var(--m-radius-card);
    background: var(--m-bg-card);
    font-size: 0.9rem;
    color: var(--m-text);
    box-shadow: var(--m-shadow);
    outline: none;
    transition: box-shadow 0.2s;
  }

  .features-search input:focus {
    border-color: #0050a0;
  }

  .features-search-icon {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
  }

  /* 즐겨찾기 및 카테고리 섹션 */
  .features-favorites,
  .features-category {
    margin: 0 16px 16px;
    background: var(--m-bg-card);
    border-radius: var(--m-radius-card);
    padding: 20px 16px;
    box-shadow: var(--m-shadow);
    border: none;
  }

  .fav-header,
  .features-category h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--m-text);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .fav-header span {
    font-size: 0.7rem;
    color: #64748b;
    margin-left: auto;
  }

  .fav-list,
  .features-menu-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .features-menu-item,
  .fav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--m-primary-fixed);
    border: none;
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--m-text);
    text-decoration: none;
    cursor: pointer;
    min-height: 42px;
    transition: all 0.15s;
    user-select: none;
    -webkit-user-select: none;
  }

  .features-menu-item:active,
  .fav-item:active {
    background: var(--m-brand);
    color: #ffffff;
    transform: scale(0.95);
  }

  .features-menu-item.long-pressing {
    transform: scale(0.95);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
  }

  .fav-star {
    color: #f59e0b;
    font-size: 0.9rem;
  }

  .fav-empty {
    font-size: 0.82rem;
    color: #94a3b8;
    text-align: center;
    padding: 12px 0;
    width: 100%;
  }

  /* 하단 여백 추가 */
  .features-body {
    padding-bottom: 120px;
  }

  /* ============================================================
     LAYER 7: 서브페이지 공통 스타일
     ============================================================ */

  /* ── 서브페이지 콘텐츠 영역 최적화 ── */

  /* section-label (영문 라벨) — 모바일에서 숨겨 간결하게 */
  .section-label {
    display: none !important;
  }

  /* policy-intro 본문 간결화 */
  .policy-intro {
    font-size: 0.85rem !important;
    line-height: 1.55 !important;
    word-break: keep-all;
  }

  /* 센터소개 2열 그리드 → 1열 */
  .center-intro-section > div[style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }

  /* 센터소개 체크 카드 그리드 → 2열 유지 (모바일) */
  .center-intro-section div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 12px"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* 센터소개 카드 패딩 축소 */
  .center-intro-section {
    padding: 24px 16px !important;
  }

  /* 신청서 자동작성 버튼 숨기기 (모바일 전용) */
  a[href="form-generator.html"] {
    display: none !important;
  }

  /* Step 0 사전확인 버튼 풀 폭 */
  button[onclick*="step0Popup"] {
    width: 100%;
    justify-content: center;
  }

  /* 서브페이지 내부 info-box 패딩 조정 */
  .info-box {
    padding: 14px !important;
    font-size: 0.84rem !important;
  }

  .info-box h4 {
    font-size: 0.9rem !important;
    margin-bottom: 8px !important;
  }

  .info-box ul {
    font-size: 0.82rem !important;
    line-height: 1.65 !important;
  }

  /* info-card 패딩 */
  .info-card {
    padding: 14px !important;
  }

  .info-card h4 {
    font-size: 0.88rem !important;
  }

  .info-card p {
    font-size: 0.82rem !important;
    line-height: 1.55 !important;
  }

  /* 용어 카드 그리드 — 1열 */
  .glossary-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .glossary-card {
    padding: 14px !important;
  }

  .glossary-card h4 {
    font-size: 0.9rem !important;
  }

  .glossary-card p {
    font-size: 0.8rem !important;
  }

  /* 용어 서브탭 모바일 최적화 */
  .glossary-subtabs {
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .glossary-subtab {
    font-size: 0.78rem !important;
    padding: 6px 12px !important;
    border-radius: var(--m-radius-pill) !important;
  }

  /* step-detail 카드 */
  .step-detail {
    padding: 16px !important;
  }

  .step-detail h3 {
    font-size: 1rem !important;
    border: none !important;
  }

  .step-detail p {
    font-size: 0.84rem !important;
    line-height: 1.6 !important;
  }

  /* 비교표 — 가로 스크롤 필수 */
  .type-table {
    min-width: 600px;
    font-size: 0.68rem !important;
  }

  /* 서브탭(연계기준 등) pill 화 */
  .reason-subtabs {
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .reason-subtab {
    font-size: 0.78rem !important;
    padding: 8px 14px !important;
    border-radius: var(--m-radius-pill) !important;
    white-space: nowrap;
  }

  /* 팝업 버튼들 (상세보기 등) — 풀 폭 */
  button[onclick*="openPopup"],
  a[onclick*="openPopup"] {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* 체크리스트 팝업 모바일 최적화 */
  #step0Popup > div {
    width: 95% !important;
    padding: 20px 16px !important;
    max-height: 90vh !important;
  }

  /* sector-layout 내부 ul 폰트 조정 */
  .sector-layout ul {
    font-size: 0.82rem !important;
    line-height: 1.65 !important;
  }

  /* process-content-grid 아래 flex 레이아웃 모바일 */
  div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: flex-start"] {
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* policy-section h2 크기 */
  .policy-section h2 {
    font-size: 1.15rem !important;
    line-height: 1.35 !important;
  }

  /* section-padding 모바일 축소 */
  .section-padding {
    padding: 20px 0 !important;
  }

  /* 접속공사비 간편 계산기 — 풀 폭 */
  .calc-container,
  .calc-section {
    padding: 14px !important;
  }

  /* 공지사항 위젯 폰트 */
  .notice-widget {
    padding: 14px !important;
    font-size: 0.84rem !important;
  }

  /* 서브 헤더 (뒤로가기 + 제목) — sticky 해제하여 탭 선택기 가림 방지 */
  .mobile-sub-header {
    display: flex !important;
    align-items: center;
    position: relative;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 12px 16px;
    height: 48px;
    margin-top: var(--m-header-h);
    margin-bottom: 4px;
  }

  .mobile-sub-header .btn-back {
    background: none;
    border: none;
    padding: 8px;
    margin-right: 10px;
    margin-left: -8px;
    color: var(--m-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
  }

  .mobile-sub-header .btn-back:active {
    background: rgba(0, 0, 0, 0.05);
  }

  .mobile-sub-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--m-text);
    margin: 0;
  }

  /* 탭 시스템 — Stitch Pill Tabs */
  .tabs-menu {
    display: none !important;
  }

  .mobile-tab-select-wrapper {
    display: block !important;
    margin-bottom: 14px;
    padding: 0 4px;
  }

  .mobile-tab-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--m-text);
    border: none;
    border-radius: var(--m-radius-card);
    background: var(--m-bg-card);
    box-shadow: var(--m-shadow);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23727783' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
  }

  /* ── Stitch Pill Tab Buttons (horizontal scroll) ── */
  .sub-tab-bar,
  .inner-tabs {
    display: flex !important;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px var(--m-side-pad) !important;
    margin-bottom: 8px !important;
  }
  .sub-tab-bar::-webkit-scrollbar,
  .inner-tabs::-webkit-scrollbar { display: none; }

  .sub-tab-bar .sub-tab-btn,
  .inner-tabs .inner-tab-btn {
    flex-shrink: 0;
    padding: 10px 20px !important;
    border-radius: var(--m-radius-pill) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    border: none !important;
    background: var(--m-bg-card) !important;
    color: var(--m-text-sub) !important;
    box-shadow: var(--m-shadow);
    transition: all 0.2s ease;
    white-space: nowrap;
  }

  .sub-tab-bar .sub-tab-btn.active,
  .inner-tabs .inner-tab-btn.active {
    background: var(--m-brand) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 12px rgba(0,57,118,0.25) !important;
  }

  /* Glossary subtabs as Stitch pills */
  .glossary-subtabs .glossary-subtab {
    background: var(--m-bg-card) !important;
    color: var(--m-text-sub) !important;
    border: none !important;
    box-shadow: var(--m-shadow);
  }
  .glossary-subtabs .glossary-subtab.active {
    background: var(--m-brand) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 12px rgba(0,57,118,0.25) !important;
  }

  /* Reason subtabs as Stitch pills */
  .reason-subtabs .reason-subtab {
    background: var(--m-bg-card) !important;
    color: var(--m-text-sub) !important;
    border: none !important;
    box-shadow: var(--m-shadow);
  }
  .reason-subtabs .reason-subtab.active {
    background: var(--m-brand) !important;
    color: #ffffff !important;
  }

  /* 테이블 반응형 */
  .data-table {
    font-size: 0.72rem !important;
  }

  .table-scroll-wrapper,
  div[style*="overflow-x: auto"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }

  /* 2열 → 1열 스택 */
  .process-content-grid,
  .info-box-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  .sector-layout {
    border-radius: var(--m-radius-btn) !important;
  }

  /* 버튼 스타일 통일 */
  .btn,
  .btn-primary,
  .btn-secondary,
  button[class*="btn"] {
    border-radius: var(--m-radius-btn) !important;
    min-height: 48px;
    font-weight: 700;
  }

  /* 뱃지 스타일 */
  .badge {
    border-radius: var(--m-radius-pill) !important;
  }

  /* 카드/박스 스타일 통일 — Stitch No-Line */
  .info-box,
  .info-card,
  .policy-section,
  .step-detail,
  .notice-widget {
    border-radius: var(--m-radius-card) !important;
    border: none !important;
    box-shadow: var(--m-shadow) !important;
  }

  /* 텍스트 색상 통일 (순흑 방지) */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: var(--m-text) !important;
  }

  p,
  li,
  span,
  td,
  th,
  label,
  div {
    /* 개별 인라인 스타일이 우선할 수 있으므로 !important 사용 최소화 */
    color: inherit;
  }

  /* ============================================================
     LAYER 8: 페이지별 모바일 최적화
     ============================================================ */

  /* --- process.html 스테퍼 --- */
  .process-timeline {
    display: none !important;
  }

  .mobile-stepper-container {
    display: block !important;
  }

  /* 용어 카드 그리드 → 1열 */
  .glossary-grid {
    grid-template-columns: 1fr !important;
  }

  .glossary-subtabs {
    display: flex !important;
    overflow-x: auto !important;
    gap: 6px !important;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .glossary-subtabs::-webkit-scrollbar {
    display: none;
  }

  .glossary-subtab {
    flex-shrink: 0;
    border-radius: var(--m-radius-pill) !important;
    padding: 8px 16px !important;
    font-size: 0.82rem !important;
    min-height: 36px;
  }

  /* --- construction-cost.html 계산기 --- */
  .calc-form input,
  .calc-form select {
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 0.95rem !important;
    border-radius: var(--m-radius-btn) !important;
    min-height: 48px;
  }

  /* --- faq.html --- */
  .faq-category-tabs {
    display: none !important;
  }

  .faq-category-select {
    display: block !important;
    width: 100%;
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(0, 80, 160, 0.12);
    border-radius: var(--m-radius-btn);
    background: var(--m-bg-card);
    color: var(--m-text);
    outline: none;
    margin-bottom: 16px;
  }

  .accordion-item {
    border-radius: var(--m-radius-btn) !important;
    margin-bottom: 8px !important;
  }

  .accordion-header {
    font-size: 0.9rem !important;
    padding: 14px 16px !important;
    min-height: 52px;
    color: var(--m-text) !important;
  }

  .accordion-body {
    font-size: 0.88rem !important;
    line-height: 1.7 !important;
    color: var(--m-text-sub) !important;
    padding: 14px 16px !important;
  }

  /* --- documents.html --- */
  .doc-download-btn,
  a[download] {
    display: flex !important;
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--m-radius-btn) !important;
    font-size: 0.88rem;
    font-weight: 600;
    min-height: 48px;
    align-items: center;
    justify-content: center;
  }

  /* --- notice.html 카드형 --- */
  .notice-list-table {
    display: none !important;
  }

  /* ============================================================
     LAYER 8-B: 서브페이지 모바일 종합 최적화
     - 인라인 스타일 그리드/플렉스 오버라이드
     - 계산기, 타임라인, 통계카드 등
     ============================================================ */

  /* ── 인라인 2열 그리드 → 1열 스택 ── */
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* ── 인라인 3열 그리드(통계카드) → 1열 ── */
  div[style*="repeat(3, 1fr)"],
  div[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* ── 3열 통계카드 내부 폰트 축소 ── */
  div[style*="repeat(3, 1fr)"] > div,
  div[style*="grid-template-columns: repeat(3"] > div {
    padding: 14px !important;
  }

  div[style*="repeat(3, 1fr)"] > div > div:first-child,
  div[style*="grid-template-columns: repeat(3"] > div > div:first-child {
    font-size: 0.75rem !important;
  }

  div[style*="repeat(3, 1fr)"] > div > div:last-child,
  div[style*="grid-template-columns: repeat(3"] > div > div:last-child {
    font-size: 1.15rem !important;
  }

  /* ── 인라인 flex space-between → 세로 배치 ── */
  div[style*="justify-content: space-between"][style*="align-items: flex-start"],
  div[style*="justify-content: space-between"][style*="align-items: flex-end"],
  div[style*="justify-content: space-between"][style*="align-items: center"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  /* ── 계산기 페이지: 메인 2열 → 1열 ── */
  div[style*="grid-template-columns: 1.2fr 1.3fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* 계산기 내부 2열 select → 1열 */
  div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 12px 16px"],
  div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 10px"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* 계산기 결과 2열 → 1열 */
  #calcResult div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* 계산기 플레이스홀더 텍스트 수정 (위가 아니라 위에) */
  #calcPlaceholder p {
    font-size: 0.85rem !important;
  }

  /* ── 대금지급 타임라인 카드 축소 ── */
  .payment-timeline {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .payment-step {
    padding: 18px 14px !important;
  }

  .payment-step h4 {
    font-size: 0.88rem !important;
  }

  .payment-step p {
    font-size: 0.78rem !important;
  }

  .step-num {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.85rem !important;
    margin-bottom: 10px !important;
  }

  .step-owner {
    font-size: 0.68rem !important;
    padding: 2px 8px !important;
    margin-bottom: 8px !important;
  }

  .step-note {
    font-size: 0.65rem !important;
  }

  /* ── step-detail 헤더: flex → 세로 ── */
  .step-detail > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .step-detail .badge {
    font-size: 0.7rem !important;
    padding: 3px 8px !important;
    white-space: normal !important;
    text-align: left !important;
  }

  /* ── info-grid 2열 → 1열 ── */
  .info-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* ── inner-tabs (SMP/REC 탭) ── */
  .inner-tabs {
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 8px !important;
    margin-bottom: 16px !important;
    padding: 0 4px !important;
  }

  .inner-tab-btn {
    font-size: 0.82rem !important;
    padding: 10px 14px !important;
    flex: 1 !important;
    min-width: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
    border-radius: var(--m-radius-btn) !important;
  }

  /* ── REC info-box 내부 링크 버튼: 세로 배치 & 풀 너비 ── */
  .inner-tab-content .info-box > div[style*="flex-direction: column"] {
    width: 100% !important;
  }

  .inner-tab-content .info-box > div[style*="flex-direction: column"] a {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* ── contact.html: 담당자 카드 → 세로 배치 ── */
  .contact-card {
    flex-direction: column !important;
  }

  /* ── 텍스트 가독성 전역 개선 ── */
  .policy-intro {
    font-size: 0.83rem !important;
    line-height: 1.6 !important;
    word-break: keep-all !important;
  }

  .policy-section h2 {
    font-size: 1.1rem !important;
    line-height: 1.35 !important;
    word-break: keep-all !important;
  }

  /* ── cost-grid (공사비 구성 4열 → 2열) ── */
  .cost-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .cost-item {
    padding: 14px !important;
  }

  .cost-item h4 {
    font-size: 0.82rem !important;
  }

  .cost-item p {
    font-size: 0.75rem !important;
    line-height: 1.5 !important;
  }

  /* ── 서브페이지 컨테이너 패딩 — 가독성 확보 ── */
  .section-padding .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* ── 테이블 폰트 추가 축소 ── */
  .data-table {
    font-size: 0.68rem !important;
  }

  .data-table th,
  .data-table td {
    padding: 6px 4px !important;
    word-break: keep-all !important;
  }

  /* ── FAQ 아코디언 답변 영역 하단 여백 ── */
  .accordion-body {
    padding-bottom: 70px !important;
  }

  /* ── 하단 네비 겹침 방지 ── */
  .tab-content:last-child,
  .tabs-container {
    padding-bottom: 80px !important;
  }

  /* ============================================================
     LAYER 9: 드로어 (사이드 메뉴)
     ============================================================ */
  .mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: var(--m-header-h);
  }

  .mobile-drawer.open {
    transform: translateX(0);
  }

  .mobile-drawer-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--m-header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 10001;
  }

  .drawer-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--m-text);
    font-size: 1.3rem;
    border-radius: 50%;
  }

  .drawer-close:active {
    background: rgba(0, 0, 0, 0.05);
  }

  .drawer-menu-item {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--m-text);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  }

  .drawer-menu-item:active {
    background: rgba(0, 80, 160, 0.04);
  }

  .drawer-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: rgba(0, 80, 160, 0.02);
  }

  .drawer-submenu.open {
    max-height: 500px;
  }

  .drawer-submenu a {
    display: flex;
    align-items: center;
    padding: 14px 20px 14px 52px;
    font-size: 0.88rem;
    color: var(--m-text-sub);
    text-decoration: none;
    min-height: 48px;
  }

  .drawer-submenu a:active {
    background: rgba(0, 80, 160, 0.06);
    color: var(--m-brand);
  }

  /* ============================================================
     LAYER 10: 검색 오버레이 모바일 대응
     ============================================================ */
  .search-overlay .search-modal {
    border-radius: 0 !important;
    height: 100vh;
    max-height: 100vh;
  }

  .search-overlay .search-input-wrapper input {
    font-size: 1rem !important;
    padding: 14px 16px !important;
  }

  .search-overlay .s-tag {
    border-radius: var(--m-radius-pill) !important;
    padding: 10px 16px !important;
    font-size: 0.85rem !important;
    min-height: 40px;
  }

  /* ============================================================
     LAYER 11: 유틸리티
     ============================================================ */

  /* 토스트 알림 */
  .mobile-toast {
    position: fixed;
    bottom: calc(var(--m-bnav-h) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--m-text);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--m-radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 20000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
  }

  .mobile-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  /* 툴팁 아이콘 */
  .tooltip-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 80, 160, 0.1);
    color: var(--m-brand);
    font-size: 0.7rem;
    font-weight: 800;
    border: 1px solid rgba(0, 80, 160, 0.2);
    cursor: pointer;
    margin-left: 4px;
  }

  /* 페이지 헤더 숨김 (서브페이지) */
  .page-header {
    display: none !important;
  }

  /* CTA 섹션 숨김 */
  .cta-section {
    display: none !important;
  }

  /* 기존 바텀바 제거 */
  .mobile-bottom-bar {
    display: none !important;
  }

  /* 기존 벤토 그리드 / 스와이프 카드 / 위젯 섹션 제거 */
  .mobile-widget-section {
    display: none !important;
  }

  /* ============================================================
     LAYER 12: 서브페이지 footer 모바일 숨김 + 추가 콘텐츠 최적화
     ============================================================ */

  /* 서브페이지에서도 footer 숨기기 (데스크톱 전용 footer) */
  footer {
    display: none !important;
  }

  /* 서브페이지 main 영역 하단 여백 확보 (bottom nav 겹침 방지) */
  main {
    padding-bottom: 20px !important;
  }

  /* 탭 콘텐츠 영역 최적화 — 좌우 여백 확보 */
  .tab-content {
    padding: 12px 4px 16px !important;
  }

  .tab-content section {
    padding: 14px 4px !important;
  }

  /* 공사비 계산기 placeholder — 모바일 안내 텍스트 */
  #calcPlaceholder p {
    font-size: 0.85rem !important;
    line-height: 1.6 !important;
  }

  /* 세금계산서 발행 버튼 영역 모바일 최적화 */
  #invoiceActionBtns {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    margin-top: 16px !important;
  }

  #invoiceActionBtns button,
  #invoiceActionBtns a {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  /* 계산기 입력/결과 영역 사이 여백 */
  #calcResult {
    margin-top: 16px !important;
  }

  /* 테이블 자동 넘침 스크롤 */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    max-width: 100%;
  }

  table th,
  table td {
    font-size: 0.78rem !important;
    padding: 10px 12px !important;
    white-space: normal;
    word-break: keep-all;
  }

  /* 서브페이지 메인 콘텐츠 제목 */
  .section-padding h2 {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    word-break: keep-all;
  }

  /* 서브페이지 info-box 내 리스트 간격 */
  .info-box li {
    margin-bottom: 6px;
  }

  /* 폼 요소 모바일 최적화 */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important; /* iOS 확대 방지 */
    min-height: 44px;
    border-radius: var(--m-radius-btn) !important;
  }

  /* 컨택트 페이지 카드 최적화 */
  .contact-card,
  .staff-card {
    padding: 16px !important;
    border-radius: var(--m-radius-card) !important;
    margin-bottom: 12px;
  }

  /* 이미지 넘침 방지 */
  img {
    max-width: 100%;
    height: auto;
  }

  /* 모바일 모달 인라인 (window.open 오버라이드) */
  .mobile-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .mobile-modal {
    background: #fff;
    border-radius: var(--m-radius-card);
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--m-shadow-lg);
  }

  .mobile-modal-header {
    display: flex;
    justify-content: flex-end;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .mobile-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--m-text-sub);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
  }

  .mobile-modal-close:active {
    background: rgba(0, 0, 0, 0.05);
  }

  .mobile-modal iframe {
    flex: 1;
    width: 100%;
    min-height: 60vh;
    border: none;
  }

  /* bottom-nav-item 클래스 호환 */
  .mobile-bottom-nav .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 0;
    text-decoration: none;
    color: var(--m-text-light);
    font-size: 0.6rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-nav .bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
  }

  .mobile-bottom-nav .bottom-nav-item.active {
    color: var(--m-brand);
  }

  .mobile-bottom-nav .bottom-nav-item .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ============================================================
     PHASE 1: 레이아웃 수정 — 잘림/오버플로 해결
     ============================================================ */

  /* --- 계산기 입력+버튼 세로 배치 (construction-cost.html #tab-calc) --- */
  .calc-input-group,
  #tab-calc .info-box > div[style*="display: flex"],
  #tab-calc div[style*="display:flex"] {
    flex-direction: column !important;
    gap: 12px !important;
  }
  #tab-calc .btn-primary,
  .calc-input-group .btn-primary {
    width: 100% !important;
    white-space: normal !important;
    min-height: 48px;
  }
  #tab-calc input[type="number"],
  #tab-calc input[type="text"] {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 1rem !important;
  }

  /* --- 공사비 카드 2열→1열 --- */
  .cost-cards-grid,
  #tab-structure .info-box[style*="grid-template-columns"],
  #tab-structure div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* --- 연락처 탭 3탭 축소 (tab-agency, tab-capacity 숨김) --- */
  .tab-btn[data-tab="tab-agency"],
  .tab-btn[data-tab="tab-capacity"],
  .mobile-tab-select option[value="tab-agency"],
  .mobile-tab-select option[value="tab-capacity"],
  #tab-agency,
  #tab-capacity {
    display: none !important;
  }

  /* --- FAQ 하단 검색바 + 네비 충돌 수정 --- */
  .mobile-bottom-search-bar {
    bottom: 68px !important;
  }
  /* FAQ 페이지 콘텐츠에 하단 여백 확보 */
  body[data-page="faq"] .section-padding,
  body .faq-section {
    padding-bottom: 140px !important;
  }

  /* ============================================================
     PHASE 2: Stitch 디자인 시스템 적용
     ============================================================ */

  /* --- No-Line Rule: border 제거 → Tonal Depth & Shadow --- */
  .card, .info-card,
  .cost-card, .reason-card {
    border: none !important;
    background: var(--m-bg-card);
    box-shadow: var(--m-shadow);
    border-radius: var(--m-radius-card);
  }

  /* --- Surface Hierarchy --- */
  main {
    background: var(--m-bg) !important;
  }

  /* --- 타이포그래피: Stitch 최적화 --- */
  .policy-intro,
  .info-box p,
  .accordion-body-inner > p,
  .proc-right p,
  .reason-card p,
  .payment-step p {
    word-break: keep-all;
    line-height: 1.65;
    font-size: 0.88rem;
    letter-spacing: -0.01em;
  }

  .mobile-sub-header h2 {
    font-weight: 700;
    color: var(--m-text);
  }

  /* --- info-box 2열→1열 (대금지급 등) --- */
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* --- 3열 요약 카드(평균/최고/최저) → 세로 배치 --- */
  div[style*="grid-template-columns: repeat(3, 1fr)"],
  div[style*="grid-template-columns:repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* --- 대금지급 타임라인 2x2 → 1열 (좁은 모바일) --- */
  .payment-timeline {
    grid-template-columns: 1fr !important;
  }

  /* --- Material Symbols Outlined 기본 스타일 --- */
  .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    /* FOUT 방지: 폰트 로딩 전 영어 텍스트 완전 숨김 */
    overflow: hidden;
    width: 24px;
    height: 24px;
  }

  /* ============================================================
     PHASE 3: 콘텐츠 최적화 — 기능 숨김/재배치
     ============================================================ */

  /* --- 챗봇 플로팅 아이콘 숨김 --- */
  .chatbot-trigger,
  #chatbotToggle,
  .chatbot-mobile-btn,
  .chatbot-trigger-btn,
  .chatbot-toggle-btn {
    display: none !important;
  }

  /* --- AI 서식 자동작성 배너 숨김 (자료실) --- */
  .ai-assistant-banner {
    display: none !important;
  }

  /* --- 쉽게보기 토글 헤더에서 숨김 → 드로어로 이동 --- */
  .header-util .senior-mode-toggle {
    display: none !important;
  }

  /* --- desktop-only / mobile-only 유틸리티 (보험용) --- */
  .desktop-only {
    display: none !important;
  }

  /* ============================================================
     횡스크롤 화살표 버튼 (넷플릭스 스타일)
     ============================================================ */
  .hscroll-wrap {
    position: relative;
  }

  .hscroll-wrap > .hscroll-arr {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 18px;
    font-weight: 400;
    font-family: system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    opacity: 1;
    transition: opacity 0.25s ease, background 0.25s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  .hscroll-wrap > .hscroll-arr:active {
    opacity: 1;
    background: rgba(0, 0, 0, 0.45);
    transform: translateY(-50%) scale(0.9);
  }

  .hscroll-wrap > .hscroll-arr.hscroll-left {
    left: 4px;
  }

  .hscroll-wrap > .hscroll-arr.hscroll-right {
    right: 4px;
  }

  .hscroll-wrap > .hscroll-arr.hscroll-hide {
    opacity: 0;
    pointer-events: none;
  }

  /* 횡스크롤 영역 스크롤바 완전 숨김 */
  .hscroll-wrap > [style*="overflow"],
  .hscroll-wrap > .overflow-x-auto {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .hscroll-wrap > [style*="overflow"]::-webkit-scrollbar,
  .hscroll-wrap > .overflow-x-auto::-webkit-scrollbar {
    display: none;
  }

}

/* @media end */

/* ============================================================
   Stitch 듀얼-렌더링 모바일 스코프: Material Symbols 아이콘 정중앙 보정
   ============================================================ */
.stitch-mobile .material-symbols-outlined {
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  text-rendering: optimizeLegibility;
}