:root {
    --ink: #18332f;
    --muted: #697b77;
    --paper: #f7f4ec;
    --card: #fffdf8;
    --green: #123c36;
    --gold: #c8963e;
    --salary: #fff0c9;
    --line: #e4dfd3;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 5%, rgba(200,150,62,.12), transparent 25rem),
        var(--paper);
    font-family: Tahoma, Arial, sans-serif;
}

.hero {
    padding: 42px 24px 64px;
    color: #fff;
    background: var(--green);
    border-bottom: 5px solid var(--gold);
}

.hero__inner, main { max-width: 1440px; margin: auto; }
.hero__inner { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 8px; color: #e8d6a9; font-size: .88rem; letter-spacing: .08em; }
h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: 1.1; }
.range { margin: 10px 0 0; color: #c9d8d4; }
.selected-year { margin: 7px 0 0; color: #e8d6a9; font-size: 1.05rem; }

.header-navs { display: flex; align-items: flex-end; flex-direction: column; gap: 9px; }
.year-nav, .month-nav { display: flex; gap: 8px; }
.year-nav a, .month-nav a {
    padding: 10px 17px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 99px;
    text-decoration: none;
    transition: .2s ease;
}
.year-nav a:hover, .year-nav .current, .month-nav a:hover, .month-nav .current-month { color: var(--green); background: #fff; }
.month-nav .current-month { min-width: auto; color: var(--green); }
.month-nav a { min-width: 112px; border-color: rgba(232,214,169,.5); color: #f2dfae; text-align: center; }
.nav-arrow { display: inline-block; font-size: 1.15rem; font-style: normal; font-weight: bold; line-height: .8; }

main { padding: 0 24px 36px; }
.legend {
    display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px;
    margin: -25px 0 28px; padding: 16px 22px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 10px 30px rgba(18,60,54,.08);
    font-size: .9rem;
}
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend__note { color: var(--muted); margin-inline-start: auto; }
.dot { width: 12px; height: 12px; border-radius: 4px; }
.dot--today { background: var(--green); }
.dot--salary { background: var(--gold); }
.dot--retirement { background: #7557a6; }
.dot--citizen { background: #287e75; }
.dot--housing { background: #3978b8; }

.months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.month-card {
    overflow: hidden;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 5px 16px rgba(38,55,51,.045);
}
.month-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px 13px; border-bottom: 1px solid var(--line); }
.month-card__head > div { display: flex; align-items: center; gap: 10px; }
.month-card h2 { margin: 0; font-size: 1.08rem; }
.month-card h2 a { color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--gold); }
.month-card h2 a:hover { color: var(--gold); border-bottom-style: solid; }
.month-card__head p { margin: 0; color: var(--muted); direction: ltr; font-size: .74rem; }
.month-card__head .gregorian-range { display: flex; align-items: flex-end; flex-direction: column; gap: 3px; }
.gregorian-range strong { color: var(--gold); font-size: .72rem; white-space: nowrap; }
.month-number { display: grid; place-items: center; width: 29px; height: 29px; color: #fff; background: var(--green); border-radius: 8px; font-weight: bold; }

.weekdays, .days { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays { padding: 10px 10px 5px; color: var(--muted); text-align: center; font-size: .7rem; font-weight: bold; }
.days { padding: 0 10px 12px; gap: 3px; direction: rtl; }
.day { position: relative; display: flex; min-width: 0; height: 53px; padding: 5px; flex-direction: column; align-items: center; border: 1px solid transparent; border-radius: 8px; direction: rtl; }
.day b { font-size: .88rem; }
.day small { color: var(--muted); font-size: .58rem; direction: ltr; }
.event-tags { position: absolute; right: 2px; bottom: 2px; left: 2px; display: flex; justify-content: center; flex-wrap: wrap; gap: 1px; }
.day em { padding: 1px 3px; color: #fff; border-radius: 4px; font-size: .47rem; font-style: normal; font-weight: bold; line-height: 1.4; }
.event--salary { background: #b77a15; }
.event--retirement { background: #7557a6; }
.event--citizen { background: #287e75; }
.event--housing { background: #3978b8; }
.day--event { background: var(--salary); border-color: #edcf8e; }
.day--today { color: #fff; background: var(--green); box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--green); }
.day--today small { color: #d6e2df; }
.day--today.day--event em { color: var(--green); background: #fff; }
.day--empty { visibility: hidden; }

.accuracy { margin: 25px 4px 0; color: var(--muted); font-size: .82rem; }
footer { padding: 22px; color: #8a9996; background: #eae6dc; text-align: center; font-size: .8rem; }

.months--single { display: block; max-width: 920px; margin: 0 auto; }
.months--single .month-card__head { padding: 22px 26px; }
.months--single .month-card h2 { font-size: 1.6rem; }
.months--single .month-number { width: 40px; height: 40px; font-size: 1.15rem; }
.months--single .gregorian-range strong { font-size: .95rem; }
.months--single .month-card__head p { font-size: .86rem; }
.months--single .weekdays { padding: 18px 16px 9px; font-size: .88rem; }
.months--single .days { padding: 0 16px 20px; gap: 7px; }
.months--single .day { height: 92px; justify-content: flex-start; padding: 10px; border-color: var(--line); }
.months--single .day b { font-size: 1.3rem; }
.months--single .day small { margin-top: 4px; font-size: .76rem; }
.months--single .day em { padding: 3px 7px; font-size: .65rem; }
.months--single .event-tags { bottom: 7px; gap: 3px; }

@media (max-width: 1050px) { .months { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
    .hero { padding: 30px 16px 52px; }
    .hero__inner { align-items: stretch; flex-direction: column; }
    .header-navs { align-items: stretch; }
    .year-nav a, .month-nav a { flex: 1; text-align: center; }
    main { padding-inline: 12px; }
    .legend { margin-top: -25px; }
    .legend__note { width: 100%; }
    .months { grid-template-columns: 1fr; }
    .months--single .day { height: 74px; padding: 7px 3px; }
    .months--single .day b { font-size: 1.05rem; }
    .months--single .day em { padding: 2px 3px; font-size: .52rem; }
}

@media print {
    body { background: #fff; }
    .hero { padding: 15px 20px; }
    .year-nav, .legend { display: none; }
    main { padding: 12px; }
    .months { grid-template-columns: repeat(3, 1fr); gap: 7px; }
    .month-card { break-inside: avoid; box-shadow: none; }
    .day { height: 42px; }
    footer { display: none; }
}
