/* 西原小学校 学区まちガイド — 藍色×桜色の水彩デザイン */
:root {
  --ai: #2F5D8A;          /* 藍色：見出し・リンク */
  --ai-dk: #234766;
  --ai-lt: #E6EEF6;
  --sakura: #F2B3C4;
  --sakura-lt: #FBEAEF;
  --leaf: #8FB57E;
  --leaf-dk: #4E7346;
  --kaido: #E8A33D;
  --boshin: #8A6BB8;
  --castle: #5E9A63;
  --paper: #FBF7EE;
  --card: #FFFDF8;
  --sumi: #3A342E;
  --sumi-2: #645C53;
  --line: #E7DDCB;
  --radius: 18px;
  --brush: "Zen Kurenaido", "Klee One", "Zen Maru Gothic", cursive;  /* 見出し：やわらかい筆ペン。水彩のにじみと合う */
  --hand: "Klee One", "Zen Maru Gothic", cursive;                     /* ひとこと・吹き出し：教科書のような手書き風 */
  --round: "Zen Maru Gothic", "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; color: var(--sumi); font-family: var(--round); font-size: 16px; line-height: 1.8;
  background: var(--paper);
  background-image:
    radial-gradient(900px 420px at 0% 0%, rgba(173,205,226,.35), transparent 60%),
    radial-gradient(800px 500px at 100% 10%, rgba(242,179,196,.18), transparent 60%),
    radial-gradient(900px 600px at 50% 100%, rgba(143,181,126,.15), transparent 60%);
}
a { color: var(--ai); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--ai); outline-offset: 2px; border-radius: 6px; }
.small { font-size: .875rem; color: var(--sumi-2); }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.draft-banner { margin: 0; padding: 6px 16px; font-size: .82rem; background: #FFF4DA; border-bottom: 1px solid #F0DDA8; text-align: center; }
button { font-family: inherit; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: relative; max-width: 1240px; margin: 0 auto; padding: 18px 20px 6px;
  display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 8px 24px;
}
.site-title { margin: 0; font-family: var(--brush); font-weight: 400; line-height: 1.15; }
.site-title a { color: var(--ai); text-decoration: none; display: inline-flex; flex-direction: column; }
.site-title span:first-child { font-size: clamp(1.6rem, 5vw, 2.6rem); letter-spacing: .06em; }
.site-title span:last-child { font-size: clamp(2rem, 6.4vw, 3.4rem); letter-spacing: .04em; transform: rotate(-2deg); transform-origin: left; }
.tagline { margin: 4px 0 0 1.2em; font-family: var(--brush); color: var(--ai-dk); font-size: clamp(.95rem, 2.4vw, 1.15rem); transform: rotate(-2deg); }
.motto { display: none; }
.menu-btn { display: none; width: 48px; height: 48px; border: 0; background: rgba(255,255,255,.7); border-radius: 12px; cursor: pointer; place-content: center; gap: 6px; }
.menu-btn span { display: block; width: 24px; height: 3px; border-radius: 2px; background: var(--ai); transition: transform .2s, opacity .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
.gnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 0; padding: 8px 18px; background: rgba(255,255,255,.75); border-radius: 999px; box-shadow: 0 2px 10px rgba(58,52,46,.06); }
.gnav a { text-decoration: none; color: var(--sumi); font-size: .9rem; padding: 6px 2px; display: inline-block; }
.gnav a:hover { color: var(--ai); }
@media (min-width: 960px) {
  .motto { display: block; position: absolute; right: 24px; top: 92px; margin: 0; padding: 10px 18px; font-family: var(--brush); color: var(--ai-dk); background: rgba(205,224,238,.7); border-radius: 24px 30px 22px 28px; transform: rotate(4deg); line-height: 1.4; }
}
@media (max-width: 760px) {
  .menu-btn { display: grid; }
  .gnav { grid-column: 1 / -1; }
  .gnav[data-open="false"] { display: none; }
  .gnav ul { flex-direction: column; border-radius: 16px; }
}

/* ---------- 地図 ---------- */
.map-section { max-width: 1240px; margin: 8px auto 0; padding: 0 16px; display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 960px) { .map-section { grid-template-columns: minmax(0, 1fr) 270px; } }
.map-wrap { position: relative; align-self: start; border-radius: 26px; overflow: hidden; background: #F6F1E3; box-shadow: 0 6px 24px rgba(58,52,46,.10), inset 0 0 0 1px rgba(160,140,110,.15); }
.map-viewport { width: 100%; aspect-ratio: 1000 / 890; touch-action: none; cursor: grab; }
.map-viewport.dragging { cursor: grabbing; }
.map-svg { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.map-tools { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-tools button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.92); font-size: 1.2rem; color: var(--ai); cursor: pointer; }
.map-hint { transition: opacity .4s; position: absolute; left: 14px; top: 10px; margin: 0; font-family: var(--hand); color: var(--ai-dk); background: rgba(255,253,248,.85); padding: 4px 12px; border-radius: 14px; font-size: .95rem; line-height: 1.4; pointer-events: none; }
.map-quiz-banner { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: #fff; border: 2px solid var(--sakura); padding: 8px 16px; border-radius: 16px; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.1); max-width: 90%; text-align: center; }

.pin { cursor: pointer; }
.pin .pin-bg { transition: transform .15s; transform-box: fill-box; transform-origin: center; }
.pin:hover .pin-bg, .pin:focus .pin-bg, .pin.active .pin-bg { transform: scale(1.12); }
.pin:focus { outline: none; }
.pin:focus-visible .pin-ring { stroke: var(--ai); stroke-width: 4; }
.pin-label { font-family: var(--round); font-weight: 700; font-size: 19px; fill: var(--sumi); paint-order: stroke; stroke: #FFFDF8; stroke-width: 5px; stroke-linejoin: round; pointer-events: none; }
.pin.dim { opacity: .22; }
.pin.dim .pin-label { display: none; }
.route { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 14; opacity: .9; }

.map-panel { display: flex; flex-direction: column; gap: 12px; }
.panel-card { background: rgba(255,253,248,.92); border: 1px solid var(--line); border-radius: 20px; padding: 12px 14px; }
.panel-title { margin: 0 0 8px; font-family: var(--brush); font-weight: 400; color: var(--ai-dk); font-size: 1.15rem; }
.legend-list { list-style: none; margin: 0; padding: 0; font-size: .88rem; display: grid; gap: 2px; }
.legend-list li { display: flex; align-items: center; gap: 8px; }
.lg { display: inline-block; width: 22px; height: 14px; border-radius: 4px; flex: none; }
.lg-school { background: #F1E3C6; border: 2px solid var(--ai); border-radius: 50%; width: 16px; height: 16px; }
.lg-spot { background: #fff; border: 2px solid #C9B79A; border-radius: 50%; width: 16px; height: 16px; }
.lg-approx { background: #fff; border: 2px dashed #B9A07C; border-radius: 50%; width: 16px; height: 16px; }
.lg-major { background: #F3DFA0; height: 8px; }
.lg-rail { background: repeating-linear-gradient(90deg, #6A6A6A 0 6px, #fff 6px 10px); height: 5px; border: 1px solid #6A6A6A; }
.lg-river { background: linear-gradient(90deg, #A9CBE0, #F2B3C4); height: 8px; }

.thread-btns { display: grid; gap: 8px; }
.thread-btn { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 2px solid transparent; background: var(--tb-lt); color: var(--sumi); font-weight: 700; cursor: pointer; text-align: left; font-size: .95rem; }
.thread-btn .ti { width: 38px; height: 38px; border-radius: 50%; background: var(--tb); color: var(--tb); display: grid; place-items: center; flex: none; }
.thread-btn .ti svg { width: 26px; height: 26px; }
.thread-btn[aria-pressed="true"] { border-color: var(--tb); background: #fff; }

#eraRange { width: 100%; accent-color: var(--ai); }
.era-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--sumi-2); line-height: 1.3; }
.era-labels span { width: 20%; text-align: center; }
.era-text { margin: 6px 0 0; font-size: .85rem; min-height: 3em; }

/* ---------- セクション ---------- */
.section { max-width: 1240px; margin: 36px auto 0; padding: 0 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 12px; }
.section-head .small { flex-basis: 100%; margin: 0; }
.h2 { margin: 0; font-family: var(--brush); font-weight: 400; color: var(--ai-dk); font-size: 1.7rem; display: flex; align-items: center; gap: 8px; }
.leaf { width: 26px; height: 26px; background: radial-gradient(circle at 30% 30%, #B7D3A2, #7EA86F); border-radius: 0 60% 0 60%; transform: rotate(-20deg); display: inline-block; }
.more { font-size: .95rem; text-decoration: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; cursor: pointer; text-align: center; box-shadow: 0 3px 12px rgba(58,52,46,.06); transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; padding: 0; font: inherit; color: inherit; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(58,52,46,.12); }
.card-art { position: relative; aspect-ratio: 3 / 2; background: #FBF7EE; overflow: hidden; }
.card-art svg, .card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-art img { object-fit: cover; }
.card-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-name { font-family: var(--brush); font-size: 1.3rem; margin: 0; color: var(--ai-dk); line-height: 1.4; }
.card-catch { font-family: var(--hand); font-size: .92rem; color: var(--sumi-2); margin: 0; flex: 1; }
.card-meta { display: flex; justify-content: center; align-items: center; gap: 10px; font-size: .8rem; color: var(--sumi-2); margin-top: 6px; }
.id-badge { background: var(--ai); color: #fff; border-radius: 8px; padding: 0 8px; font-weight: 700; font-size: .78rem; }
.approx-tag { font-size: .72rem; border: 1px dashed #B9A07C; border-radius: 8px; padding: 0 6px; color: #8A6E4C; }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: .9rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ai); color: #fff; border-color: var(--ai); }

/* 3パネル */
.trio { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .trio { grid-template-columns: repeat(3, 1fr); } }
.trio-card { border-radius: 24px; padding: 18px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.trio-card .sub { margin: -6px 0 4px; font-size: .9rem; color: var(--sumi-2); }
.trio-card.pink { background: linear-gradient(160deg, #FCEEF2, #FFFAF4); }
.trio-card.blue { background: linear-gradient(160deg, #EAF2F9, #FFFDF8); }
.trio-card.cream { background: linear-gradient(160deg, #FFF6E6, #F4F9EE); }
.big { font-size: 2.2rem; color: var(--ai); line-height: 1; }
.thread-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; background: rgba(255,255,255,.75); border-radius: 18px; padding: 8px; cursor: pointer; border: 0; text-align: left; font: inherit; color: inherit; }
.thread-row .tag { display: flex; align-items: center; gap: 6px; background: var(--tb); color: #fff; border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 700; white-space: nowrap; }
.thread-row .tag .ti { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; color: var(--tb); }
.thread-row .tag .ti svg { width: 24px; height: 24px; }
.thread-row p { margin: 0; font-size: .88rem; line-height: 1.5; }
.thread-row .q { display: block; color: var(--sumi-2); font-size: .8rem; margin-top: 2px; }
.era-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.era-tile { border: 0; background: rgba(255,255,255,.8); border-radius: 18px; padding: 8px; cursor: pointer; font: inherit; text-align: center; }
.era-tile b { display: block; color: var(--ai-dk); }
.era-tile span { font-size: .75rem; color: var(--sumi-2); }
.era-tile .mini { height: 64px; border-radius: 50%/40%; overflow: hidden; margin: 4px auto 0; width: 86%; }
.era-tile .mini img { width: 100%; height: 100%; object-fit: cover; }
.era-tile b { font-family: var(--brush); font-weight: 400; font-size: 1.1rem; }
.pill-link { align-self: center; border: 1px solid var(--ai); border-radius: 999px; padding: 4px 18px; text-decoration: none; background: #fff; font-size: .9rem; }
.fun-btn { display: flex; align-items: center; gap: 12px; border-radius: 999px; padding: 8px 16px 8px 8px; text-decoration: none; color: var(--sumi); font-weight: 700; background: #fff; border: 2px solid var(--fb); }
.fun-btn span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fb); color: #fff; flex: none; }
.fun-btn.orange { --fb: #F0B24E; } .fun-btn.pink { --fb: #EE8FA8; } .fun-btn.blue { --fb: #6FA3CF; }
.guide-say { display: flex; align-items: flex-end; gap: 8px; margin-top: auto; }
.keyaji { width: 92px; flex: none; }
.bubble { position: relative; margin: 0; background: #fff; border-radius: 18px; padding: 10px 12px; font-size: .85rem; line-height: 1.55; font-family: var(--hand); border: 1px solid var(--line); }

/* ミッション */
.stamp-meter { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.stamp-bar { flex: 1; height: 14px; background: #fff; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.stamp-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sakura), #F0B24E); transition: width .3s; }
.stamp-meter p { margin: 0; font-weight: 700; white-space: nowrap; }
.missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mission { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px; }
.stamp { width: 64px; height: 64px; border-radius: 50%; border: 3px dashed #D9C9AE; display: grid; place-items: center; font-family: var(--hand); color: #C9B79A; font-size: .8rem; text-align: center; line-height: 1.2; }
.mission.done .stamp { border: 3px solid #D2553F; color: #D2553F; background: #FFF1EC; transform: rotate(-8deg); font-size: .95rem; }
.mission h3 { margin: 0; font-size: 1rem; }
.mission p { margin: 2px 0 6px; font-size: .85rem; }
.btn { border: 0; background: var(--ai); color: #fff; border-radius: 999px; padding: 6px 16px; font-weight: 700; cursor: pointer; font-size: .9rem; }
.btn.ghost { background: #fff; color: var(--ai); border: 1px solid var(--ai); }
.btn.small { padding: 3px 12px; font-size: .8rem; }
.cert { margin-top: 16px; text-align: center; background: #FFFBEF; border: 6px double #D4B26A; border-radius: 12px; padding: 20px; }
.cert-title { font-family: var(--brush); font-size: 2rem; color: #A07A2A; margin: 0; }

/* クイズ */
.quiz-box { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 18px; max-width: 760px; }
.quiz-level { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.quiz-q { font-size: 1.15rem; font-weight: 700; margin: 6px 0 12px; }
.quiz-progress { font-size: .85rem; color: var(--sumi-2); }
.quiz-choices { display: grid; gap: 8px; }
.quiz-choice { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 14px; font-size: 1rem; cursor: pointer; }
.quiz-choice:hover:not(:disabled) { border-color: var(--ai); }
.quiz-choice.correct { border-color: #5E9A63; background: #EEF7EA; }
.quiz-choice.wrong { border-color: #D2553F; background: #FDEEEB; }
.quiz-ex { margin: 12px 0 0; padding: 10px 14px; background: var(--ai-lt); border-radius: 14px; font-size: .92rem; }
.quiz-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.quiz-score { font-size: 1.5rem; font-family: var(--hand); color: var(--ai-dk); }

/* エピソード */
.episodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.episode { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; }
.episode h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--ai-dk); }
.episode p { margin: 0 0 8px; font-size: .9rem; }
.legend-tag { font-size: .75rem; background: #F6EEDC; border-radius: 8px; padding: 1px 8px; color: #7A5E35; white-space: nowrap; }

/* 年表 */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 3px dotted var(--sakura); }
.timeline li { position: relative; padding: 6px 0 10px 14px; }
.timeline li::before { content: ""; position: absolute; left: -27px; top: 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--era-c, var(--ai)); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.timeline .yr { font-weight: 700; color: var(--ai-dk); margin-right: 10px; }
.timeline button { border: 0; background: none; color: var(--ai); text-decoration: underline; cursor: pointer; font-size: .85rem; padding: 0 4px; }
.timeline .era-head { font-family: var(--brush); font-size: 1.2rem; color: var(--sumi-2); padding-left: 0; }
.timeline .era-head::before { display: none; }

/* about */
.about-grid { display: grid; gap: 20px; grid-template-columns: 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 18px 20px; margin-top: 12px; }
@media (min-width: 860px) { .about-grid { grid-template-columns: 1fr 1fr; } }
.about h3 { margin: 0 0 6px; color: var(--ai-dk); font-size: 1.05rem; }
.about ul { padding-left: 1.2em; margin: 0 0 12px; }

/* フッター */
.site-footer { position: relative; margin-top: 48px; padding: 70px 16px 28px; text-align: center; }
.site-footer p { margin: 0; }
.foot-town { position: absolute; inset: 0 0 auto 0; height: 70px; }
.foot-town svg { width: 100%; height: 100%; }
.page-top { position: absolute; right: 16px; bottom: 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; text-decoration: none; text-align: center; line-height: 1.1; font-size: 1.1rem; }
.page-top span { font-size: .6rem; }

/* ---------- 詳細シート ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(40,36,30,.42); z-index: 50; }
.sheet { position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, 94vw); max-height: 92vh; overflow: auto; background: var(--paper); border-radius: 26px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
@media (max-width: 640px) { .sheet { top: auto; bottom: 0; transform: translateX(-50%); width: 100vw; max-height: 90vh; border-radius: 26px 26px 0 0; } }
.sheet-close { position: sticky; top: 10px; float: right; margin: 10px 10px 0 0; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1.5rem; cursor: pointer; z-index: 2; }
.sheet-body { padding: 0 0 24px; }
.d-hero { aspect-ratio: 3 / 2; max-height: 340px; width: 100%; overflow: hidden; }
.d-hero svg, .d-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-hero img { object-fit: contain; background: #FBF7EE; }
.d-inner { padding: 0 20px; }
.d-title { margin: 14px 0 0; font-family: var(--brush); font-weight: 400; font-size: 2rem; line-height: 1.3; color: var(--ai-dk); }
.d-yomi { font-size: .85rem; color: var(--sumi-2); margin: 0; }
.d-kind { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.d-tag { font-size: .78rem; border-radius: 999px; padding: 1px 10px; background: var(--ai-lt); color: var(--ai-dk); }
.d-tag.th { background: var(--tb); color: #fff; }
.d-catch { margin: 10px 0 0; font-family: var(--hand); font-size: 1.35rem; color: var(--ai-dk); }
.d-mode { display: inline-flex; margin: 14px 0 4px; border: 2px solid var(--ai); border-radius: 999px; overflow: hidden; }
.d-mode button { border: 0; background: #fff; color: var(--ai); padding: 4px 16px; font-weight: 700; cursor: pointer; }
.d-mode button[aria-pressed="true"] { background: var(--ai); color: #fff; }
.d-sec { margin-top: 16px; }
.d-sec h3 { margin: 0 0 4px; font-size: 1rem; color: var(--ai-dk); display: flex; align-items: center; gap: 6px; }
.d-sec h3 .no { width: 24px; height: 24px; border-radius: 50%; background: var(--sakura); color: #fff; display: inline-grid; place-items: center; font-size: .78rem; }
.d-sec p { margin: 0; }
.d-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.d-table th { text-align: left; white-space: nowrap; color: var(--sumi-2); font-weight: 500; padding: 4px 12px 4px 0; vertical-align: top; width: 7em; }
.d-table td { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.d-hist { margin: 0; padding-left: 1.2em; }
.d-deep { background: #fff; border-left: 5px solid var(--ai); border-radius: 0 14px 14px 0; padding: 10px 14px; }
.d-episode { background: #FFF8EA; border-radius: 14px; padding: 10px 14px; }
.d-mission { background: #F0F6EB; border-radius: 14px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.d-note { background: #FFF4DA; border-radius: 14px; padding: 8px 14px; font-size: .85rem; }
.d-related { display: flex; flex-wrap: wrap; gap: 8px; }
.d-related button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: .88rem; }
.d-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.gmap { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--ai); border-radius: 999px; padding: 6px 16px; text-decoration: none; font-weight: 700; }
.d-sources { font-size: .8rem; color: var(--sumi-2); margin: 6px 0 0; padding-left: 1.2em; }
.solemn-note { font-size: .85rem; background: #EEF0F3; border-radius: 12px; padding: 6px 12px; margin-top: 10px; }

@media print {
  body > *:not(main), main > *:not(#mission), .draft-banner, #mission > *:not(.cert) { display: none !important; }
  .cert { display: block !important; border-width: 10px; margin-top: 30vh; }
}

@media (max-width: 640px) {
  .map-hint { top: auto; bottom: 10px; left: 10px; font-size: .8rem; }
  .map-tools button { width: 38px; height: 38px; }
  .thread-btns { grid-template-columns: repeat(3, 1fr); }
  .thread-btn { flex-direction: column; gap: 2px; padding: 6px; border-radius: 16px; font-size: .8rem; text-align: center; }
}

/* ---------- 水彩画まわり ---------- */
.header-art { display: none; }
@media (min-width: 960px) {
  .header-art { display: block; position: absolute; right: 190px; top: 74px; width: 250px; opacity: .95; pointer-events: none; z-index: -1;
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 55%, transparent 100%); mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 55%, transparent 100%); }
  .site-header { min-height: 190px; }
}
.d-hero { background: radial-gradient(ellipse at 50% 60%, #FFFDF8, #F6EFDF); }
.d-hero img { background: transparent; padding: 8px 8px 0; }
.thread-row p, .episode p, .mission p, .d-sec p, .d-hist { font-family: var(--round); }
.d-episode b, .episode h3, .mission h3 { font-family: var(--brush); font-weight: 400; font-size: 1.15rem; }
.quiz-q { font-family: var(--hand); font-weight: 600; }
.pin-label { font-family: "Klee One", var(--round); font-weight: 600; }
.bubble { font-size: .9rem; }
.wip { position: absolute; right: 8px; bottom: 6px; font-size: .7rem; background: rgba(255,253,248,.9); border-radius: 8px; padding: 0 8px; color: var(--sumi-2); }
.card-art svg { opacity: .8; }

/* ---------- 西原エリアのまちを行き来するバー ---------- */
.area-switch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 16px; background: rgba(230,238,246,.85); border-bottom: 1px solid var(--line); font-size: .82rem; }
.area-switch .area-label { color: var(--sumi-2); margin-right: 4px; font-family: var(--brush); font-size: .95rem; }
.area-switch a { text-decoration: none; padding: 3px 12px; border-radius: 999px; border: 1px solid rgba(47,93,138,.35); background: #fff; color: var(--ai); }
.area-switch a[aria-current="page"] { background: var(--ai); border-color: var(--ai); color: #fff; }
.gnav a.to-area { color: #66558F; font-weight: 700; }
.area-link { margin: 0 0 8px; }
.area-link a { display: inline-block; padding: 6px 14px; border-radius: 999px; background: #EEE9F7; color: #66558F; text-decoration: none; font-weight: 700; font-size: .9rem; }
.area-footer { margin: 4px 0 !important; font-size: .9rem; }

/* 中くらいの幅では、メニューをタイトルの下の段に回してタイトルがつぶれないようにする */
@media (min-width: 761px) and (max-width: 1100px) {
  .gnav { grid-column: 1 / -1; }
  .header-art { display: none; }
  .site-header { min-height: 0; }
}
