/* ==========================================================================
   宝塚くらしの便利帳 — Takarazuka Living Guide  Design System
   Brand: sumire violet × stage gold on warm washi — tuned for daily utility.
   Type: Zen Kaku Gothic New (body) / Zen Old Mincho (display)
   ========================================================================== */

:root {
  color-scheme: light dark;
  /* inks & papers (shared with 宝塚百景) */
  --ink: #203238;
  --ink-soft: #4b5d62;
  --ink-faint: #5c6d71; /* AA fix: 5.01:1 on paper (was #708185 = 3.76:1 FAIL) */
  --paper: #f3f7f5;
  --paper-2: #e7efeb;
  --line: #d2dfda;
  --white: #ffffff;

  /* brand */
  --sumire: #5d467d;
  --sumire-deep: #40305c;
  --sumire-night: #213943;
  --gold: #c98732;              /* large/decorative/on-dark only */
  --gold-text: #8a6122;         /* AA fix: 5.10:1 on paper — for gold-toned TEXT on light */
  --gold-bright: #f1bb58;
  --vermilion: #bd4f3e;
  --vermilion-deep: #90382c;
  --seiji: #237d78;

  /* category accents (12) — AA on white for text use */
  --c-emergency: #b6432e;
  --c-disaster:  #b05c21;
  --c-garbage:   #5d7a3c;
  --c-procedure: #5a3e8e;
  --c-childcare: #a8527c;
  --c-medical:   #2e7268;
  --c-welfare:   #3e5e8e;
  --c-tax:       #8a6d23;
  --c-lifeline:  #3a7290;
  --c-transport: #7a3b52;
  --c-facility:  #4f6e54;
  --c-events:    #9a6b1f;

  --serif-ja: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  /* Universal Design body font (Morisawa BIZ UD, SIL OFL) for civic/all-age legibility; Zen Kaku as graceful fallback */
  --sans: "BIZ UDPGothic", "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;

  --maxw: 1100px;
  --radius: 8px;
  --radius-s: 6px;
  --shadow: 0 10px 30px rgba(36, 29, 49, .10);
  --shadow-soft: 0 3px 12px rgba(36, 29, 49, .07);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: anywhere;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--sumire); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
ul, ol { padding-left: 1.3em; margin: .4em 0; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--gold-pale, #f0dca8); }

/* washi grain */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.022 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
header, main, footer, nav { position: relative; z-index: 1; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--sumire-deep); color: #fff; padding: .55em 1.1em;
  border-radius: 0 0 10px 10px; transition: top .2s;
}
.skip-link:focus { top: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ==========================================================================
   header
   ========================================================================== */
.site-head {
  background: var(--sumire-night);
  color: #efe9f8;
  border-bottom: 3px solid var(--gold);
}
.site-head .wrap {
  display: flex; align-items: center; gap: 14px;
  padding-top: 10px; padding-bottom: 10px;
}
.brand {
  display: flex; align-items: baseline; gap: 10px;
  color: #fff; font-family: var(--serif-ja); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .b-main { font-size: 1.25rem; font-weight: 700; letter-spacing: .06em; }
.brand .b-sub { font-size: .72rem; color: var(--gold-bright); letter-spacing: .22em; }
.head-links { margin-left: auto; display: flex; gap: 6px 16px; flex-wrap: wrap; }
.head-links a { color: #cfc3e6; font-size: .82rem; }
.head-links a:hover { color: #fff; }
.menu-toggle { display: none; }

/* ==========================================================================
   sticky topbar (home + cross-page search) — all pages
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(248, 244, 234, .96);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.tb-home {
  flex: none; display: inline-flex; align-items: center; gap: .4em;
  font-size: .84rem; font-weight: 700; color: var(--sumire-deep);
  white-space: nowrap;
}
.tb-home svg { width: 18px; height: 18px; }
.tb-home:hover { text-decoration: none; color: var(--sumire); }
.tb-search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1.5px solid var(--gold);
  border-radius: 99px; padding: 2px 6px 2px 14px; box-shadow: var(--shadow-soft);
}
.tb-search svg { flex: none; width: 18px; height: 18px; color: var(--sumire); }
.tb-search input {
  flex: 1; min-width: 0; border: 0; background: none; font: inherit;
  font-size: .95rem; padding: .5em 0; color: var(--ink);
}
.tb-search input:focus { outline: none; }
.tb-search input::placeholder { color: #9a8fae; }
.tb-clear {
  flex: none; border: 0; background: var(--paper-2); color: var(--ink-soft);
  border-radius: 99px; width: 30px; height: 30px; font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center;
}

/* search results dropdown */
.search-results {
  position: absolute; left: 0; right: 0;
  max-width: var(--maxw); margin: 0 auto; padding: 8px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 0 0 14px 14px; box-shadow: var(--shadow);
  max-height: min(70vh, 560px); overflow-y: auto;
}
.sr-item {
  display: block; padding: 9px 12px; border-radius: 10px;
  border-left: 3px solid var(--cat, var(--sumire)); margin-bottom: 4px;
  color: var(--ink);
}
.sr-item:hover, .sr-item:focus { text-decoration: none; background: var(--paper); }
.sr-cat {
  display: inline-block; font-size: .66rem; font-weight: 700;
  color: #fff; background: var(--cat, var(--sumire));
  border-radius: 5px; padding: .1em .5em; margin-bottom: 3px;
}
.sr-t { display: block; font-weight: 700; font-size: .92rem; line-height: 1.4; }
.sr-s { display: block; font-size: .78rem; color: var(--ink-faint); line-height: 1.5;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sr-empty { font-size: .85rem; color: var(--ink-faint); padding: 10px 12px; margin: 0; }

/* A compact topic rail lets residents move directly from a broad concern to a useful page. */
.topic-nav { background: var(--white); border-bottom: 1px solid var(--line); }
.topic-nav .wrap { display: flex; align-items: stretch; justify-content: space-between; gap: 4px; padding-top: 7px; padding-bottom: 7px; overflow-x: auto; scrollbar-width: none; }
.topic-nav .wrap::-webkit-scrollbar { display: none; }
.topic-nav a { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 34px; padding: 4px 8px; color: var(--ink-soft); font-size: .75rem; font-weight: 700; white-space: nowrap; border-radius: 5px; }
.topic-nav a:hover, .topic-nav a:focus { color: var(--topic); background: color-mix(in srgb, var(--topic) 8%, #fff); text-decoration: none; }
.topic-nav svg { width: 16px; height: 16px; color: var(--topic); }

/* ==========================================================================
   hero
   ========================================================================== */
.hero--living-map {
  position: relative;
  color: #eff8f4;
  background: #213943;
  padding: 64px 0 0;
  overflow: hidden;
}
.hero--living-map::before {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(241, 187, 88, .11) 1px, transparent 1px), linear-gradient(90deg, rgba(241, 187, 88, .09) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, #000 0 48%, transparent 92%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.hero-copy { max-width: 650px; }
.hero-kicker {
  display: flex; align-items: center; gap: 10px; margin: 0 0 15px;
  color: var(--gold-bright); font-size: .7rem; font-weight: 700; letter-spacing: .3em; line-height: 1.2;
}
.hero-kicker::before { content: ""; width: 34px; height: 1px; background: currentColor; }
.hero h1 { font-family: var(--serif-ja); margin: 0; line-height: 1.08; }
.hero-name { display: block; font-size: 2.7rem; font-weight: 900; letter-spacing: .1em; }
.hero-statement { display: block; margin-top: 18px; color: #fff; font-size: 4.25rem; font-weight: 900; letter-spacing: .04em; }
.hero .hero-lede { margin: 20px 0 0; max-width: 34em; color: #c6dad6; font-size: .95rem; line-height: 2; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 25px 0 18px; }
.hero-action {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .6em 1em; border: 1px solid rgba(255,255,255,.36); border-radius: 5px;
  color: #fff; background: transparent; font-size: .86rem; font-weight: 700; text-decoration: none;
}
.hero-action svg { width: 17px; height: 17px; }
.hero-action:hover, .hero-action:focus { color: #fff; text-decoration: none; border-color: var(--gold-bright); background: rgba(255,255,255,.08); }
.hero-search-trigger { border-color: var(--gold-bright); background: var(--gold-bright); color: #273f40; }
.hero-search-trigger:hover, .hero-search-trigger:focus { color: #273f40; background: #ffd07c; }
.hero-updated { display: flex; flex-wrap: wrap; gap: .45em .65em; margin: 0; color: #b6ceca; font-size: .72rem; line-height: 1.5; }
.hero-updated b { color: var(--gold-bright); font-weight: 700; }
.hero-journey { position: absolute; right: 20px; bottom: 46px; display: grid; grid-template-columns: repeat(3, 1fr); width: min(42vw, 420px); padding-top: 17px; border-top: 1px solid rgba(241,187,88,.62); }
.hero-journey::before { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 0 5px rgba(241,187,88,.13); }
.journey-stop { position: relative; padding-top: 12px; color: #dceae7; font-size: .69rem; line-height: 1.3; }
.journey-stop::before { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: #dceae7; }
.journey-stop b, .journey-stop small { display: block; }
.journey-stop b { color: #fff; font-size: .84rem; }
.journey-stop small { color: #adc5c1; margin-top: 2px; }
.journey-traveler { position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--vermilion); box-shadow: 0 0 0 5px rgba(189,79,62,.15); animation: journey-travel 7s ease-in-out infinite; }
.hero-art { position: relative; z-index: 1; max-width: 1320px; margin: 48px auto 0; padding: 0 20px; display: block; line-height: 0; }
.hero-art img, .hero-art svg { width: 100%; display: block; filter: saturate(1.08) contrast(1.02); }

@keyframes journey-travel { 0%, 12% { left: 0; } 42%, 54% { left: 48%; } 84%, 100% { left: calc(100% - 9px); } }

/* Hub-only arrival links: three practical starting points, not a decorative feature list. */
.arrival-strip { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; padding-top: 0; padding-bottom: 0; background: var(--line); border: 1px solid var(--line); }
.arrival-link { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 0 8px; min-height: 120px; padding: 17px 18px; color: var(--ink); background: var(--white); text-decoration: none; overflow: hidden; }
.arrival-link::after { content: ""; position: absolute; right: 0; bottom: 0; width: 68px; height: 3px; background: var(--arrival); transform-origin: right; transition: transform .35s ease; }
.arrival-link:hover, .arrival-link:focus { color: var(--ink); text-decoration: none; }
.arrival-link:hover::after, .arrival-link:focus::after { transform: scale(1.4); }
.arrival-link span { grid-column: 1; color: var(--arrival); font-size: .68rem; font-weight: 700; letter-spacing: .08em; }
.arrival-link strong { grid-column: 1; margin-top: 4px; font-family: var(--serif-ja); font-size: 1.2rem; letter-spacing: .05em; line-height: 1.35; }
.arrival-link small { grid-column: 1; margin-top: 3px; color: var(--ink-soft); font-size: .72rem; }
.arrival-link svg { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 19px; height: 19px; color: var(--arrival); }
.arrival-urgent { --arrival: var(--vermilion); }.arrival-today { --arrival: var(--sumire); }.arrival-local { --arrival: var(--seiji); }

/* ==========================================================================
   hub refinement — a civic guide with a visual scene and direct life-stage paths
   ========================================================================== */
.hero--living-map { min-height: 830px; background: #07434d; padding-top: 34px; padding-bottom: 445px; }
.hero--living-map::before { display: none; }
.hero-inner { z-index: 2; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(390px, .9fr); align-items: end; gap: 46px; }
.hero-copy { max-width: 620px; padding-bottom: 20px; }
.hero-name { font-size: 2rem; letter-spacing: .08em; }
.hero-statement { margin-top: 12px; font-size: 3.85rem; }
.hero .hero-lede { max-width: 31em; color: #d0e1db; }
.hero-stage-nav { align-self: center; padding-bottom: 18px; }
.hero-stage-nav > p { margin: 0 0 4px; color: #a5d3c6; font-size: .66rem; font-weight: 700; letter-spacing: .14em; }
.hero-stage-nav h2 { margin: 0 0 11px; color: #fff; font-family: var(--serif-ja); font-size: 1.2rem; letter-spacing: .05em; }
.stage-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.stage-link { min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 7px 4px; color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; text-align: center; font-size: .68rem; font-weight: 700; line-height: 1.45; transition: transform .22s ease, border-color .22s ease, background .22s ease; }
.stage-link svg { width: 26px; height: 26px; }
.stage-link:hover, .stage-link:focus { color: #fff; text-decoration: none; transform: translateY(-4px); border-color: rgba(255,255,255,.72); }
.stage-home { background: #287d86; }.stage-child { background: #b75d78; }.stage-health { background: #407e98; }.stage-safety { background: #637b58; }.stage-care { background: #87689a; }
.hero-art { position: absolute; z-index: 1; top: 465px; left: 50%; width: min(1060px, calc(100% - 40px)); margin: 0; padding: 0; transform: translateX(-50%); }
.hero-scene img { border-radius: 20px; box-shadow: 0 16px 34px rgba(0, 23, 30, .26); }

.arrival-strip.wrap { z-index: 5; grid-template-columns: minmax(205px, 1.3fr) repeat(4, minmax(150px, 1fr)); gap: 0; margin-top: -1px; padding: 0; background: var(--white); border: 1px solid #d9e0da; border-radius: 8px; box-shadow: 0 18px 38px rgba(28, 53, 57, .12); overflow: hidden; }
.arrival-intro { display: flex; flex-direction: column; justify-content: center; min-height: 120px; padding: 17px 20px; background: #fffaf4; border-right: 1px solid #eadfd5; }
.arrival-intro p { margin: 0 0 4px; color: var(--vermilion); font-size: .64rem; font-weight: 700; letter-spacing: .14em; }
.arrival-intro strong { font-family: var(--serif-ja); color: var(--ink); font-size: 1.04rem; line-height: 1.45; letter-spacing: .04em; }
.arrival-intro small { margin-top: 5px; color: var(--ink-faint); font-size: .68rem; }
.arrival-link { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; column-gap: 8px; min-height: 120px; padding: 16px 12px; border-right: 1px solid #e3e9e5; }
.arrival-link::after { display: none; }
.arrival-link > svg:first-child { grid-row: 1 / span 2; grid-column: 1; align-self: center; width: 25px; height: 25px; padding: 5px; border-radius: 50%; color: #fff; background: var(--arrival); }
.arrival-link > svg:last-child { display: none; }
.arrival-link span { grid-column: 2; align-self: end; color: var(--ink); font-family: var(--serif-ja); font-size: .92rem; letter-spacing: .03em; }
.arrival-link small { grid-column: 2; margin-top: 2px; color: var(--ink-faint); font-size: .65rem; }
.arrival-urgent { --arrival: #d37a57; }.arrival-medical { --arrival: #5c90a0; }.arrival-child { --arrival: #cf7089; }.arrival-safety { --arrival: #688a6d; }
.arrival-link:hover, .arrival-link:focus { background: color-mix(in srgb, var(--arrival) 7%, #fff); }

.page-hub .sos { margin-top: 15px; }
.page-hub .sos-card { padding: 11px 14px 12px; border: 1px solid #efd6cf; border-left: 4px solid var(--vermilion); background: #fffaf8; }
.page-hub .sos-title { margin-bottom: 8px; font-size: .92rem; }
.page-hub .sos-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.page-hub .sos-btn { min-height: 68px; border-color: #eadbd6; border-radius: 6px; padding: .35em .3em; box-shadow: none; }
.page-hub .sos-btn .n { font-size: 1.02rem; }
.page-hub .sos-btn .t { font-size: .62rem; }
.page-hub .sos-note { margin-top: 6px; font-size: .66rem; }

.page-hub .life-tools { margin-top: 58px; }
.page-hub .tools-intro { border-bottom-color: var(--sumire); }
.page-hub .local-profile { padding: 16px 18px 14px; background: #f7fbfa; border-color: #d5e6df; }
.page-hub .tool-card { border-color: color-mix(in srgb, var(--seiji) 24%, #d6e1dd); }
.page-hub .tool-district { background: #f4faf8; }.page-hub .tool-child { background: #fff7f8; }.page-hub .tool-care { background: #f6f8fd; }.page-hub .tool-disaster { background: #fffaf3; }
.page-hub .route-card { background: color-mix(in srgb, var(--route) 7%, #fff); border-color: color-mix(in srgb, var(--route) 23%, #dbe5e0); }
.page-hub .route-primary { border-radius: 6px; }
.page-hub .cat-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.page-hub .cat-card { min-height: 162px; background: color-mix(in srgb, var(--cat) 5%, #fff); border-color: color-mix(in srgb, var(--cat) 21%, #dce5e0); }
.page-hub .cat-card .cc-icon { background: var(--cat); }
.page-hub .hub-events { border-radius: 8px; }

@media (max-width: 940px) {
  .hero-inner { grid-template-columns: 1fr; gap: 0; }
  .hero-copy { padding-bottom: 28px; }
  .hero-stage-nav { padding-bottom: 30px; }
  .stage-grid { max-width: 620px; }
  .arrival-strip.wrap { grid-template-columns: minmax(190px, 1.15fr) repeat(2, minmax(0, 1fr)); }
  .arrival-link { min-height: 98px; }
  .page-hub .sos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-hub .cat-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* The home page has a clear editorial rhythm; its tools remain useful without looking like nested panels. */
.page-hub .sos { margin-top: 28px; }
.page-hub .life-tools {
  margin: 54px 0 56px; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
.page-hub .tools-intro { align-items: end; padding: 0 0 14px; border-bottom: 2px solid var(--seiji); }
.page-hub .tools-intro h2 { font-size: 1.8rem; }
.page-hub .local-profile { margin: 15px 0 18px; border-radius: var(--radius); background: #e9f3ef; box-shadow: none; }
.page-hub .tool-grid { gap: 12px; }
.page-hub .tool-card { min-height: 262px; border-radius: var(--radius); box-shadow: none; transition: transform .25s ease, box-shadow .25s ease; }
.page-hub .tool-card:hover { transform: translateY(-3px); box-shadow: 0 14px 24px rgba(32, 50, 56, .09); }
.page-hub .quick-routes { margin: 0 0 58px; }
.page-hub .route-heading { border-bottom-color: var(--ink); }
.page-hub .route-card { min-height: 252px; border-radius: var(--radius); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.page-hub .route-card:hover { transform: translateY(-4px); box-shadow: 0 16px 28px rgba(32, 50, 56, .11); border-color: var(--route); }
.page-hub .cat-cards { margin: 0 0 56px; }
.page-hub .cat-cards .sec-head { margin-bottom: 14px; padding-bottom: 11px; border-bottom: 2px solid var(--ink); }
.page-hub .cat-card { border-radius: var(--radius); transition: transform .22s ease, box-shadow .22s ease; }
.page-hub .cat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(32, 50, 56, .1); }
.page-hub .hub-events { margin-bottom: 0; padding: 22px 24px; background: #eef5f2; border-top: 3px solid var(--seiji); }

.motion-reveal { opacity: 0; transform: translateY(22px); transition: opacity .58s ease, transform .58s ease; }
.motion-reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 800px) {
  .hero--living-map { padding-top: 46px; }
  .hero-name { font-size: 2.15rem; }
  .hero-statement { font-size: 2.85rem; }
  .hero-journey { position: relative; right: auto; bottom: auto; width: 100%; margin: 34px 0 0; }
  .hero-art { margin-top: 32px; }
  .arrival-strip { grid-template-columns: 1fr; gap: 1px; }
  .arrival-link { min-height: 96px; }
}

/* ==========================================================================
   emergency strip
   ========================================================================== */
.sos {
  max-width: var(--maxw); margin: 18px auto 8px; padding: 0 20px;
}
.sos-card {
  background: linear-gradient(135deg, #fff6f3, #fdeee9);
  border: 1.5px solid #e4b3a7; border-left: 6px solid var(--vermilion);
  border-radius: var(--radius); padding: 16px 18px 14px;
}
.sos-title {
  display: flex; align-items: center; gap: .55em;
  font-family: var(--serif-ja); font-weight: 700; font-size: 1.04rem;
  color: var(--vermilion-deep); margin: 0 0 10px;
}
.sos-title svg { width: 21px; height: 21px; flex: none; }
.faq-block h3 svg { width: 16px; height: 16px; flex: none; }
.sos-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.sos-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; text-align: center;
  background: var(--white); border: 1.5px solid #dca99d; border-radius: var(--radius-s);
  padding: .6em .5em .55em; line-height: 1.45;
  color: var(--ink); box-shadow: var(--shadow-soft);
}
.sos-btn:hover { text-decoration: none; border-color: var(--vermilion); transform: translateY(-1px); }
.sos-btn .n { font-size: 1.3rem; font-weight: 700; color: var(--vermilion); letter-spacing: .03em; }
.sos-btn .t { font-size: .78rem; color: var(--ink-soft); }
.sos-note { font-size: .78rem; color: #8c5246; margin: 9px 0 0; }

/* pill button (events "show more") */
.catchip {
  display: inline-flex; align-items: center; gap: .45em;
  font-size: .84rem; font-weight: 700; color: var(--sumire-deep);
  background: var(--white); border: 1px solid var(--gold); border-radius: 99px;
  padding: .5em 1.4em; white-space: nowrap;
}
.catchip:hover { text-decoration: none; background: var(--paper-2); }

/* ==========================================================================
   breadcrumb
   ========================================================================== */
.breadcrumb { background: var(--paper-2); border-bottom: 1px solid var(--line); }
.breadcrumb ol {
  display: flex; flex-wrap: wrap; align-items: center; gap: .2em .1em;
  list-style: none; padding: 8px 0; margin: 0; font-size: .78rem; color: var(--ink-faint);
}
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li + li::before { content: "›"; margin: 0 .55em; color: var(--ink-faint); }
.breadcrumb a { color: var(--sumire); font-weight: 500; }
.breadcrumb li[aria-current] { color: var(--ink); font-weight: 700; }

/* ==========================================================================
   emergency strip (category pages)
   ========================================================================== */
.sos-strip {
  background: linear-gradient(135deg, #fff6f3, #fdeee9);
  border-bottom: 1px solid #e4b3a7;
}
.sos-strip .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  padding-top: 8px; padding-bottom: 8px; font-size: .84rem;
}
.ss-label {
  display: inline-flex; align-items: center; gap: .35em;
  font-weight: 700; color: var(--vermilion-deep);
}
.ss-label svg { width: 16px; height: 16px; }
.sos-strip a { color: var(--vermilion-deep); }
.sos-strip a b { color: var(--vermilion); font-size: 1.02rem; letter-spacing: .02em; }
.sos-strip .ss-more {
  margin-left: auto; display: inline-flex; align-items: center; gap: .2em;
  font-weight: 700; color: var(--vermilion);
}
.sos-strip .ss-more svg { width: 14px; height: 14px; }

/* ==========================================================================
   category hero (per-category page header band)
   ========================================================================== */
.cat-hero {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--cat) 14%, var(--paper)) 0, var(--paper) 100%);
  border-bottom: 2px solid var(--cat, var(--sumire));
}
.cat-hero .wrap { display: flex; align-items: center; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.cat-hero .cat-icon {
  flex: none; width: 54px; height: 54px; border-radius: 15px;
  display: grid; place-items: center; color: #fff;
  background: var(--cat, var(--sumire)); box-shadow: var(--shadow-soft);
}
.cat-hero .cat-icon svg { width: 30px; height: 30px; }
.cat-hd-text { min-width: 0; }
.cat-hero h1 {
  font-family: var(--serif-ja); font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900; letter-spacing: .07em; margin: 0; line-height: 1.3;
}
.cat-hero .cat-en {
  display: block; font-size: .66rem; letter-spacing: .26em;
  color: var(--cat, var(--sumire)); font-weight: 700; text-transform: uppercase; margin-bottom: 2px;
}
.cat-hero .cat-tagline { color: var(--ink-soft); font-size: .9rem; margin: 4px 0 0; }

/* ==========================================================================
   sections
   ========================================================================== */
.cat-section { padding: 28px 0 10px; }
.item-card { scroll-margin-top: 70px; }

/* ==========================================================================
   hub: section heads + category cards + events teaser
   ========================================================================== */
.sec-head {
  display: flex; align-items: baseline; gap: 14px;
  margin: 30px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.sec-head h2 {
  font-family: var(--serif-ja); font-size: 1.25rem; font-weight: 700;
  letter-spacing: .06em; margin: 0; display: flex; align-items: center; gap: .5em;
}
.sec-head h2 svg { width: 22px; height: 22px; color: var(--sumire); }
.sec-more {
  margin-left: auto; font-size: .82rem; font-weight: 700; color: var(--sumire);
  display: inline-flex; align-items: center; gap: .25em; white-space: nowrap;
}
.sec-more svg { width: 14px; height: 14px; }

.cat-cards { margin-top: 8px; }
.cat-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px;
}
.cat-card {
  display: flex; align-items: center; gap: 13px;
  background: var(--white); border: 1px solid var(--line);
  border-left: 4px solid var(--cat, var(--sumire));
  border-radius: var(--radius); padding: 14px 14px 14px 15px;
  box-shadow: var(--shadow-soft); color: var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.cat-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.cc-icon {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; background: var(--cat, var(--sumire));
}
.cc-icon svg { width: 23px; height: 23px; }
.cc-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.cc-en { font-size: .6rem; letter-spacing: .2em; color: var(--cat, var(--sumire)); font-weight: 700; text-transform: uppercase; }
.cc-title { font-family: var(--serif-ja); font-size: 1.06rem; font-weight: 700; line-height: 1.35; }
.cc-desc { font-size: .78rem; color: var(--ink-soft); line-height: 1.5; margin-top: 1px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cc-meta { font-size: .68rem; color: var(--ink-faint); margin-top: 3px; }
.cc-arrow { flex: none; color: var(--cat, var(--sumire)); }
.cc-arrow svg { width: 20px; height: 20px; }

/* compact variant for "other categories" nav */
.cat-card-grid.compact .cat-card { padding: 11px 12px; }
.cat-card-grid.compact .cc-desc, .cat-card-grid.compact .cc-meta { display: none; }
.cat-card-grid.compact .cc-icon { width: 36px; height: 36px; }
.cat-card-grid.compact .cc-title { font-size: .98rem; }

.othercat { margin-top: 30px; padding-top: 6px; }
.othercat h2 {
  font-family: var(--serif-ja); font-size: 1.1rem; font-weight: 700;
  letter-spacing: .06em; margin: 0 0 12px;
}

.hub-events { margin-bottom: 20px; }

/* ---------- hub: personal local-life desk ---------- */
.life-tools {
  margin: 30px 0 38px; padding: 20px;
  background: linear-gradient(135deg, #e8f0ed 0%, #f7f3e7 52%, #e9e4f1 100%);
  border: 1px solid #c5d5cf; border-top: 5px solid var(--seiji); border-radius: 18px;
  box-shadow: var(--shadow-soft);
}
.tools-intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.tools-kicker {
  margin: 0 0 4px; color: var(--seiji); font-size: .63rem; font-weight: 700;
  letter-spacing: .22em; line-height: 1.2;
}
.tools-intro h2 {
  font-family: var(--serif-ja); font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: .06em; margin: 0; line-height: 1.4;
}
.tools-intro > p { max-width: 35em; margin: 0; color: var(--ink-soft); font-size: .82rem; line-height: 1.7; }
.local-profile {
  margin: 16px 0; padding: 13px 14px 10px; background: rgba(255, 253, 247, .78);
  border: 1px solid rgba(56, 118, 111, .36); border-radius: 10px;
}
.profile-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 9px 12px; }
.profile-fields label { display: flex; flex-direction: column; gap: 3px; min-width: min(220px, 100%); font-size: .74rem; font-weight: 700; color: var(--ink-soft); }
.profile-fields select {
  height: 2.5em; font: inherit; font-size: .9rem; font-weight: 400; color: var(--ink);
  background: var(--white); border: 1px solid #a5c0b8; border-radius: 7px; padding: .35em .55em;
}
.profile-fields button, .tool-actions button {
  min-height: 2.5em; color: #fff; background: var(--seiji); border: 1px solid var(--seiji);
  border-radius: 7px; padding: .45em .85em; font-size: .82rem; font-weight: 700;
}
.profile-fields .profile-reset { color: var(--ink-soft); background: transparent; border-color: #a5c0b8; }
#local-profile-note { margin: 7px 0 0; color: var(--ink-faint); font-size: .7rem; line-height: 1.55; }
.profile-status { min-height: 1.2em; margin: 4px 0 0; color: var(--seiji); font-size: .75rem; font-weight: 700; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.tool-card {
  display: flex; flex-direction: column; min-height: 255px; background: rgba(255, 253, 247, .93);
  border: 1px solid rgba(113, 106, 91, .28); border-radius: 12px; padding: 15px;
}
.tool-card h3 { font-family: var(--serif-ja); font-size: 1.13rem; letter-spacing: .04em; margin: 0; line-height: 1.4; }
.tool-card > p:not(.tool-overline) { margin: 7px 0 10px; color: var(--ink-soft); font-size: .8rem; line-height: 1.7; }
.tool-overline { margin: 0 0 4px; color: var(--seiji); font-size: .62rem; font-weight: 700; letter-spacing: .16em; line-height: 1.2; }
.tool-child .tool-overline { color: var(--c-childcare); }
.tool-care .tool-overline { color: var(--c-welfare); }
.tool-disaster .tool-overline { color: var(--c-disaster); }
.district-result, .care-area-result, .disaster-area-result {
  margin: 4px 0 10px; padding: 9px 10px; background: #f2f8f5; border-left: 3px solid var(--seiji);
  border-radius: 0 7px 7px 0; color: var(--ink-soft); font-size: .78rem; line-height: 1.65;
}
.district-result strong, .care-area-result strong, .disaster-area-result strong { color: var(--ink); }
.area-links { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 5px; }
.area-links a { font-weight: 700; }
.area-events { margin-top: 12px; padding-top: 9px; border-top: 1px solid rgba(56, 118, 111, .2); }
.area-events b { display: block; color: var(--ink); font-size: .73rem; }
.area-events ul { display: grid; gap: 5px; list-style: none; margin: 6px 0 0; padding: 0; }
.area-events li { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; font-size: .73rem; }
.area-events a { color: var(--ink); font-weight: 700; }
.area-events span { flex: none; color: var(--ink-faint); font-size: .68rem; }
.mini-event-list { list-style: none; padding: 0; margin: 4px 0 10px; }
.mini-event-list li { display: flex; align-items: baseline; gap: 7px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .78rem; line-height: 1.5; }
.mini-event-list li:last-child { border-bottom: 0; }
.mini-event-list span { flex: none; color: var(--c-childcare); font-size: .7rem; font-weight: 700; }
.mini-event-list a { color: var(--ink); font-weight: 700; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: auto; padding-top: 9px; border-top: 1px solid var(--line); }
.tool-actions a { color: var(--seiji); font-size: .76rem; font-weight: 700; line-height: 1.5; }
.tool-child .tool-actions a { color: var(--c-childcare); }
.tool-care .tool-actions a { color: var(--c-welfare); }
.tool-disaster .tool-actions a { color: var(--c-disaster); }
.tool-actions a::before { content: "› "; }
.tool-disaster .tool-actions button { background: var(--c-disaster); border-color: var(--c-disaster); }
.care-steps { list-style: none; counter-reset: care; margin: 8px 0; padding: 0; }
.care-steps li { counter-increment: care; position: relative; padding-left: 2.1em; margin-bottom: .5em; color: var(--ink-soft); font-size: .78rem; line-height: 1.55; }
.care-steps li::before { content: counter(care); position: absolute; left: 0; top: .08em; display: grid; place-items: center; width: 1.45em; height: 1.45em; color: #fff; background: var(--c-welfare); border-radius: 50%; font-size: .76em; font-weight: 700; }
.care-steps b, .care-steps span { display: block; }
.care-steps b { color: var(--ink); }
.disaster-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 2px 0 9px; }
.disaster-fields label { display: flex; flex-direction: column; gap: 3px; color: var(--ink-soft); font-size: .68rem; font-weight: 700; }
.disaster-fields input { width: 100%; min-width: 0; font: inherit; font-size: .78rem; font-weight: 400; background: #fff; border: 1px solid #d9b18b; border-radius: 6px; padding: .5em .55em; }
.tool-disaster .disaster-area-result { background: #fff8ed; border-left-color: var(--c-disaster); }

/* ---------- hub: life routes ---------- */
.quick-routes { margin: 30px 0 38px; }
.route-heading {
  display: flex; justify-content: space-between; align-items: end; gap: 20px;
  padding: 0 0 12px; border-bottom: 2px solid var(--sumire-deep);
}
.route-heading h2, .saved-head h2 {
  font-family: var(--serif-ja); font-size: clamp(1.3rem, 3vw, 1.65rem);
  letter-spacing: .06em; line-height: 1.4; margin: 0;
}
.route-heading > p { max-width: 33em; margin: 0; color: var(--ink-soft); font-size: .84rem; line-height: 1.7; }
.route-kicker {
  margin: 0 0 3px; color: var(--sumire); font-size: .62rem; font-weight: 700;
  letter-spacing: .2em; line-height: 1.2;
}
.route-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  margin-top: 14px;
}
.route-card {
  position: relative; display: flex; flex-direction: column; min-height: 240px;
  background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--route, var(--sumire));
  border-radius: var(--radius); padding: 15px 15px 13px; box-shadow: var(--shadow-soft);
}
.route-card::before {
  content: ""; position: absolute; width: 30px; height: 30px; top: 0; right: 0;
  background: color-mix(in srgb, var(--route, var(--sumire)) 14%, transparent);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.route-label {
  color: var(--route, var(--sumire)); font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; margin: 0 0 5px;
}
.route-card h3 { margin: 0; font-size: 1rem; line-height: 1.5; }
.route-lead { margin: 7px 0 13px; color: var(--ink-soft); font-size: .79rem; line-height: 1.72; }
.route-primary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center;
  margin-top: auto; color: #fff; background: var(--route, var(--sumire)); border-radius: 8px;
  padding: .62em .7em .58em .85em; font-size: .81rem; font-weight: 700; line-height: 1.35;
}
.route-primary:hover, .route-primary:focus { color: #fff; text-decoration: none; filter: brightness(.94); }
.route-primary small { grid-column: 1; font-weight: 400; font-size: .68rem; opacity: .88; margin-top: 2px; }
.route-primary svg { grid-column: 2; grid-row: 1 / span 2; width: 17px; height: 17px; }
.route-links { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 9px; }
.route-links a { color: var(--route, var(--sumire)); font-size: .72rem; font-weight: 700; line-height: 1.45; }
.route-links a::before { content: "› "; }

/* ---------- personal, local-only saved guides ---------- */
.saved-guides {
  margin: 24px 0 32px; padding: 16px 18px;
  background: #fffaf0; border: 1px solid #e4c56f; border-left: 5px solid var(--gold);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
}
.saved-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.saved-note { margin: 3px 0 10px; color: var(--ink-soft); font-size: .77rem; }
.saved-clear {
  flex: none; color: var(--ink-soft); background: transparent; border: 0; padding: .35em .45em;
  font-size: .76rem; text-decoration: underline; text-underline-offset: 3px;
}
.saved-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 7px; padding: 0; margin: 0; list-style: none; }
.saved-list li { display: flex; align-items: stretch; min-width: 0; background: var(--white); border: 1px solid #eadfbf; border-left: 3px solid var(--saved-color, var(--gold)); border-radius: 7px; }
.saved-link { min-width: 0; flex: 1; padding: .55em .65em; color: var(--ink); line-height: 1.35; }
.saved-link:hover { background: #fffdf7; text-decoration: none; }
.saved-title, .saved-category { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-title { font-size: .79rem; font-weight: 700; }
.saved-category { margin-top: 2px; color: var(--ink-faint); font-size: .66rem; }
.saved-remove { flex: none; width: 35px; border: 0; border-left: 1px solid #eadfbf; background: transparent; color: var(--ink-faint); font-size: .72rem; }
.saved-remove:hover { background: #f8edcf; color: var(--ink); }

/* ---------- item cards ---------- */
.item-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}
.item-card {
  background: var(--white); border: 1px solid var(--line);
  border-top: 3px solid var(--cat, var(--sumire));
  border-radius: var(--radius); padding: 16px 18px 14px;
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 8px;
  break-inside: avoid;
}
.item-card.hit { box-shadow: 0 0 0 3px var(--gold-bright), var(--shadow-soft); }
.item-card h3 {
  font-size: 1.02rem; font-weight: 700; margin: 0; line-height: 1.5;
  display: flex; align-items: baseline; gap: .5em; flex-wrap: wrap;
}
.badge-imp {
  flex: none; font-size: .66rem; font-weight: 700; color: #fff;
  background: var(--vermilion); border-radius: 5px; padding: .15em .55em;
  letter-spacing: .08em;
}
.item-card .i-sum { font-size: .88rem; color: var(--ink-soft); margin: 0; line-height: 1.8; }
.i-facts { display: flex; flex-direction: column; gap: 5px; margin: 2px 0 0; }
.i-fact {
  display: flex; gap: .6em; align-items: baseline;
  font-size: .85rem; color: var(--ink);
}
.i-fact svg { flex: none; width: 15px; height: 15px; transform: translateY(2px); color: var(--cat, var(--sumire)); }
.i-fact .f-label { flex: none; font-size: .72rem; color: var(--ink-faint); width: 3.2em; }
.tel-link {
  font-weight: 700; font-size: 1.0rem; letter-spacing: .02em;
  color: var(--ink); border-bottom: 2px solid var(--cat, var(--sumire));
}
.tel-link:hover { color: var(--cat, var(--sumire)); text-decoration: none; }
.i-foot { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.i-link {
  display: inline-flex; align-items: center; gap: .35em;
  font-size: .82rem; font-weight: 700; color: var(--cat, var(--sumire));
}
.i-link svg { width: 13px; height: 13px; }
.save-item {
  display: inline-flex; align-items: center; gap: .35em; flex: none;
  color: var(--ink-soft); background: transparent; border: 1px solid var(--line); border-radius: 6px;
  padding: .34em .55em; font-size: .72rem; line-height: 1.25;
}
.save-item svg { width: 13px; height: 13px; }
.save-item:hover, .save-item[aria-pressed="true"] { color: var(--cat, var(--sumire)); border-color: var(--cat, var(--sumire)); background: color-mix(in srgb, var(--cat, var(--sumire)) 7%, var(--white)); }
.i-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.i-tag {
  font-size: .68rem; color: var(--ink-faint);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 5px; padding: .1em .5em;
}

/* ---------- steps (手順) ---------- */
.i-steps { margin: 2px 0 0; padding: 0; list-style: none; counter-reset: step; }
.i-steps li {
  counter-increment: step; position: relative;
  padding-left: 2em; font-size: .86rem; color: var(--ink-soft);
  margin-bottom: .35em; line-height: 1.7;
}
.i-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: .18em;
  width: 1.45em; height: 1.45em; border-radius: 50%;
  background: var(--cat, var(--sumire)); color: #fff;
  font-size: .78em; font-weight: 700;
  display: grid; place-items: center;
}

/* ---------- FAQ ---------- */
.faq-block { margin: 20px 0 6px; }
.faq-block h3 {
  font-size: .92rem; color: var(--ink-soft); font-weight: 700;
  margin: 0 0 8px; display: flex; align-items: center; gap: .5em;
}
.faq-item {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-s);
  margin-bottom: 7px; overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: .7em 1em .7em 2.6em; position: relative;
  font-size: .9rem; font-weight: 500; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "Q"; position: absolute; left: .9em; top: .72em;
  font-weight: 700; color: var(--cat, var(--sumire)); font-family: var(--serif-ja);
}
.faq-item summary::after {
  content: ""; position: absolute; right: 1em; top: 50%;
  width: 8px; height: 8px; border-right: 2px solid var(--ink-faint); border-bottom: 2px solid var(--ink-faint);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s;
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq-item .faq-a {
  padding: 0 1.2em .85em 2.6em; font-size: .87rem; color: var(--ink-soft);
  position: relative;
}
.faq-item .faq-a::before {
  content: "A"; position: absolute; left: 1.05em; top: -.1em;
  font-weight: 700; color: var(--gold-text); font-family: var(--serif-ja);
}

/* ==========================================================================
   open data blocks
   ========================================================================== */
.od-block {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px 16px;
  margin: 14px 0; box-shadow: var(--shadow-soft);
}
.od-block > h3 {
  font-family: var(--serif-ja); font-size: 1.08rem; margin: 0 0 4px;
  display: flex; align-items: center; gap: .55em; flex-wrap: wrap;
}
.od-badge {
  font-size: .64rem; font-weight: 700; letter-spacing: .1em;
  color: var(--seiji); border: 1px solid currentColor;
  border-radius: 5px; padding: .12em .5em;
}
.od-note { font-size: .8rem; color: var(--ink-faint); margin: 0 0 12px; }

.od-filter {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px;
}
.od-filter input, .od-filter select {
  font: inherit; font-size: .9rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: .45em .8em; max-width: 100%;
}
.od-filter input { flex: 1; min-width: 180px; }
.od-count { font-size: .8rem; color: var(--ink-faint); }

.od-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.od-table { border-collapse: collapse; width: 100%; font-size: .86rem; }
.od-table th {
  text-align: left; font-size: .76rem; color: var(--ink-faint); font-weight: 700;
  border-bottom: 2px solid var(--line); padding: .4em .7em; white-space: nowrap;
}
.od-table td { border-bottom: 1px solid var(--paper-2); padding: .5em .7em; vertical-align: top; }
.od-table tr:last-child td { border-bottom: 0; }
.od-table .od-name { font-weight: 700; }
.od-map-link { font-size: .78rem; white-space: nowrap; }

/* events */
.ev-list { list-style: none; padding: 0; margin: 0; }
.ev-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 10px 2px; border-bottom: 1px dashed var(--line);
}
.ev-item:last-child { border-bottom: 0; }
.ev-date {
  flex: none; min-width: 5.2em; text-align: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: .3em .4em; font-size: .78rem; line-height: 1.5; color: var(--c-events);
  font-weight: 700;
}
.ev-body { min-width: 0; }
.ev-body .ev-t { font-weight: 700; font-size: .92rem; margin: 0; }
.ev-body .ev-d { font-size: .8rem; color: var(--ink-soft); margin: 2px 0 0; }
.ev-more { text-align: center; margin-top: 10px; }

/* ==========================================================================
   notice / disclaimer / footer
   ========================================================================== */
.page-notice {
  max-width: var(--maxw); margin: 30px auto 0; padding: 0 20px;
}
.page-notice-box {
  border: 1px dashed var(--gold); border-radius: var(--radius);
  background: #fdf9ee; padding: 14px 18px;
  font-size: .82rem; color: var(--ink-soft);
}
.page-notice-box b { color: var(--ink); }

.site-foot {
  margin-top: 46px; background: var(--sumire-night); color: #cfc3e6;
  border-top: 3px solid var(--gold);
  font-size: .84rem; line-height: 2;
}
.site-foot .wrap { padding-top: 34px; padding-bottom: 34px; }
.site-foot h2 {
  font-family: var(--serif-ja); color: #fff; font-size: 1.05rem;
  letter-spacing: .12em; margin: 0 0 8px;
}
.site-foot a { color: var(--gold-bright); }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 30px; }
.foot-small { margin-top: 20px; padding-top: 14px; border-top: 1px solid rgba(207, 195, 230, .25); font-size: .76rem; color: #a294c4; }

/* back-to-top */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--sumire-deep); color: #fff; border: 1.5px solid var(--gold);
  display: grid; place-items: center; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.to-top.on { opacity: 1; pointer-events: auto; }

/* Final hub rhythm lives here so it wins over the shared category-page defaults above. */
.page-hub .sos { margin-top: 15px; }
.page-hub .sos-card { padding: 11px 14px 12px; border: 1px solid #efd6cf; border-left: 4px solid var(--vermilion); background: #fffaf8; }
.page-hub .sos-title { margin-bottom: 8px; font-size: .92rem; }
.page-hub .sos-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.page-hub .sos-btn { min-height: 68px; border-color: #eadbd6; border-radius: 6px; padding: .35em .3em; box-shadow: none; }
.page-hub .sos-btn .n { font-size: 1.02rem; }
.page-hub .sos-btn .t { font-size: .62rem; }
.page-hub .sos-note { margin-top: 6px; font-size: .66rem; }

@media (max-width: 800px) {
  .hero--living-map { min-height: 0; padding-top: 38px; padding-bottom: 0; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 28px; }
  .hero-stage-nav { padding-bottom: 30px; }
  .stage-grid { max-width: 620px; }
  .hero-art { position: relative; top: auto; left: auto; width: auto; margin: 0 auto; padding: 0 20px; transform: none; }
  .arrival-strip.wrap { grid-template-columns: minmax(190px, 1.15fr) repeat(2, minmax(0, 1fr)); }
  .page-hub .cat-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ==========================================================================
   responsive
   ========================================================================== */
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .site-head .wrap { display: block; padding-top: 8px; padding-bottom: 8px; }
  .brand .b-main { display: block; font-size: 1.08rem; white-space: nowrap; }
  .brand .b-sub { display: none; }
  .head-links { margin: 3px 0 0; gap: 8px 14px; }
  .head-links a { font-size: .72rem; }
  .menu-toggle { display: grid; width: 38px; height: 38px; margin-left: auto; padding: 9px; border: 1px solid rgba(255,255,255,.5); border-radius: 6px; background: transparent; }
  .menu-toggle span:not(.sr-only) { display: block; height: 2px; background: #fff; transition: transform .2s ease, opacity .2s ease; }
  .menu-toggle[aria-expanded="true"] span:nth-of-type(2) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-of-type(3) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-of-type(4) { transform: translateY(-7px) rotate(-45deg); }
  .head-links { display: none; }
  .topic-nav .wrap { gap: 2px; padding-left: 12px; padding-right: 12px; }
  .topic-nav a { min-height: 32px; padding: 3px 7px; font-size: .69rem; }
  .topic-nav svg { width: 14px; height: 14px; }
  .topic-nav { display: none; border-top: 1px solid var(--line); }
  .topic-nav.is-open { display: block; }
  .topic-nav.is-open .wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding-top: 9px; padding-bottom: 10px; overflow: visible; }
  .topic-nav.is-open a { min-height: 42px; justify-content: flex-start; white-space: normal; }
  .hero--living-map { padding-top: 36px; }
  .hero-name { font-size: 1.8rem; letter-spacing: .06em; white-space: nowrap; }
  .hero-statement { font-size: 2.35rem; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-action { min-width: 0; padding-left: .55em; padding-right: .55em; font-size: .78rem; }
  .hero-updated { display: block; font-size: .7rem; line-height: 1.55; padding-left: .85em; padding-right: .85em; }
  .hero-stage-nav { padding-bottom: 24px; }
  .hero-stage-nav h2 { font-size: 1.04rem; }
  .stage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .stage-link { min-height: 82px; font-size: .65rem; }
  .stage-link svg { width: 22px; height: 22px; }
  .hero-scene img { border-radius: 12px 12px 0 0; }
  .arrival-strip.wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
  .arrival-intro { grid-column: 1 / -1; min-height: 88px; padding: 14px 16px; border-right: 0; border-bottom: 1px solid #eadfd5; }
  .arrival-link { min-height: 92px; padding: 12px 10px; }
  .arrival-link span { font-size: .8rem; }
  .arrival-link small { font-size: .61rem; }
  .page-hub .sos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-hub .sos-btn { min-height: 62px; }
  .item-grid { grid-template-columns: 1fr; }
  .sos-grid { grid-template-columns: repeat(2, 1fr); }
  .ev-item { gap: 10px; }
  .topbar .wrap { gap: 8px; }
  .tb-home span { display: none; }            /* アイコンのみ（省スペース） */
  .page-hub .cat-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .page-hub .cat-card { min-height: 142px; }
  .life-tools { margin-left: -4px; margin-right: -4px; padding: 15px; }
  .tools-intro { display: block; }
  .tools-intro > p { margin-top: 6px; }
  .profile-fields { align-items: stretch; }
  .profile-fields label { flex: 1 1 100%; }
  .profile-fields button { flex: 1; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
  .disaster-fields { grid-template-columns: 1fr; }
  .route-heading { display: block; }
  .route-heading > p { margin-top: 6px; }
  .route-grid { grid-template-columns: 1fr; }
  .route-card { min-height: 0; }
  .saved-guides { padding: 14px; }
  .sos-strip .ss-more { margin-left: 0; flex-basis: 100%; }
}

/* ==========================================================================
   print — 市民が紙で持ち歩ける
   ========================================================================== */
@media print {
  body::before, .topbar, .search-results, .to-top,
  .hero-art, .head-links, .ev-more, .othercat { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .hero, .site-head, .site-foot, .cat-hero, .sos-strip, .breadcrumb {
    background: #fff !important; color: #000 !important;
  }
  .hero h1, .site-foot h2, .cat-hero h1 { color: #000; }
  .item-card, .od-block, .sos-card, .cat-card { box-shadow: none; border: 1px solid #999; }
  a { color: #000; }
  .cat-section { padding: 14px 0 0; }
  body.print-disaster * { visibility: hidden !important; }
  body.print-disaster .family-card, body.print-disaster .family-card * { visibility: visible !important; }
  body.print-disaster .family-card { position: absolute; inset: 14mm 12mm auto; width: calc(100% - 24mm); min-height: 0; border: 2px solid #000; box-shadow: none; }
  body.print-disaster .tool-actions, body.print-disaster #disaster-area-result { display: none !important; }
}

/* ==========================================================================
   Dark mode — verified WCAG AA (all ratios Bash-computed on the target bg)
   Method: prefers-color-scheme override — same decisive token values as the
   spec's light-dark(), with wider support. Auto-follows OS; no JS/toggle.
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eef0;        /* 13.70:1 on dark paper */
    --ink-soft: #b9c6ca;   /* 9.17:1 */
    --ink-faint: #8fa0a5;  /* 5.92:1 */
    --paper: #16232a;
    --paper-2: #1a2a31;
    --line: #33454d;
    --white: #1e2f37;      /* card surface in dark */
    --sumire: #c9b3e0;     /* heading 8.42:1 */
    --sumire-deep: #d8c8ec;
    --gold: #f1bb58;
    --gold-text: #e0c070;
    --gold-bright: #f1bb58;
    /* category accents lightened for legibility on dark card (all >=5.5:1, Bash-verified) */
    --c-emergency: #f08a76; --c-disaster: #e6a15c; --c-garbage: #a6c483;
    --c-procedure: #b79ce6; --c-childcare: #e79ab8; --c-medical: #6fc4b8;
    --c-welfare: #8fb0e6;   --c-tax: #e0c070;      --c-lifeline: #7cc0dd;
    --c-transport: #e08aa6; --c-facility: #94c19a; --c-events: #e6b45f;
    --shadow: 0 10px 30px rgba(0,0,0,.45);
    --shadow-soft: 0 3px 12px rgba(0,0,0,.35);
  }
  /* SVG crest / illustrations keep their own fills; ensure focus rings stay visible */
  :focus-visible { outline-color: var(--gold-bright); }
}

/* ==========================================================================
   Modern CSS enhancements — progressive, CSP-safe (no JS), no-op if unsupported
   ========================================================================== */
/* Smooth same-origin page transitions (CSS only). Disabled under reduced-motion. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* Container queries: cards adapt to the space they occupy, not the viewport */
.cat-card-grid, .cat-cards, .route-grid, .item-grid { container-type: inline-size; }
@container (max-width: 340px) {
  .cat-card, .route-card, .item-card { padding-inline: 14px; }
}

/* Subtle scroll-reveal for content cards. Never for emergency/SOS.
   The reset block near the top also nukes all animation under reduced-motion. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .cat-card, .item-card, .faq-item {
      animation: life-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 28%;
    }
  }
}
@keyframes life-rise {
  from { opacity: .4; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}
/* Safety: emergency/SOS/quick-route are never animated or transition-morphed */
.sos-strip, .sos-strip *, .sos-card, .sos-card *, .sos-btn,
.ss-label, .ss-more, .route-card:first-child {
  animation: none !important;
  view-transition-name: none !important;
}
