/* GIS Cantonal Statistics - SwissCarInfo */

/* Scroll overflow indicator (generic) */
.gis-scroll-hint { position: relative; }
.gis-scroll-hint::after {
    content: '\203A';
    position: absolute; right: 0; top: 0; bottom: 0;
    width: 40px; display: none; align-items: center; justify-content: center;
    background: linear-gradient(to right, rgba(255,255,255,0), #fff 50%);
    color: #3b82f6; font-size: 1.4rem; font-weight: 700;
    pointer-events: none; z-index: 2;
    transition: opacity 0.2s;
}
.gis-scroll-hint.has-overflow::after { display: flex; }
.gis-scroll-hint.scrolled-end::after { opacity: 0; }

/* Tabs wrapper */
.gis-tabs-scroll { margin-bottom: 20px; }

/* Tabs */
.gis-tabs { display: flex; gap: 8px; justify-content: flex-end; }
.gis-tab {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 20px; border-radius: 10px; cursor: pointer;
    font-size: 0.95rem; font-weight: 700; border: 2px solid #e2e8f0;
    background: #f8fafc; color: #64748b; transition: all 0.2s;
    text-decoration: none;
}
.gis-tab:hover { border-color: #cbd5e1; background: #fff; color: #475569; }
.gis-tab.active {
    background: linear-gradient(135deg, #eff6ff, #fff);
    border-color: #3b82f6; color: #1e40af;
    box-shadow: 0 2px 8px rgba(59,130,246,0.15);
}
.gis-tab i { font-size: 1.1rem; }

/* Filter bar */
.gis-filters {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    padding: 14px 18px; background: #f8fafc; border-radius: 12px;
    border: 1px solid #e2e8f0; margin-bottom: 16px;
}
.gis-filter-group { display: flex; flex-direction: column; gap: 2px; flex: 1 1 130px; min-width: 130px; }
.gis-filter-group label { font-size: 0.72rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.gis-filter-group select {
    padding: 6px 28px 6px 10px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 0.85rem; background: #fff; color: #334155;
    appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center; cursor: pointer;
    width: 100%;
}
.gis-filter-group select:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.gis-filter-group select.gis-filter-active { border-color: #3b82f6; background-color: #eff6ff; font-weight: 600; }
.gis-active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 12px; }
.gis-active-filter-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; background: #dbeafe; color: #1d4ed8; border-radius: 20px; font-size: 0.78rem; font-weight: 500; white-space: nowrap; }
.gis-active-filter-tag .tag-remove { cursor: pointer; font-size: 1.1rem; line-height: 1; opacity: 0.6; margin-left: 2px; }
.gis-active-filter-tag .tag-remove:hover { opacity: 1; }

/* Metric selector */
.gis-metrics { display: flex; gap: 4px; flex-wrap: wrap; }
.gis-metric-btn {
    padding: 5px 12px; border-radius: 6px; border: 1px solid #e2e8f0;
    background: #fff; color: #64748b; font-size: 0.8rem; cursor: pointer;
    font-weight: 500; transition: all 0.15s; white-space: nowrap;
}
.gis-metric-btn:hover { border-color: #94a3b8; color: #334155; }
.gis-metric-btn.active { background: #1e40af; color: #fff; border-color: #1e40af; }

/* View toggle */
.gis-view-toggle { display: flex; gap: 4px; }
.gis-view-btn {
    padding: 6px 14px; border-radius: 6px; border: 1px solid #e2e8f0;
    background: #fff; color: #64748b; font-size: 0.85rem; cursor: pointer;
    font-weight: 500; display: flex; align-items: center; gap: 6px;
}
.gis-view-btn:hover { border-color: #94a3b8; }
.gis-view-btn.active { background: #0f172a; color: #fff; border-color: #0f172a; }
.gis-view-btn.gis-btn-export { background: #2563eb; color: #fff; border-color: #2563eb; }
.gis-view-btn.gis-btn-export:hover { background: #1d4ed8; border-color: #1d4ed8; }

/* Map container */
.gis-map-container {
    position: relative; background: #f8fafc; border-radius: 12px;
    border: 1px solid #e2e8f0; padding: 16px; min-height: 400px;
}
.gis-map-container svg { width: 100%; height: auto; }

/* Legend */
.gis-legend {
    display: flex; align-items: center; gap: 8px; margin-top: 12px;
    font-size: 0.78rem; color: #64748b;
}
.gis-legend-bar {
    display: flex; height: 14px; flex: 1; border-radius: 4px; overflow: hidden;
}
.gis-legend-bar .step { flex: 1; }

/* Detail panel */
.gis-detail-panel {
    background: #fff; border-radius: 12px; border: 1px solid #e2e8f0;
    padding: 20px; height: 100%;
}
.gis-detail-panel h3 { font-size: 1.15rem; font-weight: 700; color: #0f172a; margin: 0 0 4px 0; }
.gis-detail-panel .detail-subtitle { font-size: 0.85rem; color: #64748b; margin-bottom: 16px; }
.gis-detail-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 40px 20px; color: #94a3b8;
}
.gis-detail-empty i { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.gis-detail-empty p { font-size: 0.9rem; margin: 0; }

/* Stat rows */
.gis-stat-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid #f1f5f9;
}
.gis-stat-row:last-child { border-bottom: none; }
.gis-stat-label { font-size: 0.85rem; color: #64748b; }
.gis-stat-value { font-size: 0.95rem; font-weight: 700; color: #0f172a; }
.gis-stat-value.positive { color: #16a34a; }
.gis-stat-value.negative { color: #dc2626; }

/* Section titles in detail panel & modal */
.gis-detail-section-title { font-size: 0.9rem; font-weight: 700; margin: 16px 0 8px; color: #334155; }
.gis-modal-section-title { font-size: 0.9rem; font-weight: 700; margin: 16px 0 8px; }

/* Top brands list */
.gis-brand-list { list-style: none; padding: 0; margin: 12px 0 0 0; }
.gis-brand-item {
    display: flex; align-items: center; gap: 10px; padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}
.gis-brand-item:last-child { border-bottom: none; }
.gis-brand-rank { font-size: 0.75rem; font-weight: 700; color: #94a3b8; width: 20px; text-align: center; }
.gis-brand-name { flex: 1; font-size: 0.85rem; font-weight: 600; color: #334155; }
.gis-brand-count { font-size: 0.85rem; color: #64748b; }
.gis-brand-bar { width: 60px; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.gis-brand-bar-fill { height: 100%; background: #3b82f6; border-radius: 3px; transition: width 0.3s; }

/* Table view */
.gis-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #e2e8f0; }
.gis-table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.gis-table th {
    background: #f8fafc; padding: 10px 14px; text-align: left;
    font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0;
    cursor: pointer; white-space: nowrap; user-select: none;
}
.gis-table th:hover { background: #f1f5f9; }
.gis-table th .sort-icon { margin-left: 4px; font-size: 0.7rem; opacity: 0.4; }
.gis-table th.sorted .sort-icon { opacity: 1; color: #3b82f6; }
.gis-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; color: #334155; }
.gis-table tr:hover td { background: #f8fafc; }
.gis-table td.canton-cell { font-weight: 600; cursor: pointer; color: #1e40af; }
.gis-table td.canton-cell:hover { text-decoration: underline; }
.gis-table td.number { text-align: right; font-variant-numeric: tabular-nums; }

/* Time slider */
.gis-time-slider {
    display: flex; align-items: center; gap: 12px; padding: 12px 18px;
    background: #f8fafc; border-radius: 10px; border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}
.gis-time-slider label { font-size: 0.8rem; font-weight: 600; color: #64748b; white-space: nowrap; }
.gis-time-slider input[type="range"] { flex: 1; accent-color: #3b82f6; }
.gis-time-slider .year-display {
    font-size: 1.1rem; font-weight: 700; color: #1e40af;
    min-width: 50px; text-align: center;
}
.gis-play-btn {
    width: 34px; height: 34px; border-radius: 50%; border: none;
    background: #3b82f6; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; transition: background 0.2s;
}
.gis-play-btn:hover { background: #2563eb; }
.gis-play-btn.playing { background: #dc2626; }

/* History summary bar */
.gis-history-summary {
    display: flex; align-items: center; gap: 20px; padding: 12px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
    border-radius: 12px; margin-bottom: 16px; color: #fff;
    animation: gisSlideIn 0.3s ease;
}
@keyframes gisSlideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.gis-hs-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gis-hs-year { font-size: 1.6rem; font-weight: 800; letter-spacing: -1px; }
.gis-hs-val { font-size: 1.15rem; font-weight: 700; }
.gis-hs-label { font-size: 0.7rem; color: rgba(255,255,255,0.65); text-transform: uppercase; letter-spacing: 0.5px; }
/* Comparison panel */
.gis-compare-panel {
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border-radius: 12px; border: 1px solid #bfdbfe; padding: 20px;
    margin-top: 16px; margin-bottom: 16px;
}
.gis-compare-hint {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; background: #eff6ff; border: 1px solid #93c5fd;
    border-radius: 8px; color: #1e40af; font-size: 0.9rem; font-weight: 500;
}
.gis-compare-hint-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; background: #fef2f2; border: 1px solid #fca5a5;
    border-radius: 6px; color: #dc2626; font-size: 0.8rem; font-weight: 600;
    white-space: nowrap; animation: gis-hint-in 0.3s ease;
}
@keyframes gis-hint-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
.gis-compare-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.gis-compare-header h4 { font-size: 1rem; font-weight: 700; color: #1e40af; margin: 0; }
.gis-compare-grid {
    display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px;
    font-size: 0.85rem;
}
.gis-compare-grid .label { text-align: center; color: #64748b; font-weight: 600; padding: 4px; }
.gis-compare-grid .val-a, .gis-compare-grid .val-b { padding: 6px 10px; border-radius: 6px; font-weight: 600; }
.gis-compare-grid .val-a { background: #dbeafe; color: #1e40af; text-align: right; }
.gis-compare-grid .val-b { background: #dcfce7; color: #166534; text-align: left; }
.gis-compare-grid .vs { text-align: center; color: #94a3b8; font-weight: 700; align-self: center; }

/* Canton detail modal */
.gis-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    z-index: 1050; display: none; align-items: center; justify-content: center; padding: 20px;
}
.gis-modal-overlay.show { display: flex; }
.gis-modal {
    background: #fff; border-radius: 16px; max-width: 600px; width: 100%;
    max-height: 85vh; overflow-y: auto; box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}
.gis-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid #e2e8f0;
}
.gis-modal-header h3 { font-size: 1.2rem; font-weight: 700; margin: 0; color: #0f172a; }
.gis-modal-close {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: #f1f5f9; color: #64748b; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.gis-modal-close:hover { background: #e2e8f0; }
.gis-modal-body { padding: 24px; }
.gis-modal-chart { width: 100%; max-width: 280px; margin: 0 auto 20px; }

/* Loading state */
.gis-loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 20px; color: #64748b;
}
.gis-loading .spinner-border { width: 2rem; height: 2rem; margin-bottom: 12px; }

/* Data source footer */
.gis-data-source {
    text-align: center; padding: 16px; font-size: 0.8rem; color: #94a3b8;
    border-top: 1px solid #f1f5f9; margin-top: 24px;
}

/* FAQ section */
.gis-faq { margin-top: 3rem; }
.gis-faq h2 { font-size: 1.5rem; font-weight: 700; color: #0f172a; margin-bottom: 1.5rem; }
.gis-faq-item {
    border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 10px; overflow: hidden;
}
.gis-faq-q {
    padding: 14px 18px; cursor: pointer; font-weight: 600; color: #334155;
    display: flex; justify-content: space-between; align-items: center;
    background: #f8fafc; transition: background 0.2s;
}
.gis-faq-q:hover { background: #f1f5f9; }
.gis-faq-q i { transition: transform 0.2s; color: #94a3b8; }
.gis-faq-q.open i { transform: rotate(180deg); }
.gis-faq-a { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height 0.3s, padding 0.3s; color: #64748b; line-height: 1.6; }
.gis-faq-a.open { max-height: 200px; padding: 14px 18px; }

/* EV focus specific */
.gis-ev-card {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 1px solid #86efac; border-radius: 12px; padding: 20px;
    text-align: center;
}
.gis-ev-card .big-number { font-size: 2rem; font-weight: 800; color: #166534; }
.gis-ev-card .label { font-size: 0.85rem; color: #15803d; }

/* Advanced analysis */
.gis-adv-card {
    background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; padding: 20px;
}
.gis-adv-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.gis-adv-header h4 {
    font-size: 1.05rem; font-weight: 700; color: #0f172a; margin: 0;
    display: flex; align-items: center; gap: 8px;
}
.gis-adv-header h4 i { color: #3b82f6; }
.gis-adv-select {
    padding: 6px 28px 6px 10px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 0.85rem; background: #fff; color: #334155;
    appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center; cursor: pointer;
}
.gis-adv-select:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.gis-export-btn {
    padding: 6px 14px; border-radius: 8px; border: 1px solid #e2e8f0;
    background: #fff; color: #334155; font-size: 0.85rem; cursor: pointer;
    font-weight: 500; display: flex; align-items: center; gap: 6px;
    transition: all 0.15s; white-space: nowrap;
}
.gis-export-btn:hover { background: #f1f5f9; border-color: #94a3b8; }

/* Ranking list */
.gis-ranking-list { display: flex; flex-direction: column; gap: 2px; }
.gis-rank-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    border-radius: 8px; transition: background 0.1s;
}
.gis-rank-row:hover { background: #f8fafc; }
.gis-rank-pos { font-size: 0.85rem; font-weight: 800; min-width: 28px; text-align: center; }
.gis-rank-name { font-size: 0.85rem; font-weight: 600; color: #334155; min-width: 140px; }
.gis-rank-bar { flex: 1; height: 14px; background: #e2e8f0; border-radius: 7px; overflow: hidden; }
.gis-rank-bar { display: flex; }
.gis-rank-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #3b82f6); border-radius: 7px; transition: width 0.3s; min-width: 2px; }
.gis-rank-val { font-size: 0.85rem; font-weight: 700; color: #0f172a; min-width: 80px; text-align: right; font-variant-numeric: tabular-nums; }

/* Period info banner */
.gis-period-info {
    font-size: 0.8rem; color: #64748b; padding: 6px 14px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}
.gis-period-info i { color: #94a3b8; }
.gis-period-info:empty { display: none; }

/* Neuzu year selector */
.gis-neuzu-year-selector { margin-bottom: 12px; }
.gis-year-pills {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.gis-year-pill {
    padding: 4px 12px; border-radius: 20px; border: 1px solid #cbd5e1;
    background: white; color: #475569; font-size: 0.78rem; cursor: pointer;
    transition: all 0.15s ease; font-weight: 500;
}
.gis-year-pill:hover { border-color: #3b82f6; color: #2563eb; background: #eff6ff; }
.gis-year-pill.active {
    background: #2563eb; color: white; border-color: #2563eb;
}

/* Export gate overlay */
.gis-export-gate {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; animation: gisGateFade 0.2s ease;
}
@keyframes gisGateFade { from { opacity: 0; } to { opacity: 1; } }
.gis-export-gate-content {
    background: white; border-radius: 20px; padding: 40px 36px; text-align: center;
    max-width: 400px; width: 90%; box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    position: relative;
}
.gis-export-gate-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; color: white; font-size: 1.5rem;
}
.gis-export-gate-content h4 {
    font-size: 1.15rem; font-weight: 700; color: #0f172a; margin: 0 0 8px;
}
.gis-export-gate-content p {
    font-size: 0.9rem; color: #64748b; margin: 0 0 16px; line-height: 1.5;
}
.gis-export-gate-badge {
    display: inline-block; background: linear-gradient(135deg, #059669, #10b981);
    color: white; font-weight: 700; font-size: 0.8rem; padding: 4px 16px;
    border-radius: 20px; margin-bottom: 20px;
}
.gis-export-gate-actions { display: flex; flex-direction: column; gap: 10px; }
.gis-export-gate-cta {
    display: block; padding: 14px 24px; border-radius: 12px;
    background: linear-gradient(135deg, #1e40af, #2563eb); color: white;
    font-weight: 700; font-size: 0.95rem; text-decoration: none;
    transition: all 0.2s; text-align: center;
}
.gis-export-gate-cta:hover { background: linear-gradient(135deg, #1e3a8a, #1d4ed8); color: white; transform: translateY(-1px); }
.gis-export-gate-close {
    position: absolute; top: 12px; right: 16px; background: none; border: none;
    font-size: 1.5rem; color: #94a3b8; cursor: pointer; line-height: 1;
}
.gis-export-gate-close:hover { color: #475569; }

/* Export button locked state */
.gis-export-btn.gis-export-locked {
    opacity: 0.7; border-style: dashed;
}

/* PDF config modal */
.gis-pdf-config {
    background: white; border-radius: 20px; padding: 32px 28px; text-align: left;
    max-width: 460px; width: 92%; box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    position: relative; max-height: 90vh; overflow-y: auto;
}
.gis-pdf-config-header { text-align: center; margin-bottom: 20px; }
.gis-pdf-config-icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px; color: white; font-size: 1.4rem;
}
.gis-pdf-config h4 { font-size: 1.1rem; font-weight: 700; color: #0f172a; margin: 0 0 4px; }
.gis-pdf-config p { font-size: 0.85rem; color: #64748b; margin: 0; }

.gis-pdf-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.gis-pdf-option {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer;
    transition: all 0.15s; user-select: none;
}
.gis-pdf-option:hover { border-color: #94a3b8; background: #f8fafc; }
.gis-pdf-option:has(input:checked) { border-color: #3b82f6; background: #eff6ff; }
.gis-pdf-option input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: #2563eb; flex-shrink: 0; cursor: pointer;
}
.gis-pdf-option-info { display: flex; flex-direction: column; gap: 1px; }
.gis-pdf-option-label { font-size: 0.9rem; font-weight: 600; color: #1e293b; }
.gis-pdf-option-desc { font-size: 0.75rem; color: #94a3b8; }

.gis-pdf-orientation {
    display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
    padding: 10px 12px; background: #f8fafc; border-radius: 10px;
}
.gis-pdf-orientation-label { font-size: 0.85rem; font-weight: 600; color: #475569; }
.gis-pdf-radio { font-size: 0.85rem; color: #334155; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.gis-pdf-radio input { accent-color: #2563eb; cursor: pointer; }

.gis-pdf-actions { display: flex; gap: 10px; }
.gis-pdf-cancel {
    flex: 1; padding: 12px; border-radius: 10px; border: 1px solid #e2e8f0;
    background: #fff; color: #64748b; font-weight: 600; font-size: 0.9rem; cursor: pointer;
}
.gis-pdf-cancel:hover { background: #f1f5f9; }
.gis-pdf-generate {
    flex: 2; padding: 12px; border-radius: 10px; border: none;
    background: linear-gradient(135deg, #dc2626, #ef4444); color: white;
    font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all 0.2s;
}
.gis-pdf-generate:hover { background: linear-gradient(135deg, #b91c1c, #dc2626); transform: translateY(-1px); }
.gis-pdf-generate:disabled { opacity: 0.7; cursor: wait; transform: none; }
.gis-pdf-error { text-align: center; color: #dc2626; font-size: 0.8rem; margin-top: 10px; }

/* Tooltip */
.gis-tooltip {
    position: absolute; background: #0f172a; color: #fff; padding: 8px 12px;
    border-radius: 8px; font-size: 0.8rem; pointer-events: none;
    z-index: 100; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translate(-50%, -100%); margin-top: -10px; display: none;
}
.gis-tooltip::after {
    content: ''; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%); border: 6px solid transparent;
    border-top-color: #0f172a;
}

/* ============ RESPONSIVE ============ */

/* --- Tablet (768px – 991px) --- */
@media (max-width: 991px) {
    /* Tabs: horizontal scroll instead of stacking */
    .gis-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .gis-tabs::-webkit-scrollbar { display: none; }
    .gis-tab { padding: 10px 16px; font-size: 0.88rem; white-space: nowrap; flex-shrink: 0; }

    /* Toolbar: full-width stacked */
    #gis-toolbar { flex-direction: column !important; align-items: stretch !important; }
    #gis-toolbar > .d-flex.flex-column { align-items: flex-start !important; width: 100%; }

    /* Filters: 3 per row */
    .gis-filters { gap: 8px; }
    .gis-filter-group { flex: 1 1 calc(33.333% - 8px); min-width: 130px; }

    /* Map */
    .gis-map-container { min-height: 340px; }

    /* Modal on tablet */
    .gis-modal-overlay { padding: 12px; }
    .gis-modal { max-width: 520px; max-height: 80vh; }
    .gis-modal-header { padding: 16px 18px; }
    .gis-modal-header h3 { font-size: 1.1rem; }
    .gis-modal-body { padding: 18px; }
    .gis-modal-chart { max-width: 220px; }
}

/* --- Mobile (< 768px) --- */
@media (max-width: 767px) {
    /* Tabs: compact scrollable */
    .gis-tabs { gap: 6px; margin-bottom: 14px; }
    .gis-tab { padding: 8px 14px; font-size: 0.82rem; gap: 6px; border-width: 1.5px; border-radius: 8px; }
    .gis-tab i { font-size: 0.95rem; }

    /* Filters: full-width stacked */
    .gis-filters { flex-direction: column; gap: 8px; padding: 10px 12px; }
    .gis-filter-group { width: 100%; flex: none; min-width: unset; }
    .gis-filter-group select { width: 100%; min-width: unset; }
    .gis-filter-group label { font-size: 0.68rem; }

    /* Controls area: force full width and contain overflow */
    #gis-toolbar > div:last-child {
        width: 100% !important; max-width: 100% !important;
        align-items: stretch !important; overflow: hidden;
    }

    /* Metrics: horizontal scroll within bounds */
    .gis-metrics {
        overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px;
        scrollbar-width: none; width: 100%; max-width: 100%;
    }
    .gis-metrics::-webkit-scrollbar { display: none; }
    .gis-metric-btn { padding: 4px 10px; font-size: 0.76rem; }

    /* View / export buttons: full-width wrap */
    .gis-view-btn { padding: 5px 10px; font-size: 0.78rem; gap: 4px; }
    .gis-view-toggle { gap: 2px; }
    #gis-toolbar > div:last-child > .d-flex { flex-wrap: wrap !important; width: 100%; gap: 4px !important; }

    /* Time slider */
    .gis-time-slider { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
    .gis-time-slider input[type="range"] { width: 100%; order: 3; }
    .gis-time-slider .year-display { font-size: 1rem; }

    /* History summary */
    .gis-history-summary { gap: 10px; padding: 10px 12px; flex-wrap: wrap; justify-content: center; }
    .gis-hs-year { font-size: 1.2rem; }
    .gis-hs-val { font-size: 0.95rem; }

    /* Map container */
    .gis-map-container { min-height: 280px; padding: 10px; border-radius: 10px; }

    /* Detail panel */
    .gis-detail-panel { padding: 14px; border-radius: 10px; }
    .gis-detail-panel h3 { font-size: 1.05rem; }
    .gis-detail-empty { padding: 24px 16px; }
    .gis-detail-empty i { font-size: 2.2rem; }

    /* Compare panel */
    .gis-compare-panel { padding: 14px; border-radius: 10px; }
    .gis-compare-header h4 { font-size: 0.9rem; }
    .gis-compare-grid { gap: 4px; font-size: 0.78rem; }
    .gis-compare-grid .val-a, .gis-compare-grid .val-b { padding: 5px 8px; }
    .gis-compare-grid .vs small { font-size: 0.7rem; }
    .gis-compare-hint { font-size: 0.82rem; padding: 8px 12px; }

    /* Table */
    .gis-table { font-size: 0.78rem; }
    .gis-table th, .gis-table td { padding: 8px 10px; }

    /* Period info */
    .gis-period-info { font-size: 0.74rem; padding: 5px 10px; }

    /* Year pills */
    .gis-year-pills { gap: 3px; }
    .gis-year-pill { padding: 3px 10px; font-size: 0.72rem; }

    /* Advanced analysis */
    .gis-adv-card { padding: 14px; border-radius: 10px; }
    .gis-adv-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .gis-adv-header .d-flex { flex-wrap: wrap; width: 100%; }
    .gis-adv-select { font-size: 0.8rem; padding: 5px 24px 5px 8px; }
    .gis-export-btn { padding: 5px 10px; font-size: 0.78rem; }

    /* Ranking */
    .gis-rank-row { padding: 6px 8px; gap: 8px; }
    .gis-rank-name { min-width: 80px; font-size: 0.78rem; }
    .gis-rank-bar { display: none; }
    .gis-rank-val { min-width: 60px; font-size: 0.78rem; }
    .gis-rank-pos { font-size: 0.78rem; min-width: 24px; }

    /* Trend chart */
    #gis-trend-chart-wrap { height: 220px !important; }

    /* EV cards */
    .gis-ev-card { padding: 14px; border-radius: 10px; }
    .gis-ev-card .big-number { font-size: 1.5rem; }

    /* Data source */
    .gis-data-source { font-size: 0.72rem; padding: 12px 8px; }

    /* FAQ */
    .gis-faq h2 { font-size: 1.25rem; }
    .gis-faq-q { padding: 12px 14px; font-size: 0.9rem; }
    .gis-faq-a.open { padding: 10px 14px; font-size: 0.85rem; }

    /* Modal - bottom sheet on mobile */
    .gis-modal-overlay { padding: 0; align-items: flex-end; }
    .gis-modal {
        border-radius: 16px 16px 0 0; max-width: 100%; width: 100%;
        max-height: 88vh;
    }
    .gis-modal-header {
        padding: 12px 16px; position: sticky; top: 0; background: #fff;
        z-index: 1; border-radius: 16px 16px 0 0;
        border-bottom: 1px solid #e2e8f0;
    }
    .gis-modal-header h3 { font-size: 1rem; }
    .gis-modal-close { width: 28px; height: 28px; }
    .gis-modal-body { padding: 14px; }
    .gis-modal-body .row.g-3 { --bs-gutter-x: 0.5rem; --bs-gutter-y: 0.5rem; }
    .gis-modal-body .gis-ev-card { padding: 10px 8px; border-radius: 8px; }
    .gis-modal-body .gis-ev-card .big-number { font-size: 1.2rem; }
    .gis-modal-body .gis-ev-card .label { font-size: 0.7rem; }
    .gis-modal-chart { max-width: 180px; margin-bottom: 14px; }
    .gis-modal-section-title { font-size: 0.8rem; margin: 10px 0 6px; }
    .gis-modal-body .gis-stat-row { padding: 5px 0; }
    .gis-modal-body .gis-stat-label { font-size: 0.76rem; }
    .gis-modal-body .gis-stat-value { font-size: 0.82rem; }
    .gis-modal-body .btn { font-size: 0.8rem; padding: 6px 12px; }

    /* Export gate */
    .gis-export-gate-content { padding: 28px 20px; border-radius: 16px; }
    .gis-export-gate-icon { width: 52px; height: 52px; font-size: 1.3rem; }
    .gis-export-gate-content h4 { font-size: 1.05rem; }

    /* PDF config */
    .gis-pdf-config { padding: 24px 18px; border-radius: 16px; }
    .gis-pdf-actions { flex-direction: column; }
    .gis-pdf-cancel, .gis-pdf-generate { flex: none; }
}

/* --- Very small mobile (< 480px) --- */
@media (max-width: 479px) {
    /* Tabs: even more compact */
    .gis-tab { padding: 7px 10px; font-size: 0.76rem; gap: 4px; }
    .gis-tab i { font-size: 0.88rem; }

    /* Buttons: very compact */
    .gis-view-btn { padding: 5px 8px; font-size: 0.72rem; }

    /* Compare grid tighter */
    .gis-compare-grid .val-a, .gis-compare-grid .val-b { padding: 4px 6px; font-size: 0.72rem; }

    /* Ranking tighter */
    .gis-rank-name { min-width: 60px; font-size: 0.72rem; }
    .gis-rank-val { min-width: 50px; font-size: 0.72rem; }

    /* Map even smaller */
    .gis-map-container { min-height: 240px; padding: 8px; }

    /* Detail panel tighter */
    .gis-detail-panel { padding: 12px; }
    .gis-detail-panel h3 { font-size: 0.95rem; }
    .gis-stat-row { padding: 6px 0; }
    .gis-stat-label { font-size: 0.78rem; }
    .gis-stat-value { font-size: 0.85rem; }

    /* History summary very compact */
    .gis-history-summary { gap: 8px; padding: 8px 10px; }
    .gis-hs-year { font-size: 1rem; }
    .gis-hs-val { font-size: 0.85rem; }
    .gis-hs-label { font-size: 0.62rem; }

    /* Data source */
    .gis-data-source { font-size: 0.68rem; }

    /* Modal: even tighter */
    .gis-modal { max-height: 90vh; }
    .gis-modal-header { padding: 10px 12px; }
    .gis-modal-header h3 { font-size: 0.92rem; }
    .gis-modal-body { padding: 10px; }
    .gis-modal-body .gis-ev-card .big-number { font-size: 1.05rem; }
    .gis-modal-body .gis-ev-card .label { font-size: 0.65rem; }
    .gis-modal-chart { max-width: 150px; }
    .gis-modal-section-title { font-size: 0.75rem; }
    .gis-modal-body .gis-stat-label { font-size: 0.72rem; }
    .gis-modal-body .gis-stat-value { font-size: 0.78rem; }
}

/* ============================================
   SEO PAGE HEADER (hero section)
   ============================================ */
.seo-page-header { background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%); padding: 2.5rem 0; position: relative; overflow: hidden; }
.seo-page-header::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); opacity: 0.5; }
.seo-breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 1.5rem; position: relative; }
.seo-breadcrumb a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.seo-breadcrumb a:hover { color: #fff; }
.seo-breadcrumb .separator { color: rgba(255,255,255,0.4); font-size: 0.75rem; }
.seo-breadcrumb .current { color: rgba(255,255,255,0.9); font-size: 0.9rem; }
.seo-hero-content { position: relative; }
.seo-hero-text h1 { color: #fff; font-size: 2.25rem; font-weight: 700; margin: 0 0 0.5rem 0; display: flex; align-items: center; gap: 1rem; }
.seo-hero-text h1 i { font-size: 1.75rem; opacity: 0.9; }
.seo-hero-text p { color: rgba(255,255,255,0.75); font-size: 1.1rem; margin: 0; }
@media (max-width: 768px) {
    .seo-page-header { padding: 1.5rem 0; }
    .seo-hero-text h1 { font-size: 1.5rem; gap: 0.6rem; }
    .seo-hero-text h1 i { font-size: 1.3rem; }
    .seo-hero-text p { font-size: 0.95rem; }
    .seo-breadcrumb { display: none; }
}
@media (max-width: 479px) {
    .seo-page-header { padding: 1.2rem 0; }
    .seo-hero-text h1 { font-size: 1.25rem; }
    .seo-hero-text p { font-size: 0.88rem; }
    .seo-breadcrumb a, .seo-breadcrumb .current { font-size: 0.8rem; }
}
