/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

:root {
    --surface-radius-lg: 20px;
    --surface-radius-md: 16px;
    --surface-radius-sm: 14px;
    --surface-padding-lg: 24px;
    --surface-padding-md: 18px;
    --surface-shadow: 0 12px 32px rgba(17, 24, 39, 0.09);
    --surface-shadow-soft: 0 8px 22px rgba(17, 24, 39, 0.07);
    --surface-border: 1px solid rgba(102, 126, 234, 0.08);
    --inner-surface: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 24px 20px 18px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.header-left {
    text-align: left;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: #2c3e50;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: 500;
    line-height: 1.45;
}

/* 공유 버튼 */
.share-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 22px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.share-icon {
    font-size: 1.2rem;
}

.favorite-btn {
    background: #ffffff;
    color: #596579;
    border: 1px solid rgba(102, 126, 234, 0.24);
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    white-space: nowrap;
}

.favorite-btn.icon-only {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 14px;
}

.favorite-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.38);
    box-shadow: 0 10px 24px rgba(102, 126, 234, 0.16);
}

.favorite-icon {
    color: #f4b100;
    font-size: 0.95rem;
    line-height: 1;
}

.favorite-btn.icon-only .favorite-icon {
    font-size: 1.1rem;
}

.favorite-text {
    line-height: 1;
}

.toast-message {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(12px);
    min-width: 220px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(28, 37, 56, 0.94);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.5;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 9999;
    text-align: center;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-message.toast-error {
    background: rgba(167, 36, 47, 0.96);
}

/* 네비게이션 */
.main-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 14px;
}

.nav-link {
    padding: 10px 24px;
    background: #f8f9fa;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* 메인 컨텐츠 */
main {
    padding-bottom: 60px;
}

/* 상단 섹션 - 통계(왼쪽 2/3) + 기록하기(오른쪽 1/3) */
.top-section {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 왼쪽 2/3, 오른쪽 1/3 */
    gap: 20px;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 700;
}

.stats-summary-wrapper {
    background: white;
    padding: var(--surface-padding-md);
    border-radius: var(--surface-radius-lg);
    box-shadow: var(--surface-shadow);
    border: var(--surface-border);
}

.sidebar-panel-header {
    display: flex;
    align-items: center;
    min-height: 58px;
}

.sidebar-panel-header h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    border-left: 5px solid #667eea;
    padding-left: 15px;
    margin: 0;
}

/* 통계 요약 */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: var(--inner-surface);
    padding: 16px 14px;
    border-radius: var(--surface-radius-md);
    text-align: center;
    transition: transform 0.2s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #667eea;
}

.stat-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card h3 {
    font-size: 0.8rem;
    margin-bottom: 8px;
    opacity: 0.85;
    font-weight: 600;
}

.stat-card.highlight h3 {
    color: white;
}

.stat-number {
    font-size: 2rem;
    font-weight: 900;
    margin: 6px 0;
    color: #667eea;
    line-height: 1;
}

.stat-card.highlight .stat-number {
    color: white;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
}

/* 기록 섹션 */
.record-section {
    background: white;
    padding: var(--surface-padding-lg);
    border-radius: var(--surface-radius-lg);
    box-shadow: var(--surface-shadow);
    border: var(--surface-border);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.record-title {
    font-size: clamp(1.15rem, 1.8vw, 1.75rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

.extra-time-emphasis {
    margin: -2px 0 14px;
    padding: 12px 14px;
    border-radius: var(--surface-radius-md);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1px solid rgba(102, 126, 234, 0.16);
    color: #4b5a70;
    font-size: 0.86rem;
    line-height: 1.6;
}

.extra-time-emphasis strong {
    color: #2f3f58;
}

.form-group {
    margin-bottom: 12px;
}

#recordForm {
    flex: 1 1 auto;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
    font-size: 0.85rem;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Noto Sans KR', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 3px;
    color: #7f8c8d;
    font-size: 0.75rem;
    line-height: 1.3;
}

.optional-fields {
    margin: 4px 0 14px;
    border: 1px solid rgba(102, 126, 234, 0.14);
    border-radius: var(--surface-radius-md);
    background: rgba(248, 250, 252, 0.9);
    overflow: hidden;
}

.optional-summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #42526b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.optional-summary::-webkit-details-marker {
    display: none;
}

.optional-summary::after {
    content: "＋";
    font-size: 1rem;
    color: #667eea;
}

.optional-fields[open] .optional-summary::after {
    content: "－";
}

.optional-fields-body {
    padding: 0 14px 14px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.school-type-group.is-hidden {
    display: none;
}

/* 시간 빠른 선택 */
.time-quick-select {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.time-btn {
    padding: 10px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Noto Sans KR', sans-serif;
    color: #2c3e50;
}

.time-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.time-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.time-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    white-space: nowrap;
}

.time-input-wrapper input {
    flex: 1;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Noto Sans KR', sans-serif;
    margin-top: 5px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
    font-size: 0.9rem;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.setup-notice {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #eef4ff;
    border: 1px solid #c7d8ff;
    color: #284b8f;
    line-height: 1.6;
    font-size: 0.95rem;
}

.setup-notice[hidden] {
    display: none;
}

/* 안내 박스 */
.notice-box {
    margin-top: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fff3cd 0%, #fff8e1 100%);
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notice-icon {
    font-size: 1.2rem;
    margin: 0;
    line-height: 1;
}

.notice-text {
    margin: 0;
    font-size: 0.85rem;
    color: #856404;
    line-height: 1.5;
}

.notice-text strong {
    font-weight: 700;
    color: #533f03;
}

/* 지도 섹션 */
.map-section {
    margin-bottom: 40px;
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 24px;
    align-items: stretch;
}

.card-title {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 18px;
}

.map-card {
    background: white;
    padding: var(--surface-padding-lg);
    border-radius: var(--surface-radius-lg);
    box-shadow: var(--surface-shadow);
    border: var(--surface-border);
    min-width: 0;
    height: 100%;
}

.map-canvas-panel {
    background: linear-gradient(180deg, #eef3fb 0%, #e3ebf7 100%);
    padding: 18px;
    border-radius: var(--surface-radius-lg);
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.08);
    min-width: 0;
}

.map-sidebar {
    display: grid;
    grid-template-rows: auto auto;
    gap: 20px;
    min-width: 0;
    align-content: start;
}

.map-sidebar .stats-summary {
    grid-template-columns: 1fr;
    gap: 8px;
}

.map-sidebar .stat-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "label value"
        "label unit";
    align-items: center;
    gap: 2px 12px;
    padding: 12px 14px;
    min-height: 76px;
    text-align: left;
}

.map-sidebar .stat-number {
    grid-area: value;
    font-size: 1.7rem;
    margin: 0;
    justify-self: end;
}

.map-sidebar .stat-card h3 {
    grid-area: label;
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.35;
}

.map-sidebar .stat-label {
    grid-area: unit;
    font-size: 0.76rem;
    justify-self: end;
    margin: 0;
}

.map-sidebar .stats-summary-wrapper {
    padding: var(--surface-padding-md);
}

.map-sidebar .card-title {
    margin-bottom: 12px;
}

.participant-trend-block {
    margin-top: 14px;
    padding: 14px 14px 12px;
    border-radius: var(--surface-radius-md);
    background: var(--inner-surface);
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.participant-trend-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.participant-trend-header h3 {
    margin: 0;
    font-size: 0.92rem;
    color: #2c3e50;
    font-weight: 700;
}

.participant-trend-header span {
    font-size: 0.74rem;
    color: #7b8794;
}

.participant-trend-canvas {
    height: 150px;
}

.participant-trend-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

#koreaMap {
    width: 100%;
    max-width: none;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    background: #f0f4f8;
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.region {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.region:hover {
    transform: translateY(-2px);
}

.region rect {
    transition: all 0.2s ease;
    fill: rgba(255, 255, 255, 0.98);
    stroke: rgba(102, 126, 234, 0.3);
    stroke-width: 1;
}

.region:hover rect {
    fill: rgba(255, 255, 255, 1);
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
    stroke: rgba(102, 126, 234, 0.6);
    stroke-width: 2;
}

.region text {
    fill: #2c3e50;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
}

.region .region-name {
    font-weight: 700;
    fill: #1a1a1a;
    font-size: 13px;
}

.region .region-value {
    fill: #667eea;
    font-weight: 700;
    font-size: 14px;
}

/* 레벨별 색상 (카드 배경) */
.region.level-1 rect {
    fill: rgba(255, 255, 255, 0.98);
}

.region.level-2 rect {
    fill: rgba(232, 245, 233, 0.98);
}

.region.level-3 rect {
    fill: rgba(197, 225, 165, 0.98);
}

.region.level-4 rect {
    fill: rgba(129, 199, 132, 0.98);
}

.region.level-4 .region-name,
.region.level-4 .region-value {
    fill: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.map-legend {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    min-width: 200px;
}

.map-legend h4 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid #ddd;
}

/* 차트 섹션 */
.chart-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.chart-section h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #2c3e50;
    border-left: 5px solid #667eea;
    padding-left: 15px;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.chart-box {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
}

.chart-box h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.2rem;
    text-align: center;
}

/* 최근 기록 */
.recent-records {
    background: white;
    padding: var(--surface-padding-lg);
    border-radius: var(--surface-radius-lg);
    box-shadow: var(--surface-shadow);
    border: var(--surface-border);
    margin-bottom: 25px;
}

.recent-records .card-title {
    margin-bottom: 15px;
}

.records-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.records-list::-webkit-scrollbar {
    width: 6px;
}

.records-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.records-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.records-list::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.record-item {
    background: var(--inner-surface);
    padding: 8px 12px;
    border-radius: var(--surface-radius-sm);
    border-left: 3px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.record-item:hover {
    transform: translateX(2px);
    background: #edf2f9;
}

.record-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-info .province {
    font-weight: 700;
    color: #667eea;
    font-size: 0.75rem;
    min-width: 50px;
}

.record-info .details {
    color: #7f8c8d;
    font-size: 0.7rem;
}

.record-time {
    font-size: 0.85rem;
    font-weight: 900;
    color: #f5576c;
    white-space: nowrap;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    padding: 40px;
    font-size: 1.1rem;
}

/* 푸터 */
footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 20px;
    text-align: center;
    margin-top: 60px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

footer p {
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 500;
}

.footer-note {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* 반응형 디자인 */
@media (min-width: 1181px) {
    .record-section {
        padding: 20px;
    }

    .record-section .card-title {
        margin-bottom: 14px;
    }

    .extra-time-emphasis {
        margin-bottom: 12px;
        padding: 10px 12px;
        font-size: 0.82rem;
    }

    .record-section .form-group {
        margin-bottom: 10px;
    }

    .record-section .form-group label {
        margin-bottom: 4px;
    }

    .record-section .form-group select,
    .record-section .form-group input {
        padding: 9px 12px;
    }

    .time-quick-select {
        margin-bottom: 8px;
    }

    .notice-box {
        margin-top: 12px;
        padding: 10px 12px;
    }
}

@media (max-width: 1180px) {
    .map-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .map-sidebar {
        order: -1;
    }

    .map-sidebar .stats-summary {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 1024px) {
    .records-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header {
        padding: 18px 15px 14px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-left {
        text-align: center;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .share-btn {
        justify-content: center;
        padding: 10px 16px;
    }

    .favorite-btn {
        justify-content: center;
        padding: 8px 12px;
    }

    .favorite-btn.icon-only {
        width: 40px;
        height: 40px;
        padding: 0;
    }

    .toast-message {
        bottom: 18px;
        max-width: calc(100vw - 24px);
        font-size: 0.88rem;
        padding: 11px 14px;
    }

    .container {
        padding: 0 15px;
    }

    .stats-summary-wrapper,
    .record-section,
    .map-card {
        padding: 15px;
    }

    .map-canvas-panel {
        padding: 12px;
        border-radius: 18px;
    }

    .map-sidebar .stats-summary {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .participant-trend-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .participant-trend-canvas {
        height: 170px;
    }

    .stat-card {
        padding: 10px 12px;
    }

    .stat-number {
        font-size: 1.55rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .recent-records {
        padding: 15px;
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 14px;
    }

    .stats-summary-wrapper {
        padding: 13px;
    }

    .map-sidebar .stat-card {
        min-height: 68px;
        padding: 10px 12px;
        gap: 1px 10px;
    }

    .map-sidebar .stat-card h3 {
        font-size: 0.82rem;
    }

    .map-sidebar .stat-number {
        font-size: 1.45rem;
    }

    .map-sidebar .stat-label {
        font-size: 0.72rem;
    }

    .records-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .record-item {
        padding: 6px 8px;
    }

    .record-info {
        gap: 6px;
    }

    .record-info .province {
        font-size: 0.7rem;
        min-width: 40px;
    }

    .record-info .details {
        font-size: 0.6rem;
    }

    .record-time {
        font-size: 0.7rem;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .form-group label {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .form-group select,
    .form-group input {
        padding: 12px;
        font-size: 16px; /* iOS 자동 줌 방지 */
    }

    .form-group small {
        font-size: 0.7rem;
    }

    .submit-btn {
        padding: 14px;
        font-size: 0.95rem;
        margin-top: 8px;
    }

    .message {
        padding: 8px;
        font-size: 0.85rem;
    }

    .notice-box {
        padding: 10px 12px;
        margin-top: 12px;
    }

    .notice-icon {
        font-size: 1rem;
    }

    .notice-text {
        font-size: 0.75rem;
    }

    .time-quick-select {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .time-btn {
        padding: 12px;
        font-size: 0.85rem;
    }

    .input-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.82rem;
    }

    .main-nav {
        flex-direction: row;
        gap: 6px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .stat-card h3 {
        font-size: 0.75rem;
    }

    .records-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    .record-item {
        padding: 5px 6px;
    }

    .record-info {
        gap: 5px;
    }

    .record-info .province {
        font-size: 0.65rem;
        min-width: 35px;
    }

    .record-info .details {
        font-size: 0.55rem;
    }

    .record-time {
        font-size: 0.65rem;
    }

    .map-layout {
        gap: 14px;
    }

    .map-card,
    .record-section,
    .stats-summary-wrapper {
        border-radius: 18px;
    }
}

/* ============================================ */
/* 통계 페이지 전용 스타일 */
/* ============================================ */

/* 시각화 모드 선택 - 컴팩트 버전 */
.visualization-mode-compact {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.mode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.mode-header h2 {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 700;
    margin: 0;
}

.mode-selector-compact {
    display: flex;
    gap: 10px;
}

.mode-btn-compact {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Noto Sans KR', sans-serif;
    color: #2c3e50;
}

.mode-btn-compact:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.mode-btn-compact.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* 지도 통계 섹션 */
.map-stats-section {
    background: white;
    padding: var(--surface-padding-lg);
    border-radius: var(--surface-radius-lg);
    box-shadow: var(--surface-shadow);
    border: var(--surface-border);
    margin-bottom: 25px;
}

.map-stats-section h2 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 700;
}

.map-stats-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

.map-wrapper {
    background: linear-gradient(180deg, #eef3fb 0%, #e3ebf7 100%);
    padding: 18px;
    border-radius: 24px;
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.08);
    min-width: 0;
}

#koreaStatsMap {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    background: #f0f4f8;
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.stats-region {
    cursor: pointer;
    transition: all 0.2s ease;
}

.stats-region rect {
    transition: all 0.2s ease;
    fill: rgba(255, 255, 255, 0.98);
    stroke: rgba(102, 126, 234, 0.3);
    stroke-width: 1;
}

.stats-region:hover {
    transform: translateY(-2px);
}

.stats-region:hover rect {
    fill: rgba(255, 255, 255, 1);
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
    stroke: rgba(102, 126, 234, 0.6);
    stroke-width: 2;
}

.stats-region text {
    pointer-events: none;
}

.stats-region .region-name {
    fill: #1a1a1a;
    font-size: 13px;
    font-weight: 700;
}

.stats-region .region-value {
    fill: #667eea;
    font-size: 14px;
    font-weight: 700;
}

.stats-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-mode-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: -4px;
}

.info-box {
    background: var(--inner-surface);
    padding: 18px;
    border-radius: var(--surface-radius-md);
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.mode-selector-inline {
    gap: 8px;
}

.mode-btn-icon {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 14px;
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.info-box h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 700;
}

.info-box p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box ul li {
    padding: 8px 0;
    color: #555;
    line-height: 1.5;
}

.analysis-note {
    margin-top: 10px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #6b7280;
}

.calculation-details {
    background: linear-gradient(135deg, #f093fb10 0%, #f5576c10 100%);
    border: 2px solid #f093fb;
}

.calculation-details .fuel-note {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 8px;
    font-style: italic;
}

.ranking-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.09) 100%);
    border: 1px solid rgba(102, 126, 234, 0.22);
    border-radius: var(--surface-radius-md);
}

.ranking-box ol {
    padding-left: 20px;
    margin-top: 10px;
}

.ranking-box li {
    padding: 8px 0;
    color: #2c3e50;
    font-weight: 500;
}

.ranking-box li.no-data {
    list-style: none;
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
}

/* 통계 근거 링크 섹션 */
.methodology-link-section {
    margin: 60px 0 40px;
}

.methodology-link-box {
    background: white;
    border: 1px solid rgba(102, 126, 234, 0.16);
    border-radius: var(--surface-radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--surface-shadow-soft);
}

.methodology-link-box h3 {
    font-size: 1.5rem;
    color: #3b4a66;
    margin-bottom: 15px;
}

.methodology-link-box p {
    font-size: 1rem;
    color: #5b6677;
    margin-bottom: 25px;
    line-height: 1.75;
}

.methodology-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.methodology-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.methodology-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

.methodology-btn.secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: none;
}

.methodology-btn.secondary:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.16);
}

.deep-dive-intro {
    background: var(--inner-surface);
    border-radius: var(--surface-radius-md);
    padding: 18px 20px;
    margin-bottom: 18px;
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.deep-dive-intro h2 {
    font-size: 1.15rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.deep-dive-intro p {
    color: #55606f;
    line-height: 1.7;
    margin: 0;
}

.education-sample-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.education-sample-card {
    background: #ffffff;
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: var(--surface-radius-md);
    padding: 14px 16px;
    display: grid;
    gap: 6px;
}

.education-sample-label {
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 700;
}

.education-sample-value {
    color: #23364d;
    font-size: 1.35rem;
    line-height: 1.1;
}

.education-sample-stage {
    color: #667eea;
}

.education-sample-sub {
    color: #55606f;
    font-size: 0.86rem;
    line-height: 1.55;
}

.education-sample-guide {
    margin-top: 12px;
    color: #5b6677;
    font-size: 0.88rem;
    line-height: 1.65;
}

.education-sample-visual {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: var(--surface-radius-md);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(102, 126, 234, 0.12);
}

.education-sample-visual.compact {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.68);
}

.education-sample-visual-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.education-sample-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1;
    border: 1px solid transparent;
}

.education-sample-progress-text {
    flex: 1 1 220px;
    text-align: right;
    color: #5b6677;
    font-size: 0.82rem;
    line-height: 1.5;
}

.education-sample-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    overflow: hidden;
}

.education-sample-progress.compact {
    height: 9px;
}

.education-sample-progress-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.35s ease;
    background: #cbd5e1;
}

.education-sample-thresholds {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
    color: #7b8794;
    font-size: 0.74rem;
    font-weight: 700;
}

.education-sample-thresholds span:nth-child(2) {
    text-align: center;
}

.education-sample-thresholds span:last-child {
    text-align: right;
}

.education-sample-badge.stage-none {
    background: #eef2f7;
    color: #5b6677;
    border-color: rgba(148, 163, 184, 0.24);
}

.education-sample-badge.stage-signal {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.24);
}

.education-sample-badge.stage-draft {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.22);
}

.education-sample-badge.stage-public {
    background: rgba(102, 126, 234, 0.12);
    color: #5b5fe8;
    border-color: rgba(102, 126, 234, 0.24);
}

.education-sample-badge.stage-strong {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.24);
}

.education-sample-progress-fill.stage-none {
    background: #cbd5e1;
}

.education-sample-progress-fill.stage-signal {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
}

.education-sample-progress-fill.stage-draft {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.education-sample-progress-fill.stage-public {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.education-sample-progress-fill.stage-strong {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.education-sample-stage.stage-none {
    color: #5b6677;
}

.education-sample-stage.stage-signal {
    color: #b45309;
}

.education-sample-stage.stage-draft {
    color: #1d4ed8;
}

.education-sample-stage.stage-public {
    color: #667eea;
}

.education-sample-stage.stage-strong {
    color: #047857;
}

.sample-note {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--surface-radius-sm);
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.18);
    color: #44506a;
    font-size: 0.88rem;
    line-height: 1.6;
}

.sample-note::before {
    content: "ℹ️";
    margin-right: 8px;
}

/* 전체 통계 - 컴팩트 버전 */
.total-stats-compact {
    background: white;
    padding: var(--surface-padding-lg);
    border-radius: var(--surface-radius-lg);
    box-shadow: var(--surface-shadow);
    border: var(--surface-border);
    margin-bottom: 25px;
}

.total-stats-grid-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.total-stat-compact {
    background: var(--inner-surface);
    padding: 15px;
    border-radius: var(--surface-radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon-compact {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-label-compact {
    color: #7f8c8d;
    font-size: 0.75rem;
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value-compact {
    font-size: 1.2rem;
    font-weight: 900;
    color: #2c3e50;
}

.weekly-summary-section {
    background: white;
    padding: var(--surface-padding-lg);
    border-radius: var(--surface-radius-lg);
    box-shadow: var(--surface-shadow);
    border: var(--surface-border);
    margin-bottom: 25px;
}

.weekly-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.weekly-summary-header h2 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: #2c3e50;
}

.weekly-summary-header p {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
    font-size: 0.9rem;
}

.weekly-summary-btn {
    border: none;
    border-radius: 999px;
    padding: 11px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(102, 126, 234, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.weekly-summary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.26);
}

.weekly-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.weekly-summary-card {
    background: var(--inner-surface);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: var(--surface-radius-md);
    padding: 16px;
    display: grid;
    gap: 7px;
}

.weekly-summary-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.weekly-summary-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #6b7280;
}

.weekly-summary-card.highlight .weekly-summary-label,
.weekly-summary-card.highlight .weekly-summary-sub,
.weekly-summary-card.highlight strong {
    color: white;
}

.weekly-summary-card strong {
    font-size: 1.45rem;
    line-height: 1.1;
    color: #243447;
}

.weekly-summary-sub {
    font-size: 0.8rem;
    color: #667085;
}

.weekly-summary-foot {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 14px;
    margin-top: 14px;
}

.weekly-summary-box {
    background: var(--inner-surface);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: var(--surface-radius-md);
    padding: 16px;
}

.weekly-summary-box h3 {
    margin: 0 0 10px;
    font-size: 0.96rem;
    color: #2c3e50;
}

.weekly-summary-box ol,
.weekly-summary-box p {
    margin: 0;
    color: #55606f;
    line-height: 1.7;
    font-size: 0.88rem;
}

.weekly-summary-box ol {
    padding-left: 18px;
}

.weekly-summary-box li + li {
    margin-top: 6px;
}

/* 차트 섹션 */
.charts-section {
    background: white;
    padding: var(--surface-padding-lg);
    border-radius: var(--surface-radius-lg);
    box-shadow: var(--surface-shadow);
    border: var(--surface-border);
    margin-bottom: 25px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.chart-header h2 {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 700;
    margin: 0;
}

.chart-tabs {
    display: flex;
    gap: 8px;
}

.chart-tab {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Noto Sans KR', sans-serif;
    color: #2c3e50;
    white-space: nowrap;
}

.chart-tab:hover {
    background: #e9ecef;
}

.chart-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.chart-container {
    position: relative;
    background: var(--inner-surface);
    padding: 20px;
    border-radius: var(--surface-radius-md);
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.chart-canvas {
    position: relative;
    width: 100%;
}

.chart-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-canvas-compact {
    height: 300px;
    max-height: 300px;
}

.chart-canvas-medium {
    height: 260px;
    max-height: 260px;
}

.chart-canvas-short {
    height: 240px;
    max-height: 240px;
}

.chart-panel {
    display: none;
}

.chart-panel.active {
    display: block;
}

/* 교차분석 컨트롤 */
.cross-analysis-controls {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.cross-analysis-controls label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
}

.cross-analysis-controls select {
    margin-left: 8px;
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Noto Sans KR', sans-serif;
}

/* 환산비교 그리드 */
.convert-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.convert-item {
    background: var(--inner-surface);
    padding: 20px;
    border-radius: var(--surface-radius-md);
    text-align: center;
    transition: transform 0.2s ease;
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.convert-item:hover {
    transform: translateY(-3px);
}

.convert-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.convert-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 8px;
    font-weight: 600;
}

.convert-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: #2c3e50;
    margin-bottom: 5px;
}

.convert-desc {
    font-size: 0.75rem;
    color: #95a5a6;
}

/* 1인당 통계 */
.per-person-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.distribution-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 16px;
}

.distribution-chip {
    background: var(--inner-surface);
    border: 1px solid rgba(102, 126, 234, 0.08);
    border-radius: var(--surface-radius-md);
    padding: 14px 16px;
}

.distribution-label {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 6px;
    font-weight: 600;
}

.distribution-chip strong {
    font-size: 1rem;
    color: #2c3e50;
}

.per-person-card {
    background: var(--inner-surface);
    padding: 20px;
    border-radius: var(--surface-radius-md);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.per-person-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.per-person-icon {
    font-size: 2.5rem;
}

.per-person-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 8px;
    font-weight: 600;
}

.per-person-card.highlight .per-person-label {
    color: rgba(255, 255, 255, 0.9);
}

.per-person-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: #2c3e50;
}

.per-person-card.highlight .per-person-value {
    color: white;
}

.per-person-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.per-person-chart-box {
    background: white;
    padding: 20px;
    border-radius: var(--surface-radius-md);
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.per-person-chart-box h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1rem;
    text-align: center;
}

/* 효과 예측 페이지 */
.effect-page {
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}

.effect-hero {
    background: white;
    padding: 28px;
    border-radius: var(--surface-radius-lg);
    box-shadow: var(--surface-shadow);
    border: var(--surface-border);
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
    gap: 24px;
    align-items: stretch;
}

.effect-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.12);
    color: #5a67d8;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.effect-hero-copy h2 {
    margin: 0 0 12px;
    font-size: 1.9rem;
    line-height: 1.25;
    color: #23364d;
}

.effect-hero-copy p {
    margin: 0;
    color: #5b6677;
    line-height: 1.75;
}

.effect-highlight-stack {
    display: grid;
    gap: 14px;
}

.effect-highlight-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--surface-radius-md);
    padding: 22px;
    display: grid;
    gap: 10px;
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.22);
}

.effect-highlight-card.secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    color: #2c3e50;
    box-shadow: none;
    border: 1px solid rgba(102, 126, 234, 0.12);
}

.effect-highlight-label {
    font-size: 0.82rem;
    font-weight: 700;
    opacity: 0.9;
}

.effect-highlight-value {
    font-size: 2.25rem;
    line-height: 1;
    font-weight: 900;
}

.effect-highlight-desc {
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0;
}

.effect-section {
    background: white;
    padding: 24px;
    border-radius: var(--surface-radius-lg);
    box-shadow: var(--surface-shadow);
    border: var(--surface-border);
}

.effect-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}

.effect-section-header h3 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    color: #23364d;
}

.effect-section-header p {
    margin: 0;
    color: #6b7280;
    line-height: 1.65;
    font-size: 0.92rem;
    max-width: 720px;
}

.effect-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.effect-metric-card {
    background: var(--inner-surface);
    border: 1px solid rgba(102, 126, 234, 0.12);
    border-radius: var(--surface-radius-md);
    padding: 18px;
    display: grid;
    gap: 8px;
}

.effect-metric-card strong {
    font-size: 1.5rem;
    line-height: 1.1;
    color: #243447;
}

.effect-metric-label {
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 700;
}

.effect-metric-sub {
    color: #5b6677;
    font-size: 0.88rem;
    line-height: 1.55;
}

.effect-dual-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 24px;
}

.effect-scenario-list {
    display: grid;
    gap: 14px;
}

.effect-scenario-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.1fr) minmax(140px, 0.7fr);
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border-radius: var(--surface-radius-md);
    background: var(--inner-surface);
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.effect-scenario-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #23364d;
    margin-bottom: 4px;
}

.effect-scenario-subtitle {
    color: #6b7280;
    font-size: 0.86rem;
    line-height: 1.5;
}

.effect-scenario-bar {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.14);
    overflow: hidden;
    position: relative;
}

.effect-scenario-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.effect-scenario-stats {
    display: grid;
    gap: 4px;
    text-align: right;
}

.effect-scenario-stats strong {
    font-size: 1.25rem;
    color: #23364d;
}

.effect-scenario-stats span {
    color: #6b7280;
    font-size: 0.84rem;
}

.effect-formula {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: var(--surface-radius-md);
    background: var(--inner-surface);
    border: 1px solid rgba(102, 126, 234, 0.14);
}

.effect-formula strong {
    display: block;
    margin-bottom: 8px;
    color: #23364d;
}

.effect-formula p,
.effect-formula li {
    color: #55606f;
    line-height: 1.65;
    font-size: 0.9rem;
}

.effect-formula ul {
    margin: 10px 0 0;
    padding-left: 18px;
}

.effect-status {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: var(--surface-radius-md);
    background: var(--inner-surface);
    color: #5b6677;
    font-size: 0.9rem;
    line-height: 1.65;
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.effect-sample-title {
    display: block;
    margin-bottom: 8px;
    color: #23364d;
    font-size: 0.95rem;
}

.education-sample-status p {
    margin: 0;
}

.education-sample-status p + p {
    margin-top: 8px;
}

.education-sample-status .education-sample-progress-text {
    text-align: left;
}

.effect-points {
    margin: 0;
    padding-left: 20px;
    color: #4b5563;
    line-height: 1.75;
}

.effect-points li + li {
    margin-top: 8px;
}

.effect-source-list {
    margin: 0;
    padding-left: 20px;
    color: #4b5563;
    line-height: 1.8;
}

.effect-source-list a {
    color: #5a67d8;
    word-break: break-word;
}

.effect-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 14px;
    overflow: hidden;
    background: #f8fafc;
}

.effect-table th,
.effect-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    text-align: left;
    font-size: 0.92rem;
}

.effect-table th {
    background: rgba(102, 126, 234, 0.08);
    color: #23364d;
    font-weight: 700;
}

.effect-table td {
    color: #4b5563;
}

.effect-table tr:last-child td {
    border-bottom: none;
}

/* 통계 페이지 반응형 */
@media (max-width: 1024px) {
    .map-stats-container {
        grid-template-columns: 1fr;
    }

    .stats-info {
        max-width: 700px;
        margin: 0 auto;
    }

    .info-mode-row {
        justify-content: flex-start;
    }

    .effect-hero,
    .effect-dual-grid {
        grid-template-columns: 1fr;
    }

    .effect-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .effect-scenario-row {
        grid-template-columns: 1fr;
    }

    .effect-scenario-stats {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .map-stats-section,
    .total-stats-compact,
    .charts-section {
        padding: 15px;
    }

    .mode-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .mode-selector-compact {
        width: 100%;
        justify-content: flex-start;
    }

    .mode-btn-compact {
        flex: 1;
        padding: 12px;
    }

    .mode-selector-inline {
        width: auto;
    }

    .mode-btn-icon {
        flex: 0 0 auto;
        width: 46px;
        height: 46px;
        padding: 0;
        font-size: 1.2rem;
    }

    .map-wrapper {
        padding: 12px;
        border-radius: 18px;
    }

    .total-stats-grid-compact {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .weekly-summary-header {
        flex-direction: column;
    }

    .weekly-summary-btn {
        width: 100%;
    }

    .weekly-summary-grid,
    .weekly-summary-foot {
        grid-template-columns: 1fr;
    }

    .stat-value-compact {
        font-size: 1.1rem;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .chart-tabs {
        width: 100%;
        flex-wrap: wrap;
    }

    .chart-tab {
        flex: 1;
        min-width: calc(50% - 4px);
        font-size: 0.8rem;
        padding: 10px 12px;
    }

    .chart-container {
        padding: 15px;
    }

    .chart-canvas-compact {
        height: 260px;
        max-height: 260px;
    }

    .chart-canvas-medium {
        height: 220px;
        max-height: 220px;
    }

    .chart-canvas-short {
        height: 200px;
        max-height: 200px;
    }

    .convert-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .convert-item {
        padding: 15px;
    }

    .convert-icon {
        font-size: 2rem;
    }

    .convert-value {
        font-size: 1.3rem;
    }

    .cross-analysis-controls {
        padding: 10px;
    }

    .cross-analysis-controls select {
        display: block;
        margin-top: 8px;
        width: 100%;
    }

    .per-person-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .distribution-summary {
        grid-template-columns: 1fr;
    }

    .per-person-card {
        padding: 15px;
    }

    .per-person-icon {
        font-size: 2rem;
    }

    .per-person-value {
        font-size: 1.4rem;
    }

    .per-person-charts {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .per-person-chart-box {
        padding: 15px;
    }

    .methodology-actions {
        flex-direction: column;
    }

    .methodology-btn {
        width: 100%;
        text-align: center;
    }

    .sample-note {
        font-size: 0.84rem;
    }

    .education-sample-grid {
        grid-template-columns: 1fr;
    }

    .education-sample-guide {
        font-size: 0.84rem;
    }

    .education-sample-visual-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .education-sample-progress-text {
        text-align: left;
        font-size: 0.8rem;
    }

    .education-sample-thresholds {
        font-size: 0.7rem;
    }

    .effect-page {
        gap: 18px;
    }

    .effect-hero,
    .effect-section {
        padding: 18px;
        border-radius: 14px;
    }

    .effect-hero-copy h2 {
        font-size: 1.45rem;
    }

    .effect-metric-grid {
        grid-template-columns: 1fr;
    }

    .effect-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .effect-scenario-row {
        padding: 14px;
    }

    .effect-highlight-value {
        font-size: 1.9rem;
    }

    .effect-table {
        display: block;
        overflow-x: auto;
    }
}
