:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1d232b;
  --muted: #5d6772;
  --line: #dde1e6;
  --accent: #1f3a68;
  --accent-soft: #e9eef6;
  --sun: #d0342b;
  --sat: #1f63b6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 45, 0.06), 0 4px 16px rgba(20, 30, 45, 0.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; }

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- ヘッダー・フッター ---- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(6px);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.logo img { width: 26px; height: 26px; }
.nav {
  display: flex;
  gap: 4px 16px;
  margin-left: auto;
  overflow-x: auto;
  font-size: 14px;
  white-space: nowrap;
  scrollbar-width: none;
}
.nav a {
  padding: 6px 2px;
  color: var(--muted);
  text-decoration: none;
}
.nav a:hover,
.nav a[aria-current='page'] { color: var(--accent); }
.lang-switch {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .site-head .wrap { flex-wrap: wrap; gap: 0 12px; padding-top: 6px; }
  .nav { order: 3; width: 100%; margin-left: 0; padding-bottom: 4px; }
  .lang-switch { margin-left: auto; }
}

.site-foot {
  margin-top: 64px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 14px;
}
.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 12px;
}
.site-foot a { color: var(--muted); }

/* ---- 本文 ---- */
main { display: block; }
.hero { padding: 32px 0 8px; }
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4.2vw, 36px);
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.hero p { margin: 0; color: var(--muted); }
.crumbs {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs li + li::before { content: '›'; margin: 0 6px 0 2px; }
section.block { margin-top: 40px; }
h2 {
  margin: 0 0 16px;
  font-size: 22px;
  line-height: 1.4;
}
h3 { margin: 24px 0 8px; font-size: 17px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.note { color: var(--muted); font-size: 14px; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 36px; }

/* ---- カレンダー作成 ---- */
.gen {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .gen { grid-template-columns: minmax(0, 1fr); }
}
.gen-form { position: sticky; top: 72px; }
@media (max-width: 900px) {
  .gen-form { position: static; }
}
.gen-form fieldset { margin: 0; padding: 0; border: 0; }
.gen-form legend,
.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.layouts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.layout-opt { position: relative; }
.layout-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.layout-opt span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}
.layout-opt input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.layout-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.layout-opt i {
  display: block;
  width: 44px;
  height: 32px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  opacity: 0.75;
  background-repeat: no-repeat;
}
.ico-year { background: radial-gradient(circle, currentColor 1.2px, transparent 1.5px) 0 0 / 10px 8px; }
.ico-month { background: linear-gradient(currentColor 1px, transparent 1px) 0 6px / 100% 6.5px, linear-gradient(90deg, currentColor 1px, transparent 1px) 0 6px / 6.2px 100%; }
.ico-memo { background: linear-gradient(currentColor 1px, transparent 1px) 0 6px / 68% 6.5px, linear-gradient(90deg, currentColor 1px, transparent 1px) 0 6px / 4.3px 100%; }
.ico-list { background: linear-gradient(currentColor 1px, transparent 1px) 0 4px / 100% 4px; }
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.field { display: block; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field select,
.field input[type='text'] {
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid #c9cfd6;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  font-size: 14px;
}
.checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: var(--accent); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn.secondary {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}
.gen-actions { margin-top: 18px; }
.gen-actions .btn { width: 100%; }
.gen-actions .note { margin: 10px 0 0; font-size: 13px; line-height: 1.6; }

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}
.preview {
  max-height: 80vh;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 16px;
  border-radius: var(--radius);
  background: #e7eaee;
}
@media (max-width: 900px) {
  .preview { max-height: none; }
}
.sheet-wrap {
  position: relative;
  overflow: hidden;
  margin: 0 auto 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.sheet-wrap:last-child { margin-bottom: 0; }
.sheet-wrap .sheet {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

/* ---- 一覧・リンク ---- */
.month-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.month-links a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.month-links a:hover { border-color: var(--accent); }
.month-links b { display: block; font-size: 18px; }
.month-links small { color: var(--muted); font-size: 12px; }

.dl-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dl-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.dl-list a:hover { border-color: var(--accent); }
.dl-list .pdf {
  flex: none;
  padding: 3px 6px;
  border-radius: 4px;
  background: #c43d32;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.dl-list small { display: block; color: var(--muted); font-size: 12px; }

.tbl-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 15px;
}
table.data th,
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
table.data thead th {
  background: var(--accent-soft);
  font-size: 13px;
  color: var(--muted);
}
table.data td.sun,
table.data td.hol { color: var(--sun); }
table.data td.sat { color: var(--sat); }

/* 画面表示の月カレンダー */
.mcal {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}
.mcal caption {
  padding-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}
.mcal th {
  padding: 8px 0;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  font-size: 13px;
}
.mcal td {
  height: 84px;
  padding: 6px;
  border: 1px solid var(--line);
  vertical-align: top;
  overflow: hidden;
}
.mcal .d { display: block; font-size: 18px; font-weight: 700; line-height: 1.1; }
.mcal .h { display: block; margin-top: 2px; font-size: 11px; line-height: 1.3; color: var(--sun); }
.mcal .r { display: block; font-size: 11px; color: var(--muted); }
.mcal .sun,
.mcal .hol { color: var(--sun); }
.mcal .sat { color: var(--sat); }
.mcal td.out { background: #fafbfc; }
@media (max-width: 560px) {
  .mcal td { height: 64px; padding: 3px; }
  .mcal .d { font-size: 15px; }
  .mcal .h, .mcal .r { font-size: 9.5px; }
}
.lang-en-page .mcal .sat { color: inherit; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.facts ul { margin: 0; padding-left: 1.2em; }
.facts h3 { margin-top: 0; }
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.faq details {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.faq details + details { margin-top: 8px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 10px 0 0; }
