/**
 * PC / 모바일 분기: html[data-device-type="mobile"|"tablet"|"desktop"]
 * 하단 고정 비교 바(#compare-dock)가 있는 페이지는 모바일에서 탭 위로 올림.
 */

:root {
  --versi-mobile-nav-h: 52px;
  --versi-page-pad-mobile: 12px;
}

/* ---------- 브랜드 Versi + Beta (전역) ---------- */
a.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

a.logo .logo-beta {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.1;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(14, 165, 233, 0.45);
  background: rgba(224, 247, 254, 0.95);
  color: #0369a1;
  flex-shrink: 0;
}

/* 마이페이지 상단 그라데이션 바 등 밝은 배경이 아닌 경우 */
.topbar .logo-beta {
  margin-left: 5px;
  vertical-align: middle;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* 헤더: 광고센터 (마이페이지 등에서만 사용 — 브랜드 블루 톤의 차분한 pill) */
a.versi-header-ad-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: #0369a1 !important;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
a.versi-header-ad-cta:hover {
  background: #dbeafe;
  border-color: #7dd3fc;
  color: #0c4a6e !important;
}
a.versi-header-ad-cta .versi-header-ad-cta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 5px;
  border-radius: 4px;
  background: #bae6fd;
  color: #075985;
}

/* 비교 전용 등 로고만 있는 상단 줄 */
.versi-mini-brand {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px 0;
  box-sizing: border-box;
}

html[data-device-type='mobile'] .versi-mini-brand {
  padding-left: var(--versi-page-pad-mobile);
  padding-right: var(--versi-page-pad-mobile);
}

html[data-device-type='mobile'] {
  --home-hero-height: 220px;
}

html[data-device-type='mobile'] body {
  overflow-x: hidden;
}

/* ---------- 모바일 하단 네비 ---------- */
.versi-mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  height: var(--versi-mobile-nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  align-items: stretch;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

html[data-device-type='mobile'] .versi-mobile-bottom-nav {
  display: flex;
}

.versi-mnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  text-decoration: none;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.versi-mnav-item.is-active {
  color: #00bfff;
}

.versi-mnav-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.versi-mnav-item.is-active .versi-mnav-icon {
  background: #e0f2fe;
  border-color: #7dd3fc;
}

.versi-mnav-label {
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

html[data-device-type='mobile'] [data-page='home'] .versi-mnav-icon {
  background: linear-gradient(135deg, #e0f2fe, #f0fdfa);
}
html[data-device-type='mobile'] [data-page='community'] .versi-mnav-icon {
  background: linear-gradient(135deg, #fce7f3, #fef3c7);
}
html[data-device-type='mobile'] [data-page='mypage'] .versi-mnav-icon {
  background: linear-gradient(135deg, #ffedd5, #e0f2fe);
}

/* ---------- 커뮤니티 목록 모바일: 헤더 검색(홈과 동일) + 본문 가독성 ---------- */
html[data-device-type='mobile'] body[data-versi-page='community'] .header .search-bar {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin-top: 6px;
  background: transparent;
  border: none;
  box-shadow: none;
  box-sizing: border-box;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .search-bar input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  border-radius: 10px;
  border: 1px solid #cbd5e1 !important;
  background: #fff;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.4;
  box-sizing: border-box;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .search-bar input::placeholder {
  color: #94a3b8;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .search-bar input:focus {
  outline: none;
  border-color: #00bfff !important;
  box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

html[data-device-type='mobile'] body[data-versi-page='community'] .search-bar #search-btn {
  flex: 0 0 auto;
  width: auto;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  white-space: nowrap;
  box-sizing: border-box;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .community-header {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom-width: 1px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .community-breadcrumb {
  font-size: 13px;
  margin-bottom: 10px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .community-tabs-actions-row {
  margin-bottom: 12px;
  align-items: center;
  gap: 8px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .community-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  margin-bottom: 0;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .community-tab {
  flex: 0 0 auto;
  padding: 10px 18px;
  font-size: 14px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .community-actions {
  width: auto;
  flex-shrink: 0;
  justify-content: flex-end;
  margin-bottom: 0;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .community-write-btn {
  width: auto;
  min-width: 46px;
  min-height: 46px;
  padding: 10px;
  border-radius: 10px;
  box-sizing: border-box;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .community-content {
  padding: 14px 12px 16px;
  border-radius: 12px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .platform-filter-bar {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  padding: 10px 0 14px;
  margin-bottom: 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .platform-icon-btn {
  scroll-snap-align: start;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .event-select-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .event-select-row label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .event-select-row .toolbar-select,
html[data-device-type='mobile'] body[data-versi-page='community'] #event-select {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px;
  font-size: 15px;
  box-sizing: border-box;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .list-toolbar-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 14px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .toolbar-search {
  order: 10;
  max-width: none !important;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .toolbar-search input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  font-size: 16px;
  border-radius: 10px;
  padding: 10px 12px;
  box-sizing: border-box;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .toolbar-search .community-search-btn,
html[data-device-type='mobile'] body[data-versi-page='community'] #list-search-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  white-space: nowrap;
}

html[data-device-type='mobile'] body[data-versi-page='community'] #list-sort-select {
  order: 1;
  width: 100%;
  min-height: 44px;
  font-size: 15px;
  border-radius: 10px;
  box-sizing: border-box;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .toolbar-status-filter {
  order: 2;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .toolbar-status-btn {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 8px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .view-toggle-row {
  justify-content: flex-start;
  margin-bottom: 10px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .post-list {
  gap: 10px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .deals-list-item {
  padding: 14px 12px;
  border-radius: 10px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .deals-list-content {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .deals-list-center {
  min-width: 0;
  width: 100%;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .deals-list-title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.45;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .deals-list-right {
  width: 100%;
  justify-content: flex-start;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 10px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .post-item {
  padding: 14px 12px;
  border-radius: 10px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .post-title {
  font-size: 16px;
  line-height: 1.45;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .post-meta {
  font-size: 13px;
  flex-wrap: wrap;
  gap: 8px 12px;
}

html[data-device-type='mobile'] body[data-versi-page='community'] .post-list.deals-grid-view {
  grid-template-columns: 1fr;
  gap: 12px;
}

/* ---------- 비교 도크 ↔ 하단 탭 ---------- */
html[data-device-type='mobile'] #compare-dock {
  bottom: var(--versi-mobile-nav-h);
  z-index: 102;
}

/* 모바일: 비교 바 가독성 — 1행(개수·버튼) / 2행(썸네일)
   :not(.hidden) 필수 — 아래 display:grid 가 .compare-bar.hidden 보다 특이도가 높아 숨김이 깨지던 문제 수정 */
html[data-device-type='mobile'] #compare-dock .compare-bar.hidden {
  display: none !important;
}

html[data-device-type='mobile'] #compare-dock .compare-bar:not(.hidden) {
  display: grid;
  grid-template-columns: auto 1fr max-content;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 10px;
  padding-top: 12px;
  padding-right: 14px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding-left: max(18px, calc(12px + env(safe-area-inset-left, 0px)));
  border-top-width: 3px;
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.12);
}

html[data-device-type='mobile'] #compare-dock .compare-count {
  grid-column: 1;
  grid-row: 1;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  padding: 4px 4px 4px 2px;
  line-height: 1.2;
}

html[data-device-type='mobile'] #compare-dock .compare-actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
}

html[data-device-type='mobile'] #compare-dock .compare-btn-secondary,
html[data-device-type='mobile'] #compare-dock .compare-btn-primary {
  min-height: 46px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
}

html[data-device-type='mobile'] #compare-dock .compare-btn-secondary {
  font-weight: 600;
  border-width: 2px;
  border-color: #cbd5e1;
  color: #1e293b;
}

html[data-device-type='mobile'] #compare-dock .compare-btn-primary {
  min-width: 112px;
}

html[data-device-type='mobile'] #compare-dock .compare-thumbnails {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 8px 0 0 2px;
  margin: 0;
  border-top: 1px solid #e2e8f0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

html[data-device-type='mobile'] #compare-dock .compare-thumbnail {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* 홈은 --home-compare-dock-spacer, 검색은 --search-compare-dock-spacer 중 실제 설정된 쪽만 반영 */
html[data-device-type='mobile'] .page-wrap {
  padding-bottom: calc(
    max(
        var(--home-compare-dock-spacer, 0px),
        var(--search-compare-dock-spacer, 0px)
      ) + var(--versi-mobile-nav-h)
  );
}

/* ---------- 공통: 상단바·헤더 (홈/검색/커뮤니티 유사) ---------- */
html[data-device-type='mobile'] .topbar {
  height: 32px;
  font-size: 11px;
  padding: 0 36px 0 10px;
}

html[data-device-type='mobile'] .header {
  flex-wrap: wrap;
  padding: 8px var(--versi-page-pad-mobile);
  gap: 8px;
  align-items: center;
}

html[data-device-type='mobile'] .logo {
  font-size: 17px;
}

html[data-device-type='mobile'] .search-bar {
  order: 3;
  flex: 1 1 100%;
  max-width: none;
  margin-left: 0 !important;
  margin-top: 4px;
  gap: 8px;
}

html[data-device-type='mobile'] .search-bar input {
  min-height: 44px;
  font-size: 16px;
}

html[data-device-type='mobile'] .search-bar button {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
}

html[data-device-type='mobile'] .header-right,
html[data-device-type='mobile'] .header-links {
  font-size: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

html[data-device-type='mobile'] .url-input-btn {
  min-height: 40px;
  padding: 8px 12px;
}

/* ---------- 홈: 사이드바·메인 ---------- */
html[data-device-type='mobile'] .container-row {
  flex-direction: column;
}

html[data-device-type='mobile'] .main {
  order: 1;
  padding: var(--versi-page-pad-mobile);
}

/* 홈: 모바일에서는 전체 카테고리(사이드바) 비표시 */
html[data-device-type='mobile'] #sidebar.sidebar {
  display: none !important;
}

html[data-device-type='mobile'] .banner-area {
  flex-direction: column;
  gap: 12px;
}

html[data-device-type='mobile'] .main-banner {
  min-height: 180px;
  height: auto;
  padding: 14px 16px;
}

html[data-device-type='mobile'] .main-banner-title {
  font-size: 17px;
}

html[data-device-type='mobile'] .sub-banners {
  flex-direction: column;
  width: 100%;
  gap: 14px;
}

/* 모바일: DOM은 캘린더→실검 순이나, 세로 스택에서 실검을 위에 표시 */
html[data-device-type='mobile'] .sub-banners .quick-panel {
  order: 2;
  height: auto !important;
  min-height: 0 !important;
  max-height: none;
}

html[data-device-type='mobile'] .sub-banners .trending-keywords-banner {
  order: 1;
  border-radius: 12px;
  border: 1px solid #bae6fd;
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
  box-shadow: 0 2px 10px rgba(14, 116, 144, 0.08);
}

/* 실시간 검색어: 모바일 — 컴팩트, 내부 스크롤로 순위 넘김 */
html[data-device-type='mobile'] .trending-keywords-banner {
  width: 100%;
  max-width: none;
  min-height: 0;
  height: auto;
  flex: 0 0 auto;
  max-height: none;
  overflow: hidden;
  padding: 10px 12px 12px !important;
  box-sizing: border-box;
}

html[data-device-type='mobile'] .trending-keywords-banner .trending-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  padding-bottom: 4px;
  color: #0369a1;
  border-bottom: 1px solid rgba(14, 165, 233, 0.25);
}

html[data-device-type='mobile'] .trending-list {
  min-height: 0;
}

html[data-device-type='mobile'] .trending-roller-viewport {
  --trending-slot-h: 32px;
}

html[data-device-type='mobile'] .home-hub-section {
  padding: 14px var(--versi-page-pad-mobile) 8px;
}

html[data-device-type='mobile'] .home-hub-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

html[data-device-type='mobile'] .home-hub-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  margin-left: 0;
  width: 100%;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

html[data-device-type='mobile'] .hub-tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  font-size: 13px;
}

/* 홈 허브 — 최근 본: 모바일에서 인기 비교 상품처럼 가로 슬라이드 */
html[data-device-type='mobile'] .hub-panel[data-panel='recent'] > .hub-panel-list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 4px 2px 12px;
  margin: 0 -2px;
  scrollbar-width: thin;
}

html[data-device-type='mobile'] .hub-panel[data-panel='recent'] > .hub-panel-list > .hub-panel-item {
  flex: 0 0 auto;
  width: min(158px, 74vw);
  max-width: 168px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px;
  gap: 10px;
  box-sizing: border-box;
}

html[data-device-type='mobile'] .hub-panel[data-panel='recent'] .hub-panel-item-main {
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

html[data-device-type='mobile'] .hub-panel[data-panel='recent'] .hub-panel-item-thumb-host {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  max-height: none;
}

html[data-device-type='mobile'] .hub-panel[data-panel='recent'] .hub-panel-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html[data-device-type='mobile'] .hub-panel[data-panel='recent'] .hub-panel-item-info {
  flex: 0 0 auto;
}

html[data-device-type='mobile'] .hub-panel[data-panel='recent'] .hub-panel-item-name {
  font-size: 12px;
}

html[data-device-type='mobile'] .hub-panel[data-panel='recent'] .hub-panel-item-price {
  font-size: 13px;
}

html[data-device-type='mobile'] .hub-panel[data-panel='recent'] .hub-panel-item-actions {
  flex-direction: column;
  width: 100%;
  gap: 6px;
  flex-shrink: 0;
}

html[data-device-type='mobile'] .hub-panel[data-panel='recent'] .hub-catalog-view-btn,
html[data-device-type='mobile'] .hub-panel[data-panel='recent'] .hub-compare-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 6px;
  font-size: 11px;
}

html[data-device-type='mobile'] .popular-products-section {
  padding: 8px var(--versi-page-pad-mobile) 16px;
}

html[data-device-type='mobile'] .popular-product-item {
  min-width: 158px;
  max-width: 158px;
  padding: 10px;
}

html[data-device-type='mobile'] .mega-medium-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* ---------- 검색: 필터 패널 접기 유지 + 터치 ---------- */
html[data-device-type='mobile'] .filter-toggle-btn {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
}

html[data-device-type='mobile'] .sort-select,
html[data-device-type='mobile'] .sort-select-brand,
html[data-device-type='mobile'] .sort-select-product {
  min-height: 44px;
  font-size: 16px;
}

html[data-device-type='mobile'] .results-control-bar {
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- compare.html — 모바일: 세로 스택, 가로 스크롤 제거 ---------- */
html[data-device-type='mobile'] body.compare-page {
  padding: var(--versi-page-pad-mobile);
  padding-bottom: calc(24px + var(--versi-mobile-nav-h));
  overflow-x: hidden;
}

html[data-device-type='mobile'] .compare-page .container {
  max-width: 100%;
  padding: 12px var(--versi-page-pad-mobile) 20px;
  border-radius: 8px;
  overflow-x: hidden;
  box-sizing: border-box;
}

html[data-device-type='mobile'] .compare-page .header {
  margin-bottom: 16px;
  padding-bottom: 12px;
}

html[data-device-type='mobile'] .compare-page .title {
  font-size: 20px;
  line-height: 1.25;
}

html[data-device-type='mobile'] .compare-page .subtitle {
  font-size: 13px;
}

/* 상단 상품 헤더: 라벨 + 가로 스크롤 스트립(작은 카드) */
html[data-device-type='mobile'] .compare-page #products-header.products-header {
  display: flex !important;
  flex-direction: column;
  flex-wrap: nowrap;
  overflow: hidden;
  width: 100%;
  gap: 0;
  border-radius: 10px;
}

html[data-device-type='mobile'] .compare-page #products-header .header-label {
  flex: none;
  width: 100%;
  max-width: 100%;
  position: static;
  box-sizing: border-box;
  border-right: none;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
}

html[data-device-type='mobile'] .compare-page #products-header .product-header-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 10px 12px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 12px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

html[data-device-type='mobile'] .compare-page #products-header .product-header-card {
  flex: 0 0 min(42vw, 168px);
  max-width: 168px;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-align: left;
  padding: 10px 10px 12px;
  scroll-snap-align: start;
  background: #fff;
}

html[data-device-type='mobile'] .compare-page #products-header .product-header-strip .product-header-card:last-child {
  margin-right: 2px;
}

html[data-device-type='mobile'] .compare-page #products-header .product-thumb {
  height: 88px;
  max-height: 88px;
  min-height: 72px;
  margin-bottom: 8px;
  border-radius: 8px;
}

html[data-device-type='mobile'] .compare-page #products-header .product-name {
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

html[data-device-type='mobile'] .compare-page #products-header .product-brand {
  font-size: 10px;
  margin-bottom: 4px;
}

html[data-device-type='mobile'] .compare-page #products-header .product-price {
  font-size: 13px;
}

html[data-device-type='mobile'] .compare-page .compare-mode-banner {
  font-size: 13px;
  padding: 10px 12px;
}

/* A/B/C 안 필터(모바일만 표시 — compare.html 에서 hidden 해제) */
.compare-plan-filter {
  display: none;
}

html[data-device-type='mobile'] .compare-page .compare-plan-filter:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0 var(--versi-page-pad-mobile, 12px);
  box-sizing: border-box;
}

html[data-device-type='mobile'] .compare-page .compare-plan-filter-hint {
  font-size: 11px;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
  text-align: center;
}

html[data-device-type='mobile'] .compare-page .compare-plan-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

html[data-device-type='mobile'] .compare-page .compare-plan-chip {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  -webkit-tap-highlight-color: transparent;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

html[data-device-type='mobile'] .compare-page .compare-plan-chip.is-active {
  border-color: #00bfff;
  background: #e0f7ff;
  color: #0369a1;
  box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.25);
}

html[data-device-type='mobile'] .compare-page .comparison-table[data-filter-plan='0'] .comparison-cell[data-compare-plan-index]:not([data-compare-plan-index='0']) {
  display: none !important;
}

html[data-device-type='mobile'] .compare-page .comparison-table[data-filter-plan='1'] .comparison-cell[data-compare-plan-index]:not([data-compare-plan-index='1']) {
  display: none !important;
}

html[data-device-type='mobile'] .compare-page .comparison-table[data-filter-plan='2'] .comparison-cell[data-compare-plan-index]:not([data-compare-plan-index='2']) {
  display: none !important;
}

html[data-device-type='mobile'] .compare-page .comparison-table[data-filter-plan='3'] .comparison-cell[data-compare-plan-index]:not([data-compare-plan-index='3']) {
  display: none !important;
}

html[data-device-type='mobile'] .compare-page .comparison-table[data-filter-plan='4'] .comparison-cell[data-compare-plan-index]:not([data-compare-plan-index='4']) {
  display: none !important;
}

html[data-device-type='mobile'] .compare-page .comparison-table[data-filter-plan='5'] .comparison-cell[data-compare-plan-index]:not([data-compare-plan-index='5']) {
  display: none !important;
}

/* 비교 표: 2열 그리드 대신 라벨 → 셀들 세로 흐름 */
html[data-device-type='mobile'] .compare-page .comparison-table {
  overflow-x: hidden;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

html[data-device-type='mobile'] .compare-page .comparison-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: 12px;
}

html[data-device-type='mobile'] .compare-page .comparison-row:last-child {
  margin-bottom: 0;
}

html[data-device-type='mobile'] .compare-page .comparison-label {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-right: none;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
}

html[data-device-type='mobile'] .compare-page .comparison-cell {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-right: none;
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

html[data-device-type='mobile'] .compare-page .comparison-cell:last-child {
  border-bottom: none;
}

html[data-device-type='mobile'] .compare-page .comparison-cell.span-all {
  grid-column: unset;
  width: 100%;
}

html[data-device-type='mobile'] .compare-page .comparison-row:last-child .comparison-cell:last-child {
  border-bottom: none;
}

/* 모바일: 섹션별 접기(details) + 카드형 */
html[data-device-type='mobile'] .compare-page .mobile-compare-details {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  box-sizing: border-box;
}

html[data-device-type='mobile'] .compare-page .mobile-compare-details summary.comparison-label {
  list-style: none;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 40px 14px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

html[data-device-type='mobile'] .compare-page .mobile-compare-details summary.comparison-label::-webkit-details-marker {
  display: none;
}

html[data-device-type='mobile'] .compare-page .mobile-compare-details summary.comparison-label::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

html[data-device-type='mobile'] .compare-page .mobile-compare-details[open] summary.comparison-label::after {
  margin-top: -2px;
  transform: rotate(225deg);
}

html[data-device-type='mobile'] .compare-page .mobile-compare-details-body {
  background: #fff;
}

html[data-device-type='mobile'] .compare-page .mobile-compare-details-body .comparison-cell {
  border-bottom: 1px solid #f1f5f9;
  padding: 14px 16px 16px;
}

html[data-device-type='mobile'] .compare-page .mobile-compare-details-body .comparison-cell:last-child {
  border-bottom: none;
}

html[data-device-type='mobile'] .compare-page .comparison-cell ul,
html[data-device-type='mobile'] .compare-page .comparison-cell ol {
  margin: 12px 0 10px;
  padding-left: 1.15em;
}

html[data-device-type='mobile'] .compare-page .comparison-cell li {
  margin: 11px 0;
  line-height: 1.65;
}

html[data-device-type='mobile'] .compare-page .comparison-cell .section-title {
  font-size: 15px;
  margin: 18px 0 10px;
  padding: 8px 0 0;
  border-top: 1px solid #f1f5f9;
  color: #0f172a;
}

html[data-device-type='mobile'] .compare-page .comparison-cell .section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

html[data-device-type='mobile'] .compare-page .comparison-cell p {
  margin: 12px 0;
  line-height: 1.7;
}

html[data-device-type='mobile'] .compare-page .analysis-content {
  font-size: 15px;
  line-height: 1.7;
  padding: 0 2px;
  overflow-x: hidden;
  white-space: normal;
}

html[data-device-type='mobile'] .compare-page .back-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  margin-top: 8px;
}

/* ---------- compare-brands ---------- */
html[data-device-type='mobile'] body.brands-compare-page {
  padding: var(--versi-page-pad-mobile);
  padding-bottom: calc(var(--versi-mobile-nav-h) + 16px);
}

html[data-device-type='mobile'] .brands-compare-page .container {
  padding: 16px;
}

/* ---------- 마이페이지 (기존 900px 미디어쿼리와 함께 동작) ---------- */
html[data-device-type='mobile'] #mp-layout {
  flex-direction: column;
}

html[data-device-type='mobile'] .mp-sidebar {
  display: none;
}

html[data-device-type='mobile'] .mp-nav-mobile {
  display: block;
  padding: 10px var(--versi-page-pad-mobile);
}

html[data-device-type='mobile'] .mp-main {
  padding: var(--versi-page-pad-mobile);
  padding-bottom: calc(var(--versi-page-pad-mobile) + var(--versi-mobile-nav-h));
  min-width: 0;
}

html[data-device-type='mobile'] #mp-guest {
  padding-bottom: calc(24px + var(--versi-mobile-nav-h));
}

/* ---------- 로그인 모달 (공통 클래스) ---------- */
html[data-device-type='mobile'] .modal-overlay .modal {
  margin: 10px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}

html[data-device-type='mobile'] .auth-form-input {
  min-height: 44px;
  font-size: 16px;
}

html[data-device-type='mobile'] .auth-login-btn {
  min-height: 48px;
  font-size: 16px;
}

/* ---------- 커뮤니티 글쓰기 툴바 ---------- */
html[data-device-type='mobile'] .naver-toolbar .toolbar-row {
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- 홈 허브 — 쇼핑 캘린더(모바일 전용 마크업 .hub-calendar-mobile) ---------- */
.hub-calendar-mobile {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

.hub-calendar-events-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 4px 2px 12px;
  margin: 0 -2px;
  scrollbar-width: thin;
}

.hub-calendar-event-card {
  flex: 0 0 auto;
  width: min(200px, 72vw);
  max-width: 240px;
  scroll-snap-align: start;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.hub-calendar-event-card.is-selected {
  border-color: #00bfff;
  box-shadow: 0 2px 10px rgba(0, 191, 255, 0.16);
}

.hub-calendar-event-card:focus {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

.hub-calendar-event-card__platform {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: -0.01em;
}

.hub-calendar-event-card__title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
}

.hub-calendar-products-mobile {
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.hub-calendar-products-mobile__title {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 10px;
}

.hub-calendar-under-construction {
  text-align: center;
  padding: 28px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #94a3b8;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
}

/* ---------- 태블릿: 여백만 살짝 ---------- */
html[data-device-type='tablet'] .page-wrap .main {
  padding-left: 18px;
  padding-right: 18px;
}
