/* =========================================================
   bidio — 프로토타입 공통 스타일
   ========================================================= */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg-subtle);
  padding-top: var(--header-height);
  /* 탭바 + safe-area + 추가 여백 — 페이지네이션·하단 콘텐츠가 탭바에 닿아 잘려보이지 않게.
     카드 box-shadow 가 탭바에 덮여 테두리가 잘려보이지 않도록 보조 여백 space-10(40px). */
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + var(--space-10));
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: var(--tracking-tight);
}
body.menu-open { overflow: hidden; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--color-primary-hover); }

.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 1200;
  background: var(--color-text);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

/* ========= 헤더 ========= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--grad-primary);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  z-index: 1020;
  box-shadow: var(--shadow-md);
  backdrop-filter: saturate(160%);
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
  height: 40px;
  color: #fff;
  min-width: 0;
}
.site-header .brand svg { height: 38px; width: auto; display: block; max-width: 210px; }
@media (max-width: 420px) {
  .site-header .brand svg { height: 34px; max-width: 170px; }
}
/* PC 전용 상단 nav — 브랜드와 actions 사이. 모바일은 하단 탭바로 충분하니 d-lg-flex 로 ≥992px 만 노출 */
.site-header .header-nav {
  margin-left: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.site-header .header-nav a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color .12s, color .12s;
  white-space: nowrap;
}
.site-header .header-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.site-header .header-nav a.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.site-header .header-nav a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.site-header .actions {
  margin-left: auto;
  display: flex;
  gap: var(--space-1);
  align-items: center;
}
.site-header .actions .icon-btn {
  color: #fff;
  font-size: 1.25rem;
  background: transparent;
  border: 0;
  padding: 8px;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease-out);
}
.site-header .actions .icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.site-header .back-btn {
  color: #fff;
  background: transparent;
  border: 0;
  font-size: 1.25rem;
  margin-right: var(--space-2);
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease-out);
}
.site-header .back-btn:hover { background: rgba(255, 255, 255, 0.12); }
.site-header .actions .icon-btn:focus-visible,
.site-header .back-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

/* 통합검색 — 돋보기는 actions 의 다른 icon-btn 과 동일한 위치를 유지하고,
   클릭 시 입력창이 왼쪽으로 펼쳐진다 (필터바 패턴의 헤더 변형). */
.site-header .header-search {
  display: inline-flex;
  align-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid transparent;
  overflow: hidden;
  transition: width .22s ease, flex-basis .22s ease,
              background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.site-header .header-search.is-open {
  flex-basis: min(360px, 70vw);
  width: min(360px, 70vw);
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
@media (max-width: 480px) {
  .site-header .header-search.is-open {
    flex-basis: min(260px, 62vw);
    width: min(260px, 62vw);
  }
}
.site-header .header-search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text, #111827);
  font-size: 0.92rem;
  /* 닫힘 상태에서는 padding 0 — padding 이 남으면 돋보기 버튼이 overflow:hidden 으로 잘림 */
  padding: 0;
  opacity: 0;
  transition: opacity .12s ease, padding .22s ease;
}
.site-header .header-search.is-open .header-search-input {
  opacity: 1;
  padding: 0 4px 0 14px;
}
.site-header .header-search-input::placeholder { color: rgba(15, 23, 42, .50); }
.site-header .actions .icon-btn.header-search-toggle { flex: 0 0 40px; }
.site-header .header-search.is-open .icon-btn.header-search-toggle {
  color: var(--color-text, #111827);
}
.site-header .header-search.is-open .icon-btn.header-search-toggle:hover {
  background: rgba(15, 23, 42, .08);
}

/* ========= 하단 탭바 ========= */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-bar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-top: 1px solid var(--color-border);
  display: flex;
  z-index: 1020;
}
.tab-bar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  padding: var(--space-1) 0;
  position: relative;
  transition: color var(--dur-fast) var(--ease-out);
}
.tab-bar a i { font-size: 1.3rem; }
.tab-bar a.active {
  color: var(--color-primary);
  font-weight: 700;
}
.tab-bar a.active::before {
  content: '';
  position: absolute;
  top: 8px;
  width: 44px; height: 28px;
  background: rgba(26, 54, 93, 0.10);
  border-radius: var(--radius-full);
  z-index: -1;
}
.tab-bar a:focus-visible {
  outline: 3px solid rgb(26 54 93 / .2);
  outline-offset: -3px;
}

/* ========= 컨테이너 ========= */
.page-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-4);
}
.page-wrap:focus-visible,
[role="main"]:focus-visible {
  outline: none;
}
@media (min-width: 992px) {
  .page-wrap { max-width: var(--content-max); padding: var(--space-8) var(--space-6); }
}

/* ========= 카드 (매물) ========= */
.card-case {
  display: flex;
  gap: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--space-3);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  color: var(--color-text);
  text-decoration: none;
}
.card-case:active { transform: scale(0.99); }
.card-case:hover  {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}
.card-case .thumb {
  flex: 0 0 112px;
  width: 112px;
  height: 112px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-subtle);
  font-size: 2.25rem;
}
.card-case .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.card-case:hover .thumb img { transform: scale(1.04); }
.card-case .thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(15, 23, 42, 0.08));
  pointer-events: none;
}
.card-case .body { flex: 1; min-width: 0; }
.card-case .title {
  font-weight: 700;
  color: var(--color-text);
  font-size: var(--text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: var(--space-1);
}
.card-case .addr {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-case .badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}
.card-case .price { display: flex; gap: var(--space-2); align-items: baseline; }
.card-case .price .min {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: var(--tracking-tighter);
}
.card-case .price .appr {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: line-through;
}
.card-case .price .disc {
  font-size: var(--text-sm);
  color: var(--color-danger);
  font-weight: 700;
}
.card-case .price--sold .min { color: var(--color-danger); }
.card-case .price .price-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* 모바일: 카드 세로 레이아웃 (썸네일 위, 본문 아래) — 좁은 화면에서 본문 가독성 확보 */
@media (max-width: 640px) {
  .card-case { flex-direction: column; gap: var(--space-2); }
  .card-case .thumb {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 16/10;
    height: auto;
    font-size: 2.75rem;
  }
  .card-case .title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* PC 카드 그리드 — 카드 높이 통일: grid 자식은 자동 stretch, 카드 자신은 column flex,
   body 가 flex-grow:1 로 빈 공간 차지해 카드 바닥선 정렬 일치.
   minmax(0, 1fr) 로 셀이 콘텐츠 길이에 끌려 늘어나 컨테이너를 벗어나는 문제 방지. */
@media (min-width: 992px) {
  .card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: stretch;
  }
  .card-grid .card-case-wrap { min-width: 0; }
  .card-grid .card-case {
    margin-bottom: 0;
    flex-direction: column;
    height: 100%;
    display: flex;
    min-width: 0;
  }
  .card-grid .card-case .thumb {
    width: 100%;
    aspect-ratio: 16/10;
    height: auto;
    flex: none;          /* 사진 영역은 비율 고정 */
    font-size: 3rem;
  }
  .card-grid .card-case .body {
    flex: 1 1 auto;      /* 본문이 남은 공간을 채워 카드 바닥선 통일 */
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  /* 카드 안 텍스트가 긴 단어(주소·단지명) 일 때 셀을 밀어내지 않게 줄바꿈 허용 */
  .card-grid .card-case .title,
  .card-grid .card-case .addr,
  .card-grid .card-case .listing-metrics { min-width: 0; word-break: break-all; overflow-wrap: anywhere; }
  .card-grid .card-case:hover { transform: translateY(-2px); }
}

/* ========= 배지 ========= */
.badge-score {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 800;
  background: var(--color-bg-muted);
  color: var(--color-text);
  letter-spacing: 0.02em;
}
.badge-score.gold  { background: var(--grad-gold-chip); color: #fff; box-shadow: var(--shadow-accent-glow); }
.badge-score.green { background: var(--color-success); color: #fff; }

.badge-dday {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--color-info);
  color: #fff;
}
.badge-dday.hot    { background: var(--color-danger); animation: dday-pulse 1.8s infinite; }
.badge-dday.warn   { background: var(--color-warning); }
@keyframes dday-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(220 38 38 / .4); }
  50%      { box-shadow: 0 0 0 6px rgb(220 38 38 / 0); }
}

.badge-fail {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  border: 1.5px solid var(--color-danger);
  color: var(--color-danger);
  background: #fff;
}

.badge-status {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
}
.badge-status.sold   { background: var(--color-danger); color: #fff; }
.badge-status.result { background: var(--color-text-subtle); color: #fff; }
.badge-status.pin    { background: var(--grad-gold-chip); color: #fff; }

/* ========= 필터 칩 ========= */
.chip-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.chip-filter:hover { border-color: var(--color-border-strong); }
.chip-filter.active {
  background: var(--grad-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-primary-glow);
}
.chip-filter:focus-visible {
  outline: 3px solid rgb(26 54 93 / .18);
  outline-offset: 2px;
}

.chip-bar {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
  -webkit-overflow-scrolling: touch;
}
.chip-bar::-webkit-scrollbar { display: none; }

/* ========= 섹션 타이틀 =========
   좌측 컬러 막대 + 하단 underline 으로 섹션 경계 명확화.
   "더보기" 링크는 컬러 pill 로 시각 강조. 사이트 전체 적용 (home/my/detail/about). */
.section-title {
  font-size: var(--text-lg);
  font-weight: 800;
  margin: var(--space-8) 0 var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  letter-spacing: var(--tracking-tight);
  position: relative;
  padding: 0 2px 10px 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
/* 좌측 세로 컬러 막대 — 섹션 시작 표시 */
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 14px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 60%, #1e3a8a 100%);
}
/* 하단 강조 underline — 전체 border-bottom 위에 짧은 컬러 강조 라인 */
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 56px;
  background: linear-gradient(90deg, #2563eb, transparent);
  border-radius: 2px;
}
/* h1 폰트 호환 — 더 큰 PC 사이즈 */
@media (min-width: 768px) {
  .section-title { font-size: var(--text-xl); }
}
/* 인라인 메타 (region-meta, 일반 small 등) — 타이틀 옆 부제 */
.section-title > small,
.section-title .region-meta {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  margin-left: 6px;
}
/* "더보기" 링크 — pill 스타일로 시각 강조 */
.section-title .more {
  font-size: var(--text-xs);
  font-weight: 700;
  color: #1d4ed8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, .10);
  transition: background-color .15s, color .15s, transform .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.section-title .more:hover {
  background: #2563eb;
  color: #ffffff;
  transform: translateX(2px);
}

/* ========= 버튼 오버라이드 ========= */
.btn {
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--grad-primary);
  border: 0;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--grad-primary);
  filter: brightness(1.08);
  box-shadow: var(--shadow-primary-glow);
  color: #fff;
}
.btn-primary:focus { color: #fff; }

.btn-accent {
  background: var(--grad-accent);
  border: 0;
  color: #fff;
}
.btn-accent:hover { filter: brightness(1.06); color: #fff; box-shadow: var(--shadow-accent-glow); }

.btn-cta {
  display: block;
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-weight: 700;
  text-align: center;
  font-size: var(--text-base);
}

/* ========= 가격 블록 (상세) ========= */
.price-block {
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-xs);
}
.price-block .label { font-size: var(--text-sm); color: var(--color-text-muted); }
.price-block .val {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: var(--tracking-tighter);
}
.price-block .appr { font-size: var(--text-sm); color: var(--color-text-muted); text-decoration: line-through; margin-left: var(--space-2); }

/* ========= 하트 버튼 ========= */
.heart-btn {
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  padding: var(--space-2);
  line-height: 1;
  transition: color var(--dur-fast) var(--ease-out);
}
.heart-btn.on { color: var(--color-danger); }
.heart-btn.on i { animation: heart-pop 320ms var(--ease-out); }
@keyframes heart-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ========= 하단 액션 바 ========= */
.action-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tab-bar-height) + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-top: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-4);
  display: flex;
  gap: var(--space-2);
  align-items: center;
  z-index: 1010;
  box-shadow: 0 -4px 12px rgb(15 23 42 / .06);
}
.action-bar .primary { flex: 1; }

/* ========= 스켈레톤 ========= */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton 1.2s linear infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ========= 폼 ========= */
.form-label { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-1); }
.form-control, .form-select {
  border-color: var(--color-border);
  font-size: var(--text-base);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.form-control:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgb(26 54 93 / .12);
}

/* ========= 빈 상태 ========= */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--color-text-muted);
}
.empty-state .illust {
  width: 200px;
  margin: 0 auto var(--space-4);
  display: block;
}
.empty-state h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

/* ========= 프로토타입 배너 ========= */
.proto-banner {
  background: var(--color-accent-soft);
  color: #78350f;
  padding: 8px var(--space-4);
  font-size: var(--text-xs);
  text-align: center;
  border-bottom: 1px solid #fde68a;
  position: sticky;
  top: var(--header-height);
  z-index: 900;
}

/* ========= 유틸 ========= */
.text-muted-custom { color: var(--color-text-muted); }
.fs-xs { font-size: var(--text-xs); }
.fs-sm { font-size: var(--text-sm); }

/* 가격 비교 바 */
.price-bar {
  height: 8px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  margin: var(--space-2) 0;
}
.price-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-success), var(--color-accent));
  border-radius: var(--radius-full);
}

/* 탭 */
.tabs-inline {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}
.tabs-inline::-webkit-scrollbar { display: none; }
.tabs-inline .tab {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 600;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.tabs-inline .tab:hover { color: var(--color-text); }
.tabs-inline .tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 700;
}
.tabs-inline .tab:focus-visible {
  outline: 3px solid rgb(26 54 93 / .18);
  outline-offset: -3px;
}

/* 지도 플레이스홀더 */
.map-placeholder {
  background:
    radial-gradient(circle at 25% 30%, rgba(212, 160, 23, 0.05), transparent 40%),
    radial-gradient(circle at 75% 70%, rgba(26, 54, 93, 0.05), transparent 40%),
    repeating-linear-gradient(0deg, transparent, transparent 24px, rgba(148, 163, 184, 0.08) 24px, rgba(148, 163, 184, 0.08) 25px),
    repeating-linear-gradient(90deg, transparent, transparent 24px, rgba(148, 163, 184, 0.08) 24px, rgba(148, 163, 184, 0.08) 25px),
    linear-gradient(135deg, #f8fafc, #eef2f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  min-height: 320px;
  position: relative;
  overflow: hidden;
}
.map-placeholder .marker {
  position: absolute;
  width: 34px;
  height: 34px;
  background: var(--color-danger);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: var(--text-sm);
}
.map-placeholder .marker span { transform: rotate(45deg); }

/* 비교 테이블 */
.compare-table {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.compare-table table {
  min-width: 600px;
  font-size: var(--text-sm);
  margin-bottom: 0;
}
.compare-table th {
  background: var(--color-bg-subtle);
  font-weight: 600;
  position: sticky;
  left: 0;
  z-index: 1;
}
.compare-table td { vertical-align: middle; }

/* 알림 아이템 */
.noti-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  transition: background var(--dur-fast) var(--ease-out);
}
.noti-item:hover { background: var(--color-bg-subtle); }
.noti-item.unread { background: #fffbeb; border-left: 3px solid var(--color-accent); padding-left: calc(var(--space-4) - 3px); }
.noti-item .icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-primary);
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* 페이지네이션 재치장 */
.pagination .page-link {
  color: var(--color-primary);
  border-color: var(--color-border);
  font-weight: 600;
}
.pagination .page-item.active .page-link {
  background: var(--grad-primary);
  border-color: var(--color-primary);
}

/* 입력 그룹 강조 */
.input-group-lg > .form-control {
  padding: 14px 16px;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
}

/* ========= 헤더 스크롤 시 그림자 강조 ========= */
.site-header.scrolled {
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #0f2748 0%, #2d4f85 100%);
}

/* ========= 카드 포커스 ========= */
.card-case:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========= 스켈레톤 카드 ========= */
.skeleton-card {
  display: flex; gap: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.skeleton-card .sk-thumb { flex: 0 0 112px; width:112px; height:112px; border-radius: var(--radius-md); }
.skeleton-card .sk-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-card .sk-line { height: 14px; border-radius: var(--radius-sm); }
.skeleton-card .sk-line.short { width: 40%; }
.skeleton-card .sk-line.mid { width: 70%; }
.skeleton-card .sk-line.long { width: 90%; }
.skeleton-card .sk-thumb,
.skeleton-card .sk-line {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton 1.2s linear infinite;
}

/* ========= 토스트 / 스낵바 ========= */
.snackbar {
  position: fixed;
  bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + var(--space-3));
  left: 50%; transform: translateX(-50%);
  background: var(--color-text);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xl);
  display: flex; align-items: center; gap: var(--space-3);
  z-index: 1100;
  font-size: var(--text-sm);
  max-width: calc(100vw - 32px);
  animation: snack-up 280ms var(--ease-out);
}
.snackbar .undo {
  color: var(--color-accent);
  font-weight: 700;
  background: transparent; border: 0;
  cursor: pointer; padding: 0;
}
@keyframes snack-up {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ========= 사이드 시트 메뉴 (우측 슬라이드)
   - 헤더 배경/타이틀 없음 — 본문과 한 톤
   - 슬라이드 transition 은 토큰 var() 대신 명시 ms 사용 (reduced-motion 환경에서도 슬라이드 보장) */
.menu-backdrop {
  position: fixed; inset: 0;
  background: rgb(15 23 42 / .45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1029;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
.menu-backdrop.open { opacity: 1; pointer-events: auto; }
.menu-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(340px, 88vw);
  background: var(--color-bg);
  z-index: 1030;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 420ms cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -20px 0 50px -10px rgb(15 23 42 / .22);
  will-change: transform;
}
.menu-drawer.open { transform: translateX(0); }

/* 헤더 — 닫기 버튼만 본문 위에 띄움 (공간 차지 X). 본문이 최상단부터 시작 */
.menu-drawer .md-header {
  position: absolute;
  top: 6px; right: 6px;
  z-index: 2;
  display: flex; align-items: center;
  background: transparent;
}
.menu-drawer .md-header .icon-btn {
  width: 36px; height: 36px;
  border: 0;
  background: rgba(255, 255, 255, 0.6);
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  transition: background 150ms ease, color 150ms ease;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.menu-drawer .md-header .icon-btn:hover {
  background: var(--color-bg-muted);
  color: var(--color-text);
}
.menu-drawer .md-header .icon-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* 본문 — 상단 여유 최소화. 우측은 닫기 버튼 안 가리도록 패딩 확보 */
.menu-drawer .md-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) var(--space-4) var(--space-8);
  background: var(--color-bg);
}
/* 비로그인 — 계정 카드 없이 첫 섹션의 첫 아이템이 닫기 버튼 아래 오므로 우측 패딩 확보 */
.menu-drawer .md-body > .md-section:first-child > a:first-child,
.menu-drawer .md-body > .md-section:first-child > form:first-child button {
  padding-right: 48px;
}

/* 계정 카드 — 미니멀, 좌측 정렬 텍스트 + 작은 아바타.
   우측은 absolute 닫기 버튼(36+6px) 안 가리도록 패딩 확보. */
.menu-drawer .md-account {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) 48px var(--space-3) var(--space-2);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
}
.menu-drawer .md-account .md-avatar {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  flex: 0 0 40px;
}
.menu-drawer .md-account .md-account-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-drawer .md-account .md-account-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: var(--tracking-tight);
}
.menu-drawer .md-account .md-account-email {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}

/* 섹션 — 라벨 없는 그루핑, 가벼운 구분선만 */
.menu-drawer .md-section {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}
.menu-drawer .md-section:last-of-type { border-bottom: 0; }

/* 메뉴 아이템 — 큰 터치 타깃, 미니멀 호버 */
.menu-drawer .md-section a {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 13px var(--space-2);
  color: var(--color-text);
  font-size: 0.97rem;
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease, padding-left 150ms ease;
  position: relative;
}
.menu-drawer .md-section a:hover {
  background: var(--color-bg-muted);
  padding-left: var(--space-3);
}
.menu-drawer .md-section a.active,
.menu-drawer .md-section a[aria-current="page"] {
  color: var(--color-primary);
  font-weight: 700;
  background: rgba(26, 54, 93, 0.06);
}
.menu-drawer .md-section a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.menu-drawer .md-section a i {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  width: 26px;
  text-align: center;
  transition: color 150ms ease;
}
.menu-drawer .md-section a:hover i,
.menu-drawer .md-section a.active i { color: var(--color-primary); }

/* 알림 배지 */
.menu-drawer .md-section a .md-badge {
  margin-left: auto;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  line-height: 1.35;
  min-width: 22px;
  text-align: center;
}

/* 관리자 섹션 — 좌측 작은 점으로 시각 차별화 */
.menu-drawer .md-section.is-admin a::before {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  margin-right: -8px;
  flex: 0 0 4px;
}
.menu-drawer .md-section.is-admin a:hover { color: var(--color-accent-600); }
.menu-drawer .md-section.is-admin a:hover i { color: var(--color-accent-600); }

/* 로그아웃 — 텍스트 링크 톤, 호버 시 danger */
.menu-drawer .md-logout {
  margin: 0;
  padding: 0;
}
.menu-drawer .md-logout button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  padding: 13px var(--space-2);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  display: inline-flex; align-items: center; gap: var(--space-3);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 150ms ease, color 150ms ease;
  text-align: left;
}
.menu-drawer .md-logout button i { font-size: 1.2rem; width: 26px; text-align: center; }
.menu-drawer .md-logout button:hover {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.menu-drawer .md-logout button:hover i { color: var(--color-danger); }

/* ========= sticky 사이드패널 (PC 상세) ========= */
.detail-layout { display: block; }
@media (min-width: 1100px) {
  .detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: var(--space-6);
    align-items: start;
  }
  .detail-layout .side,
  .detail-layout .detail-side {
    position: sticky;
    top: calc(var(--header-height) + var(--space-4));
    max-height: calc(100vh - var(--header-height) - var(--space-4) * 2);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

/* ========= 가격 변동 mock 차트 (SVG) ========= */
.mock-chart {
  width: 100%;
  height: 140px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.mock-chart svg { width: 100%; height: 100%; display: block; }

/* ========= 폼 필드 fancy ========= */
.field-set {
  position: relative;
}
.field-set .form-control {
  padding-top: 22px;
}
.field-set label {
  position: absolute;
  top: 8px; left: 13px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  pointer-events: none;
  font-weight: 600;
}

/* ========= 카테고리 카드 (랜딩 용도별 특화) =========
   모바일/PC 모두 4열 한 줄 — 좁은 모바일에선 카드 콘텐츠를 컴팩트하게 조정 */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}
@media (min-width: 768px) {
  .usage-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
}
.usage-card {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  min-width: 0;
}
/* 모바일에서 4열로 좁아지니 카드 패딩/폰트 작게 */
@media (max-width: 767.98px) {
  .usage-card { padding: var(--space-3) var(--space-2); gap: 6px; }
  .usage-card .uc-icon { width: 36px; height: 36px; font-size: 1.15rem; }
  .usage-card .uc-title { font-size: var(--text-sm) !important; }
  .usage-card .uc-sub { display: none; }   /* 좁은 모바일에선 부제 숨김 */
  .usage-card .uc-count { font-size: var(--text-xs) !important; }
}
.usage-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--color-text); }
.usage-card .uc-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff;
  background: var(--grad-primary);
}
.usage-card.apt   .uc-icon { background: linear-gradient(135deg, #1a365d, #2d4a7a); }
.usage-card.house .uc-icon { background: linear-gradient(135deg, #15803d, #16a34a); }
.usage-card.land  .uc-icon { background: linear-gradient(135deg, #b45309, #ea580c); }
.usage-card.com   .uc-icon { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.usage-card .uc-title { font-weight: 700; font-size: var(--text-base); }
.usage-card .uc-sub { font-size: var(--text-xs); color: var(--color-text-muted); }
.usage-card .uc-count { font-size: var(--text-sm); font-weight: 700; color: var(--color-primary); }

/* ========= 요약 통계 (랜딩) ========= */
.headline-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin: var(--space-6) 0;
}
.headline-stats .h-stat {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
}
.headline-stats .h-stat strong {
  display: block;
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: var(--tracking-tighter);
}
.headline-stats .h-stat span { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ========= 라이브 배지 (실시간 표시) ========= */
.badge-live {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--color-danger-soft);
  color: var(--color-danger);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 700;
}
.badge-live::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-danger);
  animation: live-pulse 1.4s infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ========= FAQ accordion ========= */
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  margin-bottom: var(--space-2);
  overflow: hidden;
}
.faq-item summary {
  padding: var(--space-4);
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.5rem; font-weight: 300; color: var(--color-primary);
  transition: transform var(--dur-fast);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body {
  padding: 0 var(--space-4) var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm); line-height: 1.7;
}

/* ========= 단계 인디케이터 (회원가입 등) ========= */
.step-indicator {
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.step-indicator .step {
  flex: 1;
  height: 4px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
}
.step-indicator .step.active { background: var(--grad-primary); }
.step-indicator .step.done { background: var(--color-success); }

/* ========= 카드 list (마이페이지) ========= */
.list-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.list-card .lc-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.list-card .lc-row:last-child { border-bottom: 0; }
.list-card .lc-row .lc-arrow { margin-left: auto; color: var(--color-text-muted); }

/* ========= 하트 마이크로 인터랙션 강화 ========= */
.heart-burst {
  position: relative;
}
.heart-burst.on::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 3px solid var(--color-danger);
  animation: burst 480ms var(--ease-out);
  pointer-events: none;
}
@keyframes burst {
  from { transform: scale(0.3); opacity: 1; }
  to   { transform: scale(1.8); opacity: 0; }
}
