:root {
    --color-bg: #ffffff;
    --color-text: #222222;
    --color-border: #dddddd;
    --color-header-bg: #f5f5f5;
    --color-sunday: #d1453b;
    --color-saturday: #2b6cb0;
    --color-holiday-bg: #fdecea;
    --color-holiday-text: #c0392b;
    --color-today-outline: #2b6cb0;
    --color-muted: #888888;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 1.5rem;
    font-family: "Hiragino Sans", "Yu Gothic", "Helvetica Neue", Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.4;
}

.site-header {
    max-width: 1200px;
    margin: 0 auto 1.5rem;
    text-align: center;
}

.site-header h1 {
    font-size: 1.6rem;
    margin: 0 0 0.75rem;
}

.year-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.year-nav a {
    color: var(--color-text);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.year-nav a:hover,
.year-nav a:focus {
    background: var(--color-header-bg);
}

.year-nav-current {
    font-weight: bold;
}

.year-jump {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.year-jump input[type="number"] {
    width: 6rem;
    padding: 0.25rem 0.5rem;
}

.year-jump button {
    padding: 0.3rem 0.75rem;
    cursor: pointer;
}

.calendar-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.month {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.75rem;
}

.month h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    text-align: center;
}

.month-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.month-table th,
.month-table td {
    text-align: center;
    vertical-align: top;
    padding: 0.25rem 0.15rem;
    font-size: 0.8rem;
    border: 1px solid var(--color-border);
    height: 2.6rem;
    overflow: hidden;
}

.month-table thead th {
    background: var(--color-header-bg);
    font-weight: normal;
    height: auto;
}

.month-table th.dow-0,
.month-table td.dow-0,
.month-table td.is-sunday .date-num {
    color: var(--color-sunday);
}

.month-table th.dow-6,
.month-table td.dow-6,
.month-table td.is-saturday .date-num {
    color: var(--color-saturday);
}

.month-table td.empty {
    background: transparent;
    border-color: transparent;
}

.date-num {
    display: block;
    font-weight: bold;
}

.holiday-name {
    display: block;
    font-size: 0.62rem;
    line-height: 1.1;
    word-break: break-all;
}

.month-table td.is-holiday {
    background: var(--color-holiday-bg);
}

.month-table td.is-holiday .date-num,
.month-table td.is-holiday .holiday-name {
    color: var(--color-holiday-text);
}

.month-table td.is-today {
    outline: 2px solid var(--color-today-outline);
    outline-offset: -2px;
}

.site-footer {
    max-width: 1200px;
    margin: 2rem auto 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-muted);
}

.site-footer a {
    color: inherit;
}

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

@media (max-width: 600px) {
    body {
        padding: 1rem 0.5rem;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .month-table th,
    .month-table td {
        font-size: 0.85rem;
        height: 2.8rem;
    }

    .holiday-name {
        font-size: 0.65rem;
    }

    .year-nav {
        font-size: 1rem;
        gap: 0.5rem;
    }
}
