/* おやのて 共通スタイル
   読みやすさ優先：大きめの文字、高コントラスト、スマホで押しやすいボタン */

:root {
  /* 白を基調に、きみどり（安心・やさしさ）とオレンジ（あたたかさ・電話など行動）の2色。枠はすべて四角。 */
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f8f1;
  --text: #2b3027;
  --muted: #636b5c;
  --line: #dde3d2;
  --primary: #4f8a1f;       /* 文字・ボタン用の濃いみどり（白文字が読める濃さ） */
  --primary-ink: #ffffff;
  --primary-soft: #eef6e1;
  --leaf: #a8d164;          /* きみどり（飾り・区切り線） */
  --accent: #e8792b;        /* オレンジ */
  --accent-ink: #ffffff;
  --accent-text: #b8571a;   /* 白地に置くオレンジ文字 */
  --accent-soft: #fff3e8;
  --warn-soft: #fff6ec;
  --warn-line: #f2c79c;
  --radius: 0;
  --shadow: none;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 17px; -webkit-text-size-adjust: 100%; }
html.font-lg { font-size: 20px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.8;
}

a { color: var(--primary); }
a:hover { text-decoration-thickness: 2px; }

img { max-width: 100%; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---------- ヘッダー ---------- */
.site-header {
  background: var(--surface);
  border-top: 4px solid var(--leaf);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  flex-wrap: wrap;
}
.logo {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}
.logo-mark {
  width: 32px; height: 32px;
  border-radius: 0;
  background: var(--primary);
  color: var(--primary-ink);
  display: grid; place-items: center;
  font-size: 1rem;
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 12px;
  font: inherit;
  color: var(--text);
}
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 0;
  font-size: .92rem;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.font-btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 4px 10px;
  font: inherit;
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; width: 100%; flex-direction: column; padding-bottom: 10px; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 12px; font-size: 1rem; }
}

/* ---------- 緊急バー ---------- */
.urgent {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.urgent .wrap { padding-top: 8px; padding-bottom: 8px; }
.urgent strong { color: var(--accent-text); }

/* ---------- 本文 ---------- */
main { padding: 28px 0 60px; }

h1 { font-size: 1.7rem; line-height: 1.4; margin: 0 0 12px; }
h2 {
  font-size: 1.3rem;
  line-height: 1.4;
  margin: 40px 0 14px;
  padding: 4px 0 6px 12px;
  border-left: 6px solid var(--leaf);
  border-bottom: 1px solid var(--line);
  text-wrap: balance;
}
h1 { text-wrap: balance; }
h3 { font-size: 1.12rem; margin: 24px 0 8px; }
p { margin: 0 0 14px; }
.lead { font-size: 1.05rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

.hero {
  background: var(--primary-soft);
  border-left: 6px solid var(--leaf);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.hero h1 { font-size: 1.6rem; margin-bottom: 6px; }
.hero p { margin: 0; }

/* トップの大項目タイル */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-bottom: 18px;
}
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 14px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-top: 4px solid var(--leaf);
  margin-top: -1px;
  color: var(--text);
  text-decoration: none;
}
.tile.find { border-top-color: var(--accent); }
.tile strong { font-size: 1.02rem; line-height: 1.4; }
.tile span { font-size: .8rem; color: var(--muted); line-height: 1.5; }
.tile:hover { background: var(--surface-2); }
.tile.find:hover { background: var(--accent-soft); }

.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--warn-line);
  margin-bottom: 8px;
}
.quick label { font-weight: 700; color: var(--accent-text); }
.quick select { flex: 1 1 180px; }

/* ---------- カード ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
a.card { color: var(--text); text-decoration: none; display: block; transition: border-color .15s; }
a.card:hover { border-color: var(--primary); }
.card .icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 12px 14px 12px 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 10px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px; top: 12px;
  width: 30px; height: 30px;
  border-radius: 0;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  display: grid; place-items: center;
}

.note {
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  border-radius: 0;
  padding: 12px 16px;
  font-size: .92rem;
  margin: 16px 0;
}
.tip {
  background: var(--primary-soft);
  border-radius: 0;
  padding: 12px 16px;
  margin: 16px 0;
}

/* ---------- 表 ---------- */
.table-wrap { overflow-x: auto; margin: 10px 0 18px; border: 1px solid var(--line); border-radius: 0; }
table { border-collapse: collapse; width: 100%; background: var(--surface); font-size: .94rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-2); overflow-wrap: anywhere; }
td { overflow-wrap: anywhere; }
/* Row-heading tables must leave room for the explanation on narrow screens. */
.table-wrap table:not(:has(tr > :nth-child(3))) tbody th { width: 40%; }
.table-wrap table:has(tr > :nth-child(3)) { min-width: 36rem; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: var(--primary-ink);
  border: none;
  border-radius: 0;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}
.btn:hover { filter: brightness(1.06); }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.tel { background: var(--accent); color: var(--accent-ink); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- タブ（目次） ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 20px; }
.toc a {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 4px 14px;
  text-decoration: none;
  font-size: .9rem;
  color: var(--text);
}
.toc a:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- FAQ ---------- */
details.faq {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 10px;
}
details.faq summary {
  cursor: pointer;
  padding: 14px 16px 14px 48px;
  font-weight: 700;
  position: relative;
  list-style: none;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before {
  content: "Q";
  position: absolute;
  left: 14px; top: 13px;
  width: 24px; height: 24px;
  border-radius: 0;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: .85rem;
  display: grid; place-items: center;
}
details.faq[open] summary { border-bottom: 1px dashed var(--line); }
details.faq .answer { padding: 12px 16px 14px 48px; position: relative; }
details.faq .answer::before {
  content: "A";
  position: absolute;
  left: 14px; top: 13px;
  width: 24px; height: 24px;
  border-radius: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .85rem;
  display: grid; place-items: center;
}
.faq-cat { font-size: .78rem; color: var(--muted); font-weight: 400; margin-left: 6px; }

/* ---------- フォーム ---------- */
.search-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
input[type="search"], input[type="text"], input[type="number"], select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  min-height: 44px;
}
input[type="search"], input[type="text"] { flex: 1 1 220px; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---------- 施設カード ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 0;
  padding: 4px 12px;
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}
a.chip { text-decoration: none; display: inline-block; }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

.facility { display: flex; flex-direction: column; gap: 6px; }
.facility .type {
  display: inline-block;
  font-size: .78rem;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 1px 8px;
  font-weight: 700;
  align-self: flex-start;
}
.facility .sample-badge { background: var(--warn-soft); color: var(--muted); margin-left: 4px; }
.facility h3 { margin: 4px 0 0; font-size: 1.05rem; }
.facility dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: .9rem; }
.facility dt { color: var(--muted); }
.facility dd { margin: 0; word-break: break-all; }
.facility .btn-row { margin-top: 6px; }
.facility .btn { min-height: 40px; padding: 6px 12px; font-size: .92rem; }

/* ---------- フッター ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 24px 0 40px;
  font-size: .86rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }

@media print {
  .site-header, .urgent, .site-footer, .nav-toggle, .chat-form { display: none !important; }
  body { background: #fff; color: #000; }
}

[hidden] { display: none !important; }
.search-bar select { flex: 1 1 160px; }

@media (max-width: 760px) {
  main { padding-top: 16px; }
  .hero { padding: 12px 14px; margin-bottom: 12px; }
  .hero h1 { font-size: 1.3rem; }
  .hero p { font-size: .88rem; line-height: 1.6; }
  .urgent { font-size: .8rem; line-height: 1.6; }
  .tile { padding: 10px 12px 12px; }
  .tile strong { font-size: .95rem; }
  .tile span { font-size: .74rem; }
}

/* 市区町村ページの折りたたみ */
details.section { border: 1px solid var(--line); margin: 0 0 10px; background: var(--surface); }
details.section > summary { list-style: none; cursor: pointer; padding: 0; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary h2 { font-size: 1.1rem; margin: 0; border-bottom: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
details.section > summary h2::after { content: "＋"; margin-left: auto; color: var(--primary); font-weight: 700; }
details.section[open] > summary h2 { border-bottom: 1px solid var(--line); }
details.section[open] > summary h2::after { content: "－"; }
details.section > summary:hover { background: var(--surface-2); }
details.section .grid { padding: 14px; }
.count { white-space: nowrap; font-size: .85rem; font-weight: 400; color: var(--muted); }

/* ---------- まんが ---------- */
.cast { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.cast-item { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 4px 10px 4px 4px; font-size: .85rem; }
.cast-face { width: 46px; height: 50px; overflow: hidden; background: var(--primary-soft); display: block; position: relative; }
.cast-face img { position: absolute; left: 50%; top: 3px; height: 170px; width: auto; max-width: none; transform: translateX(-50%); }
.episode h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.panels { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.panel { margin: 0; border: 2px solid var(--text); background: var(--surface); }
.scene { position: relative; aspect-ratio: 1 / 1; max-width: 100%; overflow: hidden; border-bottom: 2px solid var(--text); }
.scene svg { display: block; width: 100%; height: 100%; }
.bgphoto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.actor { position: absolute; bottom: 3%; width: auto; max-width: none; z-index: 0; pointer-events: none; }
.bubble .who { display: block; font-size: .72em; font-weight: 700; color: var(--accent-text); }
.bubble.tail-off::after { display: none; }
.bubble.tail-off { border-color: var(--accent); }
.koma {
  position: absolute; right: 0; bottom: 0; z-index: 2;
  background: var(--text); color: var(--bg);
  font-size: .75rem; font-weight: 700; padding: 1px 7px;
}
.bubble {
  position: absolute; z-index: 1; margin: 0;
  background: #fff; color: #2b3027;
  border: 2px solid #2b3027;
  border-radius: 1.2em;
  padding: .35em .7em;
  font-size: clamp(.72rem, 2.6vw, .9rem);
  line-height: 1.45;
  font-weight: 700;
}
@media (min-width: 760px) { .bubble { font-size: .82rem; } }
.bubble::after {
  content: ""; position: absolute; bottom: -10px;
  width: 0; height: 0;
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-top: 10px solid #2b3027;
}
.bubble.tail-l::after { left: 22%; }
.bubble.tail-r::after { right: 22%; }
.bubble.think { border-style: dashed; font-weight: 400; background: #fffdf6; }
.bubble.think::after { border-top-color: transparent; }
.panel figcaption {
  padding: 8px 12px;
  background: var(--primary-soft);
  font-size: .88rem;
  line-height: 1.7;
}
.episode .tip ul { margin: 6px 0 10px; padding-left: 1.2em; }
.episode .tip .btn { min-height: 40px; padding: 6px 12px; font-size: .9rem; }

/* 用語集 */
.yougo { margin: 0 0 8px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.yougo .term { padding: 10px 2px; border-bottom: 1px solid var(--line); }
.yougo dt { font-weight: 700; margin-bottom: 2px; }
.yougo dd { margin: 0; font-size: .94rem; color: var(--text); }

/* 道具（計算・案内・チェックリスト） */
.calc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.calc-grid label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .92rem; min-width: 0; }
.calc-grid input, .calc-grid select { font-weight: 400; width: 100%; }
.result { margin: 18px 0; padding: 16px; border: 2px solid var(--primary); background: var(--surface); }
.res-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.res-main strong { font-size: 2rem; color: var(--primary); font-variant-numeric: tabular-nums; }
.meter { height: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-top: 10px; }
.meter span { display: block; height: 100%; background: var(--leaf); }
label.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
label.check:last-child { border-bottom: none; }
label.check input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.tile[aria-current="true"] { background: var(--accent-soft); outline: 3px solid var(--accent); outline-offset: -3px; }

/* Keep navigation, forms and cards usable on small screens and with large text. */
:where(h1, h2, h3, p, .btn, .chip, .toc a) { overflow-wrap: anywhere; }
[id] { scroll-margin-top: 9rem; }
.grid { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
.calc-grid { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.search-bar > input, .search-bar > select, .quick select { min-width: 0; max-width: 100%; }
.facility dl { grid-template-columns: auto minmax(0, 1fr); }
button:focus-visible, summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.font-btn, .nav-toggle, .chip, .toc a { min-height: 44px; }
@media (max-width: 480px) {
  .site-header .wrap { gap: 6px; padding-top: 6px; padding-bottom: 6px; }
  .logo { font-size: 1rem; gap: 5px; }
  .logo-mark { width: 28px; height: 28px; flex: none; }
  .font-btn, .nav-toggle { padding: 4px 7px; font-size: .75rem; }
  html.font-lg .logo { font-size: .9rem; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  th, td { padding: 8px; }
  .table-wrap table:not(:has(tr > :nth-child(3))) tbody th { width: 40%; }
  td.num { white-space: normal; }
}
@media print {
  .scene, .panel, .card { break-inside: avoid; }
  .table-wrap { overflow: visible; }
}

.skip-link { position: absolute; left: 12px; top: -100px; background: #fff; padding: 8px 12px; z-index: 20; }
.skip-link:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
