html, body { 
    margin: 0; 
    padding: 0; 
    min-height: 100vh; 
    font-family: 'SUIT', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    letter-spacing: -0.025em;
    overflow: hidden; /* 전체 페이지 스크롤 방지 */
}
#main-container { display: flex; height: calc(100vh - 74px); margin-top: 0; position: relative; z-index: 1; }
#info-panel { width: 400px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid #e5e7eb; background-color: white; z-index: 10; transition: all 0.3s ease; box-shadow: 2px 0 8px rgba(0,0,0,0.04); height: 100%; }
.list-container {
    flex-grow: 1;
    overflow-y: hidden; /* 기본적으로 숨김 - region-detail이 스크롤 담당 */
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

.list-container::-webkit-scrollbar {
    width: 8px;
}

.list-container::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.list-container::-webkit-scrollbar-thumb {
    background: #FFC80F;
    border-radius: 4px;
}

.list-container::-webkit-scrollbar-thumb:hover {
    background: #e6b500;
}
#map { 
    flex-grow: 1; 
    height: 100%; 
    position: relative; 
    z-index: 1;  /* 헤더보다 낮은 z-index */
}
.header { 
    padding: 15px 20px; 
    border-bottom: 1px solid #e0e0e0; 
    display: flex; 
    flex-wrap: wrap;
    align-items: center; 
    gap: 10px; 
}
#mode-selector { display: flex; border: 1px solid #ccc; border-radius: 5px; overflow: hidden; flex-grow: 1; }
.mode-btn { flex: 1; padding: 10px; font-size: 15px; background-color: #fff; border: none; cursor: pointer; transition: background-color 0.2s; }
.mode-btn:first-child { border-right: 1px solid #ccc; }
.mode-btn.active { background-color: #FFC80F; color: #333; font-weight: bold; }
.mode-btn:hover:not(.active) { background-color: #f0f0f0; }

.fullscreen-btn { display: none; align-items: center; gap: 5px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 5px; background-color: #fff; cursor: pointer; font-size: 14px; }

/* 초기 메시지 스타일 */
.initial-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    text-align: center;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1.6;
    padding: 40px;
}

.initial-message::before {
    content: '🏠';
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.initial-message strong {
    color: #64748b;
    font-weight: 600;
    font-size: 20px;
}

.search-container {
    position: relative;
    width: 100%;
    order: -1;
    margin-bottom: 0;
}

/* 검색창 인터렉션 개선 */
.search-container.active {
    z-index: 1002;
}

.search-container.active #search-input,
.search-container.active #mobile-search-input {
    border-color: #FFC80F;
    box-shadow: 0 0 0 3px rgba(255, 200, 15, 0.1);
}
/* shadcn/ui 스타일 검색 input */
#search-input, #mobile-search-input {
    display: flex;
    height: 40px;
    width: 100%;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    padding: 0 44px 0 12px;
    font-size: 14px;
    color: #0f172a;
    box-sizing: border-box;
    transition: all 0.2s ease;
    placeholder: #9ca3af;
}

#search-input:hover, #mobile-search-input:hover {
    border-color: #cbd5e1;
}

#search-input:focus, #mobile-search-input:focus {
    outline: none;
    border-color: #FFC80F;
    box-shadow: 0 0 0 3px rgba(255, 200, 15, 0.1);
}

#search-input::placeholder, #mobile-search-input::placeholder {
    color: #9ca3af;
}

.search-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    width: 20px;
    height: 20px;
}
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #FFC80F;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(8px);
}

.autocomplete-results::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.autocomplete-results::-webkit-scrollbar-thumb {
    background: #FFC80F;
    border-radius: 3px;
}

.autocomplete-results::-webkit-scrollbar-thumb:hover {
    background: #e6b500;
}
.autocomplete-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: all 0.15s ease;
  position: relative;
}
.autocomplete-item:hover {
  background-color: #fff8e6;
  border-left: 3px solid #FFC80F;
  padding-left: 13px;
}

.autocomplete-item.keyboard-selected {
  background-color: #fff8e6;
  border-left: 3px solid #FFC80F;
  padding-left: 13px;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.item-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  height: 24px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 4px;
  margin-right: 8px;
  color: white;
  flex-shrink: 0;
  white-space: nowrap;
}

.item-type-icon.company { background-color: #007bff; }
.item-type-icon.apartment { background-color: #28a745; }
.item-type-icon.region { background-color: #FFC80F; color: #333; }
.item-name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#main-list, .info-content { padding: 0; margin: 0; }
.list-item {
    display: block;
    padding: 18px 20px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    border-radius: 0.5rem;
    margin: 8px 0;
    background: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}
.list-item:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.list-item:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #94a3b8;
}
.item-name { font-weight: 600; font-size: 16px; margin-bottom: 6px; color: #1a1a1a; line-height: 1.4; }
.item-info { font-size: 14px; color: #666; line-height: 1.5; }

#detail-view { display: none; flex-direction: column; height: 100%; padding: 0 20px; box-sizing: border-box; background: #fafbfc; }
.detail-header { padding: 16px 0; border-bottom: 1px solid #e5e7eb; background: white; margin: 0 -20px 20px -20px; padding-left: 20px; padding-right: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
#back-to-list-btn { background: rgba(255, 200, 15, 0.1); border: 1px solid rgba(255, 200, 15, 0.3); border-radius: 8px; font-size: 14px; cursor: pointer; color: #FFC80F; padding: 8px 12px; font-weight: 500; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 6px; }

#back-to-list-btn:hover {
    background: #FFC80F;
    color: white;
    border-color: #FFC80F;
}
#detail-content { line-height: 1.6; }
#detail-content h3 { margin: 0 -20px 20px -20px; padding: 24px 20px 20px 20px; font-size: 24px; font-weight: 700; background: white; border-radius: 12px 12px 0 0; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }

.loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 3px solid rgba(255, 200, 15, 0.2); border-radius: 50%; border-top: 3px solid #FFC80F; width: 32px; height: 32px; animation: spin 1s linear infinite; z-index: 1000; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
@keyframes spin { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }

/* =========================== */
/* shadcn/ui 스타일 컴포넌트 */
/* =========================== */

/* Card 컴포넌트 */
.card {
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    text-color: #020817;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    flex-direction: column;
    space-y: 1.5rem;
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.75rem;
    letter-spacing: -0.025em;
}

.card-description {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.25rem;
}

.card-content {
    padding: 1.5rem;
    padding-top: 0;
}

.card-footer {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    padding-top: 0;
}

/* Button 컴포넌트 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
}

.btn:focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #94a3b8;
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn-default {
    background-color: #020817;
    color: #f8fafc;
    height: 2.5rem;
    padding: 0.5rem 1rem;
}

.btn-default:hover {
    background-color: rgba(2, 8, 23, 0.9);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #0f172a;
    height: 2.5rem;
    padding: 0.5rem 1rem;
}

.btn-secondary:hover {
    background-color: rgba(241, 245, 249, 0.8);
}

.btn-outline {
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #020817;
    height: 2.5rem;
    padding: 0.5rem 1rem;
}

.btn-outline:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.btn-ghost {
    background-color: transparent;
    color: #020817;
    height: 2.5rem;
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.btn-sm {
    height: 2.25rem;
    border-radius: 0.375rem;
    padding: 0 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    height: 2.75rem;
    border-radius: 0.5rem;
    padding: 0.5rem 2rem;
    font-size: 1rem;
}

/* Input 컴포넌트 */
.input {
    display: flex;
    height: 2.5rem;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}

.input::placeholder {
    color: #64748b;
}

.input:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Badge 컴포넌트 */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    transition: all 0.2s;
    cursor: default;
    white-space: nowrap;
}

.badge-default {
    border: 1px solid transparent;
    background-color: #020817;
    color: #f8fafc;
}

.badge-secondary {
    border: 1px solid transparent;
    background-color: #f1f5f9;
    color: #0f172a;
}

.badge-outline {
    border: 1px solid #e2e8f0;
    color: #0f172a;
    background-color: transparent;
}

/* Separator 컴포넌트 */
.separator {
    flex-shrink: 0;
    background-color: #e2e8f0;
    height: 1px;
    width: 100%;
}

.separator-vertical {
    height: auto;
    width: 1px;
    align-self: stretch;
}

/* Slider 컴포넌트 (shadcn/ui 스타일) */
.slider {
    position: relative;
    flex: 1;
    height: 20px;
    width: 100%;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0 !important; /* 폴백 배경 */
    border-radius: 9999px;
    outline: none;
    touch-action: none;
    user-select: none;
}

/* WebKit (Chrome, Safari) - 강제 적용 */
.slider::-webkit-slider-track {
    height: 6px !important;
    background: #e2e8f0 !important;
    border-radius: 9999px !important;
    border: none !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.slider::-webkit-slider-runnable-track {
    height: 6px !important;
    background: #e2e8f0 !important;
    border-radius: 9999px !important;
    border: none !important;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    height: 20px !important;
    width: 20px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 2px solid #FFC80F !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    margin-top: -7px !important; /* 트랙 중앙 정렬 */
}

.slider::-webkit-slider-thumb:hover {
    border-color: #ffb000 !important;
    box-shadow: 0 4px 8px rgba(255, 200, 15, 0.25) !important;
    transform: scale(1.05) !important;
}

.slider::-webkit-slider-thumb:active {
    border-color: #e6a000 !important;
    box-shadow: 0 2px 4px rgba(255, 200, 15, 0.4) !important;
    transform: scale(0.95) !important;
}

/* Firefox - 강제 적용 */
.slider::-moz-range-track {
    height: 6px !important;
    background: #e2e8f0 !important;
    border-radius: 9999px !important;
    border: none !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.slider::-moz-range-thumb {
    height: 20px !important;
    width: 20px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 2px solid #FFC80F !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    -moz-appearance: none !important;
}

/* Edge/IE - 추가 지원 */
.slider::-ms-track {
    height: 6px !important;
    background: transparent !important;
    border-color: transparent !important;
    color: transparent !important;
}

.slider::-ms-fill-lower {
    background: #e2e8f0 !important;
    border-radius: 9999px !important;
}

.slider::-ms-fill-upper {
    background: #e2e8f0 !important;
    border-radius: 9999px !important;
}

.slider::-ms-thumb {
    height: 20px !important;
    width: 20px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 2px solid #FFC80F !important;
    cursor: pointer !important;
}

/* 특정 슬라이더 ID 스타일 제거 - 일반 .slider 클래스 사용 */

/* Select 컴포넌트 */
.select {
    display: flex;
    height: 2.5rem;
    width: 100%;
    align-items: center;
    justify-content: between;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.select:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
    outline: none;
}

.select:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.select-content {
    position: absolute;
    z-index: 50;
    min-width: 8rem;
    overflow: hidden;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #020817;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.select-item {
    position: relative;
    display: flex;
    cursor: pointer;
    align-items: center;
    border-radius: 0.125rem;
    padding: 0.375rem 2rem 0.375rem 0.5rem;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.select-item:focus {
    background-color: #f8fafc;
    color: #0f172a;
}

.select-item[data-disabled] {
    pointer-events: none;
    opacity: 0.5;
}

/* Table 컴포넌트 */
.table-wrapper {
    position: relative;
    width: 100%;
    overflow: auto;
}

.table {
    width: 100%;
    caption-side: bottom;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.table-header {
    border-bottom: 1px solid #e2e8f0;
}

.table-header-row {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s;
}

.table-header-row:hover {
    background-color: #f8fafc;
}

.table-head {
    height: 3rem;
    padding: 0.75rem;
    text-align: left;
    font-weight: 500;
    color: #64748b;
    vertical-align: middle;
}

.table-body {
}

.table-row {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background-color: #f8fafc;
}

.table-cell {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-caption {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

/* Chart Container 컴포넌트 (shadcn/ui 스타일) */
.chart-container {
    background: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin-bottom: 20px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.75rem;
    letter-spacing: -0.025em;
    color: #020817;
    margin: 0;
}

.chart-description {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.25rem;
    margin: 4px 0 0 0;
}

.chart-content {
    padding: 20px 24px 24px;
    position: relative;
}

.chart-canvas {
    max-height: 300px;
    width: 100%;
}

/* Chart Controls */
.chart-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chart-period-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    height: 2rem;
    padding: 0 0.75rem;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #64748b;
    transition: all 0.2s;
}

.chart-period-btn:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.chart-period-btn.active {
    background-color: #020817;
    color: #f8fafc;
    border-color: #020817;
}

.chart-period-btn:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #94a3b8;
}


/* shadcn/ui 스타일 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f1f5f9;
    border-top: 3px solid #FFC80F;
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 4px 12px rgba(255, 200, 15, 0.2);
}

.loading-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* 지도 상단 컨트롤 */
.map-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-control-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s;
    font-size: 18px;
    color: #666;
}

.map-control-btn:hover {
    background: #f5f5f5;
    border-color: #FFC80F;
    color: #FFC80F;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.map-control-btn:active {
    transform: scale(0.95);
}

/* 줌 안내 메시지 */
.zoom-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
}

.zoom-guide-content {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 200, 15, 0.2);
    border-radius: 12px;
    padding: 24px 32px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: fadeInZoom 0.3s ease-out;
}

@keyframes fadeInZoom {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-guide-content svg {
    color: #FFC80F;
    filter: drop-shadow(0 2px 4px rgba(255, 200, 15, 0.2));
}

.zoom-guide-content span {
    font-size: 15px;
    line-height: 1.5;
    color: #555;
    font-weight: 500;
}

.detail-loader-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
/* shadcn/ui 스타일 작은 로더 */
.small-loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    gap: 12px;
}

.small-loader {
    width: 24px;
    height: 24px;
    border: 2px solid #f1f5f9;
    border-top: 2px solid #FFC80F;
    border-radius: 50%;
    animation: spin 0.8s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(255, 200, 15, 0.15);
}

.load-more-btn { display: block; width: calc(100% - 40px); margin: 20px; padding: 12px; background-color: #FFC80F; color: #333; border: none; border-radius: 5px; font-size: 15px; cursor: pointer; font-weight: 600; }
.load-more-btn:hover { background-color: #e6b200; }

.zoom-in-message, .empty-list-message { padding: 40px 20px; text-align: center; color: #888; font-size: 16px; line-height: 1.6; }
.empty-list-message p { margin: 0; }

.custom-marker { 
    position: relative; 
    background: #fff; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
    padding: 5px 10px; 
    box-shadow: 1px 1px 5px rgba(0,0,0,0.2); 
    white-space: nowrap; 
    cursor: pointer; 
}
.custom-marker:after { content: ''; position: absolute; left: 50%; bottom: -10px; margin-left: -10px; border-width: 10px 10px 0; border-style: solid; border-color: #fff transparent; }
.custom-marker .name { font-weight: bold; font-size: 13px; color: #000; }
.custom-marker .info { font-size: 11px; color: #555; margin-top: 2px; }

.region-name-overlay {
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid #999;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transform: translate(-50%, -50%);
    white-space: nowrap;
    /* 중요: 라벨 자체만 클릭 가능 */
    pointer-events: auto !important;
    position: relative;
    display: inline-block;
    width: auto !important;
    height: auto !important;
}
.region-name-overlay:hover {
    background-color: #fff;
    color: #000;
}

/* CustomOverlay 컨테이너는 클릭 통과 */
.region-overlay-container {
    pointer-events: none !important;
    position: absolute;
}

#nearby-info-section { border-top: 8px solid #f0f0f0; padding-bottom: 20px; }
.nearby-header {
    padding: 0 0 16px 0;
}

.nearby-header h4 {
    margin: 0 0 4px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #020817;
    letter-spacing: -0.025em;
}

.nearby-description {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 20px 0;
    line-height: 1.5;
}
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    padding: 16px 20px;
    margin: 0 8px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.slider-label {
    font-weight: 500;
    color: #374151;
    min-width: 80px;
}

.slider-value {
    font-weight: 600;
    color: #020817;
    min-width: 60px;
    text-align: right;
    font-size: 13px;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px 24px;
    padding: 24px;
    background-color: #ffffff;
    border-radius: 0.5rem;
    margin: 0 0 20px 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}
.stats-grid div:nth-child(odd) {
    font-weight: 500;
    color: #64748b;
    font-size: 0.875rem;
    padding-right: 12px;
}

.stats-grid div:nth-child(even) {
    text-align: right;
    color: #020817;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

.detail-section {
    background: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}
.detail-section:last-child { margin-bottom: 0; }
.detail-section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #fafbfc;
}

.detail-section h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #020817;
    letter-spacing: -0.025em;
    line-height: 1.75rem;
}

.detail-section-description {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    line-height: 1.25rem;
}

.detail-section-content {
    padding: 20px 24px;
}
.detail-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px 24px;
    font-size: 0.875rem;
    align-items: center;
}

.detail-grid-item {
    display: contents;
}

.detail-grid-item:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.detail-grid span:nth-child(odd),
.detail-label {
    font-weight: 500;
    color: #64748b;
    font-size: 0.875rem;
}
.detail-grid span:nth-child(even),
.detail-value {
    color: #020817;
    font-weight: 500;
    font-size: 0.875rem;
}
.detail-grid hr { grid-column: 1 / -1; border: none; border-top: 1px dashed #ddd; margin: 5px 0; }
.detail-grid-full span:first-child { display: block; font-weight: 600; color: #666; margin-bottom: 5px; }
.detail-grid-full span:last-child {
    display: block;
    color: #222;
    line-height: 1.6;
    word-break: break-all;
}

.apt-age-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    color: white !important; 
    margin: 0 8px;
}
.age-new { background-color: #28a745; }
.age-normal { background-color: #007bff; }
.age-old { background-color: #fd7e14; }
.age-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.usage-date {
    font-size: 13px;
    color: #6c757d;
}

#chart-section {
    padding-top: 20px;
}
#chart-summary {
    padding: 0 20px;
    margin-bottom: 15px;
}
#chart-summary p {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #666;
}
#chart-summary h4 {
    margin: 0;
    font-size: 24px;
    color: #4263eb;
}
#chart-period-selector {
    /* 기본 스타일은 .transaction-type-selector에서 상속 */
}
/* shadcn/ui 스타일 기간 선택 버튼 */
.period-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    height: 36px;
    padding: 0 16px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #64748b;
    transition: all 0.2s ease;
}

.period-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.period-btn.active {
    background-color: #FFC80F;
    border-color: #FFC80F;
    color: #374151;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(255, 200, 15, 0.2);
}

.period-btn:focus {
    outline: none;
    border-color: #FFC80F;
    box-shadow: 0 0 0 3px rgba(255, 200, 15, 0.1);
}
.chart-container {
    position: relative;
    height: 200px; /* 250px에서 200px로 줄임 */
    width: 100%;
    padding: 0 10px;
}
.chart-note {
    font-size: 12px;
    color: #868e96;
    text-align: right;
    padding: 0 20px;
    margin-top: 8px;
}

.transaction-header {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 10px 0 6px;
}
.transaction-header h4 {
    margin: 0;
    padding: 0;
    border: none;
    flex-shrink: 0;
}
.transaction-selectors {
    display: flex;
    align-items: center;
    gap: 10px;
}
/* shadcn/ui 스타일 셀렉트 박스 - 공간 최대 활용 */
.area-selector {
    display: flex;
    height: 32px;
    flex: 1;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    padding: 0 8px;
    padding-right: 28px;
    font-size: 12px;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

.area-selector:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.area-selector:focus {
    outline: none;
    border-color: #FFC80F;
    box-shadow: 0 0 0 3px rgba(255, 200, 15, 0.1);
}

.area-selector:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background-color: #f1f5f9;
}

.transaction-list-wrapper {
    background: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.transaction-list-header {
    background: #f8fafc;
    display: grid;
    grid-template-columns: 80px 90px 1fr;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    gap: 12px;
    font-weight: 500;
    font-size: 0.875rem;
    color: #64748b;
}

/* transaction-section 스크롤 설정 */
.transaction-section {
    display: flex;
    flex-direction: column;
    overflow: visible;
    flex: none; /* flex 제거하여 자연스러운 높이 사용 */
}

.transaction-list-container {
    /* 스크롤 제거 - 상위에서 처리 */
    overflow: visible;
    position: relative;
    padding: 0;
    margin: 0;
}

/* PC에서만 최대 높이 제한 */
@media (min-width: 769px) {
    .transaction-list-container {
        max-height: calc(100vh - 300px);
        flex: none;
    }
}

.transaction-list-container::-webkit-scrollbar {
    display: none; /* 스크롤바 숨김 */
}


.transaction-item {
    display: grid;
    grid-template-columns: 70px 50px 35px 40px 80px 1fr 30px;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid #f1f5f9;
    gap: 6px;
    transition: background-color 0.2s;
    cursor: pointer;
    min-height: 36px;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background-color: #f8fafc;
}

.transaction-item .col-date,
.transaction-item .col-area {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.transaction-item .col-date {
    font-variant-numeric: tabular-nums;
}

.transaction-item .col-area {
    text-align: center;
    font-size: 0.8rem;
}

.transaction-item .col-floor {
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.transaction-item .col-badge {
    display: flex;
    justify-content: center;
}

.transaction-item .col-price {
    text-align: right;
}

.transaction-item .col-deal-info {
    font-size: 0.75rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-item .col-details {
    display: flex;
    justify-content: center;
}

.transaction-list-header .col-info, .transaction-item .col-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.transaction-list-header .col-info {
    text-align: right;
    align-items: flex-end;
}

.transaction-item .col-info {
    align-items: flex-end;
}

.transaction-item .col-info .info-line-1 {
    font-weight: 600;
    color: #020817;
    font-size: 0.875rem;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.transaction-item .col-info .info-line-2 {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}

.col-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.info-line-1, .info-line-2 {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

.info-line-1 {
    gap: 8px;
}

.info-line-2 {
    gap: 4px;
}

.badge-wrapper {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}

.price {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
    flex-shrink: 0;
}

.price.cancelled-price {
    color: #adb5bd;
    text-decoration: line-through;
}

.deal-location-info {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.details-btn-plus {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.details-btn-plus:hover {
    background: #e0e0e0;
}

/* 거래 상세 정보 확장 스타일 */
.transaction-details-row {
    background: #f8fafc !important;
}

.transaction-details-cell {
    padding: 0 !important;
    border-top: 1px solid #e2e8f0 !important;
}

.transaction-details-content {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.detail-item {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #64748b;
    min-width: 0;
}

.detail-label {
    font-weight: 600;
    color: #475569;
    margin-right: 6px;
    white-space: nowrap;
}

.detail-item:not(:last-child)::after {
    content: '·';
    margin-left: 16px;
    color: #cbd5e1;
}

/* 모바일에서 상세 정보 최적화 */
@media (max-width: 767px) {
    .transaction-details-content {
        padding: 8px 12px;
        flex-direction: column;
        gap: 4px;
    }

    .detail-item {
        font-size: 10px;
    }

    .detail-item:not(:last-child)::after {
        display: none;
    }

    /* 모바일 기업 정보 최적화 */
    .company-row {
        padding: 6px 8px;
        margin-bottom: 3px;
    }

    .company-name {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .company-meta {
        gap: 4px 8px;
    }

    .company-meta span {
        padding: 1px 4px;
        font-size: 9px;
    }
}

.badge {
    display: inline-block;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    color: white;
    cursor: help;
    flex-shrink: 0;
    line-height: 1.2;
}
.badge-registered {
    background-color: #10b981;
    color: white;
    font-size: 9px;
    padding: 1px 4px;
}
.badge-cancelled { background-color: #6c757d; }
.badge-renew { background-color: #FFC80F; color: #333; }
.badge-term { background-color: #868e96; font-weight: normal; }

.custom-tooltip {
    position: fixed;
    background-color: rgba(30, 30, 30, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 13px;
    z-index: 10001;
    pointer-events: none;
    white-space: pre-wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    max-width: 250px;
    line-height: 1.5;
}

/* Modern Region Page Styles - shadcn/ui inspired */
.region-detail {
    background: #ffffff;
    height: 100%;
    overflow-y: auto;
}

.region-header-modern {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 16px;
}

.region-title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.region-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.region-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Modern Tabs */
.tabs-container {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.tabs-list {
    display: flex;
    padding: 0 24px;
    gap: 4px;
}

.tab-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.tab-trigger:hover {
    color: #0f172a;
    background: #f8fafc;
}

.tab-trigger.active {
    color: #0f172a;
    border-bottom-color: #fbbf24;
    background: transparent;
}

.tab-trigger[aria-selected="true"] {
    color: #0f172a;
    border-bottom-color: #fbbf24;
}

.tab-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.tab-trigger.active .tab-icon {
    opacity: 1;
}

.tab-panels {
    padding: 0;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Ensure region transactions content uses flex when active */
#region-transactions-content.active {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

/* 지역 통계 스타일 */
.region-stats-section {
    margin-bottom: 20px;
}
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.stat-item:last-child {
    border-bottom: none;
}
.stat-label {
    font-size: 14px;
    color: #666;
}
.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
/* Modern Transaction Table Styles */
.transaction-table-wrapper {
    margin: 0;
    padding: 0;
    overflow-x: auto;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
    margin: 0;
}

.transaction-table thead {
    background: #f8fafc;
}

/* 무한 스크롤 로딩 인디케이터 */
.loading-row td {
    background: transparent !important;
    border: none !important;
}

.loading-row .small-loader {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.transaction-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 11px;
    text-transform: none;
    letter-spacing: normal;
    border-bottom: 1px solid #e2e8f0;
}

.transaction-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s;
}

.transaction-table tbody tr:hover {
    background: #f8fafc;
}

.transaction-table tbody tr:last-child {
    border-bottom: none;
}

.transaction-table td {
    padding: 10px 8px;
    color: #334155;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* 기본 컬럼 스타일 (지역 검색용 - 아파트명 포함) */
.th-date, .td-date {
    width: 80px;
    min-width: 80px;
    text-align: left;
    white-space: nowrap;
    font-size: 12px;
}

.th-type, .td-type {
    width: 35px;
    min-width: 35px;
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
}

.th-area, .td-area {
    width: 50px;
    min-width: 50px;
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
}

.th-floor, .td-floor {
    width: 40px;
    min-width: 40px;
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
}

.th-price, .td-price {
    width: 80px;
    min-width: 80px;
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
    font-size: 12px;
}

/* 아파트 상세 페이지용 (아파트명 컬럼 숨김) */
#tab-tx .th-apt,
#tab-tx .td-apt {
    display: none;
}

#tab-tx .transaction-table {
    table-layout: fixed;
}

#tab-tx .th-date,
#tab-tx .td-date {
    width: 25%;
}

#tab-tx .th-type,
#tab-tx .td-type {
    width: 15%;
}

#tab-tx .th-area,
#tab-tx .td-area {
    width: 20%;
}

#tab-tx .th-floor,
#tab-tx .td-floor {
    width: 15%;
}

#tab-tx .th-price,
#tab-tx .td-price {
    width: 25%;
}

/* 아파트명 컬럼이 있는 경우 (지역 검색 등) */
.th-apt, .td-apt {
    width: auto;
    max-width: 0; /* 남은 공간을 모두 차지하도록 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.4;
    word-break: break-word;
}

.th-status, .td-status {
    width: 10%;
    text-align: center;
    font-size: 12px;
}

/* 매매일 때 가격 컬럼이 더 넓게 차지하도록 */
.td-price.sale-price {
    background: linear-gradient(90deg, transparent 0%, #f8fafc 100%);
}

/* 빈 셀 스타일 */
.td-empty {
    background: #fafafa;
    border-left: 2px solid #f1f5f9;
}

/* 지역별 실거래 내역 특별 스타일 */
.region-transaction-table {
    /* 사이드바 패딩 제거 - 컨테이너에 맞게 정렬 */
    margin: 0;
    width: 100%;
}

/* 아파트별 실거래 내역 특별 스타일 */
.apartment-transaction-table {
    /* 아파트 상세 페이지용 테이블 */
    margin: 0;
    width: 100%;
}

/* 아파트 실거래가 테이블 컬럼 폭 조정 */
.apartment-transaction-table .th-date,
.apartment-transaction-table .td-date {
    width: 70px;
    min-width: 70px;
}

.apartment-transaction-table .th-type,
.apartment-transaction-table .td-type {
    width: 60px;
    min-width: 60px;
    text-align: center;
}

.apartment-transaction-table .th-area,
.apartment-transaction-table .td-area {
    width: 50px;
    min-width: 50px;
    text-align: center;
}

.apartment-transaction-table .th-floor,
.apartment-transaction-table .td-floor {
    width: 35px;
    min-width: 35px;
    text-align: center;
}

.apartment-transaction-table .th-price,
.apartment-transaction-table .td-price {
    width: 80px;
    min-width: 80px;
    text-align: right;
}

.apartment-transaction-table .th-details,
.apartment-transaction-table .td-details {
    width: auto;
    text-align: left;
}

/* 제거: 테이블 구조를 기본 상태로 되돌려서 무한스크롤 작동하도록 함 */

#region-transactions-content::-webkit-scrollbar {
    width: 6px;
}

#region-transactions-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#region-transactions-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#region-transactions-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.region-transaction-table .td-apt {
    font-size: 11px;
    max-width: 0;  /* flexbox처럼 남은 공간 차지 */
    overflow: hidden;
    text-overflow: ellipsis;
}

.region-transaction-table .td-apt a {
    color: #1e40af;
    text-decoration: none;
}

.region-transaction-table .td-apt a:hover {
    text-decoration: underline;
}

.region-transaction-table .td-price {
    font-size: 11px;
    color: #0f172a;
}

/* 더 컴팩트한 표시를 위한 조정 */
.region-transaction-table thead {
    font-size: 9px;
}

.region-transaction-table .th-date,
.region-transaction-table .th-type,
.region-transaction-table .th-area,
.region-transaction-table .th-floor,
.region-transaction-table .th-status {
    padding: 6px 2px;
}

/* Type badges */
.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.type-badge.type-sale {
    background: #fef3c7;
    color: #92400e;
}

.type-badge.type-jeonse {
    background: #dbeafe;
    color: #1e40af;
}

.type-badge.type-wolse {
    background: #ede9fe;
    color: #5b21b6;
}

/* Apartment cell */
.apt-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.apt-name-wrap {
    display: flex;
    align-items: center;
}

.apt-link {
    color: #1e293b;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 13px;
}

.apt-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.apt-name {
    color: #1e293b;
    font-weight: 500;
    font-size: 13px;
}

.apt-dong {
    font-size: 11px;
    color: #94a3b8;
}

/* Area info */
.area-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.area-py {
    font-weight: 500;
    color: #1e293b;
    font-size: 13px;
}

.area-m2 {
    font-size: 11px;
    color: #94a3b8;
}

/* Price styles */
.price-sale {
    color: #dc2626;
    font-size: 12px;
}

.price-jeonse {
    color: #2563eb;
    font-size: 12px;
}

.price-wolse {
    color: #7c3aed;
    font-size: 12px;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
}

.status-badge.success {
    background: #dcfce7;
    color: #166534;
}
.sub-info {
    font-size: 12px;
    color: #28a745;
    font-weight: bold;
    cursor: help;
}
.price-sale { color: #fa5252; }
.price-jeonse { color: #1c7ed6; }
.price-wolse { color: #40c057; }
.badge-sale { background-color: #fa5252; }
.badge-jeonse { background-color: #1c7ed6; }
.badge-wolse { background-color: #40c057; }
.apt-name-link { text-decoration: underline; cursor: pointer; }
.apt-detail-header { padding: 8px 8px 12px; line-height: 1.6; }
h1.apt-title, .apt-title { margin: 0 0 4px; font-size: 22px; font-weight: bold; line-height: 1.2; }
.apt-subinfo { color:#666; font-size: 13px; }

/* shadcn/ui 스타일 아파트 탭 - 상단 고정 */
.apt-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 0 0;
    margin: 0;
    background-color: transparent;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}
/* 아파트 탭 컨테이너 */
.apt-tabs {
    display: flex;
    gap: 4px; /* 간격을 4px로 늘림 */
    padding: 0 12px; /* 패딩도 조금 늘림 */
    background: transparent;
    position: relative;
    z-index: 1;
}

.apt-tabs .tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 500;
    height: 36px;
    padding: 0 16px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    background-color: #f1f5f9;
    color: #64748b;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: -1px;
}

.apt-tabs .tab-btn:hover:not(.active) {
    background-color: #e2e8f0;
    color: #475569;
    transform: translateY(-1px);
}

.apt-tabs .tab-btn.active {
    background-color: #ffffff;
    color: #1f2937;
    font-weight: 600;
    border-color: #d1d5db;
    border-bottom: 1px solid #ffffff;
    z-index: 2;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

/* 거래 헤더 */
.transaction-header {
    margin-bottom: 12px;
}

/* 모든 컨트롤을 한 줄에 배치 */
.transaction-controls-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
}

/* shadcn/ui 스타일 토글 버튼 그룹 */
.transaction-type-selector {
    display: inline-flex;
    height: auto;
    align-items: center;
    border-radius: 6px;
    background-color: #f1f5f9;
    padding: 1px;
    color: #64748b;
    flex-shrink: 0;
}

.transaction-type-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 150ms ease;
    color: #64748b;
    flex-shrink: 0;
}

.transaction-type-btn:hover:not(.active) {
    background-color: #e2e8f0;
}

.transaction-type-btn.active {
    background-color: #ffffff;
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* 거래 선택자 (면적 등) - 유연하게 확장 */
.transaction-selectors {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 4px;
    align-items: center;
}


/* 차트 컨트롤 영역 - float right 효과 */
.chart-controls {
    float: right;
    margin-bottom: 8px;
}

/* 차트 요약 영역 - 가격 정보만 */
.chart-summary {
    margin-bottom: 12px;
}

/* float 정리를 위한 clearfix */
.chart-section::after {
    content: "";
    display: table;
    clear: both;
}


/* 탭 콘텐츠 영역 - 서류철 스타일 */
.tab-content {
    display: none;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-top: 1px solid #d1d5db; /* 명시적으로 상단 보더 추가 */
    border-radius: 0 0 8px 8px; /* 하단만 둥글게 */
    position: relative;
    padding: 16px 12px;
    margin: 0 8px;
    margin-top: 0;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 330px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    position: relative;
    z-index: 1;
}

.tab-content.active {
    display: block !important;
}

/* 간단한 서류철 효과: 활성 탭만 하단 보더 제거하고 콘텐츠와 연결 */
.apt-tabs .tab-btn.active {
    border-bottom: none !important; /* 하단 보더 완전 제거 */
    margin-bottom: -1px; /* 콘텐츠와 겹치게 */
    z-index: 3 !important;
    position: relative;
}



.company-row {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 6px;
    margin-bottom: 4px;
    border: 1px solid #f1f5f9;
}

.company-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.3;
}

.company-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 11px;
    color: #64748b;
}

.company-meta span {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
}

.company-list {
    margin: 0 8px;
    padding: 0;
}
.company-stat-line { color:#444; margin-bottom:4px; }

.keyval { display:flex; justify-content:space-between; padding:6px 0; border-bottom:1px dashed #eee; }
.keyval span { color:#555; }
.keyval b { color:#222; }
.small-note { color:#777; font-size:12px; margin-bottom:8px; }
/* === 실거래가 상단 요약 텍스트 복구 === */
.chart-summary { margin: 8px 0 12px; }
/* 차트 요약 영역 복구 */
.chart-summary-title{
  margin-top:8px;
  font-size:15px;
  color:#6b7280;   /* 회색 */
}
.chart-latest-price{
  margin:2px 0 10px;
  font-size:36px;
  font-weight:800;
  color:#333;   /* 검은색 */
}
.chart-period-tabs{
  display:flex;
  gap:18px;
  margin:8px 0 6px;
}

.transaction-header .label {
  font-size: 16px;
  color: #6b7280;
}
.transaction-header .avg {
  font-size: 38px;
  line-height: 1.1;
  font-weight: 800;
  color: #3b82f6;
}

/* --- 정보 표(아파트 정보 탭) --- */
.kv-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin: 16px 0;
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}
.kv-row {
    display: contents;
}
.kv-row .k {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}
.kv-row .v {
    text-align: right;
    font-weight: 600;
    color: #111827;
    font-size: 13px;
}

/* 아파트 정보 탭 제목 스타일 */
.info-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin: 20px 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #3b82f6;
    display: inline-block;
}

.info-section-title:first-child {
    margin-top: 8px;
}

/* 아파트 정보 탭 - 활성 탭과 동일한 배경 */
#tab-info {
    background: #ffffff;
}

#tab-info .kv-table {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

#tab-info .kv-table:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#tab-info .kv-row .k {
    font-weight: 600;
    color: #475569;
}

#tab-info .kv-row .v {
    color: #1e293b;
    font-weight: 700;
}





/* ========== 모바일 스타일 ========== */
#mobile-search-header {
    display: none;
    position: fixed;
    top: 74px;
    left: 0;
    right: 0;
    z-index: 999;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 10px;
}

#mobile-tab-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

.mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    font-size: 12px;
}

.mobile-tab.active {
    color: #FFC80F;
}

.mobile-tab {
    position: relative;
}

.mobile-tab svg {
    width: 24px;
    height: 24px;
}

/* 모바일 탭 알림 점 */
.mobile-tab.has-new-content::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 18px;
    width: 8px;
    height: 8px;
    background: #FFC80F;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none; /* PC에서는 숨김 */
}

/* 768px 이하 모바일 뷰 */
@media (max-width: 768px) {
    body {
        padding-top: 134px; /* 헤더 74px + 검색바 60px */
        padding-bottom: 0; /* 바텀 시트로 변경되어 하단 여백 불필요 */
        overflow-x: hidden; /* 가로 스크롤 방지 */
    }
    
    /* iOS Safari에서 100vh 문제 해결 */
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    html {
        height: -webkit-fill-available;
    }
    
    #mobile-search-header {
        display: block;
        position: fixed;
        top: 74px;
        left: 0;
        right: 0;
        z-index: 100;
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 12px 15px;
        border-bottom: 1px solid #e5e7eb;
    }
    
    #mobile-search-header .search-container {
        position: relative;
        margin: 0;
    }
    
    #mobile-tab-nav {
        display: flex;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important; /* 모바일에서는 표시 */
    }
    
    #main-container {
        height: calc(100vh - 134px); /* 헤더(74px) + 검색바(60px) */
        position: relative;
        top: 60px; /* 검색바 높이(60px)만큼 내려서 겹치지 않게 */
    }
    
    #info-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 85vh; /* 화면의 85% 높이 */
        z-index: 1000;
        background: white;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(100%); /* 기본적으로 완전히 숨김 */
        transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.35s ease;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        will-change: transform; /* GPU 가속 최적화 */
    }
    
    #info-panel.peek {
        transform: translateY(calc(100% - 120px)); /* 살짝 엿보기 (120px만 보임) */
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    }
    
    #info-panel.half {
        transform: translateY(50%); /* 반절 올라온 상태 - 마커 선택 시 */
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }
    
    #info-panel.expanded {
        transform: translateY(150px); /* 지도가 안 보이도록 150px로 조정 */
        box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.2);
    }
    
    #info-panel.hidden {
        transform: translateY(100%); /* 완전히 숨김 */
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
    
    /* PC용 바텀 시트 요소 숨김은 mobile-only 클래스로 처리 */
    
    /* 바텀 시트 콘텐츠도 PC에서는 일반 콘텐츠로 */
    .bottom-sheet-content {
        flex: 1;
        overflow-y: auto;
        padding: 0;
        min-height: 0; /* flex item이 overflow되지 않도록 */
    }

    /* 모바일에서 탭 스타일 최적화 */
    .apt-tabs {
        padding: 0 6px;
        gap: 1px;
    }

    .apt-tabs .tab-btn {
        height: 32px;
        padding: 0 10px;
        font-size: 13px;
        border-radius: 6px 6px 0 0;
    }

    .tab-content {
        margin: 0 6px 160px 6px; /* 모바일에서만 하단 마진 추가 */
        padding: 12px 8px;
        border-radius: 0 0 6px 6px;
        max-height: none; /* 모바일에서는 높이 제한 제거 */
    }

    /* 모바일에서 컨트롤 버튼 크기 조정 */
    .transaction-controls-inline {
        gap: 6px;
    }

    .transaction-type-selector {
        height: 28px;
        padding: 1px;
    }

    .transaction-type-btn {
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 3px;
    }

    .area-selector {
        font-size: 11px;
        height: 28px;
        padding: 0 6px;
        padding-right: 24px;
        background-size: 10px;
        background-position: right 6px center;
    }

/* PC에서만 명확한 높이 제한 적용 */
@media (min-width: 768px) {
    /* PC에서 tab-content 높이 제한 복원 및 마진 제거 */
    .tab-content {
        max-height: calc(100vh - 330px) !important;
        margin-bottom: 0 !important; /* PC에서는 하단 마진 제거 */
    }
}

/* 모바일에서 탭 콘텐츠 스크롤 설정 */
@media (max-width: 768px) {
    .tab-content {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* iOS 관성 스크롤 */
        min-height: 0;
        /* iOS 스크롤 바운스 효과 활성화 */
        overscroll-behavior-y: auto;
        scroll-behavior: smooth;
        /* 높이는 JavaScript에서 동적으로 설정 */
        transition: max-height 0.3s ease;
    }

    /* 바텀시트 상태별 높이 조정 (JavaScript 백업용) */
    .half .tab-content {
        max-height: none !important; /* 높이 제한 제거 */
    }

    .expanded .tab-content {
        max-height: none !important; /* 높이 제한 제거 */
    }

    .hidden .tab-content {
        max-height: 0 !important;
    }

    /* 모든 아파트 상세 탭의 스크롤 문제 해결 - 활성 탭만 표시 */
    #tab-tx.active {
        display: flex !important;
        flex-direction: column;
        flex: 1; /* height 대신 flex 사용 */
        max-height: calc(100vh - 200px); /* 최대 높이 제한 */
        overflow-y: auto; /* 실거래가 탭만 스크롤 가능 */
        overflow-x: hidden;
        min-height: 0; /* flex 항목의 최소 높이 설정 */
    }

    #tab-stats.active,
    #tab-info.active {
        display: flex !important;
        flex-direction: column;
        height: 100%;
        overflow: hidden; /* 다른 탭은 기존대로 */
    }

    /* 비활성 탭은 숨김 */
    #tab-tx,
    #tab-stats,
    #tab-info {
        display: none;
    }

    /* 차트 영역은 고정 높이 */
    #tab-tx .chart-container,
    #tab-tx .chart-summary,
    #tab-tx .transaction-header {
        flex-shrink: 0; /* 축소 방지 */
    }

    /* 실거래가 목록 영역은 나머지 공간을 모두 차지 - 스크롤은 tab-content에서 처리 */
    #tab-tx .transaction-section {
        flex: 1;
        overflow: visible;
        min-height: 0;
    }

    /* 다른 탭들의 콘텐츠 영역도 스크롤 가능하게 */
    #tab-stats > *,
    #tab-info > * {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }

    /* 지역통계와 아파트정보 탭의 스크롤 영역 */
    .stats-content,
    .info-content,
    .kv-table-container {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
        padding: 0 15px;
    }

    /* 바텀시트 내부 모든 스크롤 가능 요소에 터치 최적화 적용 */
    .bottom-sheet-content * {
        -webkit-overflow-scrolling: touch;
    }

    /* 스크롤 가능한 요소만 세로 스크롤 허용 */
    .tab-content,
    .transaction-section,
    .transaction-list-container {
        touch-action: pan-y; /* 세로 스크롤만 허용 */
    }

    /* 드래그 핸들과 헤더는 터치 액션 제한 */
    .bottom-sheet-handle,
    .bottom-sheet-header {
        touch-action: none !important;
    }
}
    
    /* PC에서 info-panel도 명확한 높이 제한 */
    #info-panel {
        height: calc(100vh - 74px) !important;
        max-height: calc(100vh - 74px) !important;
        /* overflow는 제거하여 내부 스크롤 허용 */
    }
}

/* iOS Safari 뷰포트 문제 해결 */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        /* iOS에서 동적 뷰포트 높이 사용 */
        html {
            height: -webkit-fill-available;
        }

        body {
            min-height: 100vh;
            min-height: -webkit-fill-available;
        }

        #main-container {
            height: calc(100vh - 134px);
            height: calc(-webkit-fill-available - 134px);
        }

        #info-panel {
            height: 85vh; /* iPhone에서 더 확실한 높이 설정 */
            height: calc(-webkit-fill-available * 0.85);
            max-height: 85vh;
            max-height: calc(-webkit-fill-available * 0.85);
        }

        /* 바텀시트 상태별 높이 재조정 */
        #info-panel.peek {
            height: 120px; /* 고정 높이로 변경 */
            transform: translateY(calc(100vh - 120px));
            transform: translateY(calc(-webkit-fill-available - 120px));
        }

        #info-panel.half {
            height: calc((100vh - 134px) * 0.5); /* 헤더+검색바 제외한 50% */
            transform: translateY(calc((100vh - 134px) * 0.5 + 134px)); /* 헤더+검색바 아래에서 시작 */
        }

        #info-panel.expanded {
            height: calc(100vh - 134px - 60px); /* 헤더+검색바 제외하고 여백 60px (더 많이 빼기) */
            transform: translateY(174px); /* 헤더+검색바+여백(40px) 아래부터 시작 */
        }
    }
}
    
    #map {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        display: block;
        z-index: 1;  /* 헤더보다 낮은 z-index */
    }
    
    #map.hidden {
        display: none;
    }
    
    .list-container {
        padding-top: 0;
    }
    
    /* 모바일 검색 입력창 스타일 */
    #mobile-search-header .search-container {
        margin: 0;
        order: 0;
    }
    
    #mobile-search-input {
        width: 100%;
        padding: 12px 44px 12px 16px;
        font-size: 16px;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-sizing: border-box;
        transition: all 0.2s ease;
        background: white;
    }
    
    #mobile-search-input:focus {
        outline: none;
        border-color: #FFC80F;
        box-shadow: 0 0 0 3px rgba(255, 200, 15, 0.1);
    }
    
    #mobile-search-header .search-input-icon {
        position: absolute;
        right: 22px;
        top: 50%;
        transform: translateY(-50%);
        color: #999;
        pointer-events: none;
        width: 20px;
        height: 20px;
    }
    
    #mobile-autocomplete-results {
        position: fixed;
        top: 134px; /* 헤더 + 모바일 검색바 높이 */
        left: 10px;
        right: 10px;
        max-height: calc(100vh - 190px); /* 상하단 여백 고려 */
        background: white;
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        z-index: 1001;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #mobile-autocomplete-results .autocomplete-item {
        padding: 15px 16px;
        border-bottom: 1px solid #f5f5f5;
        font-size: 14px;
    }
    
    #mobile-autocomplete-results .item-type-icon {
        margin-right: 10px;
        padding: 0 10px;
        height: 26px;
        font-size: 12px;
    }
    
    #mobile-autocomplete-results .item-name {
        font-size: 15px;
        line-height: 1.4;
    }
    
    /* 모바일용 아이템 스타일 조정 */
    .list-item {
        padding: 12px 15px;
        margin: 6px 0;
    }
    
    .item-name {
        font-size: 15px;
        line-height: 1.3;
    }
    
    .item-info {
        font-size: 13px;
        line-height: 1.4;
    }
    
    /* 모바일 터치 개선 */
    .list-item,
    .mobile-tab,
    .transaction-item,
    .autocomplete-item {
        -webkit-tap-highlight-color: rgba(255, 200, 15, 0.2);
        touch-action: manipulation;
    }
    
    /* 차트 컨테이너 높이 조정 */
    .chart-container {
        height: 180px; /* 모바일에서는 더 작게 */
    }
    
    .chart-content {
        padding: 15px 20px 20px;
    }
    
    .chart-header {
        padding: 15px 20px 12px;
    }
    
    .chart-title {
        font-size: 1rem;
    }
    
    .chart-description {
        font-size: 0.8rem;
    }
    
    /* 상세 정보 스타일 조정 */
    .detail-grid {
        grid-template-columns: 100px 1fr;
        font-size: 13px;
    }
    
    /* 거래 내역 스타일 조정 */
    /* 모바일 거래 아이템 최적화 - 카드 스타일 */
    .transaction-item {
        display: block !important; /* 그리드에서 블록으로 변경 */
        padding: 16px;
        margin: 8px 0;
        background-color: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        font-size: 14px;
        transition: all 0.2s ease;
    }
    
    .transaction-item:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border-color: #cbd5e1;
    }
    
    .transaction-item .col-date {
        font-size: 13px;
        color: #64748b;
        font-weight: 600;
        margin-bottom: 4px;
    }
    
    .transaction-item .col-area {
        font-size: 12px;
        color: #64748b;
        background-color: #f1f5f9;
        padding: 2px 6px;
        border-radius: 4px;
        display: inline-block;
        margin-bottom: 8px;
    }
    
    .transaction-item .col-info {
        margin-top: 8px;
    }
    
    .transaction-item .price {
        font-size: 12px;
        font-weight: 600;
        color: #374151;
        margin-top: 4px;
    }

    .price {
        font-size: 12px;
    }
    
    /* 모바일 거래 테이블 최적화 */
    .transaction-table {
        font-size: 10px;
        margin: 0;
    }
    
    .transaction-table th,
    .transaction-table td {
        padding: 6px 3px;
    }
    
    .th-date, .td-date {
        width: 65px;
        min-width: 65px;
        font-size: 10px;
    }
    
    .th-apt, .td-apt {
        max-width: 120px;
        font-size: 10px;
        line-height: 1.3;
        word-break: break-word;
    }
    
    .th-area, .td-area {
        width: 45px;
        font-size: 9px;
    }
    
    .th-floor, .td-floor {
        width: 20px;
        font-size: 9px;
    }
    
    .th-price, .td-price {
        width: 55px;
        font-size: 10px;
        padding-right: 3px;
    }
    
    .th-status, .td-status {
        width: 30px;
        font-size: 9px;
    }
    
    /* 모바일에서 테이블 스크롤 개선 */
    .transaction-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .transaction-table-wrapper::-webkit-scrollbar {
        height: 4px;
    }
    
    .transaction-table-wrapper::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    .transaction-table-wrapper::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 2px;
    }
    
    /* 탭 버튼 스타일 조정 */
    .tab-btn, .period-btn {
        font-size: 14px;
        padding: 8px 12px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 200, 15, 0.3);
    }
    
    /* 지도 컨트롤 버튼 모바일 최적화 */
    .map-control-btn {
        width: 44px;
        height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .map-controls {
        top: 20px;
        right: 15px;
    }
    
    /* 통계 그리드 조정 */
    .stats-grid {
        gap: 12px 20px;
        padding: 15px;
        margin: 0 10px 15px 10px;
        font-size: 13px;
    }
    
    .stats-grid div:nth-child(odd) {
        font-size: 13px;
    }
    
    .stats-grid div:nth-child(even) {
        font-size: 14px;
    }
    
    /* 아파트 정보 테이블 조정 */
    .kv-table {
        gap: 6px 10px;
        font-size: 13px;
    }
    
    /* 모바일 컨트롤 최적화 */
    .transaction-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin: 8px 0;
    }
    
    .transaction-selectors {
        display: flex;
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    
    
    /* 모바일 기간 탭 최적화 */
    .chart-period-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .period-btn {
        font-size: 12px;
        padding: 6px 10px;
        min-width: 60px;
    }
    
    /* 모바일 용 차트 컨트롤 */
    .chart-controls {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .chart-period-btn {
        font-size: 11px;
        height: 1.8rem;
        padding: 0 0.5rem;
    }
    
    /* 모바일 슬라이더 최적화 */
    .slider-container {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 8px;
        margin: 0 8px;
    }
    
    .slider-label {
        min-width: auto;
        margin-bottom: 4px;
        font-size: 13px;
    }
    
    .slider-value {
        min-width: auto;
        text-align: left;
        margin-top: 4px;
    }
    
    /* 모바일 리스트 컨테이너 최적화 */
    .list-container {
        padding: 10px 10px 0 10px; /* 상단 패딩 추가 */
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 모바일에서 스크롤바 스타일링 */
    .list-container::-webkit-scrollbar {
        width: 3px;
    }
    
    .list-container::-webkit-scrollbar-thumb {
        background: rgba(255, 200, 15, 0.6);
        border-radius: 2px;
    }
    

    .detail-section {
        margin: 0 -10px 15px -10px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .detail-section-content {
        padding: 15px 20px;
    }
}

/* 소형 화면 대응 */
@media (max-width: 520px) {
    .kv-table { 
        grid-template-columns: 1fr 1fr; 
    }
    
    /* 극소 화면에서 테이블 최적화 */
    .transaction-table {
        font-size: 9px;
    }
    
    .th-date, .td-date {
        width: 55px;
        min-width: 55px;
    }
    
    .th-apt, .td-apt {
        max-width: 100px;
        font-size: 9px;
    }
    
    .th-area, .td-area {
        width: 35px;
        font-size: 8px;
    }
    
    .th-price, .td-price {
        width: 45px;
        font-size: 9px;
    }
    
    /* 극소 화면 컨트롤 조정 */
    .transaction-type-btn {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .period-btn {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .chart-period-btn {
        font-size: 10px;
        padding: 0 0.4rem;
    }
    
    /* 극소 화면 에서 더 컴팩한 표시 */
    .stats-grid {
        padding: 12px;
        gap: 8px 15px;
        font-size: 12px;
    }
    
    .detail-section-content {
        padding: 12px 15px;
    }
    
    /* 바텀 시트 요소들은 mobile-only 클래스로 제어됨 */
    
    /* 바텀 시트 핸들 - 강제 표시 */
    .bottom-sheet-handle {
        width: 60px !important;
        height: 12px !important; /* 훨씬 더 크게 */
        background: #ff0000 !important; /* 빨간색으로 강제 표시 */
        border: 2px solid #000000 !important; /* 검은 테두리 추가 */
        border-radius: 6px !important;
        margin: 0 auto !important;
        cursor: grab !important;
        touch-action: none !important;
        transition: all 0.2s ease !important;
        position: relative !important;
        flex-shrink: 0 !important;
        display: block !important;
        z-index: 9999 !important;
        visibility: visible !important;
        opacity: 1 !important;
        box-sizing: border-box !important;
    }

    /* PC에서도 표시 */
    @media (min-width: 769px) {
        .bottom-sheet-handle {
            display: block !important;
        }
    }
    
    .bottom-sheet-handle:active {
        cursor: grabbing;
        background: #9ca3af;
        transform: scaleY(1.5);
    }
    
    .bottom-sheet-handle:hover {
        background: #9ca3af;
        width: 48px;
    }
    
    /* 터치 디바이스에서 더 큰 터치 영역 제공 */
    .bottom-sheet-handle::before {
        content: '';
        position: absolute;
        top: -20px;
        left: -40px;
        right: -40px;
        bottom: -20px;
        border-radius: 12px;
        /* 디버깅용 - 실제 터치 영역 확인 */
        /* background: rgba(255, 0, 0, 0.1); */
    }
    
    /* 바텀 시트 헤더 */
    .bottom-sheet-header {
        padding: 15px 0 0 0 !important;
        background: #ffff00 !important; /* 노란색 배경으로 헤더 위치 확인 */
        position: sticky;
        top: 0;
        z-index: 10;
        cursor: grab;
        touch-action: none;
        user-select: none;
        display: flex !important;
        justify-content: center;
        align-items: center;
        height: 48px !important; /* 고정 높이 */
        min-height: 48px !important;
        max-height: 48px !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
    }

    /* mobile-only 클래스 무시하고 강제 표시 */
    .bottom-sheet-header.mobile-only {
        display: flex !important;
    }

    .bottom-sheet-handle.mobile-only {
        display: block !important;
    }

    .bottom-sheet-header:active {
        cursor: grabbing;
    }

    .bottom-sheet-title {
        display: none; /* 제목 숨김 */
    }
    
    /* 바텀 시트 콘텐츠 - 모바일에서는 스크롤 가능하도록 수정 */
    .bottom-sheet-content {
        flex: 1;
        overflow-y: auto; /* 스크롤 가능하도록 변경 */
        overflow-x: hidden;
        padding: 0;
        display: flex;
        flex-direction: column;
        -webkit-overflow-scrolling: touch; /* iOS 터치 스크롤 최적화 */
        min-height: 0; /* flex item이 정상적으로 축소되도록 */
    }
    
    /* 모바일에서는 바텀 시트 헤더에 제목이 있으므로 콘텐츠 내 제목 숨김 */
    .apt-detail-header .apt-title {
        display: none;
    }
    
    /* 아파트 서브 정보는 헤더 아래 여백 줄이기 */
    .apt-detail-header {
        padding-top: 0;
        margin-top: -8px;
    }
    
    /* 모바일에서 초기 메시지 폰트 크기 조정 */
    .initial-message {
        font-size: 16px;
        padding: 20px;
        height: 300px;
    }
    
    .initial-message strong {
        font-size: 17px;
    }
    
    .initial-message::before {
        font-size: 36px;
        margin-bottom: 16px;
    }
    
    /* 모바일에서 탭 리스트 여백 줄이기 */
    .tabs-list {
        padding: 0 16px; /* 24px에서 16px로 줄임 */
    }
}