:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1d232b;
  --muted: #5d6772;
  --line: #dde1e6;
  --accent: #1f3a5f;
  --accent-soft: #e6edf5;
  --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; }

.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; }

.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); }

.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; }

/* ---- 計算ツール共通 ---- */
.tool { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; margin-top: 24px; align-items: start; }
@media (max-width: 900px) { .tool { grid-template-columns: minmax(0, 1fr); } }
.tool-form .fields { margin-top: 0; }
.field small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.field input[type='number'] { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid #c9cfd6; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.stat span { display: block; font-size: 13px; color: var(--muted); }
.stat b { display: block; font-size: 22px; line-height: 1.4; overflow-wrap: anywhere; }
.stat small { display: block; font-size: 12px; color: var(--muted); }
.stat.hot b { color: var(--sun); }
.stat.good b { color: #1d7a46; }
.chart { margin: 20px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.chart figcaption { font-size: 13px; font-weight: 700; color: var(--muted); }
.chart svg { display: block; width: 100%; height: auto; }
.disclaimer { margin-top: 24px; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); font-size: 14px; }
.cross { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cross a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none; }
.cross a:hover { border-color: var(--accent); }
.cross small { display: block; color: var(--muted); }
table.data th { white-space: nowrap; }
.prose table.data th { width: 9em; }

/* ---- 小さな画面の調整 ---- */
@media (max-width: 720px) {
  .logo { white-space: normal; line-height: 1.3; min-width: 0; }
}
.prose table.data th { width: auto; white-space: nowrap; }
.tbl-wrap table.data td { min-width: 11em; }

/* ---- 入力欄 ---- */
.field > span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.inline select { width: auto; flex: none; min-height: 40px; padding: 6px 10px; border: 1px solid #c9cfd6; border-radius: 8px; background: #fff; font: inherit; font-size: 15px; }


/* ---- QRコード作成 ---- */
.qr-tool { grid-template-columns: minmax(0, 1fr) 380px; }
@media (max-width: 900px) { .qr-tool { grid-template-columns: minmax(0, 1fr); } }
.tool-form .fields { grid-template-columns: 1fr 1fr; }
.tool-form textarea { width: 100%; padding: 8px 10px; border: 1px solid #c9cfd6; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 15px; resize: vertical; }
.field input[type='url'], .field input[type='email'], .field input[type='tel'] { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid #c9cfd6; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; }
.field input[type='color'] { width: 100%; height: 40px; padding: 2px; border: 1px solid #c9cfd6; border-radius: 8px; background: #fff; }
.field input[type='file'] { width: 100%; font-size: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check.wide, .note.wide { grid-column: 1 / -1; }
.types { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; border: 0; }
.types legend { margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.types label { cursor: pointer; }
.types input { position: absolute; opacity: 0; pointer-events: none; }
.types span { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 14px; }
.types input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 700; }
.types input:focus-visible + span { outline: 3px solid #f2b705; outline-offset: 2px; }
.opts { margin-top: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.opts summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.opts .fields { margin-top: 12px; }
.opts .note { margin: 10px 0 0; font-size: 12px; }
.tool-form > .field { margin-top: 16px; }
.qr-side { display: grid; gap: 12px; min-width: 0; position: sticky; top: 72px; }
@media (max-width: 900px) { .qr-side { position: static; } }
.qr-box { display: grid; place-items: center; aspect-ratio: 1; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: repeating-conic-gradient(#f0f2f5 0 25%, #fff 0 50%) 0 0 / 20px 20px; }
.qr-box svg { display: block; width: 100%; height: auto; max-width: 100%; }
.qr-box .placeholder, .bulk-grid .placeholder { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row .btn { flex: 1 1 auto; }
.msg { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fff4dc; border-left: 4px solid #d98a00; font-size: 13px; }
.msg span { display: block; }
.msg span + span { margin-top: 4px; }
.qr-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.qr-facts div { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qr-facts dt { font-size: 12px; color: var(--muted); }
.qr-facts dd { margin: 0; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.raw summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.raw pre { max-height: 200px; margin: 8px 0 0; padding: 10px; overflow: auto; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.feature { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.feature h3 { margin: 0 0 4px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.count { flex: 0 0 auto; font-size: 18px; }
.bulk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; max-height: 70vh; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.bulk-grid figure { margin: 0; text-align: center; }
.bulk-grid svg { display: block; width: 100%; height: auto; }
.bulk-grid figcaption { font-size: 11px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bulk-grid .note { grid-column: 1 / -1; }
@media (max-width: 480px) {
  .tool-form .fields, .qr-facts { grid-template-columns: minmax(0, 1fr); }
}

/* ---- 印刷 ---- */
.print-area { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body.printing > *:not(.wrap), body.printing .site-head, body.printing .site-foot { display: none !important; }
  body.printing main > *:not(.print-area) { display: none !important; }
  body.printing main { padding: 0; max-width: none; }
  body.printing { background: #fff; }
  body.printing .print-area { display: block; }
  .print-page { display: grid; width: 210mm; height: 297mm; box-sizing: border-box; page-break-after: always; break-after: page; }
  .print-page:last-child { page-break-after: auto; break-after: auto; }
  .print-page .cell { display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
  .print-page .qr svg, .print-single .qr svg { display: block; width: 100%; height: 100%; }
  .print-page .cap { width: 92%; text-align: center; line-height: 1.25; overflow: hidden; color: #000; }
  .print-page .cap b, .print-single b { display: block; }
  .print-page .cap span, .print-single figcaption span { display: block; }
  .print-single { display: flex; flex-wrap: wrap; gap: 10mm; padding: 15mm; }
  .print-single figure { display: flex; flex-direction: column; align-items: center; margin: 0; break-inside: avoid; }
  .print-single figure.card-print { flex-direction: row; gap: 6mm; padding: 6mm 8mm; border: 0.3mm dashed #888; border-radius: 3mm; }
  .print-single figcaption { margin-top: 3mm; font-size: 4mm; line-height: 1.5; color: #000; overflow-wrap: anywhere; }
  .print-single .card-print figcaption { margin: 0; max-width: 80mm; font-size: 4.2mm; }
  .print-single .card-print figcaption b { font-size: 6mm; margin-bottom: 2mm; }
}
