/* 기본 초기화 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #f4f6f8;
    color: #1a1d20;
    padding: 20px 12px;
}

/* 전체 컨테이너 */
.container {
    max-width: 500px;
    margin: 0 auto;
}

/* 헤더 영역 */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

/* 통계 기간 안내 문구 */
.stats-period-info {
    text-align: center;
    font-size: 0.82rem;
    color: #6b7280;
    margin-top: 6px;
}

.stats-period-info span {
    font-weight: 700;
    color: #2563eb;
}

/* 셀렉트 박스 */
.select-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.select-box select {
    width: 100%;
    padding: 9px 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    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='%6B7280' 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 6px center;
    background-size: 12px;
    cursor: pointer;
}

.select-box select:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* 게시판 / 요약 카드 컨테이너 */
.board-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* 테이블 헤더 (유형 / 매매 / 전세 / 월세) */
.board-header {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    padding: 12px 10px;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    align-items: center;
}

.board-header div:first-child {
    text-align: left;
    padding-left: 6px;
}

/* 데이터 행 */
.board-body {
    display: flex;
    flex-direction: column;
}

.board-row {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    padding: 4px; /* 타일 여백 확보를 위한 최소 패딩 */
    border-bottom: 1px solid #f3f4f6;
    align-items: center;
    text-align: center;
    font-size: 0.88rem;
}

.board-row:last-child {
    border-bottom: none;
}

.board-row .label {
    text-align: left;
    font-weight: 700;
    color: #111827;
    padding-left: 6px;
}

/* 타일(Tile) 스타일 영역 - 셀 전체를 버튼화 */
.clickable-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 14px 4px; /* 높이감 확보 */
    font-weight: 600;
    color: #2563eb;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Hover 시 타일 전체 하이라이트 */
.clickable-cell:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}

/* 선택된 활성 타일 (칸 전체에 옅은 파란색 채움) */
.active-cell {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    font-weight: 800 !important;
}

/* 안내 및 로딩 상태 */
.loading-spinner, .empty-msg {
    text-align: center;
    padding: 30px 0;
    font-size: 0.85rem;
    color: #6b7280;
}

/* 모바일 대응 */
@media (max-width: 480px) {
    .select-group {
        grid-template-columns: 1fr;
    }
}