:root {
  --paper: #f3efe6;
  --ink: #1c1915;
  --muted: #6d655c;
  --line: #d9d0c3;
  --red: #9c2f2f;
  --green: #1f4d3a;
  --green-ink: #fffdf8;
  --holiday: #f8e4e0;
  --weekend: #efe6da;
  --short: #fff3d6;
  --surface: #fffdf8;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.45 "Segoe UI", "Liberation Sans", "Nimbus Sans", sans-serif;
}
a { color: var(--green); }
a:hover { color: var(--red); }
img { max-width: 100%; }
.skip {
  position: absolute; left: 8px; top: -40px; background: var(--ink); color: white; padding: 6px 10px;
}
.skip:focus { top: 8px; }

.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: relative;
  background: var(--surface);
  border-bottom: 4px solid var(--red);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.logo-mark {
  width: 28px; height: 28px; border: 1.5px solid var(--ink); display: grid; place-items: center;
  font-size: 12px; font-weight: 750; color: var(--red);
}
.menu-btn {
  display: none; background: transparent; border: 1px solid var(--line); padding: 6px 10px; font: inherit; cursor: pointer;
}
.nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.nav a[aria-current="page"] { color: var(--red); box-shadow: inset 0 -2px 0 var(--red); }

main { padding: 28px 0 64px; }
h1 { font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin: 1.6rem 0 0.6rem; }
.lead { font-size: 1.08rem; max-width: 42rem; margin: 0 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.source { margin: 0 0 16px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.86rem; color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: var(--green-ink); text-decoration: none;
  padding: 10px 14px; border-radius: 3px; font-weight: 700; font-size: 0.95rem;
  border: 1px solid var(--green);
}
.btn:hover { background: #173c2d; color: white; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 600; }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; }
.stat b { display: block; font-size: 1.55rem; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: 0.86rem; }

.cal-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
table.cal { width: 100%; border-collapse: collapse; min-width: 640px; }
.cal th, .cal td { border: 1px solid var(--line); width: 14.28%; vertical-align: top; }
.cal th { font-size: 0.78rem; font-weight: 650; color: var(--muted); text-align: center; padding: 6px 0; background: #faf7f2; }
.cal th.we { color: var(--red); }
.cal td { height: 4.8rem; padding: 4px 6px; background: var(--surface); }
.cal td.empty { background: #f7f4ee; }
.cal td.weekend { background: var(--weekend); }
.cal td.holiday { background: var(--holiday); }
.cal td.short { background: var(--short); }
.cal .n { font-weight: 750; }
.cal td.holiday .n, .cal td.short .n { color: var(--red); }
.cal .cap { display: block; margin-top: 4px; font-size: 0.72rem; line-height: 1.25; color: var(--red); }

.year-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mini { background: var(--surface); border: 1px solid var(--line); padding: 8px; }
.mini h2 { margin: 0 0 6px; font-size: 1rem; }
.mini h2 a { color: var(--ink); text-decoration: none; }
.mini h2 a:hover { color: var(--red); }
table.mini-cal { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.mini-cal th, .mini-cal td { text-align: center; padding: 2px 0; width: 14.28%; }
.mini-cal th { color: var(--muted); font-weight: 650; }
.mini-cal th.we, .mini-cal td.holiday a, .mini-cal td.short a { color: var(--red); }
.mini-cal td a { color: inherit; text-decoration: none; display: block; }
.mini-cal td.holiday { background: var(--holiday); }
.mini-cal td.weekend { background: var(--weekend); }
.mini-cal td.short { background: var(--short); }
.mini-cal td.empty { color: transparent; }

.cards { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin: 8px 0 22px; }
.card { background: var(--surface); border: 1px solid var(--line); padding: 16px 18px; box-shadow: var(--shadow); }
.card h2 { margin-top: 0; }
.card p { margin: 0 0 12px; }

.months { display: flex; flex-wrap: wrap; gap: 8px; }
.months a { background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; padding: 8px 12px; }
.months a:hover { border-color: var(--ink); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pager a { color: var(--ink); }

table.data { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.95rem; }
.data th, .data td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: right; }
.data th:first-child, .data td:first-child { text-align: left; }
.data th { background: var(--green); color: var(--green-ink); font-weight: 650; }
.data tr.strong td { background: #e7f0ea; font-weight: 700; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); }

.note {
  background: var(--surface); border-left: 4px solid var(--red); padding: 10px 14px; margin: 16px 0;
}
form.calc { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; background: var(--surface); border: 1px solid var(--line); padding: 14px; }
form.calc label { display: flex; flex-direction: column; gap: 4px; font-size: 0.86rem; color: var(--muted); }
form.calc input { font: inherit; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line); background: white; }
.result { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.faq details { background: var(--surface); border: 1px solid var(--line); padding: 10px 14px; margin: 8px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.prose { max-width: 46rem; }
.prose p { margin: 0.6rem 0; }

.ad { margin: 18px 0; min-height: 120px; }
.ad-label { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 28px 0 16px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 18px; }
.footer-title { font-weight: 750; margin: 0 0 6px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { margin: 4px 0; }
.footer-bottom { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); }

.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px; }
.cookie-inner {
  max-width: 920px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line);
  padding: 14px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(28, 25, 21, 0.12);
}
.cookie-inner p { margin: 0; flex: 1 1 280px; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
button.btn { font: inherit; cursor: pointer; }

@media (max-width: 800px) {
  .cards, .year-grid, .stats, .result, .footer-grid { grid-template-columns: 1fr; }
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; right: 16px; top: 68px; z-index: 5; background: var(--surface); border: 1px solid var(--line); padding: 10px 14px; box-shadow: 0 8px 20px rgba(28, 25, 21, 0.12); }
  .menu-btn { display: inline-flex; }
  table.cal { min-width: 0; }
  .cal td { height: 2.8rem; padding: 2px; }
  .cal .cap { display: none; }
}
@media print {
  .site-header, .site-footer, .cookie, .actions, .ad, .menu-btn { display: none; }
  body { background: white; }
}
