/* 在宅避難の備え帖：白い棚と水の青。共通の base.css は読まない（look: own） */
:root {
  --bg: #fbfcfd;
  --ink: #12263a;
  --sub: #3f5468;
  --line: #c9d6e2;
  --blue: #1d6fb8;
  --pale: #e3eef8;
  --red: #c8372d;
  --num: "Outfit", "BIZ UDPGothic", sans-serif;
  --body: "BIZ UDPGothic", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --r1: 4px;
  --r2: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.75;
  font-feature-settings: "palt";
  letter-spacing: .02em;
}
a { color: var(--blue); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: var(--r1); }
b, strong { font-weight: 700; }
.num { font-family: var(--num); font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
img, svg { max-width: 100%; }

/* ---------- 枠（ヘッダー・フッター） ---------- */
/* ヘッダー＝棚の札。上に名前と PR、下に 4 つの棚の見出し（今いる棚に水の青の線） */
.sh { max-width: 1040px; margin: 0 auto; padding: 12px 20px 0; border-bottom: 1px solid var(--line); }
.sh-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; }
.site-name {
  view-transition-name: brand;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: .08em;
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
}
.sn-mark { position: relative; width: 14px; height: 20px; border: 1.5px solid var(--ink); border-radius: 3px 3px 4px 4px; overflow: hidden; }
.sn-mark::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 62%; background: var(--blue); }
.sn-mark::after { content: ""; position: absolute; left: 3px; right: 3px; top: -1px; height: 3px; background: var(--ink); }
.pr-notice { margin: 0; font-size: 13px; color: var(--sub); line-height: 1.5; }
.tabs ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; display: inline-flex; align-items: baseline; gap: 6px; min-height: 44px; padding: 10px 12px 12px 0;
  color: var(--sub); text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.tabs li + li .tab { padding-left: 12px; }
.tab-no { font-size: 13px; font-weight: 300; color: var(--blue); }
.tab::after { content: ""; position: absolute; left: 0; right: 12px; bottom: -1px; height: 3px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.tabs li + li .tab::after { left: 12px; }
.tab:hover { color: var(--ink); }
.tab:hover::after { transform: scaleX(.35); }
.tab.is-here { color: var(--ink); }
.tab.is-here::after { transform: none; view-transition-name: tab-line; }
.site-main { max-width: 1040px; margin: 0 auto; padding: 0 20px 64px; }
.site-main > section, .site-main > .more { max-width: 680px; }
/* フッター＝棚板。厚みのある板の線の下に、出どころの約束と必須の道 */
.sf { max-width: 1040px; margin: 32px auto 0; padding: 0 20px 48px; font-size: 14px; color: var(--sub); }
.sf-board { height: 10px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); background: var(--pale); }
.sf-in { padding-top: 24px; max-width: 680px; }
.sf-name { margin: 0; font-weight: 700; color: var(--ink); letter-spacing: .08em; }
.sf-promise { margin: 8px 0 16px; line-height: 1.7; font-size: 15px; }
.sf-nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.sf-nav a { color: var(--sub); display: inline-flex; min-height: 44px; align-items: center; }
.sf-copy { margin: 8px 0 0; font-family: var(--num); letter-spacing: .04em; }

/* ---------- 入口 ---------- */
.hero { padding: 48px 0 24px; display: grid; gap: 0 48px; max-width: none !important; }
.eyebrow { margin: 0 0 16px; font-size: 13px; letter-spacing: .24em; color: var(--blue); display: flex; align-items: center; gap: 12px; font-weight: 700; }
.eyebrow-line { width: 32px; height: 2px; background: var(--blue); display: inline-block; }
.hero-title, .page-title {
  view-transition-name: page-title;
  margin: 0; font-weight: 700; color: var(--ink);
  font-size: clamp(30px, 8.2vw, 52px); line-height: 1.3; letter-spacing: .02em;
  word-break: auto-phrase; text-wrap: balance;
}
.page-title { font-size: clamp(26px, 6.4vw, 40px); }
.hero-title span { display: block; }
.ht-b { color: var(--blue); }
.lead { font-size: 17px; margin: 24px 0 0; max-width: 34em; }
.hero-art { margin: 32px 0 0; }
.bottles { width: 100%; max-width: 420px; display: block; overflow: visible; }
.bottles .outline { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.bottles .cap { fill: var(--ink); }
.bottles .fill { fill: var(--blue); transform: translateY(32%); }
.bottles .is-empty .fill { transform: translateY(100%); }
.bottles .is-empty .outline { stroke: var(--red); stroke-dasharray: 5 4; }
.bottles .shelf-line line { stroke: var(--ink); stroke-width: 3; }
.bottles .can .outline, .bottles .bag .outline { stroke-dasharray: 260; stroke-dashoffset: 0; }
.trust { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--sub); }
.trust li { display: flex; align-items: baseline; gap: 4px; }
.trust .num { font-size: 20px; color: var(--ink); }
@media (min-width: 880px) {
  .hero { grid-template-columns: 1.2fr 1fr; align-items: end; padding-top: 72px; }
  .hero .eyebrow, .hero .hero-title, .hero .lead, .hero .trust { grid-column: 1; }
  .hero-art { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
}
.page-head { padding: 48px 0 8px; }

/* ---------- 節の見出し（番号と、見えると引かれる線） ---------- */
.sec-head { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 16px; margin: 64px 0 24px; }
.sec-no { font-family: var(--num); font-weight: 300; font-size: 40px; line-height: 1; color: var(--blue); letter-spacing: 0; }
.sec-head h2 { margin: 0; font-size: 22px; line-height: 1.45; }
.sec-head .rule { grid-column: 1 / -1; height: 2px; background: var(--ink); margin-top: 16px; transform-origin: left; }
.pre .rule { transform: scaleX(0); transition: transform .7s var(--ease); }
.pre.seen .rule { transform: scaleX(1); }
@supports (animation-timeline: view()) {
  .sec-head .rule { animation: draw linear both; animation-timeline: view(); animation-range: entry 10% cover 30%; }
}
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- 入力 ---------- */
.field { margin: 0 0 32px; }
.field-label { display: block; font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.stepper { display: inline-flex; align-items: center; border: 2px solid var(--ink); border-radius: var(--r1); }
.step {
  width: 56px; height: 56px; border: 0; background: transparent; color: var(--ink);
  font-size: 24px; font-family: var(--num); cursor: pointer; transition: background .15s;
}
.step:hover { background: var(--pale); }
.step:active { background: var(--blue); color: #fff; }
.step-val { min-width: 96px; text-align: center; font-size: 15px; border-inline: 1px solid var(--line); line-height: 56px; }
.step-val .num { font-size: 32px; margin-right: 4px; }
.seg { display: inline-grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--ink); border-radius: var(--r1); overflow: hidden; }
.seg-b {
  min-height: 52px; padding: 0 20px; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; cursor: pointer; transition: background .2s, color .2s;
}
.seg-b + .seg-b { border-left: 1px solid var(--line); }
.seg-b .num { font-size: 22px; margin: 0 2px; }
.seg-b:hover { background: var(--pale); }
.seg-b[aria-checked="true"] { background: var(--ink); color: #fff; }
.select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; padding: 8px 32px 8px 0; min-height: 48px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 12px center, right 6px center; background-size: 6px 6px; background-repeat: no-repeat;
}
.pref-say, .tile-say { margin: 12px 0 0; padding: 12px 16px; background: var(--pale); border-left: 3px solid var(--blue); font-size: 15px; line-height: 1.7; }
.have { display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .have { grid-template-columns: 1fr 1fr; column-gap: 32px; } }
.hv { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hv-name { font-size: 15px; }
.hv-in { display: inline-flex; align-items: baseline; gap: 8px; font-size: 15px; }
.hv-in input {
  width: 4.2em; font-family: var(--num); font-size: 28px; font-weight: 500; color: var(--ink); text-align: right;
  border: 0; border-bottom: 2px solid var(--ink); background: transparent; padding: 0 4px; border-radius: 0; min-height: 44px;
  transition: border-color .2s;
}
.hv-in input:focus { outline: none; border-color: var(--blue); }
.hv-in .select { min-width: 7em; }
.mini { display: grid; gap: 0; border-top: 1px solid var(--line); max-width: 420px; }
.hint { font-size: 15px; color: var(--sub); line-height: 1.7; }

/* ---------- 結果：棚 ---------- */
.result { margin: 48px 0 0; padding: 32px 0 0; border-top: 2px solid var(--ink); }
.res-title { margin: 0; font-size: 17px; font-weight: 700; }
.res-big { margin: 8px 0 0; display: flex; align-items: baseline; gap: 8px; color: var(--ink); }
.res-big .num { font-size: clamp(72px, 22vw, 112px); line-height: 1; font-weight: 300; color: var(--blue); letter-spacing: -.02em; }
.res-big .approx, .res-big .unit { font-size: 22px; font-weight: 700; }
.res-big.small .num { font-size: 64px; }
.res-weak { margin: 8px 0 0; font-weight: 700; min-height: 1.75em; }
.shelf { margin: 32px 0 0; display: grid; gap: 24px; }
.shelf-row { display: grid; grid-template-columns: 3.2em 1fr auto; align-items: end; gap: 12px; }
.sr-name { font-size: 14px; font-weight: 700; color: var(--sub); line-height: 1.4; padding-bottom: 4px; }
.sr-count { font-family: var(--num); font-size: 14px; color: var(--sub); }
.marks {
  display: flex; flex-wrap: wrap; gap: 4px 3px; padding: 0 0 6px; min-height: 30px;
  border-bottom: 3px solid var(--ink); position: relative;
}
.mk {
  width: 8px; height: 18px; border-radius: 2px 2px 1px 1px; display: block;
  background: transparent; box-shadow: inset 0 0 0 1.5px var(--line);
  transition: background .25s var(--ease) calc(min(var(--i), 60) * 10ms), box-shadow .25s calc(min(var(--i), 60) * 10ms);
}
.mk.on { background: var(--blue); box-shadow: none; }
.mk.off { box-shadow: inset 0 0 0 1.5px var(--red); }
.mk.pop { animation: pop .22s var(--ease) calc(min(var(--i), 60) * 10ms) both; }
.mk.blink { animation: blink .5s steps(1) 2; }
@keyframes pop { 0% { transform: translateY(-6px); } 60% { transform: translateY(1px); } 100% { transform: none; } }
@keyframes blink { 0% { box-shadow: inset 0 0 0 1.5px var(--red); background: var(--red); } 50% { background: transparent; } }
.shelf-key { font-size: 13px; color: var(--sub); margin: 12px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shelf-key i { width: 8px; height: 16px; border-radius: 2px; display: inline-block; }
.k-on { background: var(--blue); }
.k-off { box-shadow: inset 0 0 0 1.5px var(--red); margin-left: 8px; }
.short { list-style: none; padding: 0; margin: 24px 0 0; }
.sl { display: grid; grid-template-columns: 4em 1fr; gap: 0 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.sl-k { font-weight: 700; font-size: 14px; color: var(--red); letter-spacing: .1em; }
.sl-a { font-size: 17px; }
.sl-a .num { font-size: 26px; color: var(--red); }
.sl-b { grid-column: 2; font-size: 14px; color: var(--sub); }
.sl.ok { grid-template-columns: 1fr; }
.sl.ok .sl-a { color: var(--blue); font-weight: 700; }
.basis { font-size: 15px; color: var(--sub); margin: 24px 0 0; line-height: 1.75; }
.basis .num { color: var(--ink); }

/* ---------- 都道府県のタイル地図 ---------- */
.tilemap {
  display: grid; grid-template-columns: repeat(14, 1fr); grid-template-rows: repeat(12, auto);
  gap: 3px; margin: 24px 0 0; max-width: 560px;
}
.tile {
  grid-column: var(--c); grid-row: var(--r); aspect-ratio: 1; border: 0; padding: 0; border-radius: 2px;
  display: grid; place-items: center; font: inherit; color: #fff; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s;
}
a.tile, .tilemap a { cursor: pointer; }
.tile span { display: none; font-size: 13px; font-weight: 700; line-height: 1; letter-spacing: 0; }
@media (min-width: 640px) { .tile span { display: block; } }
.tile:hover, .tile.sel { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.t-week { background: var(--ink); }
.t-three-week { background: var(--blue); }
.t-three { background: #a9cbe9; color: var(--ink) !important; }
.t-none { background: repeating-linear-gradient(135deg, #fff 0 4px, var(--line) 4px 6px); color: var(--ink) !important; box-shadow: inset 0 0 0 1px var(--line); }
.tile.t-three span, .tile.t-none span { color: var(--ink); }
/* 見えたら北から順に灯る */
.tilemap .tile { opacity: 1; }
.tilemap.pre .tile { opacity: 0; transform: scale(.6); }
.tilemap.pre.seen .tile { opacity: 1; transform: none; transition: opacity .3s var(--ease) calc(var(--r) * 45ms), transform .3s var(--ease) calc(var(--r) * 45ms); }
.legend { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 4px; font-size: 14px; color: var(--sub); }
.legend li { display: flex; align-items: center; gap: 8px; }
.sw { width: 14px; height: 14px; border-radius: 2px; display: inline-block; flex: none; }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 0; }
.figures div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.figures dt { font-size: 14px; color: var(--sub); line-height: 1.5; }
.figures dd { margin: 4px 0 0; font-size: 15px; }
.figures .num { font-size: 44px; font-weight: 300; color: var(--blue); line-height: 1.1; margin-right: 4px; }
.table-wrap { overflow-x: auto; margin: 16px 0 0; }
.pref-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.pref-table th, .pref-table td { text-align: left; vertical-align: top; padding: 12px 8px; border-bottom: 1px solid var(--line); line-height: 1.6; }
.pref-table thead th { font-size: 13px; color: var(--sub); border-bottom: 2px solid var(--ink); }
.pref-table tbody th { white-space: nowrap; font-weight: 700; }
.pref-table tr:target { background: var(--pale); }
.cat { display: inline-block; font-size: 13px; padding: 2px 8px; border-radius: var(--r1); color: #fff; line-height: 1.6; white-space: nowrap; }
.pref-table small { display: block; font-size: 13px; color: var(--sub); margin-top: 4px; }
.q .src { display: block; font-size: 13px; margin-top: 4px; }

/* ---------- ほかのページ・出どころ ---------- */
.pref-teaser p { margin: 0 0 16px; }
.pref-teaser .tilemap-link { text-decoration: none; }
.more { margin: 32px 0 0; }
.arrow { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; text-decoration: none; min-height: 44px; }
.arrow::after { content: ""; width: 28px; height: 2px; background: currentColor; transition: width .25s var(--ease); }
.arrow:hover::after { width: 44px; }
.next-pages { display: grid; gap: 0; margin: 64px 0 0; border-top: 2px solid var(--ink); }
.np { display: grid; grid-template-columns: 5em 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; align-items: baseline; position: relative; }
.np-k { font-size: 13px; font-weight: 700; letter-spacing: .2em; color: var(--blue); }
.np-t { font-size: 17px; font-weight: 700; line-height: 1.5; transition: transform .25s var(--ease); }
.np:hover .np-t { transform: translateX(6px); }
.steps { padding-left: 1.4em; margin: 0; }
.steps li { margin: 0 0 16px; }
.sources { margin: 64px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); }
.src-title { font-size: 15px; margin: 0 0 8px; }
.cite { font-size: 15px; color: var(--sub); margin: 0 0 8px; line-height: 1.7; }

/* ---------- ページの移り変わり（同じサイトの中だけ） ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s ease-in both; }
::view-transition-new(root) { animation: vt-in .38s var(--ease) both; }
::view-transition-group(page-title) { animation-duration: .38s; animation-timing-function: var(--ease); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* スマホでは表を 1 県 1 枚に積む（横に滑らせないと文が見えない形をやめる） */
@media (max-width: 639px) {
  .pref-table { min-width: 0; }
  .pref-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pref-table tr, .pref-table th, .pref-table td { display: block; }
  .pref-table tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .pref-table th, .pref-table td { border: 0; padding: 0; }
  .pref-table tbody th { font-size: 17px; margin-bottom: 8px; }
  .pref-table td.q { margin-top: 12px; }
}

/* ---------- 入口の見せ場：水が満ちて、空の 1 本が 2 回だけ灯る ---------- */
@media (prefers-reduced-motion: no-preference) {
  .bottles .fill { animation: fill .8s var(--ease) calc(var(--i) * 70ms) both; }
  .bottles .is-empty .fill { animation: none; }
  .bottles .is-empty .outline { animation: warn .36s steps(1) .85s 2; }
  .bottles .can .outline, .bottles .bag .outline { animation: ink .8s var(--ease) .1s both; }
  .bottles .shelf-line line { stroke-dasharray: 360; animation: ink .7s var(--ease) both; }
}
@keyframes fill { from { transform: translateY(100%); } to { transform: translateY(32%); } }
@keyframes warn { 0% { opacity: 1; } 50% { opacity: .15; } }
@keyframes ink { from { stroke-dashoffset: 360; } to { stroke-dashoffset: 0; } }

/* 動きを減らす設定では全部止める */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .pre .rule, .tilemap.pre .tile { transform: none !important; opacity: 1 !important; }
  @view-transition { navigation: none; }
}

/* 共通ページ（運営者情報など）の定義リスト */
.site-main dl { margin: 16px 0 24px; display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; }
.site-main dt { font-weight: 700; color: var(--sub); font-size: 14px; padding-top: 2px; }
.site-main dd { margin: 0; }
@media (max-width: 479px) { .site-main dl { grid-template-columns: 1fr; gap: 4px; } .site-main dd { margin-bottom: 12px; } }
