.dashboard {
    padding: 20px;
}

/* =========================================================
   FILTERS
========================================================= */

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.filter-card {
    background: var(--bg-elev);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
}

.filter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.filter-title i {
    color: var(--accent, #4f46e5);
}

.filter-card-content {
    margin-top: 14px;
}

.filter-card-content.collapsed {
    display: none;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 15px;
}

.year-filter-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.year-checkbox {
    background: var(--bg);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.year-checkbox input {
    margin-right: 6px;
}

.project-filter-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-filter-row label {
    font-size: 14px;
    color: var(--text-dim, #aaa);
}

.project-filter-row select {
    height: 42px;
    border-radius: 10px;
    padding: 0 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
}

.project-filter-actions {
    margin-top: 12px;
}

body.dashboard-loading .filter-card {
    opacity: 0.72;
    transition: opacity 0.15s ease;
}

body.dashboard-loading .filter-card-content {
    pointer-events: none;
}

body.dashboard-loading .toggle-btn,
body.dashboard-loading .project-filter-actions .btn,
body.dashboard-loading .project-filter-row select,
body.dashboard-loading .year-checkbox input {
    cursor: progress;
}

.btn.btn-slim {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    cursor: pointer;
}

.table-link {
    color: var(--accent);
    font-weight: 600;
}

.table-link:hover {
    text-decoration: underline;
}

/* =========================================================
   KPI ROW
========================================================= */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px,1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.kpi {
    align-content: center;
    background: #222;
    color: #fff;
    padding: 16px;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
}

.kpi small {
    display: block;
    margin-top: 6px;
    opacity: 0.8;
    font-size: 12px;
}

.kpi.clickable {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.kpi.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* =========================================================
   SECTION
========================================================= */

.dashboard-section {
    margin-bottom: 36px;
}

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

.section-header h2 {
    margin: 0 0 4px;
}

.section-header p {
    margin: 0;
    color: var(--text-dim, #999);
    font-size: 14px;
}

/* =========================================================
   SUMMARY GRID
========================================================= */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.summary-card {
    background: var(--bg-elev);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 14px;
}

.summary-card .label {
    font-size: 13px;
    color: var(--text-dim, #999);
    margin-bottom: 8px;
}

.summary-card .value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.summary-card .sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-dim, #999);
}

/* =========================================================
   DASH CARDS
========================================================= */

.dash-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
}

.dash-card {
    background: var(--bg-elev);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    padding: 16px;
    border-radius: 12px;
    flex: 1 1 360px;
    min-width: 320px;
    box-sizing: border-box;
    overflow: visible;
}

.dash-card.full {
    flex: 1 1 100%;
    min-width: 100%;
}

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

.card-header h3 {
    margin: 0;
}

/* =========================================================
   INFO TOOLTIP
========================================================= */

.info-icon {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: var(--text-dim, #999);
    flex-shrink: 0;
}

.info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 0;
    top: 140%;
    width: 260px;
    max-width: min(320px, calc(100vw - 32px));
    padding: 10px 12px;
    background: #111;
    color: #fff;
    font-size: 12px;
    line-height: 1.45;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translateY(-4px);
    z-index: 50;
    pointer-events: none;
}

.info-icon:hover::after,
.info-icon.active::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =========================================================
   SVG / CHARTS
========================================================= */

.dashboard svg {
    width: 100%;
    height: 320px;
    display: block;
    overflow: visible;
}

.dash-card {
    overflow: visible;
}

.dashboard text {
    fill: var(--text);
    font-size: 12px;
}

/* =========================================================
   TABLES / EMPTY STATES / ISSUES
========================================================= */

.table-host {
    min-height: 220px;
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.stats-table th,
.stats-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
    vertical-align: top;
}

.stats-table th {
    position: sticky;
    top: 0;
    background: var(--bg-elev);
    z-index: 1;
}

.stats-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.empty-state {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim, #999);
    text-align: center;
    border: 1px dashed var(--border-color, rgba(255,255,255,0.08));
    border-radius: 10px;
    padding: 20px;
}

.issues-box {
    min-height: 220px;
}

.issue-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.issue-list li {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    margin-bottom: 10px;
}

.issue-list li.warn {
    border-left: 4px solid #f59e0b;
}

.issue-list li.ok {
    border-left: 4px solid #22c55e;
}

.map-detail-row .dash-card {
    min-height: 360px;
}

#mini-map-container {
    width: 100%;
    height: 340px;
    overflow: hidden;
}

#world-map {
    width: 100%;
    height: 340px;
    display: block;
    overflow: visible;
}

.country-stays-box {
    min-height: 340px;
}

.country-placeholder {
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-dim, #999);
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* =========================================================
   D3 TOOLTIP
========================================================= */

.chart-tooltip {
    position: absolute;
    z-index: 2000;
    background: rgba(20,20,20,0.95);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    opacity: 0;
}

/* =========================
   Country details / stays
========================= */

.country-stays-box,
#country-stays {
    min-height: 340px;
    max-height: 340px;
    height: 340px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Placeholder bleibt schÃ¶n mittig */
.country-placeholder {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-dim, #999);
    padding: 20px;
    box-sizing: border-box;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* Wenn script.js Tabelleninhalt reinrendert */
#country-stays table,
#country-stays .stats-table {
    width: 100%;
    min-width: 640px; /* horizontal scroll auf kleinen GerÃ¤ten */
    border-collapse: collapse;
    font-size: 14px;
}

/* Scroll-Wrapper fÃ¼r Country-Content */
.country-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 10px;
}

/* Falls dein script.js direkt nur table rendert, nicht wrapper */
#country-stays > table,
#country-stays > .stats-table {
    display: block;
    overflow: auto;
    max-width: 100%;
    max-height: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Tabellenzellen */
#country-stays th,
#country-stays td,
.country-table-scroll th,
.country-table-scroll td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

/* Lange Texte in Beschreibung/Location dÃ¼rfen umbrechen */
#country-stays td.description-cell,
#country-stays td.location-cell,
.country-table-scroll td.description-cell,
.country-table-scroll td.location-cell {
    white-space: normal;
    word-break: break-word;
    min-width: 180px;
    max-width: 280px;
}

/* Sticky header */
#country-stays thead th,
.country-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-table-header);
}

/* Zebra / Hover */
#country-stays tbody tr:nth-child(even),
.country-table-scroll tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

#country-stays tbody tr:hover,
.country-table-scroll tbody tr:hover {
    background: rgba(255,255,255,0.05);
}

/* SchÃ¶ne Scrollbar */
.country-table-scroll::-webkit-scrollbar,
#country-stays > table::-webkit-scrollbar,
#country-stays > .stats-table::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.country-table-scroll::-webkit-scrollbar-thumb,
#country-stays > table::-webkit-scrollbar-thumb,
#country-stays > .stats-table::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.18);
    border-radius: 8px;
}

.country-table-scroll::-webkit-scrollbar-track,
#country-stays > table::-webkit-scrollbar-track,
#country-stays > .stats-table::-webkit-scrollbar-track {
    background: transparent;
}

/* Mobile */
@media (max-width: 900px) {
    .country-stays-box,
    #country-stays {
        min-height: 300px;
        max-height: 300px;
        height: 300px;
    }

    #country-stays table,
    #country-stays .stats-table {
        min-width: 560px;
        font-size: 13px;
    }

    #country-stays th,
    #country-stays td,
    .country-table-scroll th,
    .country-table-scroll td {
        padding: 8px 10px;
    }
}

@media (max-width: 600px) {
    .country-stays-box,
    #country-stays {
        min-height: 280px;
        max-height: 280px;
        height: 280px;
    }

    #country-stays table,
    #country-stays .stats-table {
        min-width: 520px;
        font-size: 12px;
    }

    #country-stays th,
    #country-stays td,
    .country-table-scroll th,
    .country-table-scroll td {
        padding: 7px 8px;
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 900px) {
    .dash-row {
        flex-direction: column;
    }

    .dash-card,
    .dash-card.full {
        min-width: 100%;
    }

    .dashboard svg {
        height: 260px;
    }

    .summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

.hidden {
    display: none !important;
}

/* =========================================================
   EXTENDED CARD SIZES / INSIGHTS
========================================================= */

.dash-card-12,
.dash-card.full {
    flex: 1 1 100%;
    min-width: 100%;
}

.dash-card-8 {
    flex: 1 1 calc(66.666% - 8px);
    min-width: 420px;
}

.dash-card-6 {
    flex: 1 1 calc(50% - 8px);
    min-width: 360px;
}

.dash-card-4 {
    flex: 1 1 calc(33.333% - 11px);
    min-width: 300px;
}

.dash-card-3 {
    flex: 1 1 calc(25% - 12px);
    min-width: 260px;
}

.kpi-intensity {
    background: linear-gradient(135deg, #0f5132 0%, #198754 100%);
}

.card-header-with-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.card-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.apple-switch-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    cursor: pointer;
    flex-shrink: 0;
}

.apple-switch-label {
    font-size: 13px;
    color: var(--text-dim, #999);
    white-space: nowrap;
}

.apple-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 28px;
    flex-shrink: 0;
}

.apple-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.apple-switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(120, 120, 128, 0.32);
    transition: background 0.25s ease, box-shadow 0.25s ease;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.apple-switch-slider::before {
    content: "";
    position: absolute;
    height: 24px;
    width: 24px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.apple-switch input:checked + .apple-switch-slider {
    background: #34c759;
}

.apple-switch input:checked + .apple-switch-slider::before {
    transform: translateX(18px);
}

.apple-switch input:focus-visible + .apple-switch-slider {
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.08),
        0 0 0 3px rgba(52, 199, 89, 0.22);
}

.travel-calendar-card {
    min-width: 300px;
}

#travelCalendar {
    display: grid;
    gap: 10px;
    min-height: 0;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.calendar-select {
    height: 34px;
    min-width: 110px;
    border-radius: 10px;
    padding: 0 10px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    font-size: 13px;
}

.calendar-legend {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-dim, #999);
    flex-wrap: wrap;
}

.calendar-legend .calendar-cell {
    width: 12px;
    height: 12px;
    min-width: 12px;
}

.calendar-grid.year-mode {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.calendar-grid.month-mode {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.calendar-month-card {
    display: grid;
    gap: 6px;
    justify-items: center;
}

.calendar-month-label {
    font-size: 11px;
    color: var(--text-dim, #999);
    text-align: center;
    line-height: 1.2;
}

.calendar-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    min-width: 0;
}

.calendar-grid.year-mode .calendar-cell {
    max-width: 34px;
}

.calendar-grid.month-mode .calendar-cell {
    max-width: 22px;
    justify-self: center;
}

.calendar-cell:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.14);
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 4px;
}

.calendar-days-header span {
    font-size: 10px;
    color: var(--text-dim, #999);
    text-align: center;
}

@media (max-width: 1100px) {
    .calendar-grid.year-mode {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .calendar-grid.year-mode .calendar-cell {
        max-width: 28px;
    }
}

@media (max-width: 760px) {
    .calendar-grid.year-mode {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .calendar-grid.year-mode .calendar-cell {
        max-width: 26px;
    }

    .calendar-grid.month-mode .calendar-cell {
        max-width: 18px;
    }

    .calendar-month-label {
        font-size: 10px;
    }
}

/* Passport card */

.passport-card {
    background: linear-gradient(160deg, #123b7a 0%, #0b2856 100%);
    color: #f5e7a1;
    border: 1px solid rgba(245,231,161,0.18);
    position: relative;
    overflow: hidden;
}

.passport-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.08), transparent 30%),
        linear-gradient(to bottom, transparent, rgba(255,255,255,0.03));
    pointer-events: none;
}

.passport-card .card-header,
.passport-card .card-header h3,
.passport-card .info-icon {
    color: #f5e7a1;
}

.passport-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.passport-topline {
    font-size: 11px;
    letter-spacing: 0.18em;
    opacity: 0.9;
    text-transform: uppercase;
}

.passport-name {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
}

.passport-sub {
    font-size: 13px;
    opacity: 0.9;
}

.passport-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}

.passport-field {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(245,231,161,0.12);
}

.passport-field .label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 4px;
}

.passport-field .value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.66em;
    height: 0.66em;
    margin-left: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #4da3ff 0%, #1570ef 100%);
    color: #fff;
    box-shadow: 0 3px 7px rgba(21, 112, 239, 0.20);
    vertical-align: 0.02em;
}

.verified-badge i {
    font-size: 0.33em;
    line-height: 1;
}

.verified-badge--passport {
    width: 0.62em;
    height: 0.62em;
    margin-left: 6px;
}

.passport-theme-verified {
    color: #d7fff8;
}

.passport-theme-verified .passport-field {
    border-color: rgba(94, 234, 212, 0.28);
    background: rgba(14, 116, 110, 0.22);
}

.passport-theme-supporter {
    color: #efe7ff;
}

.passport-theme-supporter .passport-field {
    border-color: rgba(196, 181, 253, 0.25);
    background: rgba(91, 33, 182, 0.22);
}

.passport-theme-donator {
    color: #fff2c2;
}

.passport-theme-donator .passport-field {
    border-color: rgba(252, 211, 77, 0.25);
    background: rgba(180, 83, 9, 0.22);
}

.passport-theme-admin {
    color: #ffe2e2;
}

.passport-theme-admin .passport-field {
    border-color: rgba(252, 165, 165, 0.25);
    background: rgba(153, 27, 27, 0.24);
}

/* Insight cards */

.insight-card-host {
    min-height: 240px;
}

.insight-stack {
    display: grid;
    gap: 12px;
}

.insight-box {
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 14px;
    padding: 14px;
    background: rgba(255,255,255,0.02);
}

.insight-box .label {
    font-size: 13px;
    color: var(--text-dim, #999);
    margin-bottom: 6px;
}

.insight-box .value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
}

.insight-box .sub {
    font-size: 13px;
    color: var(--text-dim, #999);
    margin-top: 4px;
}

/* Travel calendar */

#travelCalendar {
    display: grid;
    gap: 12px;
    min-height: 240px;
}

.calendar-legend {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-dim, #999);
}

.calendar-grid.year-mode {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px;
}

.calendar-grid.month-mode {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-cell {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.calendar-cell:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.16);
}

.calendar-cell.placeholder {
    background: transparent !important;
    border-color: transparent;
    box-shadow: none;
}

.calendar-month-card {
    display: grid;
    gap: 8px;
}

.calendar-month-label {
    font-size: 12px;
    color: var(--text-dim, #999);
    text-align: center;
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 6px;
}

.calendar-days-header span {
    font-size: 11px;
    color: var(--text-dim, #999);
    text-align: center;
}

@media (max-width: 1100px) {
    .dash-card-8,
    .dash-card-6,
    .dash-card-4,
    .dash-card-3 {
        flex: 1 1 calc(50% - 8px);
        min-width: 320px;
    }

    .calendar-grid.year-mode {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .dash-card,
    .dash-card-8,
    .dash-card-6,
    .dash-card-4,
    .dash-card-3,
    .dash-card-12 {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .apple-switch-wrapper {
        width: 100%;
        justify-content: flex-end;
    }

    .calendar-toolbar {
        width: 100%;
        justify-content: flex-end;
    }

    .calendar-grid.year-mode {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .calendar-grid.year-mode {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
