/* =====================================================================
   防災アプリ2.0 — モバイル Web クライアント
   Design language: "Calm authority" — 公共の信頼 / 高コントラスト / 大きめタップ領域
   依存ゼロ・WebView / モバイルブラウザ両対応・safe-area 対応
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* brand */
  --primary: #1565C0;
  --primary-bright: #1E88E5;
  --primary-soft: #E8F1FB;
  --ink: #0B1F33;
  --ink-2: #44566B;
  --ink-3: #8193A5;

  /* semantic */
  --danger: #D32F2F;
  --danger-deep: #B71C1C;
  --danger-soft: #FDECEA;
  --warn: #EF6C00;
  --warn-soft: #FFF3E0;
  --safe: #2E7D32;
  --safe-soft: #E7F4E8;
  --info: #0277BD;
  --info-soft: #E3F2FD;
  --teal: #00897B;
  --teal-soft: #E0F2F1;
  --pet: #F57C00;
  --pet-soft: #FFF4E2;
  --purple: #7B1FA2;
  --purple-soft: #F5E9F8;

  /* surfaces */
  --bg: #EEF2F7;
  --bg-deep: #E4EAF2;
  --card: #FFFFFF;
  --line: #E6ECF3;
  --line-soft: #F0F4F8;

  /* type scale (mobile, elderly-friendly) */
  --fs-display: 26px;
  --fs-h1: 21px;
  --fs-h2: 18px;
  --fs-h3: 16px;
  --fs-body: 15px;
  --fs-sub: 13.5px;
  --fs-meta: 12px;
  --fs-micro: 11px;

  /* spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;

  /* radius */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* elevation */
  --sh-1: 0 1px 2px rgba(11, 31, 51, 0.06), 0 1px 3px rgba(11, 31, 51, 0.05);
  --sh-2: 0 4px 14px rgba(11, 31, 51, 0.08), 0 2px 4px rgba(11, 31, 51, 0.04);
  --sh-3: 0 10px 30px rgba(11, 31, 51, 0.14);
  --sh-appbar: 0 6px 18px rgba(11, 31, 51, 0.18);

  /* safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 62px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* [hidden] must win over component display rules (.sheet-host/.netbar set display:flex);
   without this the empty sheet-host overlay (inset:0, z-index:150) eats every click. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--bg-deep);
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', sans-serif;
  color: var(--ink);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- App shell ---------- */
.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 50px rgba(11, 31, 51, 0.12);
}

/* network strip */
.netbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: #37474F;
  color: #fff;
  font-size: var(--fs-meta);
  font-weight: 700;
  padding: 6px 12px;
  padding-top: calc(6px + var(--safe-top));
  z-index: 60;
}
.netbar__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #FFB300;
  box-shadow: 0 0 0 0 rgba(255, 179, 0, 0.6);
  animation: ping 1.6s infinite;
}
@keyframes ping { to { box-shadow: 0 0 0 8px rgba(255, 179, 0, 0); } }

/* ---------- App bar ---------- */
.appbar {
  position: relative;
  flex-shrink: 0;
  color: #fff;
  padding: calc(var(--safe-top) + 14px) var(--sp-4) 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-bright));
  box-shadow: var(--sh-appbar);
  z-index: 40;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
/* when netbar visible the safe-top is already consumed by netbar */
.app.is-offline .appbar { padding-top: 14px; }

.appbar--danger { background: linear-gradient(135deg, var(--danger-deep), var(--danger)); }
.appbar--teal { background: linear-gradient(135deg, #00695C, var(--teal)); }
.appbar--ink { background: linear-gradient(135deg, #15233A, #243a5e); }
.appbar--purple { background: linear-gradient(135deg, #6A1B9A, var(--purple)); }
.appbar--warn { background: linear-gradient(135deg, #E65100, var(--warn)); }
.appbar--safe { background: linear-gradient(135deg, #1B5E20, var(--safe)); }

.appbar__top { display: flex; align-items: center; gap: var(--sp-2); }
.appbar__back {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-left: -8px;
  border: none; background: rgba(255, 255, 255, 0.16);
  color: #fff; border-radius: 50%; font-size: 22px; line-height: 1;
  transition: transform 0.12s, background 0.2s;
}
.appbar__back:active { transform: scale(0.9); background: rgba(255, 255, 255, 0.28); }
.appbar__titles { flex: 1; min-width: 0; }
.appbar__eyebrow { font-size: var(--fs-micro); font-weight: 700; opacity: 0.85; letter-spacing: 0.04em; }
.appbar__title {
  font-size: var(--fs-h1); font-weight: 900; letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar__title.is-small { font-size: var(--fs-h3); }
.appbar__sub { font-size: var(--fs-meta); opacity: 0.9; margin-top: 2px; }

.muni-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, 0.2);
  border: none; color: #fff;
  border-radius: var(--r-pill);
  padding: 4px 12px; margin-top: 7px;
  font-size: var(--fs-meta); font-weight: 700;
  transition: background 0.2s;
}
.muni-chip:active { background: rgba(255, 255, 255, 0.34); }

.bell {
  position: relative; flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.16); border: none;
  border-radius: 50%; font-size: 19px;
  transition: transform 0.12s;
}
.bell:active { transform: scale(0.9); }
.bell__count {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: #FFC400; color: #1a1a1a;
  font-size: 10px; font-weight: 900; line-height: 18px; text-align: center;
  border-radius: var(--r-pill);
  border: 2px solid var(--primary);
}
.appbar--danger .bell__count { border-color: var(--danger); }

.appbar__actions { display: flex; align-items: center; gap: 6px; }
.appbar__icon-btn {
  width: 38px; height: 38px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s;
}
.appbar__icon-btn:active { transform: scale(0.9) rotate(40deg); }

/* sub-tabs inside an appbar context (segmented) */
.segbar {
  flex-shrink: 0;
  display: flex; background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.segbar__item {
  flex: 1; text-align: center; padding: 13px 6px;
  font-size: var(--fs-sub); font-weight: 700; color: var(--ink-3);
  background: none; border: none; border-bottom: 2.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.segbar__item.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* filter chip rail */
.chiprail {
  flex-shrink: 0;
  display: flex; gap: var(--sp-2); overflow-x: auto;
  padding: 10px var(--sp-4); background: var(--card);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.chiprail::-webkit-scrollbar { display: none; }
.fchip {
  flex-shrink: 0;
  padding: 7px 14px; border-radius: var(--r-pill);
  background: var(--bg-deep); color: var(--ink-2);
  font-size: var(--fs-meta); font-weight: 700; border: none;
  transition: background 0.18s, color 0.18s, transform 0.1s;
}
.fchip:active { transform: scale(0.95); }
.fchip.is-active { background: var(--primary); color: #fff; }

/* ---------- Screen body ---------- */
.screen {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
}
.screen::-webkit-scrollbar { width: 0; }
.sec { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.sec--flush { padding-top: var(--sp-3); }

/* page-load stagger */
.stagger > * { opacity: 0; transform: translateY(10px); animation: rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.10s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(8) { animation-delay: 0.30s; }
.stagger > *:nth-child(n+9) { animation-delay: 0.34s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .stagger > * { animation: none; opacity: 1; transform: none; }
}

/* screen transition */
.screen.is-entering { animation: screenIn 0.26s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  box-shadow: var(--sh-1);
  border: 1px solid var(--line);
}
.card--tap { transition: transform 0.12s, box-shadow 0.2s; }
.card--tap:active { transform: scale(0.985); box-shadow: var(--sh-2); }
.card--flat { box-shadow: none; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.card__title { font-size: var(--fs-h3); font-weight: 900; display: flex; align-items: center; gap: 7px; }
.card__more { font-size: var(--fs-meta); font-weight: 700; color: var(--primary); background: none; border: none; }

.accent-l { border-left: 4px solid var(--primary); }
.accent-l.danger { border-left-color: var(--danger); }
.accent-l.warn { border-left-color: var(--warn); }
.accent-l.safe { border-left-color: var(--safe); }
.accent-l.info { border-left-color: var(--info); }
.accent-l.purple { border-left-color: var(--purple); }
.accent-l.pet { border-left-color: var(--pet); }

/* tinted cards */
.tint { border: 1.5px solid transparent; }
.tint-danger { background: var(--danger-soft); border-color: rgba(211, 47, 47, 0.25); }
.tint-warn { background: var(--warn-soft); border-color: rgba(239, 108, 0, 0.25); }
.tint-safe { background: var(--safe-soft); border-color: rgba(46, 125, 50, 0.25); }
.tint-info { background: var(--info-soft); border-color: rgba(2, 119, 189, 0.22); }
.tint-pet { background: var(--pet-soft); border-color: rgba(245, 124, 0, 0.28); }
.tint-purple { background: var(--purple-soft); border-color: rgba(123, 31, 162, 0.22); }
.tint-primary { background: var(--primary-soft); border-color: rgba(21, 101, 192, 0.22); }

/* section label */
.sec-label {
  font-size: var(--fs-meta); font-weight: 800; color: var(--ink-3);
  letter-spacing: 0.04em; padding: 2px 2px 0; margin-top: 2px;
}

/* ---------- Typography helpers ---------- */
.t-meta { font-size: var(--fs-meta); color: var(--ink-3); }
.t-sub { font-size: var(--fs-sub); color: var(--ink-2); }
.t-strong { font-weight: 900; }
.muted { color: var(--ink-3); }
.lh { line-height: 1.75; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: var(--fs-micro); font-weight: 800; white-space: nowrap;
}
.b-safe { background: var(--safe-soft); color: #1B5E20; }
.b-warn { background: var(--warn-soft); color: #C65000; }
.b-danger { background: var(--danger-soft); color: #B3261E; }
.b-info { background: var(--info-soft); color: #01579B; }
.b-pet { background: var(--pet-soft); color: #C65000; }
.b-purple { background: var(--purple-soft); color: #6A1B9A; }
.b-gray { background: var(--bg-deep); color: var(--ink-2); }
.b-teal { background: var(--teal-soft); color: #00695C; }
.b-solid { background: var(--primary); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 14px 16px; border: none; border-radius: var(--r-md);
  color: #fff; font-size: var(--fs-h3); font-weight: 800; line-height: 1.2;
  box-shadow: var(--sh-1); transition: transform 0.1s, box-shadow 0.2s, filter 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); filter: brightness(0.96); }
.btn-p { background: linear-gradient(135deg, var(--primary), var(--primary-bright)); }
.btn-d { background: linear-gradient(135deg, var(--danger-deep), var(--danger)); }
.btn-s { background: linear-gradient(135deg, #1B5E20, var(--safe)); }
.btn-o { background: linear-gradient(135deg, #E65100, var(--warn)); }
.btn-pet { background: linear-gradient(135deg, #E65100, var(--pet)); }
.btn-purple { background: linear-gradient(135deg, #6A1B9A, var(--purple)); }
.btn-teal { background: linear-gradient(135deg, #00695C, var(--teal)); }
.btn-sm { padding: 9px 14px; font-size: var(--fs-sub); border-radius: var(--r-sm); }

.btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px 16px; border-radius: var(--r-md);
  background: var(--card); border: 1.5px solid var(--line);
  color: var(--ink); font-size: var(--fs-sub); font-weight: 800;
  transition: transform 0.1s, border-color 0.2s, background 0.2s;
}
.btn-line:active { transform: scale(0.99); background: var(--line-soft); }
.btn-line.is-primary { color: var(--primary); border-color: rgba(21, 101, 192, 0.4); }

/* ---------- Lists / rows ---------- */
.row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.row:last-child { border-bottom: none; }
.row__body { flex: 1; min-width: 0; }
.row__title { font-size: var(--fs-sub); font-weight: 700; }
.row__meta { font-size: var(--fs-meta); color: var(--ink-3); margin-top: 2px; }

/* icon chip */
.ichip {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: var(--primary-soft);
}
.ichip--sm { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
.ichip.t-danger { background: var(--danger-soft); }
.ichip.t-warn { background: var(--warn-soft); }
.ichip.t-safe { background: var(--safe-soft); }
.ichip.t-info { background: var(--info-soft); }
.ichip.t-pet { background: var(--pet-soft); }
.ichip.t-purple { background: var(--purple-soft); }
.ichip.t-teal { background: var(--teal-soft); }

/* key-value grid */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.kv > div { font-size: var(--fs-sub); }
.kv b { font-weight: 800; }

/* ---------- Quick actions grid ---------- */
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.qa {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 6px 12px; text-align: center;
  box-shadow: var(--sh-1); transition: transform 0.12s, box-shadow 0.2s;
}
.qa:active { transform: scale(0.95); box-shadow: var(--sh-2); }
.qa__ico {
  width: 46px; height: 46px; margin: 0 auto 7px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: var(--primary-soft);
}
.qa__label { font-size: var(--fs-meta); font-weight: 700; color: var(--ink); }

/* ---------- Progress ---------- */
.progress { height: 8px; background: var(--bg-deep); border-radius: var(--r-pill); overflow: hidden; }
.progress__fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--safe), #66BB6A); transition: width 0.6s ease; }
.progress__fill.warn { background: linear-gradient(90deg, var(--warn), #FFB74D); }

/* ---------- Banners ---------- */
.alert-banner {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--danger-deep), var(--danger));
  color: #fff; padding: 14px 16px; border-radius: var(--r-md);
  font-weight: 800; box-shadow: 0 8px 20px rgba(183, 28, 28, 0.3);
  animation: bannerPulse 2.4s ease-in-out infinite;
}
.alert-banner__ico { font-size: 22px; animation: shake 2.4s ease-in-out infinite; }
@keyframes bannerPulse { 0%, 100% { box-shadow: 0 8px 20px rgba(183, 28, 28, 0.3); } 50% { box-shadow: 0 8px 28px rgba(183, 28, 28, 0.5); } }
@keyframes shake { 0%, 92%, 100% { transform: rotate(0); } 94% { transform: rotate(-12deg); } 96% { transform: rotate(12deg); } 98% { transform: rotate(-8deg); } }

.info-strip {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--primary-soft); color: #0D3B66;
  border: 1px solid rgba(21, 101, 192, 0.18);
  padding: 11px 13px; border-radius: var(--r-sm);
  font-size: var(--fs-meta); line-height: 1.65; font-weight: 500;
}
.info-strip.teal { background: var(--teal-soft); color: #00564B; border-color: rgba(0, 137, 123, 0.2); }
.info-strip.safe { background: var(--safe-soft); color: #1B5E20; border-color: rgba(46, 125, 50, 0.2); }
.info-strip.warn { background: var(--warn-soft); color: #C65000; border-color: rgba(239, 108, 0, 0.22); }
.info-strip.purple { background: var(--purple-soft); color: #6A1B9A; border-color: rgba(123, 31, 162, 0.2); }

/* hero weather */
.weather {
  color: #fff; border: none;
  background: linear-gradient(135deg, #1E88E5, #42A5F5);
  border-radius: var(--r-md); padding: var(--sp-4); box-shadow: var(--sh-2);
}
.weather__row { display: flex; justify-content: space-between; align-items: flex-start; }
.weather__big { font-size: 30px; font-weight: 900; line-height: 1.1; }
.weather__temp { font-size: 34px; font-weight: 900; }
.weather__forecast {
  display: flex; justify-content: space-around; margin-top: 12px;
  background: rgba(255, 255, 255, 0.16); border-radius: var(--r-sm); padding: 10px 4px;
}
.weather__day { text-align: center; font-size: 11px; line-height: 1.7; }
.weather__day .e { font-size: 19px; }

/* level meter (epidemic) */
.levelmeter { display: flex; gap: 4px; background: #fff; border-radius: var(--r-sm); padding: 10px 8px; }
.levelmeter__cell { flex: 1; text-align: center; font-size: 10px; color: var(--ink-3); }
.levelmeter__cell .n { font-size: 15px; font-weight: 800; display: block; }
.levelmeter__cell.is-on { color: var(--safe); }
.levelmeter__cell.is-on .n { color: var(--safe); }

/* map placeholder (offline-safe schematic) */
.map {
  position: relative; height: 200px; border-radius: var(--r-md); overflow: hidden;
  background:
    radial-gradient(circle at 20% 30%, rgba(46, 125, 50, 0.12), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(21, 101, 192, 0.12), transparent 40%),
    linear-gradient(160deg, #DDEAD9, #CFE0EC);
  border: 1px solid var(--line);
}
.map::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 28px 28px;
}
.map__road {
  position: absolute; background: rgba(255, 255, 255, 0.85);
}
.map__road.r1 { top: 42%; left: -5%; width: 110%; height: 9px; transform: rotate(-7deg); border-radius: 6px; }
.map__road.r2 { top: 8%; left: 58%; width: 9px; height: 90%; transform: rotate(6deg); border-radius: 6px; }
.map__pin {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 800; color: var(--ink);
}
.map__pin .dot {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0;
  transform: rotate(45deg); display: flex; align-items: center; justify-content: center;
  background: var(--safe); color: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  border: 2px solid #fff;
}
.map__pin .dot span { transform: rotate(-45deg); font-size: 15px; }
.map__pin.pet .dot { background: var(--pet); }
.map__pin.store .dot { background: var(--warn); }
.map__pin.me .dot { background: var(--primary); }
.map__badge {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(255, 255, 255, 0.92); color: var(--ink-2);
  font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: var(--r-pill);
  box-shadow: var(--sh-1);
}

/* notice list */
.notice { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.notice:last-child { border-bottom: none; }
.notice__t { font-size: var(--fs-sub); font-weight: 700; }
.notice__m { font-size: var(--fs-micro); color: var(--ink-3); margin-top: 3px; }

/* settings list */
.slist { background: var(--card); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-1); border: 1px solid var(--line); }
.slist__title { font-size: var(--fs-micro); font-weight: 800; color: var(--ink-3); padding: 13px 16px 6px; letter-spacing: 0.04em; }
.sitem { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line-soft); background: none; border-left: none; border-right: none; width: 100%; text-align: left; }
.sitem:first-of-type { border-top: none; }
.sitem__ico { width: 26px; text-align: center; font-size: 18px; }
.sitem__label { flex: 1; font-size: var(--fs-sub); color: var(--ink); }
.sitem__value { font-size: var(--fs-meta); color: var(--ink-3); }
.sitem__chev { color: var(--ink-3); font-size: 19px; }
.on { color: var(--safe); font-weight: 800; }
.off { color: var(--ink-3); font-weight: 800; }

/* QR / disaster id card */
.idcard {
  background: linear-gradient(150deg, #15233A, #2b4a72);
  color: #fff; border-radius: var(--r-lg); padding: 22px 20px;
  box-shadow: var(--sh-3); text-align: center;
}
.idcard__eyebrow { font-size: 10px; letter-spacing: 0.28em; opacity: 0.6; }
.idcard__title { font-size: var(--fs-h2); font-weight: 900; margin-top: 4px; }
.qr {
  width: 172px; height: 172px; margin: 16px auto; padding: 9px;
  background: #fff; border-radius: 14px;
}
.qr__pat {
  position: relative;
  width: 100%; height: 100%; border: 5px solid #15233A; border-radius: 4px;
  background: repeating-conic-gradient(#15233A 0% 25%, #fff 0% 50%) 0 0 / 15px 15px;
}
/* finder squares (top-left, top-right, bottom-left) で QR らしく */
.qr__pat::before,
.qr__pat::after {
  content: ""; position: absolute; top: 7px; left: 7px;
  width: 30px; height: 30px; background: #fff;
  border: 6px solid #15233A; box-shadow: 0 0 0 4px #fff;
}
.qr__pat::after { left: auto; right: 7px; }
.idcard__divider { border-top: 1px solid rgba(255, 255, 255, 0.2); margin-top: 16px; padding-top: 12px; font-size: var(--fs-meta); line-height: 1.85; opacity: 0.9; text-align: left; }

/* checklist row */
.check {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--line-soft); background: none; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left;
  font-size: var(--fs-sub); color: var(--ink);
}
.check:last-child { border-bottom: none; }
.check__box {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 7px;
  border: 2px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: transparent; transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.check.is-on .check__box { background: var(--safe); border-color: var(--safe); color: #fff; }
.check__label { flex: 1; }
.check.is-on .check__label { color: var(--ink-2); }

/* pet card */
.petcard {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #FFF6E6, #FFE9CC);
  border: 1.5px solid rgba(245, 124, 0, 0.4);
  border-radius: var(--r-md); padding: 12px;
}
.petcard__av {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: linear-gradient(135deg, #FFD166, #FF8F00);
}
.petcard__name { font-size: var(--fs-sub); font-weight: 800; }
.petcard__meta { font-size: var(--fs-meta); color: var(--ink-2); margin-top: 1px; }

/* avatar */
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-bright));
}

/* shelter list card */
.shelter { display: flex; flex-direction: column; gap: 8px; }
.shelter__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.shelter__name { font-size: var(--fs-h3); font-weight: 800; }
.shelter__meta { font-size: var(--fs-meta); color: var(--ink-3); margin-top: 2px; }
.shelter__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.occ { display: flex; align-items: center; gap: 8px; }
.occ__bar { flex: 1; }

/* ---------- States: skeleton / empty / error ---------- */
.skeleton { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.sk {
  border-radius: var(--r-md);
  background: linear-gradient(100deg, #E9EEF4 30%, #F4F7FA 50%, #E9EEF4 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite linear;
}
.sk.card { height: 96px; box-shadow: none; border: none; padding: 0; }
.sk.line { height: 14px; }
.sk.line.w60 { width: 60%; } .sk.line.w40 { width: 40%; } .sk.line.w80 { width: 80%; }
.sk.tall { height: 150px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

.placeholder { text-align: center; padding: 48px 28px; color: var(--ink-3); }
.placeholder__ico {
  width: 78px; height: 78px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  background: var(--card); box-shadow: var(--sh-1);
}
.placeholder__title { font-size: var(--fs-h3); font-weight: 800; color: var(--ink-2); }
.placeholder__text { font-size: var(--fs-sub); margin-top: 6px; line-height: 1.7; }
.placeholder .btn-line { width: auto; margin: 18px auto 0; padding: 10px 22px; }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  flex-shrink: 0; position: relative; z-index: 50;
  display: flex; background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -4px 20px rgba(11, 31, 51, 0.06);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 9px 0 7px; background: none; border: none;
  color: var(--ink-3); font-size: 10.5px; font-weight: 700;
  position: relative; transition: color 0.2s;
}
.tab__ico { font-size: 21px; line-height: 1; transition: transform 0.2s; }
.tab__badge {
  position: absolute; top: 5px; left: 56%;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 9px; font-weight: 900;
  line-height: 16px; text-align: center; border-radius: var(--r-pill); border: 1.5px solid #fff;
}
.tab.is-active { color: var(--primary); }
.tab.is-active .tab__ico { transform: translateY(-2px) scale(1.06); }
.tab.is-active::before {
  content: ""; position: absolute; top: 0; width: 28px; height: 3px;
  background: var(--primary); border-radius: 0 0 4px 4px;
}
.app.is-emergency .tab.is-active { color: var(--danger); }
.app.is-emergency .tab.is-active::before { background: var(--danger); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px);
  transform: translateX(-50%) translateY(12px);
  background: rgba(15, 23, 35, 0.94); color: #fff;
  padding: 12px 18px; border-radius: var(--r-pill);
  font-size: var(--fs-sub); font-weight: 700; max-width: 86%;
  box-shadow: var(--sh-3); z-index: 200; opacity: 0;
  transition: opacity 0.24s, transform 0.24s;
  pointer-events: none;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Bottom sheet ---------- */
.sheet-host {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-host__bg { position: absolute; inset: 0; background: rgba(11, 31, 51, 0.5); animation: fade 0.2s; }
.sheet {
  position: relative; width: 100%; max-width: 480px;
  background: var(--card); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 8px var(--sp-4) calc(var(--sp-4) + var(--safe-bottom));
  max-height: 82vh; overflow-y: auto;
  animation: sheetUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet__handle { width: 42px; height: 4px; background: var(--line); border-radius: var(--r-pill); margin: 6px auto 14px; }
.sheet__title { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-h3); font-weight: 900; margin-bottom: 12px; }
.sheet__close { background: var(--bg-deep); border: none; width: 30px; height: 30px; border-radius: 50%; font-size: 16px; color: var(--ink-2); }
.sheet-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--line-soft); border: 1.5px solid transparent;
  border-radius: var(--r-sm); padding: 12px; margin-bottom: 7px; width: 100%; text-align: left;
}
.sheet-item.is-active { background: var(--primary-soft); border-color: var(--primary); }
.sheet-item__radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sheet-item.is-active .sheet-item__radio { border-color: var(--primary); }
.sheet-item.is-active .sheet-item__radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.sheet-sec { font-size: var(--fs-micro); font-weight: 800; color: var(--ink-3); margin: 12px 2px 7px; }

/* segmented toggle (demo controls) */
.seg { display: flex; background: var(--bg-deep); border-radius: var(--r-sm); padding: 4px; gap: 4px; }
.seg__opt { flex: 1; padding: 9px 6px; border: none; background: none; border-radius: 8px; font-size: var(--fs-meta); font-weight: 800; color: var(--ink-2); transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.seg__opt.is-on { background: var(--card); color: var(--primary); box-shadow: var(--sh-1); }
.seg__opt.is-on.danger { color: var(--danger); }
.seg__opt.is-on.warn { color: var(--warn); }

/* dot list */
.dotlist { font-size: var(--fs-sub); line-height: 1.9; }
.dotlist .ok { color: var(--safe); font-weight: 800; }
.dotlist .ng { color: var(--danger); font-weight: 800; }

/* utility */
.gap-sm { display: flex; flex-direction: column; gap: 7px; }
.flex { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wrap { flex-wrap: wrap; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }

/* a11y */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen:focus { outline: none; }
:focus-visible { outline: 3px solid #FFC400; outline-offset: 2px; border-radius: 4px; }
