:root {
  /* 「お金の国」テーマ: ゴールド×オレンジの派手めパレット */
  --bg: #fff6e3;              /* あたたかいゴールドクリーム */
  --surface: #ffffff;
  --text: #3d2f23;
  --muted: #a3907a;
  --border: #f2e2c4;
  --accent: #ff9214;          /* メイン＝ビビッドオレンジ */
  --accent-deep: #e07800;
  --accent-weak: #fff1d6;
  --gold: #ffce3a;            /* 金貨ゴールド */
  --gold-deep: #d9a916;
  --trip: #ff6b8a;            /* 旅行・イベント＝ピンク */
  --trip-weak: #ffe3ea;
  --warn: #ffbe0b;            /* 注意＝イエロー */
  --warn-weak: #fff3cd;
  --pos: #1f8a5b;
  --neg: #e0483a;
  --radius: 16px;
  --shadow: 0 3px 16px rgba(160,110,20,0.10);
}

/* -------------------------------------------------------------------------
   マネコタウン2.0 — 立体地形ベース + 動的な目標建物/住民レイヤー
   ------------------------------------------------------------------------- */
.jr-overlay.tm-overlay.tmv3-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  width: 100%;
  height: 100%;
  background: #63743a;
  overflow: hidden;
  color: #4b351e;
}

.tmv3-canvas,
.tmv3-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.tmv3-viewport {
  touch-action: none;
  user-select: none;
  cursor: grab;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 230, 150, .25), transparent 55%),
    #516638;
}

.tmv3-viewport:active { cursor: grabbing; }

.tmv3-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.tmv3-background {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.tmv3-quiet .tmv3-background {
  filter: saturate(.82) brightness(.92);
}

.tmv3-festival .tmv3-background {
  filter: saturate(1.08) brightness(1.04) sepia(.04);
}

.tmv3-header {
  position: absolute;
  z-index: 20;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  max-width: 680px;
  margin: 0 auto;
  padding: 9px 12px 9px 8px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 22px;
  background: rgba(255, 250, 235, .9);
  box-shadow: 0 12px 34px rgba(63, 43, 19, .2), inset 0 1px 0 #fff;
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}

.tmv3-back {
  width: 40px;
  height: 40px;
  padding: 0 0 4px;
  border: 0;
  border-radius: 15px;
  background: #fff8e7;
  color: #71502d;
  box-shadow: 0 3px 10px rgba(88, 56, 20, .15);
  font: 700 34px/36px system-ui, sans-serif;
}

.tmv3-header > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tmv3-header strong {
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: .02em;
}

.tmv3-header span {
  overflow: hidden;
  margin-top: 3px;
  color: #856d50;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tmv3-header .tmv3-activity {
  margin: 0;
  padding: 7px 9px;
  border-radius: 999px;
  background: #f5df9e;
  color: #705020;
  font-size: 11px;
  font-weight: 800;
}

.tmv3-status {
  position: absolute;
  z-index: 19;
  top: calc(env(safe-area-inset-top, 0px) + 88px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 7px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.tmv3-status > span,
.tmv3-fit {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: rgba(66, 54, 35, .72);
  color: #fff9e8;
  box-shadow: 0 4px 14px rgba(34, 29, 20, .18);
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tmv3-fit {
  border-color: rgba(255, 244, 197, .9);
  background: rgba(232, 182, 43, .94);
  color: #493510;
}

.tmv3-hint {
  position: absolute;
  z-index: 18;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  left: 50%;
  width: max-content;
  max-width: calc(100vw - 28px);
  margin: 0;
  padding: 8px 13px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(54, 45, 31, .72);
  color: #fff;
  font-size: 11px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tmv3-goal-site {
  position: absolute;
  z-index: 7;
  width: 190px;
  height: 205px;
  padding: 0;
  transform: translate(-50%, -57%);
  border: 0;
  background: transparent;
  color: #4d371c;
}

.tmv3-goal-building {
  position: absolute;
  left: 50%;
  bottom: 48px;
  width: 118px;
  height: 148px;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 8px rgba(58, 40, 16, .25));
}

.tmv3-foundation {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 2px;
  height: 25px;
  transform: skewY(-5deg);
  border: 3px solid rgba(89, 67, 39, .42);
  border-radius: 9px 9px 14px 14px;
  background: linear-gradient(135deg, #d9c494, #a88e62);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, .32);
}

.tmv3-floor {
  position: absolute;
  left: 14px;
  bottom: calc(24px + var(--floor) * 18px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 90px;
  height: 24px;
  padding: 5px 9px;
  transform: skewY(-4deg);
  border: 2px solid #907248;
  border-radius: 5px;
  background: linear-gradient(135deg, #f2d179 0%, #d8a83a 65%, #b98627 100%);
  box-shadow: inset 0 3px 0 rgba(255, 252, 218, .5);
}

.tmv3-floor b {
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(#8bc6d2, #4f8494);
  box-shadow: inset 0 0 0 2px rgba(67, 68, 59, .25);
}

.tmv3-goal-roof {
  position: absolute;
  left: 4px;
  bottom: calc(46px + var(--max-floors) * 18px);
  display: none;
  width: 110px;
  height: 32px;
  transform: perspective(80px) rotateX(32deg) skewY(-4deg);
  border: 2px solid #7f5630;
  border-radius: 50% 50% 8px 8px;
  background: linear-gradient(135deg, #e8734d, #b94d34);
  box-shadow: inset 0 4px 0 rgba(255, 188, 126, .48);
}

.tmv3-goal-site.is-complete .tmv3-goal-roof { display: block; }

.tmv3-scaffold {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 18px;
  height: 116px;
  border: 3px solid rgba(132, 82, 31, .55);
  border-top-width: 5px;
  background:
    linear-gradient(67deg, transparent 47%, rgba(130, 78, 28, .52) 48% 52%, transparent 53%),
    linear-gradient(-67deg, transparent 47%, rgba(130, 78, 28, .52) 48% 52%, transparent 53%);
  opacity: .9;
}

.tmv3-goal-site.is-complete .tmv3-scaffold,
.tmv3-goal-site.is-planned .tmv3-scaffold { display: none; }

.tmv3-goal-site.is-foundation .tmv3-scaffold { height: 58px; opacity: .65; }

.tmv3-goal-tag {
  position: absolute;
  left: 50%;
  bottom: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 180px;
  padding: 6px 9px;
  transform: translateX(-50%);
  border: 2px solid rgba(150, 113, 50, .32);
  border-radius: 12px;
  background: rgba(255, 249, 227, .94);
  box-shadow: 0 5px 12px rgba(65, 45, 18, .18);
  white-space: nowrap;
}

.tmv3-goal-tag b {
  overflow: hidden;
  max-width: 120px;
  font-size: 11px;
  text-overflow: ellipsis;
}

.tmv3-goal-tag i {
  color: #9a6814;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.tmv3-goal-site.is-empty {
  height: 116px;
  transform: translate(-50%, -48%);
  border: 3px dashed rgba(109, 91, 51, .36);
  border-radius: 50%;
  background: rgba(255, 244, 199, .16);
}

.tmv3-empty-mark {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 23px auto 3px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 248, 223, .9);
  box-shadow: 0 4px 12px rgba(72, 52, 24, .18);
  color: #a07726;
  font-size: 28px;
}

.tmv3-goal-name {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 248, 230, .88);
  font-size: 10px;
  font-weight: 800;
}

.tmv3-citizen {
  position: absolute;
  z-index: 8;
  height: auto;
  transform: translate(-50%, -84%) scaleX(var(--citizen-flip));
  transform-origin: 50% 100%;
  filter: hue-rotate(var(--citizen-hue)) drop-shadow(0 7px 5px rgba(50, 35, 14, .25));
  pointer-events: none;
  animation: tmv3-bob 1.8s ease-in-out var(--citizen-delay) infinite;
}

.tmv3-citizen.is-sit { animation-name: tmv3-breathe; }
.tmv3-citizen.is-walk { animation-duration: 1.05s; }

@keyframes tmv3-bob {
  0%, 100% { translate: 0 0; rotate: -1deg; }
  50% { translate: 0 -7px; rotate: 1.5deg; }
}

@keyframes tmv3-breathe {
  0%, 100% { scale: 1; }
  50% { scale: 1.025; }
}

.tmv3-hotspot {
  position: absolute;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 128px;
  min-height: 30px;
  padding: 4px 8px 4px 5px;
  transform: translate(-50%, -10%);
  border: 2px solid rgba(255, 250, 225, .8);
  border-radius: 999px;
  background: rgba(70, 55, 31, .72);
  box-shadow: 0 5px 12px rgba(54, 39, 20, .2);
  color: #fff9e9;
  opacity: .9;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tmv3-hotspot > span {
  display: grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #f0c755;
  font-size: 12px;
}

.tmv3-hotspot b {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tmv3-hotspot.is-home { background: rgba(161, 93, 31, .8); }

.tmv3-sheet {
  position: absolute;
  z-index: 30;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  left: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.tmv3-sheet[hidden] { display: none; }

.tmv3-card {
  position: relative;
  padding: 20px 18px 18px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 28px;
  background: rgba(255, 250, 237, .96);
  box-shadow: 0 20px 48px rgba(51, 36, 19, .3), inset 0 1px 0 #fff;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.tmv3-sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #efe3c9;
  color: #755536;
  font-size: 22px;
  line-height: 34px;
}

.tmv3-card-emoji { font-size: 32px; }

.tmv3-card h3 {
  margin: 7px 42px 3px 0;
  font-size: 21px;
}

.tmv3-card p {
  margin: 0 0 12px;
  color: #80684b;
  font-size: 12px;
}

.tmv3-card > strong {
  display: block;
  margin-top: 9px;
  color: #5a421f;
  font-size: 14px;
  text-align: right;
}

.tmv3-progress {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e6ddca;
}

.tmv3-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8b62b, #f28e3d);
}

.tmv3-receipts {
  max-height: 190px;
  margin: 10px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.tmv3-receipts li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 2px;
  border-top: 1px solid #eadfc8;
  font-size: 12px;
}

.tmv3-receipts li span { color: #917b60; }
.tmv3-receipts li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmv3-receipts li i { color: #b05243; font-style: normal; font-weight: 800; }
.tmv3-sheet-empty { padding: 12px 0; text-align: center; }

@media (max-width: 520px) {
  .tmv3-header { border-radius: 20px; }
  .tmv3-header .tmv3-activity { display: none; }
  .tmv3-header { grid-template-columns: 42px minmax(0, 1fr); }
  .tmv3-hint { font-size: 10px; }
  .tmv3-sheet { bottom: calc(env(safe-area-inset-bottom, 0px) + 48px); }
}

@media (prefers-reduced-motion: reduce) {
  .tmv3-citizen { animation: none; }
}

* { box-sizing: border-box; }

/* アプリ自体を背景化: 外側背景の露出とオーバースクロール／ピンチズームの余白を無くす。 */
html { width: 100%; height: 100%; overscroll-behavior: none; }

body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  overscroll-behavior: none;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; }

/* グローバルの appbar は非表示（ダッシュボードの挨拶カードがヘッダー役） */
.appbar { display: none; }

main {
  max-width: 820px;
  margin: 18px auto 40px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 14px 0 8px; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.muted { color: var(--muted); font-size: 13px; }
.spacer { flex: 1; }

/* フォーム */
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 12px; color: var(--muted); }
input, select {
  font: inherit;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfbf9;
}
input:focus, select:focus { outline: 2px solid var(--accent-weak); border-color: var(--accent); }
input.grow { flex: 1; min-width: 140px; }
input.price { width: 110px; }

/* 日付入力: iOS Safari のネイティブ装飾（内側の枠/影・値のはみ出し）を消して
   指定した枠にきちんと収める。値は中央寄せ・高さは他の入力とそろえる。 */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: calc(1.6em + 20px);
  text-align: center;
  line-height: 1.2;
}
input[type="date"]::-webkit-date-and-time-value { text-align: center; margin: 0; }
input[type="date"]::-webkit-datetime-edit { padding: 0; }
input[type="date"]::-webkit-calendar-picker-indicator { margin-left: 6px; }

button {
  font: inherit;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
button:hover { background: #f5f4ef; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); border-radius: 999px; font-weight: 700; }
button.primary:hover { filter: brightness(1.06); background: var(--accent); }
.link-btn { border: none; background: none; color: var(--accent); padding: 4px 6px; }
.link-btn:hover { background: none; text-decoration: underline; }

/* プロジェクトカード */
.trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.trip-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; position: relative; transition: transform .12s, box-shadow .12s; }
.trip-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(31,60,45,0.10); }
.proj-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.proj-icon.trip { background: var(--trip-weak); }
.proj-icon.daily { background: var(--accent-weak); }
.proj-tag { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.proj-tag.trip { background: var(--trip-weak); color: var(--trip); }
.proj-tag.daily { background: var(--accent-weak); color: var(--accent-deep); }
.trip-title { font-weight: 700; font-size: 16px; margin-top: 4px; }
.trip-total { font-size: 22px; font-weight: 800; color: var(--accent-deep); }

/* アバター（メンバー） */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid #fff; margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }

/* プロジェクト詳細ヘッダー（種類で色分け：旅行=珊瑚 / 日常=緑） */
.trip-header { position: relative; border-radius: var(--radius); padding: 18px 20px 20px; color: #fff; overflow: hidden;
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "back back" "main album"; align-items: end; column-gap: 12px;
  background: linear-gradient(135deg, #2bb074, var(--accent-deep)); box-shadow: var(--shadow); }
.trip-header.trip { background: linear-gradient(135deg, #ef9b76, #e07248); }
.trip-header .back { grid-area: back; font-size: 13px; color: rgba(255,255,255,0.92); text-decoration: none; margin-bottom: 6px; }
.trip-header-main { grid-area: main; }
.trip-header h1 { margin: 4px 0 2px; color: #fff; }
.trip-header .muted { color: rgba(255,255,255,0.9); }
.album-open-btn { grid-area: album; align-self: center; background: #fff; color: var(--text); border: none; border-radius: 999px; padding: 9px 16px; font-weight: 700; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.album-open-btn:hover { filter: brightness(0.98); }

.members { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.member-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-name { font-weight: 600; min-width: 80px; }
.member-name-input { flex: 1; min-width: 110px; font-weight: 600; }
.weight-input { width: 64px; }
.link-btn.danger { color: var(--neg); }

/* プロジェクト詳細：下部タブバー＋タブ単位の表示 */
.detail { display: flex; flex-direction: column; gap: 16px; padding-bottom: 88px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: #fff;
  border-top: 1px solid var(--border); box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  display: flex; justify-content: center; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tabbar-item { border: none; background: none; cursor: pointer; flex: 0 0 auto; width: 72px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--muted); padding: 6px 4px; border-radius: 14px; }
.tabbar-item:hover { background: #f5f4ef; }
.tabbar-item .ti-ico { font-size: 19px; line-height: 1; }
.tabbar-item.active { color: var(--accent-deep); background: var(--accent-weak); font-weight: 700; }
.weight-mini { width: 48px; margin-left: 4px; padding: 2px 4px; }
.override-wrap { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 月次予算バー */
.budget-bar { height: 12px; background: #efeee7; border-radius: 999px; overflow: hidden; margin: 6px 0 12px; }
.budget-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.budget-fill.over { background: var(--neg); }

/* 繰り返し支出 */
.recurring-list { list-style: none; margin: 0 0 12px; padding: 0; }
.recurring-list li { padding: 6px 0; border-bottom: 1px solid #f0f0ee; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.recurring-list li:last-child { border-bottom: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { background: var(--accent-weak); color: var(--accent); border-radius: 999px; padding: 3px 12px; font-size: 13px; }
.chip.sm { background: #f1f0eb; color: var(--muted); padding: 2px 8px; font-size: 12px; }

/* 集計テーブル */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 6px 8px; border-bottom: 1px solid #f0f0ee; }
.table td.pos { color: var(--pos); font-weight: 600; }
.table td.neg { color: var(--neg); font-weight: 600; }
.settle { margin: 4px 0 0; padding-left: 18px; }
.settle li { margin: 2px 0; }

/* レシート明細フォーム */
.item-rows { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; background: #fafafa; border: 1px solid var(--border); border-radius: 8px; }
/* 負担者をトグルチップで選ぶ（✓＝選択中は緑） */
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { font-size: 13px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; background: #f1f0ea; color: var(--muted); cursor: pointer; border: 1px solid transparent; }
.check input[type=checkbox] { display: none; }
.check:has(input:checked) { background: var(--accent-weak); color: var(--accent-deep); border-color: var(--accent); font-weight: 600; }
.check:has(input:checked)::before { content: '✓'; font-weight: 800; }

/* レシート一覧 */
.receipt { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f0ee; }
.receipt:last-child { border-bottom: none; }
.receipt-body { flex: 1; min-width: 0; }
.receipt-thumb { width: 56px; height: 56px; flex: 0 0 56px; object-fit: cover; border-radius: 8px; background: #f1f0eb; cursor: pointer; }
.receipt-thumb.placeholder { display: flex; align-items: center; justify-content: center; font-size: 26px; cursor: default; }
.receipt-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.items { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.items li { margin: 2px 0; }
.items .share { color: var(--muted); font-size: 12px; }

.status { display: inline-block; padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.status.err { background: #fcebeb; color: var(--neg); }

/* 写真プレビュー */
.preview { max-width: 240px; max-height: 180px; border-radius: 8px; margin-top: 4px; }

/* タブ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab { border: none; background: none; padding: 8px 16px; border-radius: 0; border-bottom: 2px solid transparent; color: var(--muted); }
.tab:hover { background: none; color: var(--text); }
.tab.active { color: var(--accent-deep); border-bottom-color: var(--accent); font-weight: 700; }

/* 挨拶ヘッダー */
.greeting { display: flex; align-items: center; gap: 12px; }
.greeting .leaf { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-weak); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.greeting-text { flex: 1; }
.greeting-text strong { font-size: 17px; }
.greeting .me-avatar { width: 38px; height: 38px; font-size: 14px; }

/* 5タブ・ナビ */
.nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.nav-item { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #f1f0ea; color: var(--text); border: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.nav-item:hover { background: #e9e7df; }
.nav-item.active { background: var(--accent-deep); color: #fff; }

/* 残高ヒーローカード */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 22px 24px; color: #fff;
  background: linear-gradient(135deg, #2bb074, var(--accent-deep)); box-shadow: 0 8px 24px rgba(21,131,79,0.22); }
.hero::after { content: ''; position: absolute; right: -30px; top: -30px; width: 150px; height: 150px; border-radius: 999px; background: rgba(255,255,255,0.08); }
.hero-label { font-size: 13px; opacity: .9; }
.hero-amount { font-size: 40px; font-weight: 800; margin: 2px 0 10px; letter-spacing: .5px; }
.hero-stats { display: flex; gap: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stat { font-size: 13px; }
.hero-stat .k { display: block; opacity: .85; font-size: 11px; }
.hero-stat .v { font-weight: 700; font-size: 15px; }
.hero-stat + .hero-stat { border-left: 1px solid rgba(255,255,255,0.25); padding-left: 18px; }

/* セクション見出し＋作成ボタン */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.section-head h2 { margin: 0; }

/* レシート読取バナー */
.scan-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--accent-weak); margin-bottom: 12px; }
.scan-banner .scan-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-deep); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }
.scan-banner .scan-text { flex: 1; min-width: 0; }
.scan-banner .scan-text strong { display: block; font-size: 14px; }
.scan-banner .scan-text .muted { font-size: 12px; }

/* 支払いの内訳（横バー） */
.paybars { display: flex; flex-direction: column; gap: 10px; }
.paybar-row { display: flex; align-items: center; gap: 10px; }
.paybar-track { flex: 1; height: 14px; background: #efeee7; border-radius: 999px; overflow: hidden; }
.paybar-fill { height: 100%; border-radius: 999px; }
.paybar-val { font-weight: 700; font-size: 13px; min-width: 72px; text-align: right; }

/* 精算行（アバター付き） */
.settle { list-style: none; margin: 6px 0 0; padding: 0; }
.settle li { display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.settle .arrow { color: var(--muted); }
.settle .amt { margin-left: auto; font-weight: 700; color: var(--accent-deep); }

/* 認証・グループ */
.auth-wrap { max-width: 420px; margin: 40px auto; }
.auth-card h2 { font-size: 20px; }
.auth-legal { margin: 12px 0 0; font-size: 12px; line-height: 1.6; }
.auth-action-link { display: inline-block; margin-top: 12px; text-decoration: none; }
.legacy-email-prompt {
  display: flex;
  flex-direction: column;
  gap: 11px;
  color: #604221;
}
.legacy-email-prompt > img {
  align-self: center;
  width: 104px;
  height: 116px;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgba(77,43,10,.18));
}
.legacy-email-prompt > p {
  margin: 0;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.65;
}
.legacy-email-prompt .field { margin: 0; }
.legacy-email-prompt input { width: 100%; }
.legacy-email-prompt .primary { width: 100%; min-height: 46px; }
.auth-action-web-link {
  display: block;
  width: fit-content;
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.userbar { padding: 4px 0; }
.group-list { list-style: none; margin: 0 0 12px; padding: 0; }
.group-list li { padding: 6px 0; border-bottom: 1px solid #f0f0ee; font-size: 14px; }
.group-list li:last-child { border-bottom: none; }
.invite { background: var(--accent-weak); color: var(--accent); padding: 1px 8px; border-radius: 6px; font-size: 13px; user-select: all; }

/* 家計簿スペースの削除（2段階確認。取り消せない操作なので導線は控えめ・確認は強め） */
.group-delete { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.group-delete-lead { margin: 0; font-weight: 800; font-size: 15px; color: #A6412C; }
.group-delete-note { margin: 0; font-size: 13px; line-height: 1.6; color: #6E675C; }
.group-delete-status { margin: 0; min-height: 18px; font-size: 12.5px; color: #A6412C; }
/* :hover は素の `button:hover` が同着以上の詳細度で背景を白く塗ってしまうので、必ず一緒に指定する */
.group-delete-final, .group-delete-final:hover {
  min-height: 46px; border-radius: 12px; font-family: inherit; font-weight: 800; font-size: 15px;
  border: 1px solid #b8442c; background: linear-gradient(145deg, #d4664a, #b8442c); color: #fff;
}
.group-delete-final:hover { filter: brightness(1.06); }
.group-delete-final[disabled] { opacity: .6; }

/* TimeTree風の家計簿スペース切替。全タブの同じ位置に固定し、選択状態を共有する。 */
.space-switcher {
  position: absolute;
  z-index: 2600;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
}
.space-select,
.quick-space-select {
  max-width: 230px;
  border: 1px solid rgba(90, 70, 35, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #352d24;
  box-shadow: 0 5px 18px rgba(55, 42, 20, .13);
  padding: 8px 30px 8px 13px;
  font-weight: 800;
  font-size: 12px;
}
.theme-kids .space-select {
  background: rgba(255, 250, 225, .95);
  border: 2px solid rgba(135, 96, 20, .35);
  color: #5b421a;
}
.af-place-detected {
  display: block;
  min-height: 18px;
  margin: -2px 0 8px;
  color: #24784d;
  font-size: 12px;
  font-weight: 700;
}
.card-group { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 思い出写真グリッド */
.row.between { justify-content: space-between; align-items: center; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.photo-item { position: relative; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--border); }
.photo-thumb { width: 100%; height: 130px; object-fit: cover; display: block; background: #f1f0eb; cursor: pointer; }
.photo-del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 999px; border: none; background: rgba(0,0,0,0.55); color: #fff; font-size: 13px; cursor: pointer; line-height: 1; }
.photo-del:hover { background: rgba(0,0,0,0.8); }
.photo-cap { padding: 6px 8px 0; font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-link { padding: 2px 8px 8px; font-size: 11px; color: var(--accent-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 地図 */
.map { height: 360px; border-radius: 10px; overflow: hidden; }

/* 場所ピッカー（地図でピンを刺す） */
.picker-overlay { position: fixed; inset: 0; z-index: 2500; background: var(--bg); }
.picker-map { position: absolute; inset: 0; }
.picker-search { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 2; }
.picker-search-row { display: flex; gap: 8px; }
.picker-input { flex: 1; background: #fff; border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow); }
.picker-search .primary { box-shadow: var(--shadow); }
.picker-results { margin-top: 8px; background: #fff; border: 1px solid var(--border); border-radius: 12px; max-height: 46vh; overflow: auto; box-shadow: var(--shadow); }
.picker-result { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.picker-result:last-child { border-bottom: none; }
.picker-result:hover { background: var(--accent-weak); }
.picker-result-name { font-weight: 700; font-size: 14px; }
.picker-result-detail { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-loc { position: absolute; right: 16px; bottom: 168px; z-index: 2; background: #fff; border-radius: 999px; padding: 10px 16px; font-weight: 700; color: var(--accent-deep); box-shadow: var(--shadow); }
.picker-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; background: #fff; border-radius: 18px 18px 0 0; padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgba(0,0,0,0.12); }
.picker-tag { font-size: 12px; font-weight: 800; color: var(--accent-deep); }
.picker-name { font-size: 18px; font-weight: 800; margin: 2px 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-bar { display: flex; gap: 12px; }
.picker-bar button { flex: 1; padding: 13px; border-radius: 12px; }

/* グラフ */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.chart-box { min-width: 0; }

/* 詳細モーダル */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 1000; }
.modal { background: #fff; border-radius: 12px; max-width: 420px; width: 100%; max-height: 90vh; overflow: auto; position: relative; }
.modal-photo { width: 100%; max-height: 240px; object-fit: cover; display: block; background: #f1f0eb; }
.modal-photo.placeholder { display: flex; align-items: center; justify-content: center; height: 160px; font-size: 48px; }
.modal-close { position: absolute; top: 8px; right: 8px; background: #fff; border: 1px solid var(--border); border-radius: 999px; width: 32px; height: 32px; padding: 0; line-height: 1; }
.modal-body { padding: 14px 18px 18px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head strong { font-size: 17px; }
.modal-meta { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.modal-total { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; font-size: 16px; }

/* スマホ対応 */
@media (max-width: 600px) {
  .appbar { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; }
  main { margin: 12px auto; padding: 0 12px; gap: 12px; }
  .card { padding: 14px 16px; }
  h1 { font-size: 20px; }

  /* フォームは縦積み・入力欄は全幅 */
  .row { gap: 8px; }
  .field { flex: 1 1 100%; }
  .field input, .field select { width: 100%; }
  .row > input, .row > button, .row > select { flex: 1 1 100%; }
  input.grow, input.price { flex: 1 1 100%; width: 100%; }
  .item-row { gap: 6px; }
  .checks { gap: 6px 14px; }

  /* 集計テーブルを詰める */
  .table { font-size: 13px; }
  .table th, .table td { padding: 5px 4px; }

  .trip-grid { grid-template-columns: 1fr 1fr; }
  .photo-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .charts { grid-template-columns: 1fr; }
  .map { height: 300px; }

  .overlay { padding: 10px; }
  .tab { padding: 8px 12px; }
}

/* ===== 思い出アルバム（スクラップブック・ビューア） ===== */
.album-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: #2b2925;
  display: flex; flex-direction: column;
}
.album-top {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: rgba(0,0,0,0.25);
  color: #fff; flex: 0 0 auto;
}
.album-close { background: none; border: none; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.album-title { flex: 1; text-align: center; font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-top-spacer { width: 56px; }

/* ページ送り（横スクロール＋スナップ） */
.album-pages {
  flex: 1; min-height: 0;
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none;
}
.album-pages::-webkit-scrollbar { display: none; }
.album-loading { margin: auto; color: #cfcabd; }

.album-page {
  flex: 0 0 100%; width: 100%; height: 100%;
  scroll-snap-align: center; scroll-snap-stop: always;
  position: relative; overflow: hidden;
}

/* 記録ページ（台紙クリーム） */
.album-leaf {
  background: #fbf8f1;
  display: flex; flex-direction: column;
  padding: 20px; max-width: 760px; margin: 0 auto;
}
.album-area { position: relative; flex: 1; min-height: 0; margin: 0 auto; width: 100%; max-width: 520px; }
.album-slot { position: absolute; padding: 6px; display: flex; align-items: center; justify-content: center; }
/* 白フチのプリント */
.album-print {
  max-width: 100%; max-height: 100%;
  background: #fff; padding: 8px; border-radius: 3px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.22);
  display: flex;
}
.album-img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; display: block; background: #efeae0; }

/* 写真なしページ */
.album-textcard {
  position: absolute; inset: 6px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid #e7e1d4; border-radius: 12px;
}
.album-cat-icon { font-size: 72px; }

.album-footer { flex: 0 0 auto; padding-top: 14px; }
.album-meta-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.album-place { font-size: 18px; font-weight: 800; color: #2b2925; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-amount { font-size: 19px; font-weight: 800; color: var(--accent); }
.album-date { font-size: 12px; color: #8a857a; margin-top: 2px; }
.album-caption { font-size: 15px; font-style: italic; color: #2b2925; margin-top: 8px; }

/* 表紙 */
.album-cover { background: #3a3a3a; }
.album-cover-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.album-cover-plain { background: linear-gradient(135deg, #4b4690, #2b2925); }
.album-cover-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.32); display: flex; align-items: center; justify-content: center; padding: 24px; }
.album-cover-plate { border: 2px solid rgba(255,255,255,0.85); padding: 28px 30px; text-align: center; max-width: 80%; }
.album-cover-title { font-size: 30px; font-weight: 800; color: #fff; letter-spacing: 1px; }
.album-cover-subtitle { font-size: 14px; color: #fff; margin-top: 12px; font-weight: 600; letter-spacing: 2px; }

/* ナビ */
.album-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 999px; border: none;
  background: rgba(0,0,0,0.45); color: #fff; font-size: 26px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5;
}
.album-nav:hover { background: rgba(0,0,0,0.65); }
.album-nav.prev { left: 12px; }
.album-nav.next { right: 12px; }
.album-counter {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.55); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; z-index: 5;
}

@media (max-width: 600px) {
  .album-nav { display: none; }
  .album-leaf { padding: 16px; }
  .album-cover-title { font-size: 24px; }
}

/* ===== マネコのステージ（3Dキャラクター） ============================ */
.stage-card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: linear-gradient(180deg, #bfe3f7 0%, #dff0fb 45%, #eaf6ea 100%);
}
.stage-holder { position: relative; height: 420px; }
.stage-canvas { position: absolute; inset: 0; }
.stage-canvas canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
.stage-name {
  position: absolute;
  left: 14px; bottom: 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #4a3b30;
  pointer-events: none;
}
.stage-bubble {
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  max-width: 78%;
  background: #fff;
  border: 2px solid #4a3b30;
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #35302a;
  box-shadow: 0 3px 10px rgba(40,40,30,0.12);
  transition: opacity 0.25s;
  z-index: 3;
  pointer-events: none;
}
.stage-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px; left: 50%;
  margin-left: -8px;
  border: 8px solid transparent;
  border-top-color: #4a3b30;
  border-bottom: 0;
}
.stage-bubble.hidden { opacity: 0; }
.stage-bubble.pop { animation: bubble-pop 0.25s ease-out; }
@keyframes bubble-pop {
  0% { transform: translateX(-50%) scale(0.7); }
  70% { transform: translateX(-50%) scale(1.06); }
  100% { transform: translateX(-50%) scale(1); }
}

/* マネコの気づきチップ */
.tips { display: flex; flex-wrap: wrap; gap: 8px; }
.tip {
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: #fff;
}
.tip.warn { background: var(--warn-weak); border-color: #e8d3a0; }
.tip.ok { background: var(--accent-weak); border-color: #bfe0cd; }
.tip.info { background: #eef4fb; border-color: #d3e2f2; }

.center { text-align: center; }
button.big-add { font-size: 16px; padding: 13px 26px; border-radius: 999px; }

/* 最近の買い物 */
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fbfbf9;
  cursor: pointer;
}
.recent-row:hover { background: var(--accent-weak); }
.recent-icon { font-size: 22px; }
.recent-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.recent-store { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-total { font-weight: 700; color: var(--accent-deep); }

/* カレンダー */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-head h2 { margin: 0; }
.cal-nav { padding: 4px 12px; border-radius: 999px; font-size: 16px; }
.cal-month-total { display: flex; flex-wrap: wrap; gap: 3px 10px; font-weight: 800; font-size: 12px; }
.cal-month-income, .cal-t.income { color: #187443; }
.cal-month-expense, .cal-t.expense { color: #B1493A; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-w { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.cal-cell {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 2px;
  min-height: 52px;
  padding: 4px 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.cal-cell.has { background: var(--accent-weak); }
.cal-cell.today { outline: 2px solid var(--accent); }
.cal-d { font-size: 12px; color: var(--text); font-weight: 800; }
.cal-d.has-income { color: #187443; }
.cal-d.has-expense { color: #B1493A; }
.cal-d.has-both { color: #6C4CA0; }
.cal-t { font-size: 10px; font-weight: 800; line-height: 1.15; word-break: keep-all; }
.cal-detail { margin-top: 12px; }
.cal-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.chart-box.wide { max-width: 100%; }

@media (max-width: 600px) {
  .stage-holder { height: 300px; }
  .cal-cell { min-height: 44px; }
  .cal-t { font-size: 9px; }
}

/* ===== 派手化: お金の国テーマの上書き ================================= */
body {
  background:
    radial-gradient(circle at 12% 8%, rgba(255,206,58,0.14) 0 90px, transparent 90px),
    radial-gradient(circle at 88% 30%, rgba(255,146,20,0.10) 0 120px, transparent 120px),
    radial-gradient(circle at 22% 80%, rgba(255,107,138,0.08) 0 100px, transparent 100px),
    var(--bg);
  background-attachment: fixed;
}

/* 今月の支出ヒーロー: ゴールドグラデ＋金貨 */
.hero {
  background: linear-gradient(135deg, #ffc02e 0%, #ff9214 55%, #ff7a3d 100%) !important;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "🪙";
  position: absolute;
  font-size: 110px;
  right: -14px; top: -22px;
  opacity: 0.28;
  transform: rotate(18deg);
}
.hero::after {
  content: "✨";
  position: absolute;
  font-size: 36px;
  left: 12px; bottom: 8px;
  opacity: 0.6;
}

/* タブの選択状態をゴールドに */
.nav-item.active {
  background: linear-gradient(135deg, #ffd44d, #ffab2e) !important;
  color: #4a3410 !important;
  border-color: #eab53a !important;
  box-shadow: 0 2px 8px rgba(230,160,30,0.35);
}

/* ステージ背景をもっとドラマチックに（空→金色の地平線） */
.stage-card {
  background: linear-gradient(180deg, #8fd3ff 0%, #cfeeff 38%, #ffe9a8 62%, #ffd97a 100%);
}

/* きろく（クイック記録）フォーム */
.quick-card { border: 2px solid var(--gold); }
.quick-amount-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 10px 0 14px;
}
.quick-yen { font-size: 34px; font-weight: 800; color: var(--accent-deep); }
input.quick-price {
  font-size: 40px;
  font-weight: 800;
  width: 220px;
  text-align: center;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: #fffdf4;
  color: var(--text);
}
input.quick-price:focus { outline: 3px solid var(--warn-weak); border-color: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.qchip {
  border-radius: 999px;
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}
.qchip.active {
  background: linear-gradient(135deg, #ffd44d, #ffab2e);
  border-color: #eab53a;
  color: #4a3410;
  font-weight: 700;
}
.stack { display: flex; flex-direction: column; gap: 8px; }

/* 3Dが使えない環境のフォールバック */
.stage-fallback {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
}
.fb-cat { font-size: 96px; animation: fb-bob 2.2s ease-in-out infinite; }
@keyframes fb-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.fb-msg {
  background: #fff;
  border: 2px solid #4a3b30;
  border-radius: 14px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 14px;
}

/* ======================================================================
   2アプリ化（デザイン 2a/3a）: theme-kids「マネコタウン」/ theme-adult「マネコ家計簿」
   デザイントークン: 墨#2E2A24 紙#F7F4EE 金#C99B2E/#E3C56A/#FFD54A 緑#7CC77A→#3E9E6C
   ====================================================================== */
body { font-family: "M PLUS Rounded 1c", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif; }
main { padding-bottom: 130px; } /* 下部ナビのぶん */

/* ---- 下部ナビ（共通ベース・中央=きろく） ---- */
.bnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  display: flex; justify-content: center; align-items: flex-end; gap: 6px;
  padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
}
.bnav-item {
  width: 72px; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700; color: #8C8375; padding: 0;
}
.bnav-ico { font-size: 20px; line-height: 1; }
.bnav-item.center { transform: translateY(-20px); }
.bnav-item.center .bnav-ico {
  width: 62px; height: 62px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800;
  transition: transform .15s;
}
.bnav-item.center:hover .bnav-ico { transform: scale(1.06); }

/* おとな: 白バー＋墨色の＋ボタン */
body.theme-adult .bnav { background: #fff; box-shadow: 0 -6px 20px rgba(60,50,30,.08); }
body.theme-adult .bnav-item.active { color: #C99B2E; }
body.theme-adult .bnav-item.center .bnav-ico { background: #2E2A24; color: #FFD54A; box-shadow: 0 6px 16px rgba(46,42,36,.35); }

/* こども: パステル丸ボタン＋金コインのきろく */
body.theme-kids .bnav { background: rgba(255,253,246,.92); box-shadow: 0 -6px 20px rgba(120,80,10,.12); }
body.theme-kids .bnav-item .bnav-ico {
  width: 50px; height: 50px; border-radius: 999px; border: 3.5px solid #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(120,80,10,.18);
}
body.theme-kids .bnav-item:nth-child(1) .bnav-ico { background: radial-gradient(circle at 35% 30%, #FFE9A8, #FFD54A); }
body.theme-kids .bnav-item:nth-child(2) .bnav-ico { background: radial-gradient(circle at 35% 30%, #BFE3FA, #6FB7E8); }
body.theme-kids .bnav-item:nth-child(4) .bnav-ico { background: radial-gradient(circle at 35% 30%, #FBD0E0, #F06292); }
body.theme-kids .bnav-item:nth-child(5) .bnav-ico { background: radial-gradient(circle at 35% 30%, #D9CDF4, #9B7FD4); }
body.theme-kids .bnav-item.center .bnav-ico {
  width: 74px; height: 74px;
  background: radial-gradient(circle at 35% 28%, #FFE9A8, #FFD54A 55%, #DFA318);
  border: 4px solid #fff; color: #A9750B;
  box-shadow: 0 8px 18px rgba(190,130,20,.4);
  animation: fb-bob 3s ease-in-out infinite;
}
body.theme-kids .bnav-item { color: #7A6647; }
body.theme-kids .bnav-item.active { color: #A9750B; }

/* ---- 初回モード選択 ---- */
.mode-pick { margin-top: 36px; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.mode-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px 14px; border-radius: 20px; background: #fff; cursor: pointer;
  border: 2.5px solid var(--border); font: inherit; transition: transform .12s;
}
.mode-card:hover { transform: translateY(-3px); }
.mode-emoji { font-size: 46px; }
.mode-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.mode-kids { border-color: #FFD54A; }
.mode-adult { border-color: #C99B2E; }
.mode-family { border-color: #6FB7E8; }
.mode-personal { border-color: #C99B2E; }
@media (max-width: 600px) { .mode-grid { grid-template-columns: 1fr; } }

/* ---- 初回利用タイプ選択 v2: 認証画面から続くマネコタウンの入口 ---- */
.usage-v2-page {
  --usage-ink: #54371f;
  --usage-muted: #927657;
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 460px;
  height: 100vh;
  height: 100dvh;
  min-height: 620px;
  margin: 0 auto;
  overflow: hidden;
  color: var(--usage-ink);
  background: #dce8e4;
  font-family: "M PLUS Rounded 1c", "Hiragino Sans", system-ui, sans-serif;
}
.usage-v2-scene {
  position: absolute;
  z-index: -4;
  inset: 0;
  background: url("/assets/kids/home-stage-1.webp") center 44% / cover no-repeat;
  transform: scale(1.025);
}
.usage-v2-shade {
  position: absolute;
  z-index: -3;
  inset: 0;
  background: linear-gradient(180deg, rgba(32,29,22,.35), rgba(32,29,22,.04) 38%, rgba(74,42,14,.25));
}
.usage-v2-brand {
  position: absolute;
  z-index: 3;
  top: calc(24px + env(safe-area-inset-top));
  left: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(34,22,10,.48);
}
.usage-v2-brand img {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  box-shadow: 0 5px 14px rgba(55,29,4,.28);
}
.usage-v2-brand strong,
.usage-v2-brand small { display: block; }
.usage-v2-brand strong { font-size: 16px; line-height: 1; letter-spacing: .08em; }
.usage-v2-brand small { margin-top: 4px; font-size: 8px; font-weight: 900; letter-spacing: .06em; }
.usage-v2-hero {
  position: absolute;
  z-index: 2;
  top: calc(82px + env(safe-area-inset-top));
  right: 22px;
  left: 22px;
  max-width: 290px;
  color: #fff;
  text-shadow: 0 3px 14px rgba(36,23,9,.58);
}
.usage-v2-hero > span { font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.usage-v2-hero h1 {
  max-width: 245px;
  margin: 5px 0 0;
  color: inherit;
  font-size: clamp(22px, 6vw, 27px);
  line-height: 1.27;
}
.usage-v2-hero p {
  max-width: 225px;
  margin: 7px 0 0;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.6;
}
.usage-v2-maneko {
  position: absolute;
  z-index: 1;
  top: calc(82px + env(safe-area-inset-top));
  right: -5px;
  width: 145px;
  height: auto;
  filter: drop-shadow(0 12px 14px rgba(68,37,6,.34));
  pointer-events: none;
}
.usage-v2-sheet {
  position: absolute;
  z-index: 5;
  right: 12px;
  bottom: calc(11px + env(safe-area-inset-bottom));
  left: 12px;
  max-height: min(560px, calc(100dvh - 214px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  padding: 15px 17px 16px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 30px;
  background: linear-gradient(155deg, rgba(255,253,247,.97), rgba(255,245,225,.96));
  box-shadow: 0 -7px 30px rgba(65,39,14,.17), 0 18px 40px rgba(59,37,15,.25), inset 0 1px 0 #fff;
  scrollbar-width: none;
  backdrop-filter: blur(19px) saturate(1.1);
  -webkit-backdrop-filter: blur(19px) saturate(1.1);
}
.usage-v2-sheet::-webkit-scrollbar { display: none; }
.usage-v2-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: #ddc8a7;
}
.usage-v2-sheet-head span {
  color: #c98218;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
}
.usage-v2-sheet-head h2 {
  margin: 2px 0 0;
  color: var(--usage-ink);
  font-size: 20px;
  line-height: 1.3;
}
.usage-v2-sheet-head p {
  margin: 4px 0 0;
  color: var(--usage-muted);
  font-size: 9px;
  font-weight: 750;
}
.usage-v2-choices {
  display: grid;
  gap: 10px;
  margin-top: 13px;
}
.usage-v2-choice {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 124px;
  padding: 12px 11px;
  border: 1px solid #ead8ba;
  border-radius: 22px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 6px 18px rgba(93,59,22,.08), inset 0 1px 0 #fff;
  color: var(--usage-ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.usage-v2-choice:hover,
.usage-v2-choice:focus-visible {
  transform: translateY(-2px);
  border-color: #edb54f;
  box-shadow: 0 10px 22px rgba(151,91,22,.14), 0 0 0 3px rgba(245,183,61,.13);
  outline: none;
}
.usage-v2-choice:disabled { cursor: wait; opacity: .66; }
.usage-v2-choice-visual {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(145deg, #fff8e7, #f7dfaa);
  box-shadow: inset 0 1px 0 #fff, 0 5px 12px rgba(118,72,22,.12);
}
.usage-v2-choice.is-family .usage-v2-choice-visual {
  background: linear-gradient(145deg, #fff5e0, #f7dca0);
}
.usage-v2-choice-visual img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(93,53,16,.16));
}
.usage-v2-choice-copy { display: block; min-width: 0; }
.usage-v2-choice-copy small {
  display: block;
  color: #c98218;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .12em;
}
.usage-v2-choice-copy strong {
  display: block;
  margin-top: 1px;
  font-size: 16px;
  line-height: 1.3;
}
.usage-v2-choice-desc {
  display: block;
  margin-top: 4px;
  color: #836c55;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
}
.usage-v2-points {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  margin-top: 6px;
}
.usage-v2-points span {
  color: #9a681d;
  font-size: 8px;
  font-weight: 850;
}
.usage-v2-choice-arrow {
  color: #c98a2b;
  font-size: 26px;
  font-weight: 500;
}
.usage-v2-note {
  margin: 10px 0 0;
  color: #9a856f;
  font-size: 8px;
  font-weight: 750;
  text-align: center;
}
.usage-v2-saving {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  visibility: hidden;
  opacity: 0;
  background: rgba(35,24,14,.55);
  color: #fff;
  transition: opacity .18s ease;
  pointer-events: none;
}
.usage-v2-saving img {
  width: 112px;
  filter: drop-shadow(0 10px 13px rgba(43,24,7,.36));
  animation: fb-bob 1.8s ease-in-out infinite;
}
.usage-v2-saving strong { font-size: 13px; text-shadow: 0 2px 9px rgba(40,22,8,.55); }
.usage-v2-page.is-saving .usage-v2-saving {
  visibility: visible;
  opacity: 1;
}
@media (max-height: 700px) {
  .usage-v2-hero { top: calc(72px + env(safe-area-inset-top)); }
  .usage-v2-maneko { top: calc(72px + env(safe-area-inset-top)); width: 126px; }
  .usage-v2-sheet { max-height: calc(100dvh - 174px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}

/* ======================= こども「マネコタウン」 ======================= */
body.theme-kids { background: linear-gradient(180deg, #FFF3CF, #FFE9B8); }
.kids-scene {
  position: relative; border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, #5FB2EE 0%, #A8DCFA 30%, #FFE2A0 50%, #FFD489 58%, #EFD3A0 72%, #D9AE6E 100%);
  box-shadow: 0 8px 24px rgba(120,80,10,.18);
}
.kids-stage-holder { height: 560px; }
@media (max-width: 600px) { .kids-stage-holder { height: 500px; } }

.k-hud-top {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 5;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.k-pill {
  background: #FFFDF6; border: 2.5px solid #E8B62B; border-radius: 999px;
  padding: 4px 13px; font-weight: 800; font-size: 14px; color: #7A6647;
  box-shadow: 0 2px 6px rgba(120,80,10,.16);
}
.k-coin { margin-right: 2px; }
.k-hearts { color: #F06292; letter-spacing: 2px; font-size: 15px; }
.k-present {
  margin-left: auto; font-size: 32px; border: none; background: none; cursor: pointer;
  filter: drop-shadow(0 3px 4px rgba(120,80,10,.3));
  transition: transform .15s;
}
.k-present:hover { transform: scale(1.12) rotate(-6deg); background: none; }

.k-lv {
  position: absolute; top: 58px; left: 14px; z-index: 5;
  width: 58px; height: 58px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(120,80,10,.22);
}
.k-lv-inner {
  width: 46px; height: 46px; border-radius: 999px; background: #FFFDF6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.k-lv-label { font-size: 9px; font-weight: 800; color: #A9750B; line-height: 1; }
.k-lv-num { font-size: 17px; font-weight: 800; color: #7A6647; line-height: 1.1; }

.k-challenge {
  position: absolute; top: 58px; right: 14px; z-index: 5; width: 205px;
  background: #FFFDF6; border: 2.5px solid #E8B62B; border-radius: 14px;
  overflow: hidden; cursor: pointer; text-align: left;
  box-shadow: 0 3px 10px rgba(120,80,10,.2);
}
.k-ch-head { background: linear-gradient(135deg, #FFD54A, #E8B62B); padding: 4px 11px; font-size: 11px; font-weight: 800; color: #5a4326; }
.k-ch-body { padding: 8px 11px; font-size: 12.5px; font-weight: 700; color: #5a4326; display: flex; flex-direction: column; gap: 2px; }
.k-ch-left { color: #E8483F; }
.k-ch-bonus { color: #3E9E6C; font-size: 11.5px; font-weight: 800; }
.k-challenge.done { border-color: #7CC77A; }

.k-goal {
  position: absolute; right: 14px; top: 45%; z-index: 5; width: 215px;
  background: #FFFDF6; border: 2.5px solid #E8B62B; border-radius: 14px;
  padding: 10px 12px; cursor: pointer;
  box-shadow: 0 3px 10px rgba(120,80,10,.2);
}
.k-goal-head { font-size: 12.5px; font-weight: 800; color: #5a4326; }
.k-goal-pct { color: #3E9E6C; }
.k-goal-bar { height: 10px; background: #F0E4C8; border-radius: 999px; overflow: hidden; margin: 6px 0; }
.k-goal-fill { height: 100%; background: linear-gradient(90deg, #7CC77A, #3E9E6C); border-radius: 999px; }
.k-goal-nums { font-size: 11.5px; font-weight: 700; color: #7A6647; }
.k-goal.empty { border-style: dashed; }

.k-edge {
  position: absolute; top: 60%; z-index: 5;
  width: 56px; height: 56px; border-radius: 999px;
  background: #fff; border: 3px solid #E8B62B; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(120,80,10,.22);
  transition: transform .15s;
}
.k-edge:hover { transform: scale(1.08); background: #fff; }
.k-edge-l { left: 10px; }
.k-edge-r { right: 10px; }
.k-edge-ico { font-size: 20px; font-weight: 800; color: #A9750B; line-height: 1; }
.k-edge-label { font-size: 8.5px; font-weight: 800; color: #7A6647; }

.k-toast {
  position: absolute; left: 50%; bottom: 16px; z-index: 6;
  transform: translate(-50%, 24px); opacity: 0;
  background: #2E2A24; color: #FFD54A; border-radius: 999px;
  padding: 9px 20px; font-weight: 800; font-size: 14px;
  transition: all .4s ease;
  pointer-events: none;
}
.k-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* こどもモードのきろくフォームはおおきく */
body.theme-kids .quick-card h2 { font-size: 20px; }
body.theme-kids .qchip { font-size: 15px; padding: 9px 18px; }
body.theme-kids input.quick-price { font-size: 46px; }

/* ======================= おとな「マネコ家計簿」 ======================= */
body.theme-adult { background: #F7F4EE; }
body.theme-adult .card { border: none; border-radius: 20px; box-shadow: 0 4px 14px rgba(60,50,30,.07); }

.a-header { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 0; }
.a-month-big { font-size: 24px; font-weight: 800; color: #2E2A24; }
.a-month-year { font-size: 13px; color: #8C8375; margin-left: 6px; }
.a-lv-pill { background: #fff; border-radius: 999px; padding: 5px 13px; font-size: 12px; font-weight: 800; color: #C99B2E; box-shadow: 0 2px 8px rgba(60,50,30,.08); }

.a-hero-wrap { position: relative; padding-top: 92px; }
.a-peek { position: absolute; top: -6px; right: 22px; width: 150px; height: 132px; z-index: 0; }
.a-peek-fallback { font-size: 70px; display: block; text-align: center; }
.a-chip {
  position: absolute; top: 30px; left: 6px; z-index: 2; max-width: 58%;
  background: #fff; border-radius: 14px 14px 14px 4px; padding: 8px 14px;
  font-size: 12.5px; font-weight: 800; color: #2E2A24;
  box-shadow: 0 4px 14px rgba(60,50,30,.14);
}
.a-hero {
  position: relative; z-index: 1;
  background: #2E2A24; border-radius: 24px; padding: 18px 20px;
  box-shadow: 0 14px 30px rgba(46,42,36,.28);
  display: flex; flex-direction: column; gap: 9px;
}
.a-hero-top { display: flex; justify-content: space-between; font-size: 12.5px; color: #B8AE9C; font-weight: 700; }
.a-hero-amount { font-size: 38px; font-weight: 800; color: #F7F4EE; line-height: 1.1; }
.a-hero-bar { height: 10px; background: #4A443A; border-radius: 999px; overflow: hidden; }
.a-hero-fill { height: 100%; background: linear-gradient(90deg, #E3C56A, #C99B2E); border-radius: 999px; }
.a-hero-sub { display: flex; gap: 18px; font-size: 12.5px; color: #B8AE9C; font-weight: 700; }
.a-hero-sub strong { color: #F7F4EE; }
.a-hero-sub .a-pos { color: #E3C56A; }
.a-set-budget { align-self: flex-start; background: none; border: 1.5px solid #4A443A; color: #E3C56A; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 5px 13px; }
.a-set-budget:hover { background: #3a352d; }

.a-card { background: #fff; border-radius: 20px; padding: 16px 18px; box-shadow: 0 4px 14px rgba(60,50,30,.07); }
.a-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.a-card h2 { margin: 0; font-size: 15px; color: #2E2A24; }
.a-link { background: none; border: none; color: #C99B2E; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.a-link:hover { background: none; text-decoration: underline; }
.a-empty { color: #8C8375; font-size: 13px; }

.a-cat-row { display: grid; grid-template-columns: 84px 1fr 84px; align-items: center; gap: 10px; padding: 7px 0; }
.a-cat-name { font-size: 13px; font-weight: 700; color: #2E2A24; }
.a-cat-bar { height: 8px; background: #F0EBE0; border-radius: 999px; overflow: hidden; }
.a-cat-fill { height: 100%; border-radius: 999px; }
.a-cat-amount { text-align: right; font-size: 13px; font-weight: 800; color: #2E2A24; }

.a-recent-row { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: none; border-bottom: 1px solid #F0EBE0; padding: 10px 2px; cursor: pointer; text-align: left; }
.a-recent-row:last-child { border-bottom: none; }
.a-recent-row:hover { background: #FBF8F1; }
.a-recent-ico { width: 34px; height: 34px; border-radius: 999px; background: #F0E4C8; color: #7A6647; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.a-recent-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.a-recent-name { font-size: 13px; font-weight: 800; color: #2E2A24; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-recent-date { font-size: 10.5px; color: #8C8375; }
.a-recent-amount { font-size: 14px; font-weight: 800; color: #2E2A24; }

/* ---- ちょきん（両モード共通） ---- */
.sv-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.sv-stat { display: flex; flex-direction: column; }
.sv-stat .k { font-size: 12px; color: var(--muted); }
.sv-stat strong { font-size: 22px; color: var(--accent-deep); }
.sv-goal { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.sv-goal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sv-goal-nums { margin-left: auto; font-size: 12.5px; font-weight: 700; color: #7A6647; }
.sv-bar { height: 12px; background: #F0E4C8; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.sv-fill { height: 100%; background: linear-gradient(90deg, #7CC77A, #3E9E6C); border-radius: 999px; transition: width .5s; }
.sv-fill.done { background: linear-gradient(90deg, #E3C56A, #C99B2E); }
.sv-done-badge { color: #C99B2E; font-weight: 800; }

/* ======================================================================
   デザインモック移植（design_handoff_maneko_home）: keyframes・スマホ画面キャンバス
   ====================================================================== */
@keyframes mfloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
@keyframes mfloat2 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-7px)} }
@keyframes mshadow { 0%,100%{transform:scaleX(1);opacity:.55} 50%{transform:scaleX(.8);opacity:.3} }
@keyframes mspin { from{transform:rotateY(0)} to{transform:rotateY(360deg)} }
@keyframes mspinr { from{transform:rotate(0) } to{transform:rotate(360deg)} }
@keyframes morbit { from{transform:rotate(0)} to{transform:rotate(360deg)} }
@keyframes mbeckon { 0%,100%{transform:rotate(34deg)} 50%{transform:rotate(4deg)} }
@keyframes mwag { 0%,100%{transform:rotate(28deg)} 50%{transform:rotate(50deg)} }
@keyframes mjump { 0%,12%{transform:translateY(0) rotate(-7deg) scale(1.04,.94)} 40%{transform:translateY(-42px) rotate(5deg) scale(.97,1.05)} 62%{transform:translateY(0) rotate(-2deg) scale(1.05,.93)} 74%{transform:translateY(-12px) rotate(-6deg) scale(1,1)} 88%,100%{transform:translateY(0) rotate(-7deg) scale(1.02,.97)} }
@keyframes mjshadow { 0%,12%{transform:scaleX(1);opacity:.55} 40%{transform:scaleX(.62);opacity:.22} 62%{transform:scaleX(1);opacity:.55} 74%{transform:scaleX(.85);opacity:.4} 88%,100%{transform:scaleX(1);opacity:.55} }
@keyframes msparkle { 0%,100%{transform:rotate(45deg) scale(.35);opacity:.15} 50%{transform:rotate(45deg) scale(1);opacity:1} }
@keyframes mfall { 0%{transform:translateY(-80px) rotateY(0);opacity:0} 12%{opacity:1} 100%{transform:translateY(760px) rotateY(900deg);opacity:1} }
@keyframes mcloud { 0%,100%{transform:translateX(0)} 50%{transform:translateX(22px)} }
@keyframes mbagbob { 0%,100%{transform:rotate(-4deg)} 50%{transform:rotate(4deg)} }

/* こどもホーム v3: 生成3Dアートを主役にし、操作だけを高コントラストで重ねる */
.kids-town-3d {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("/assets/kids/maneko-town-3d.webp") center center / cover no-repeat;
  transform: scale(1.015);
  transition: filter .35s ease;
}
.kids-town-stage-0 { filter: saturate(.78) brightness(.92); }
.kids-town-stage-1 { filter: saturate(.9) brightness(.96); }
.kids-town-stage-2 { filter: saturate(1) brightness(1); }
.kids-town-stage-3 { filter: saturate(1.08) brightness(1.03); }
.kids-town-stage-4 { filter: saturate(1.16) brightness(1.08) contrast(1.03); }
.kids-town-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.06) 0 31%, transparent 47%, rgba(66,38,13,.14) 100%);
}
.kids-maneko-wrap {
  position: absolute;
  left: 50%;
  bottom: 130px;
  width: 214px;
  height: 300px;
  transform: translateX(-50%);
  transform-origin: bottom center;
  cursor: pointer;
  z-index: 4;
  filter: drop-shadow(0 12px 12px rgba(64,35,9,.26));
}
.kids-maneko-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: center bottom;
  user-select: none;
  -webkit-user-drag: none;
}
.kids-maneko-shadow {
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 4px;
  height: 20px;
  border-radius: 50%;
  background: rgba(50,29,10,.35);
  filter: blur(6px);
  transform-origin: center;
}
.kids-world-action {
  position: absolute;
  top: 586px;
  z-index: 9;
  width: 92px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 22px;
  background: rgba(255,253,246,.84);
  box-shadow: 0 8px 24px rgba(67,38,12,.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #60420f;
  font-size: 11px;
  font-weight: 800;
}
.kids-world-action-icon { font-size: 30px; line-height: 1.05; }

/* モックの提示背景と同じ生成りの上に、402×840 のスマホ画面を置く。
   こどもは「世界そのものが背景」に見えるよう、フチを生成りではなく空→砂のグラデにする。 */
/* おとなはホームのキャンバスと完全同色に統一（旧 #F6EFE2 → #F7F4EE）。renderHome が html/body に上書きする。 */
body.theme-adult { background: #F7F4EE; }
/* こどもの既定フォールバック（renderHome が stageBackdrop で上書き）。
   background-attachment:fixed は iOS で効かず、むしろ描画不整合を招くため外す。 */
body.theme-kids {
  background: linear-gradient(180deg,#7FC0F0 0%,#A8DCFA 24%,#FFE7B0 50%,#EFD3A0 72%,#D9AE6E 100%);
}
.pc-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.pc-canvas {
  position: relative;
  width: 402px; height: 840px;
  overflow: hidden;
  /* アプリ自体を背景化: カード感（角丸・影）を廃し、キャンバス＝画面の背景そのものに見せる。 */
  border-radius: 0;
  box-shadow: none;
  transform-origin: top center;
  flex: 0 0 auto;
}
/* fillHeight モード（きろく/レポート/ちょきん/せってい）: transform なしで幅いっぱい＋高さ画面フィット。
   内側の .pc-scroll だけがスクロールする（body/二重スクロールを起こさない）。 */
.pc-canvas.fill { width: 100%; max-width: none; height: 100%; }

/* テーマ表示中は main の余白を詰めてスマホ画面を全画面フィットに（body の二重スクロール防止）。
   ホーム（絶対配置840px）で縦がはみ出す場合だけ body スクロールする。 */
body.theme-kids main#app, body.theme-adult main#app {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: none;
  gap: 0;
  height: 100dvh;
  min-height: 100dvh;
  justify-content: flex-start;
  overflow: hidden;
}
body.theme-kids, body.theme-adult { height: 100%; overflow: hidden; }
.pc-scroll {
  position: absolute; inset: 0;
  overflow-y: auto;
  /* 下パディングにソフトキーボード高さ(--kb)を足す: iOS standalone PWA では
     キーボード表示で window.innerHeight が縮まず、記録ボタンがキーボードの裏に隠れて
     スクロールしても前に出せなくなる（phone.ts が --kb を設定）。 */
  padding: 20px 14px calc(240px + env(safe-area-inset-bottom) + var(--kb, 0px));
  display: flex; flex-direction: column; gap: 14px;
}
.hv { transition: transform .15s; }
.hv:hover { transform: scale(1.05); }

/* ======================================================================
   おとなモード機能拡張: モーダル・明細カード・詳細フォーム・ジャンル・地図
   ====================================================================== */
/* キャンバス内モーダル */
.cm-overlay {
  position: absolute; inset: 0; z-index: 3000; /* Leaflet のペイン/コントロール(〜1000)より上 */
  background: rgba(46,42,36,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 22px 16px;
}
.cm-card {
  position: relative; z-index: 1;
  width: 100%; max-height: 92%;
  background: #FFFFFF; border-radius: 20px;
  box-shadow: 0 18px 40px rgba(46,42,36,.35);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: cm-pop .18s ease-out;
}
@keyframes cm-pop { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.cm-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; }
.cm-title { font-size: 14px; font-weight: 800; color: #2E2A24; }
.cm-close { border: none; background: #F0EBE0; color: #8C8375; width: 28px; height: 28px; border-radius: 999px; font-size: 13px; cursor: pointer; padding: 0; }
.cm-body { overflow-y: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }

/* 見やすい明細カード */
.rc-card { display: flex; flex-direction: column; gap: 6px; }
.rc-head { padding-bottom: 6px; border-bottom: 1px solid #F0EBE0; }
.rc-store { font-size: 15px; font-weight: 800; color: #2E2A24; }
.rc-meta { font-size: 11px; font-weight: 700; color: #8C8375; }
.rc-genre { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.rc-genre-chip { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 10px; }
.rc-genre-sub { font-size: 12px; font-weight: 800; color: #8C8375; }
.rc-item { display: flex; justify-content: space-between; gap: 10px; padding: 5px 2px 5px 10px; border-radius: 8px; cursor: pointer; }
.rc-item:hover { background: #FBF8F1; }
.rc-item-name { font-size: 13px; font-weight: 700; color: #2E2A24; }
.rc-item-price { font-size: 13px; font-weight: 800; color: #2E2A24; }
.rc-total { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1.5px solid #2E2A24; font-size: 13px; font-weight: 800; }
.rc-total-amount { font-size: 16px; font-weight: 800; color: #2E2A24; }
.rc-photos { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rc-photo { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; cursor: pointer; box-shadow: 0 3px 10px rgba(60,50,30,.18); }
.rc-photo-big { width: 100%; border-radius: 14px; }
.cal-day-cards { display: flex; flex-direction: column; gap: 18px; }
.cal-day-cards .rc-card + .rc-card { border-top: 2px dashed #F0E4C8; padding-top: 12px; }

/* ジャンル選択シート */
.gp-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 8px; }
.gp-chip { border: 2px solid transparent; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 800; cursor: pointer; }
.gp-chip.active { border-color: #2E2A24; }

/* 詳細きろくフォーム */
.af-card h2 { margin-bottom: 4px; }
.af-place-row { align-items: center; }
.af-place { font-size: 12.5px; font-weight: 700; color: #5C544A; }
.af-rows-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; font-size: 13px; font-weight: 800; color: #2E2A24; }
.af-total { font-size: 16px; color: #C99B2E; }
.af-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.af-row { display: grid; grid-template-columns: 1fr 84px 108px 30px; gap: 6px; align-items: center; }
.af-name, .af-price { min-width: 0; }
.af-genre { font-size: 11.5px; font-weight: 800; border: none; border-radius: 999px; padding: 8px 8px; cursor: pointer; }
.af-del { border: none; background: none; color: #B8AE9C; cursor: pointer; font-size: 13px; padding: 4px; }
.af-del:hover { color: #E8483F; background: none; }
.af-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.af-thumb { position: relative; }
.af-thumb img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; }
.af-thumb-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 999px; border: none; background: #2E2A24; color: #fff; font-size: 11px; cursor: pointer; padding: 0; }

/* 今月のジャンル別 */
.gr-row { display: grid; grid-template-columns: 96px 1fr 76px; gap: 10px; align-items: center; padding: 6px 0; }
.gr-chip { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 8px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-bar { height: 8px; border-radius: 999px; background: #F0EBE0; overflow: hidden; }
.gr-fill { height: 100%; border-radius: 999px; }
.gr-value { min-width: 0; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.gr-amount { text-align: right; font-size: 12.5px; font-weight: 800; color: #2E2A24; }
.gr-percent { color: #8C8375; font-size: 10px; font-weight: 800; }

/* 買い物マップ */
.report-map { height: 300px; border-radius: 14px; overflow: hidden; }

/* 月初サマリー */
.ms-body { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.ms-total-label { font-size: 12px; font-weight: 700; color: #8C8375; }
.ms-total { font-size: 34px; font-weight: 800; color: #2E2A24; line-height: 1.1; }
.ms-diff { font-size: 12.5px; font-weight: 800; color: #C99B2E; }
.ms-sec { font-size: 12px; font-weight: 800; color: #8C8375; margin-top: 8px; }
.ms-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.ms-chip { font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 3px 10px; }
.ms-note { font-size: 12px; font-weight: 700; color: #5C544A; }
.ms-comment { margin-top: 8px; background: #FBF8F1; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; font-weight: 700; color: #2E2A24; }

/* レシート読み取りボタン（きろくフォームの窓口） */
.af-ocr {
  width: 100%;
  border: 2px dashed #C99B2E;
  background: #FBF8F1;
  color: #7A5A20;
  font-weight: 800;
  font-size: 14px;
  border-radius: 14px;
  padding: 13px 12px;
  cursor: pointer;
  margin-top: 4px;
}
.af-ocr:hover { background: #F5EDDA; }
.af-ocr:disabled { opacity: .6; cursor: wait; }
.af-ocr-note { margin: 2px 0 6px; }

/* 金額入力のスピナー矢印を消す（84pxの狭い欄を圧迫するため。テンキーは inputMode で維持） */
.af-price::-webkit-outer-spin-button, .af-price::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.af-price { -moz-appearance: textfield; appearance: textfield; }

/* ======================================================================
   目標（期限・ペース・ホームのスワイプカード）＋ こども世界観の統一
   ====================================================================== */
/* 背景はSafe Areaまで全面表示し、操作要素だけが各自 env(safe-area-inset-*) で避ける。 */
body.theme-kids main#app, body.theme-adult main#app {
  padding: 0;
}

/* 貯金目標のペース表示（毎月あと¥X） */
.sv-pace { margin: 2px 0 6px; font-size: 12px; font-weight: 700; color: #B9506E; }

/* ホームの目標カード（スワイプ切替） */
.ag-swipe {
  display: flex; overflow-x: auto; gap: 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
  cursor: pointer;
}
.ag-swipe::-webkit-scrollbar { display: none; }
.ag-card {
  flex: 0 0 100%; scroll-snap-align: start;
  background: #FFFFFF; border-radius: 18px; padding: 12px 16px 10px;
  box-shadow: 0 4px 14px rgba(60,50,30,.07);
  display: flex; flex-direction: column; gap: 7px;
}
.ag-head { display: flex; justify-content: space-between; align-items: baseline; }
.ag-name { font-size: 13px; font-weight: 800; color: #2E2A24; }
.ag-pct { font-size: 12px; font-weight: 800; color: #C99B2E; }
.ag-bar { height: 8px; border-radius: 999px; background: #F0EBE0; overflow: hidden; }
.ag-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #E3C56A, #C99B2E); }
.ag-sub { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 700; color: #8C8375; }
.ag-dots { display: flex; justify-content: center; gap: 6px; margin-top: 7px; }
.ag-dot { width: 6px; height: 6px; border-radius: 999px; background: #D8D2C4; cursor: pointer; }
.ag-dot.on { background: #C99B2E; }

/* こども: 記録ボタンが金色ナビに隠れないよう余白を大きく（iPhone のホームインジケータぶんも足す）。
   下端に十分な余白があると、保存ボタンをスクロールでナビより上へ持ってこられる。 */
body.theme-kids .pc-scroll { padding-bottom: calc(340px + env(safe-area-inset-bottom) + var(--kb, 0px)); }

/* こども: 全タブをマネコタウンの世界観に（クリーム＋金ふち＋丸文字） */
body.theme-kids .pc-scroll .card {
  background: #FFFDF6;
  border: 2.5px solid #E8B62B;
  border-radius: 18px;
  box-shadow: 0 5px 14px rgba(120,80,20,.22);
}
body.theme-kids .pc-scroll h2 { color: #7A4A00; }
body.theme-kids .pc-scroll h3 { color: #A08A60; }
body.theme-kids .pc-scroll .muted { color: #A08A60; }
body.theme-kids .pc-scroll .field-label { color: #A08A60; font-weight: 700; }
body.theme-kids .pc-scroll input, body.theme-kids .pc-scroll select {
  border: 2px solid #F0E4C8; border-radius: 12px; background: #FFFDF6;
}
body.theme-kids .pc-scroll input:focus, body.theme-kids .pc-scroll select:focus {
  outline: 3px solid #FFF3CD; border-color: #E8B62B;
}
body.theme-kids .pc-scroll button.primary {
  background: radial-gradient(circle at 35% 30%, #FFC94D, #F5A623);
  border: 3px solid #FFFDF6; color: #7A4A00; font-weight: 800;
  box-shadow: 0 5px 12px rgba(120,80,20,.35);
}
body.theme-kids .pc-scroll button.primary:hover { filter: brightness(1.04); }
body.theme-kids .pc-scroll .sv-bar, body.theme-kids .pc-scroll .cal-cell { border-radius: 12px; }
body.theme-kids .pc-scroll .cal-cell { border: 2px solid #F0E4C8; background: #FFFDF6; }
body.theme-kids .pc-scroll .cal-cell.has { background: #FFF3CD; }
body.theme-kids .pc-scroll .cal-cell.today { outline: 2.5px solid #E8B62B; }
body.theme-kids .pc-scroll .gr-bar { background: #F0E4C8; }

/* こどものモーダル（けいじばん・ちょきんばこ）も世界観に */
body.theme-kids .cm-card { background: #FFFDF6; border: 3px solid #E8B62B; }
body.theme-kids .cm-title { color: #7A4A00; }
body.theme-kids .cm-close { background: #F0E4C8; color: #A08A60; }
.kd-form { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }

/* ======================================================================
   👨‍👩‍👧 親子アカウント連携（main.ts settingsPanel）
   ====================================================================== */
/* 子リストの1行: 名前＋操作ボタン */
.link-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.link-row:last-of-type { border-bottom: none; }
.link-name { font-weight: 800; color: #2E2A24; }
.link-btns { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.link-btns .link-btn { padding: 5px 10px; border-radius: 999px; background: #F0EBE0; font-weight: 700; font-size: 12.5px; }
.link-btns .link-btn:hover { background: #E7E0D2; text-decoration: none; }
.link-btns .link-btn.danger { background: none; }
.link-connected { font-weight: 800; color: #2E7D46; }
body.theme-kids .link-connected { color: #3E9E6C; }

/* 連携コード表示（1文字ずつ間隔・タップで選択しやすく） */
.link-code-block { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 10px; }
.link-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 30px; font-weight: 800; letter-spacing: .34em;
  color: #2E2A24; background: #F7F3EA; border: 2px dashed #C9BEA6;
  border-radius: 14px; padding: 12px 20px; text-align: center;
  align-self: stretch; user-select: all; -webkit-user-select: all;
}
body.theme-kids .link-code { background: #FFF7DE; border-color: #E8B62B; color: #7A4A00; }
/* こどものコード入力（大きめ・字間） */
input.link-code-input { font-size: 22px; letter-spacing: .18em; text-align: center; text-transform: uppercase; }
.link-sent { font-weight: 800; color: #2E7D46; }
body.theme-kids .link-sent { color: #3E9E6C; }

/* 子のようす モーダル（読み取り専用） */
.cv { display: flex; flex-direction: column; gap: 12px; }
.cv-wallet { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  background: #F7F3EA; border-radius: 14px; padding: 12px 16px; }
.cv-wallet-k { font-size: 13px; font-weight: 800; color: #8C8375; }
.cv-wallet-v { font-size: 30px; font-weight: 800; color: #2E2A24; }
.cv-month { display: flex; gap: 10px; }
.cv-stat { flex: 1; background: #FAF7F0; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.cv-stat span { font-size: 12px; font-weight: 700; color: #8C8375; }
.cv-stat strong { font-size: 17px; font-weight: 800; color: #2E2A24; }
/* 「今月あと使える／こえたぶん」は横いっぱいで1行（おさいふ行を撤去した跡地） */
.cv-stat-wide { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 10px; background: #F7F3EA; padding: 12px 16px; border-radius: 14px; }
.cv-stat-wide strong { font-size: 24px; }
.cv-stage { font-size: 14px; font-weight: 800; color: #7A4A00; background: #FFF3CD; border-radius: 999px; padding: 8px 14px; text-align: center; }
.cv-sec { font-size: 13px; font-weight: 800; color: #8C8375; margin-top: 2px; }
.cv-goal { display: flex; flex-direction: column; gap: 6px; }
.cv-goal-head { display: flex; align-items: center; gap: 10px; }
.cv-goal-nums { margin-left: auto; font-size: 12.5px; font-weight: 700; color: #7A6647; }
.cv-goal .sv-done-badge { margin-left: auto; }
.cv-rec { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #F0EBE0; }
.cv-rec:last-child { border-bottom: none; }
.cv-rec-date { font-size: 11.5px; font-weight: 700; color: #8C8375; white-space: nowrap; }
.cv-rec-name { flex: 1; font-weight: 700; color: #2E2A24; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-rec-amt { font-weight: 800; color: #2E2A24; white-space: nowrap; }

/* ⭐ 旧お手伝いポイントの残高精算カード（機能撤去後の受け皿） */
.chore-pts { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  background: #FFF7DE; border-radius: 14px; padding: 12px 16px; margin-bottom: 4px; }
.chore-pts-k { font-size: 13px; font-weight: 800; color: #8C7A4A; }
.chore-pts-v { font-size: 28px; font-weight: 800; color: #A9750B; }
.chore-ex { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.chore-ex-btn { border-radius: 999px; font-weight: 800; }

/* 🎁 プレゼント（衣装ガチャ）モーダル */
.gacha { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.gc-stage { position: relative; height: 96px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gc-burst { position: absolute; inset: 0; pointer-events: none; }
.gc-get { position: absolute; left: 50%; bottom: 4px; transform: translate(-50%, 6px); opacity: 0; transition: opacity .25s, transform .25s;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 14px; font-weight: 800; color: #B9506E; white-space: nowrap; text-shadow: 0 1px 0 rgba(255,255,255,.7); }
.gc-get.show { opacity: 1; transform: translate(-50%, 0); }
.gc-rl { font-size: 12px; font-weight: 800; padding: 1px 10px; border-radius: 999px; }
.gc-rl.gc-rare { background: #DCE7FA; color: #39628F; }
.gc-rl.gc-super { background: linear-gradient(90deg,#FFE9A0,#F5C542); color: #8A5E0A; }
.gc-price { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gc-cost { font-size: 13px; font-weight: 800; color: #7A5A20; }
.gc-need { font-size: 12px; font-weight: 700; color: #B9506E; }
.gc-complete { font-size: 15px; font-weight: 800; color: #C99B2E; text-align: center; padding: 6px 0; }
.gc-open { border: none; cursor: pointer; font-size: 16px; font-weight: 800; color: #7A4A00;
  padding: 10px 30px; border-radius: 999px; background: linear-gradient(180deg,#FFE9A8,#FFD54A);
  box-shadow: 0 6px 14px rgba(150,95,10,.4); }
.gc-open:disabled { background: #EAE2CF; color: #B4A98C; box-shadow: none; cursor: default; }
.gc-hint { font-size: 12px; font-weight: 800; color: #A08A60; text-align: center; }
.gc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gc-slot { display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 4px; border-radius: 14px; background: #FFFDF6; border: 2.5px solid #EAD9AE; }
.gc-slot.equipped { border-color: #F5C542; box-shadow: 0 0 0 2px rgba(245,197,66,.4), 0 4px 10px rgba(150,100,20,.22); }
.gc-slot.locked { background: #F1EEE6; border-color: #E0DACD; }
.gc-ico { font-size: 26px; line-height: 1; }
.gc-ico.gc-sil { color: #C4BCA9; filter: grayscale(1); }
.gc-name { font-size: 10.5px; font-weight: 800; color: #6B5638; text-align: center; line-height: 1.2; }
.gc-slot.locked .gc-name { color: #B4A98C; }
.gc-toggle { border: none; cursor: pointer; font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 999px;
  background: #F0E4C8; color: #7A5A20; }
.gc-slot.equipped .gc-toggle { background: #FFD54A; color: #7A4A00; }
@keyframes gcshake { 0%,100%{transform:rotate(0)} 15%{transform:rotate(-7deg)} 30%{transform:rotate(6deg)} 45%{transform:rotate(-5deg)} 60%{transform:rotate(4deg)} 75%{transform:rotate(-2deg)} }
@keyframes gcfall { 0%{transform:translateY(-10px) rotate(0);opacity:0} 12%{opacity:1} 100%{transform:translateY(150px) rotate(340deg);opacity:0} }

/* 金額入力(.price)のスピナー矢印も消す（ちょきん・収入の入力欄） */
input.price::-webkit-outer-spin-button, input.price::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.price { -moz-appearance: textfield; appearance: textfield; }

/* ======================================================================
   マネコのぼうけん（RPGふう たびマップ）— journey.ts
   フルスクリーンの縦スクロール。貯金が進むと景色とマネコの衣装が変わる。
   ====================================================================== */
.jr-overlay {
  position: fixed; inset: 0; z-index: 4000;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: #BFD3E8;                 /* 中央402ステージ外（PC等の左右）はデザインのフレーム色 */
  font-family: 'M PLUS Rounded 1c', sans-serif;
  opacity: 0;
  transition: opacity .32s ease;
}
/* overlay 自体に transform を持たせない（opacityフェードのみ）。
   スクロールコンテナ(.jr-overlay)に transform を持たせると、その中の position:fixed
   （.jr-top / .jr-foot）の包含ブロックを奪ってしまい、固定バーがスクロールで消えるため。 */
.jr-overlay.jr-in { opacity: 1; }
.jr-overlay.jr-out { opacity: 0; pointer-events: none; }

/* 上部固定バー（もどる／タイトル／％）— v2 の見た目 */
.jr-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 4100;
  display: flex; align-items: center; gap: 10px;
  padding: calc(40px + env(safe-area-inset-top)) 14px 12px;
  background: linear-gradient(180deg, rgba(191,211,232,.96), rgba(191,211,232,0));
  pointer-events: none;
}
.jr-top .jr-back {
  pointer-events: auto;
  border: none; cursor: pointer;
  background: #FFFDF6; color: #5C4A2E;
  font-weight: 800; font-size: 14px; font-family: inherit;
  border-radius: 999px; padding: 8px 15px 8px 12px;
  box-shadow: 0 4px 12px rgba(80,60,20,.2);
}
.jr-title {
  display: flex; align-items: center; gap: 6px;
  color: #2E2A24; font-weight: 800; font-size: 16px;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}
.jr-hud {
  margin-left: auto;
  background: linear-gradient(180deg, #FF7A5C, #D8382C);
  color: #FFF; font-weight: 800; font-size: 15px;
  border-radius: 999px; padding: 7px 15px; box-shadow: 0 4px 12px rgba(180,50,40,.35);
}

/* 目標切替ピル（.jr-top の直下・fixed）。◀▶で目標を循環切替 */
.jr-goal-bar {
  position: fixed; left: 0; right: 0;
  top: calc(88px + env(safe-area-inset-top));
  display: flex; justify-content: center;
  z-index: 4100; pointer-events: none;
}
.jr-goal-pill {
  pointer-events: auto;
  display: flex; align-items: center;
  background: #FFFDF6; border: 2.5px solid #E8B62B; border-radius: 999px;
  padding: 0 8px;
  box-shadow: 0 4px 12px rgba(150,100,20,.25);
  font-size: 13px; font-weight: 800; color: #7A5A20;
}
.jr-goal-pill .jr-goal-label { white-space: nowrap; padding: 10px 6px; }
.jr-goal-pill button {
  border: none; background: none; cursor: pointer; padding: 0;
  min-width: 44px; min-height: 44px;              /* タップ領域44px確保 */
  font-family: inherit; font-size: 13px; font-weight: 800; color: #C89A2E;
}

/* 下部の現在地バナー — v2（白フェードは内側の inline が担当。ここは固定枠だけ） */
.jr-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4100;
  pointer-events: none;
}

@keyframes mflame { from { transform: scaleY(.82); opacity: .85; } to { transform: scaleY(1.12); opacity: 1; } }
@keyframes mpulse { 0%,100%{transform:translateX(-50%) scale(1);box-shadow:0 0 0 0 rgba(216,60,44,.5)} 50%{transform:translateX(-50%) scale(1.06);box-shadow:0 0 0 12px rgba(216,60,44,0)} }
@keyframes mflag { 0%,100%{transform:skewY(0)} 50%{transform:skewY(-9deg)} }
@keyframes mchev { 0%,100%{opacity:.3;transform:translateX(-50%) translateY(0)} 50%{opacity:1;transform:translateX(-50%) translateY(5px)} }

/* ======================================================================
   📣 アプリ内トースト（こども向け通知・どの画面でも .pc-canvas 上部に出る）
   ====================================================================== */
.app-toast {
  position: absolute; top: 104px; left: 50%; transform: translateX(-50%);
  z-index: 2500; /* HUD(〜15)より上・モーダル .cm-overlay(3000) より下 */
  width: max-content; max-width: 86%;
  background: #FFFDF6;
  border: 2.5px solid #E8B62B;
  border-radius: 18px;
  padding: 10px 18px;
  font-size: 13px; font-weight: 800; color: #7A5A20;
  line-height: 1.5; text-align: center;
  box-shadow: 0 8px 20px rgba(120,80,20,.32);
  cursor: pointer;
  animation: toast-pop .3s cubic-bezier(.34,1.56,.64,1);
}
.app-toast.leaving { opacity: 0; transform: translateX(-50%) translateY(-8px); transition: opacity .2s, transform .2s; }
@keyframes toast-pop { from { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(.9); } to { opacity: 1; transform: translateX(-50%); } }

/* 📅 カレンダーの日別カードに表示する収入行 */
.cal-inc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #EAF7EE; border: 1.5px solid #BCE3C8; border-radius: 12px;
  padding: 8px 12px;
}
.cal-inc-name { font-size: 13px; font-weight: 700; color: #2E2A24; }
.cal-inc-amt { color: #1E7A43; font-size: 13px; }
.cal-inc-row[role="button"] { cursor: pointer; }
.cal-inc-row[role="button"]:active { transform: scale(.985); }

/* レポートカード内の複数家計簿切替。縦方向には他の内容と一緒にスクロールする。 */
.report-group-switcher {
  margin: 0 0 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(142, 94, 28, .14);
}
.report-group-label {
  display: block;
  margin: 0 3px 5px;
  color: #7B5C35;
  font-size: 9px;
  font-weight: 800;
}
.report-group-rail {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.report-group-rail::-webkit-scrollbar { display: none; }
.report-group-button {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  scroll-snap-align: start;
  padding: 7px 12px 7px 8px;
  border: 1.5px solid #E3CEAA;
  border-radius: 999px;
  background: #FFFDF7;
  color: #765638;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.report-group-button.active {
  border-color: #E39A21;
  background: linear-gradient(180deg,#FFF1C8,#FFE2A0);
  color: #68430D;
  box-shadow: 0 3px 8px rgba(181, 112, 14, .17);
}
.report-group-check {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1.5px solid #D7BE96;
  border-radius: 999px;
  background: #FFF;
  color: #FFF;
  font-size: 11px;
}
.report-group-button.active .report-group-check {
  border-color: #D9890D;
  background: #E99A1B;
}
.report-group-button.shake { animation: report-group-shake .28s ease; }
@keyframes report-group-shake {
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.kids-report-summary .report-group-switcher {
  margin: -2px -3px 11px;
  border-bottom-color: rgba(255,255,255,.17);
}
.kids-report-summary .report-group-label { color: #D8C7AD; }
.kids-report-summary .report-group-button {
  border-color: rgba(255,255,255,.24);
  background: rgba(255,255,255,.1);
  color: #FFF9E9;
}
.kids-report-summary .report-group-button.active {
  border-color: #F0BB58;
  background: rgba(240,174,54,.22);
  color: #FFF4D8;
}

.rc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; }
.rc-payer {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--payer-color), transparent 60%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--payer-color), white 88%);
  color: var(--payer-color);
  font-size: 10px;
  font-weight: 800;
}

/* App Store IAP */
.iap-card { overflow: hidden; }
.iap-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.iap-heading h2 { margin: 1px 0 0; }
.iap-kicker { color: #D78A14; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.iap-owned-badge {
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg,#F9B53E,#EC8616);
  color: #FFF;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(195, 104, 10, .22);
}
/* 契約中だけ出る「いまの状態」＋解約導線（無料トライアル / 解約ずみ） */
.iap-plan-status {
  margin: 11px 0 4px;
  padding: 12px;
  border: 1.5px solid #e5cfa4;
  border-radius: 15px;
  background: rgba(255, 252, 244, .92);
  text-align: center;
}
.iap-plan-status.trial {
  border-color: #7bc47f;
  background: linear-gradient(150deg, #f2fbf0, #dff3dd);
}
.iap-plan-status.canceled {
  border-color: #dcc0b0;
  background: linear-gradient(150deg, #fff8f4, #fdeee6);
}
.iap-plan-status > small {
  display: block;
  margin-top: 4px;
  color: #7c6242;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.55;
}
.iap-plan-title {
  display: block;
  color: #2f6b34;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.4;
}
.iap-plan-title.canceled { color: #a4562c; }
.iap-cancel-btn {
  display: block;
  margin: 10px auto 0;
  padding: 11px 16px;
  max-width: 260px;
  border: 1.5px solid #d6b9a8;
  border-radius: 999px;
  background: #fff;
  color: #a4562c;
  font: 900 12px "M PLUS Rounded 1c", sans-serif;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(120, 71, 40, .1);
}
.iap-plan-help {
  display: block;
  margin-top: 6px;
  color: #9a7d59;
  font-size: 8.5px;
  font-weight: 750;
}
/* 未契約の人にだけ出す「はじめての方は2週間無料」 */
/* リリース記念価格の小バッジ（プランボックスのタイトル横） */
.iap-launch-badge {
  display: inline-block;
  align-self: flex-start;
  margin: 2px 0 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #fdeccb;
  border: 1px solid #e3b45c;
  color: #8a5a10;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .02em;
}
.iap-free-trial {
  margin: 0 0 9px;
  padding: 7px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .72);
  border: 1px dashed #cf9a2c;
  color: #7a4a0d;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}
.iap-ocr-quota {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 11px 0 4px;
  padding: 10px 12px;
  border: 1px solid #ead9bd;
  border-radius: 14px;
  background: rgba(255, 250, 239, .82);
  color: #704716;
}
.iap-ocr-quota .kids-line-icon { width: 22px; height: 22px; color: #d58b1d; }
.iap-ocr-quota strong,
.iap-ocr-quota small { display: block; }
.iap-ocr-quota strong { font-size: 11px; }
.iap-ocr-quota small {
  margin-top: 1px;
  color: #967247;
  font-size: 9px;
  font-weight: 750;
}
.iap-plus-box {
  margin: 12px 0;
  padding: 13px;
  border: 1.5px solid #E8AF4D;
  border-radius: 17px;
  background: linear-gradient(145deg,#FFF7D9,#FFE6AD);
}
.iap-offer-code {
  margin-top: 9px;
  padding-top: 10px;
  border-top: 1px solid rgba(151,112,56,.17);
  text-align: center;
}
.iap-offer-code-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d5b77f;
  border-radius: 12px;
  background: rgba(255,252,244,.9);
  color: #76501f;
  font: 850 11px "M PLUS Rounded 1c",sans-serif;
  box-shadow: inset 0 1px 0 #fff,0 3px 8px rgba(92,59,20,.07);
}
.iap-offer-code-help {
  display: block;
  margin: 6px 4px 0;
  color: #9a7d59;
  font-size: 8px;
  font-weight: 750;
  line-height: 1.5;
}
.iap-plus-box > strong, .iap-plus-box > span { display: block; }
.iap-plus-box > strong { color: #714611; font-size: 16px; }
.iap-plus-box > span { margin: 2px 0 9px; color: #97703B; font-size: 10px; }
.iap-plus-benefit {
  margin: 4px 0 11px;
  padding: 10px 11px;
  border: 1px solid rgba(222,154,37,.34);
  border-radius: 12px;
  background: rgba(255,255,255,.58);
  color: #704716;
}
.iap-plus-benefit b,
.iap-plus-benefit small { display: block; }
.iap-plus-benefit b {
  font-size: 11px;
  line-height: 1.45;
}
.iap-plus-benefit small {
  margin-top: 3px;
  color: #8d6838;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.55;
}
.iap-plus-box.family {
  border-color: #e4b96d;
  background: linear-gradient(145deg,#fff9e8,#ffe4ae);
}
.iap-family-label {
  margin: 8px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.iap-family-label small {
  color: #8c6636;
  font-size: 9px;
  font-weight: 800;
}
.iap-family-group {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d9bd8c;
  border-radius: 11px;
  background: rgba(255,255,255,.76);
  color: #68451f;
  font: 800 10px "M PLUS Rounded 1c",sans-serif;
}
.iap-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #EADCC5;
  border-radius: 14px;
  background: rgba(255,255,255,.82);
}
.iap-product-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.iap-savings-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e68c14;
  color: #fff;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(176,91,7,.18);
}
.iap-product-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.iap-product-copy strong { color: #5F4528; font-size: 12px; }
.iap-product-copy small { color: #9A8062; font-size: 9px; line-height: 1.35; }
.iap-buy {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.iap-buy:disabled { opacity: .62; }
.iap-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.iap-note { margin: 9px 0 0; color: #8C7357; font-size: 10px; text-align: center; }
.kids-photo-settings-body > .iap-card .iap-buy {
  width: auto;
  min-width: 86px;
  min-height: 34px;
  flex: 0 0 auto;
  padding: 7px 10px;
  white-space: nowrap;
}
.kids-photo-settings-body > .iap-card .iap-product-copy {
  flex: 1 1 auto;
  min-width: 0;
  writing-mode: horizontal-tb;
}
.kids-photo-settings-body > .iap-card .iap-product-copy strong,
.kids-photo-settings-body > .iap-card .iap-product-copy small {
  word-break: normal;
  overflow-wrap: anywhere;
  writing-mode: horizontal-tb;
}

/* ======================================================================
   🐾 初回チュートリアル（利用タイプ選択の直後・1回だけ）
   ====================================================================== */
.tut-overlay {
  position: absolute;
  inset: 0;
  z-index: 5000;
  overflow: hidden;
  pointer-events: none;
  font-family: "M PLUS Rounded 1c", sans-serif;
}
.tut-spotlight {
  position: absolute;
  z-index: 1;
  border: 3px solid rgba(255,210,91,.98);
  border-radius: 22px;
  background: rgba(255,255,255,.05);
  box-shadow:
    0 0 0 9999px rgba(25,20,16,.68),
    0 0 0 6px rgba(255,218,112,.22),
    0 10px 30px rgba(25,20,16,.32);
  transition: left .28s ease, top .28s ease, width .28s ease, height .28s ease;
  pointer-events: none;
}
.tut-spotlight::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(255,232,166,.7);
  border-radius: 28px;
  animation: tut-pulse 1.7s ease-in-out infinite;
}
.tut-card {
  position: absolute;
  left: 18px;
  z-index: 2;
  width: calc(100% - 36px);
  max-height: 470px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 24px;
  background: rgba(255,252,244,.97);
  box-shadow: 0 20px 50px rgba(29,19,10,.4);
  padding: 17px 18px 14px;
  color: #4d321d;
  text-align: left;
  pointer-events: auto;
  animation: tut-card-in .25s cubic-bezier(.2,.8,.2,1);
  scrollbar-width: none;
}
.tut-card::-webkit-scrollbar { display: none; }
.tut-skip {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  border: 0;
  background: transparent;
  color: #8a7764;
  padding: 6px 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.tut-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 16px;
  padding-right: 52px;
  color: #a28d75;
  font-size: 9px;
  font-weight: 800;
}
.tut-dots { display: flex; gap: 5px; }
.tut-dot {
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: #e5ddce;
  transition: background .2s, width .2s;
}
.tut-dot.active { width: 28px; background: linear-gradient(90deg,#eea625,#f4c852); }
.tut-guide {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin-top: 8px;
}
.tut-guide img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  object-position: center top;
  filter: drop-shadow(0 5px 6px rgba(93,53,16,.18));
}
.tut-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: #c98218;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}
.tut-title {
  margin: 0;
  color: #4d321d;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}
.tut-text {
  margin: 7px 0 12px;
  color: #695643;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.65;
}
.tut-card .tut-next {
  width: 100%;
  min-height: 45px;
  border: 0 !important;
  border-radius: 15px;
  background: linear-gradient(135deg,#f5ad27,#e88a16) !important;
  box-shadow: 0 7px 15px rgba(196,111,11,.24), inset 0 1px rgba(255,255,255,.45);
  color: #fff !important;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.tut-card .tut-next:hover,
.tut-card .tut-next:focus,
.tut-card .tut-next:active {
  background: linear-gradient(135deg,#f8b737,#e98512) !important;
  color: #fff !important;
  filter: none;
}
.tut-card .tut-next:disabled { opacity: .58; cursor: wait; }
.tut-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 22px;
  margin-top: 2px;
}
.tut-prev {
  border: none;
  background: none;
  color: #8C8375;
  padding: 4px 0;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.tut-prev:disabled { visibility: hidden; }
.tut-input-label,
.tut-field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
  color: #6e5439;
  font-size: 10px;
  font-weight: 900;
}
.tut-field { grid-template-columns: 56px 1fr; }
.tut-money-input,
.tut-goal-name {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1.5px solid #e7d7bc;
  border-radius: 12px;
  outline: 0;
  background: #fff;
  padding: 0 12px;
  color: #4d321d;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
}
.tut-money-input:focus,
.tut-goal-name:focus {
  border-color: #efa326;
  box-shadow: 0 0 0 3px rgba(239,163,38,.14);
}
.tut-quicks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 10px;
}
.tut-quick {
  min-height: 32px;
  border: 1px solid #e8d8bd;
  border-radius: 10px;
  background: #fffaf0;
  color: #7b6043;
  font: inherit;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}
.tut-quick.active {
  border-color: #ef9e20;
  background: #fff0cc;
  color: #b56509;
}
.tut-status {
  min-height: 16px;
  margin: 5px 0 0;
  color: #a56a1d;
  font-size: 9.5px;
  font-weight: 800;
  text-align: center;
}
/* 体験型チュートリアル（2026-07-31）: オーバーレイを body 直下の fixed 層にして、
   スマホキャンバスの中でも、分析タウン（.at-overlay: z-index 12000）の上でも
   同じ座標系（viewport）で案内できるようにする。 */
.tut-overlay.tut-layer { position: fixed; z-index: 13000; }
.tut-overlay.tut-layer .tut-spotlight,
.tut-overlay.tut-layer .tut-card,
.tut-overlay.tut-layer .tut-reopen { position: fixed; }
/* 結果確認中は大きい案内を畳み、この小さなボタンだけ残す。 */
.tut-reopen {
  z-index: 3;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 7px;
  border: 1.5px solid rgba(255,255,255,.92);
  border-radius: 999px;
  background: rgba(255,250,239,.96);
  box-shadow: 0 8px 24px rgba(29,19,10,.28);
  color: #704512;
  font: 900 10.5px "M PLUS Rounded 1c", sans-serif;
  pointer-events: auto;
  cursor: pointer;
  animation: tut-card-in .2s ease;
}
.tut-reopen[hidden] { display: none; }
.tut-reopen img { width: 32px; height: 32px; object-fit: contain; }
/* 店舗レポートでは本文や下部CTAを避け、ヘッダー右下の小さな丸だけにする。 */
.tut-reopen.is-town {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  justify-content: center;
  padding: 5px;
}
.tut-reopen.is-town span { display: none; }
.tut-reopen.is-town img { width: 34px; height: 34px; }
.tut-inspect {
  width: 100%;
  min-height: 36px;
  margin-top: 7px;
  border: 1.5px solid #e7cf9d;
  border-radius: 12px;
  background: #fffaf0;
  color: #9a6516;
  font: 900 10.5px "M PLUS Rounded 1c", sans-serif;
  cursor: pointer;
}
/* 読むだけのシーン: 全面をブロックする（誤タップで先へ進ませない） */
.tut-block {
  position: fixed;
  inset: 0;
  pointer-events: auto;
}
.tut-block.is-dim { background: rgba(25,20,16,.68); }
/* 実タップさせるシーン: 対象のまわり4枚だけブロックし、対象には指が届く（穴あき） */
.tut-mask {
  position: fixed;
  pointer-events: auto;
}
.tut-wait {
  margin: 8px 0 0;
  color: #b06f10;
  font-size: 10.5px;
  font-weight: 900;
  text-align: center;
}
.tut-later { color: #a08a70; }
.tut-cta {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  border: 1.5px solid #e7cf9d;
  border-radius: 13px;
  background: #fffaf0;
  color: #a3690f;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.tut-plus-card {
  display: grid;
  gap: 3px;
  border: 1.5px solid #f0d7a4;
  border-radius: 15px;
  background: linear-gradient(135deg,#fff7e6,#fff1d3);
  padding: 11px 13px;
  text-align: left;
}
.tut-plus-card strong { color: #a3690f; font-size: 13px; font-weight: 900; }
.tut-plus-card span { color: #6e5439; font-size: 11.5px; font-weight: 900; }
.tut-plus-card small { color: #8a7052; font-size: 10px; font-weight: 800; line-height: 1.5; }
.tut-ask {
  margin: 10px 0 6px;
  color: #6e5439;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.5;
}
.tut-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tut-choice {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg,#f5ad27,#e88a16);
  box-shadow: 0 7px 15px rgba(196,111,11,.24);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.tut-choice-ghost {
  border: 1.5px solid #e2d3ba;
  background: #fffaf0;
  box-shadow: none;
  color: #8a7764;
}
/* 練習レシートの見本（モックOCRの演出・自動で消える） */
.tut-receipt-demo {
  position: fixed;
  inset: 0;
  z-index: 13500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(25,20,16,.72);
  animation: tut-card-in .2s ease;
}
.tut-receipt-demo-card {
  display: grid;
  justify-items: center;
  gap: 7px;
  border-radius: 20px;
  background: rgba(255,252,244,.97);
  padding: 16px 20px 14px;
  max-width: 260px;
  text-align: center;
  font-family: "M PLUS Rounded 1c", sans-serif;
}
.tut-receipt-demo-card img { width: 132px; height: auto; }
.tut-receipt-demo-card strong { color: #8a5a12; font-size: 12px; font-weight: 900; }
.tut-receipt-demo-card small { color: #9b8c78; font-size: 9.5px; font-weight: 800; line-height: 1.5; }
@keyframes tut-pulse {
  0%, 100% { opacity: .3; transform: scale(.98); }
  50% { opacity: .9; transform: scale(1.025); }
}
@keyframes tut-card-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* Web/PWAの初期ロード。Expo版は同じ構成をネイティブ側でも描画する。 */
.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 39%, rgba(255,255,255,.96) 0 15%, rgba(255,246,211,.76) 32%, transparent 54%),
    linear-gradient(180deg,#fff9ea 0%,#ffe6ac 64%,#f4c65e 100%);
  color: #65421e;
  font-family: "M PLUS Rounded 1c",sans-serif;
}
.boot-loader-glow {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(255,255,255,.47);
  filter: blur(3px);
  animation: boot-glow 1.8s ease-in-out infinite;
}
.boot-loader-stage {
  position: relative;
  width: 210px;
  height: 245px;
  display: grid;
  place-items: center;
}
.boot-loader-maneko {
  position: relative;
  z-index: 2;
  width: 148px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 10px rgba(109,70,21,.2));
  transform-origin: 50% 88%;
  animation: boot-maneko 1.15s ease-in-out infinite;
}
.boot-loader-shadow {
  position: absolute;
  left: 50%;
  bottom: 19px;
  width: 94px;
  height: 19px;
  border-radius: 50%;
  background: rgba(112,73,22,.18);
  filter: blur(3px);
  animation: boot-shadow 1.15s ease-in-out infinite;
}
.boot-loader-coin {
  position: absolute;
  z-index: 3;
  width: 31px;
  height: 31px;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 50%;
  background: linear-gradient(145deg,#ffda57,#e89417);
  color: #fff5c4;
  box-shadow: 0 5px 10px rgba(155,87,7,.2),inset 0 1px 2px rgba(255,255,255,.65);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  animation: boot-coin 1.5s ease-in-out infinite;
}
.boot-loader-coin.c1 { left: 12px; top: 68px; animation-delay: -.25s; }
.boot-loader-coin.c2 { right: 11px; top: 36px; animation-delay: -.85s; }
.boot-loader-coin.c3 { right: 2px; top: 140px; width: 23px; height: 23px; font-size: 10px; animation-delay: -1.2s; }
.boot-loader h1 { position: relative; margin: 5px 0 3px; color: #65421e; font-size: 17px; font-weight: 900; letter-spacing: .03em; }
.boot-loader p { position: relative; margin: 0; color: #9b713d; font-size: 11px; font-weight: 800; }
.boot-loader-dots { display: inline-flex; gap: 4px; margin-left: 4px; vertical-align: middle; }
.boot-loader-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d9871a;
  animation: boot-dot 1s ease-in-out infinite;
}
.boot-loader-dots i:nth-child(2) { animation-delay: .14s; }
.boot-loader-dots i:nth-child(3) { animation-delay: .28s; }
@keyframes boot-maneko {
  0%,100% { transform: translateY(4px) rotate(-1.5deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}
@keyframes boot-shadow {
  0%,100% { opacity: .23; transform: translateX(-50%) scaleX(1); }
  50% { opacity: .11; transform: translateX(-50%) scaleX(.76); }
}
@keyframes boot-coin {
  0%,100% { opacity: .65; transform: translateY(6px) rotate(-8deg) scale(.9); }
  50% { opacity: 1; transform: translateY(-9px) rotate(9deg) scale(1.05); }
}
@keyframes boot-glow {
  0%,100% { opacity: .58; transform: scale(.92); }
  50% { opacity: .92; transform: scale(1.06); }
}
@keyframes boot-dot {
  0%,100% { opacity: .25; transform: translateY(1px); }
  50% { opacity: 1; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .boot-loader * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* 保存・貯金・目標作成などの共通ローディング */
.maneko-action-loading {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 22px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(63,43,20,.34);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: opacity .18s ease, visibility .18s ease;
}
.maneko-action-loading.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.maneko-action-loading-card {
  position: relative;
  width: min(284px,calc(100vw - 44px));
  min-height: 290px;
  padding: 21px 18px 22px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 35%,rgba(255,255,255,.98),rgba(255,247,218,.93) 55%,rgba(255,224,155,.96)),
    #fff2ca;
  box-shadow: 0 22px 55px rgba(70,39,8,.29),inset 0 1px 0 #fff;
  color: #68431e;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.maneko-action-loading-card img {
  position: relative;
  z-index: 2;
  width: 164px;
  height: 205px;
  margin: -2px 0 3px;
  object-fit: contain;
  filter: drop-shadow(0 12px 9px rgba(105,61,12,.2));
  transform-origin: 50% 88%;
  animation: maneko-loading-breathe 1.65s ease-in-out infinite;
}
.maneko-action-loading-card strong {
  position: relative;
  z-index: 3;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: .02em;
}
.maneko-loading-dots {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 5px;
  margin-top: 12px;
}
.maneko-loading-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e9951f;
  animation: maneko-loading-dot .9s ease-in-out infinite;
}
.maneko-loading-dots i:nth-child(2) { animation-delay: .12s; }
.maneko-loading-dots i:nth-child(3) { animation-delay: .24s; }
@keyframes maneko-loading-breathe {
  0%,100% { transform: translateY(2px) scale(1); }
  50% { transform: translateY(-5px) scale(1.018); }
}
@keyframes maneko-loading-dot {
  0%,100% { opacity: .25; transform: translateY(1px); }
  50% { opacity: 1; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .maneko-action-loading * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
/* ======================================================================
   Maneko Town v4 — savings-driven town, journey and four-tab experience
   ====================================================================== */
.kids-home-v3 {
  position: relative;
  width: 402px;
  height: 840px;
  max-width: none;
  margin: 0;
  padding: 0;
  display: block;
  gap: 0;
  overflow: hidden;
  isolation: isolate;
  color: #3d2f22;
  font-family: "M PLUS Rounded 1c", sans-serif;
  background: #d8ebf1;
}
.kids-home-v3-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  background-position: center 50%;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.035);
  filter: saturate(.98) contrast(.98);
}
.kids-home-v3.stage-0 .kids-home-v3-bg { background-position: center 48%; }
.kids-home-v3.stage-1 .kids-home-v3-bg { background-position: center 51%; }
.kids-home-v3.stage-2 .kids-home-v3-bg { background-position: center 52%; }
.kids-home-v3.stage-3 .kids-home-v3-bg { background-position: center 53%; }
.kids-home-v3.stage-4 .kids-home-v3-bg { background-position: center 55%; }
.kids-home-v3-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(26,35,44,.3), rgba(26,35,44,0) 26%),
    linear-gradient(0deg, rgba(48,31,15,.28), rgba(48,31,15,0) 30%);
}
.kids-home-v3-header {
  position: absolute;
  left: 14px;
  right: 14px;
  top: calc(48px + env(safe-area-inset-top));
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kids-month-chip,
.kids-map-chip,
.kids-goal-strip {
  border: 1px solid rgba(255,255,255,.82);
  background: rgba(255,250,239,.87);
  color: #3d2f22;
  box-shadow: 0 8px 24px rgba(39,25,12,.2);
  backdrop-filter: blur(15px) saturate(1.1);
  -webkit-backdrop-filter: blur(15px) saturate(1.1);
}
.kids-map-chip {
  min-height: 40px;
  border-radius: 999px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  cursor: pointer;
}
.kids-month-chip {
  min-width: 188px;
  min-height: 78px;
  padding: 10px 14px 9px 53px;
  position: relative;
  border-radius: 19px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.kids-month-chip::before {
  content: "◒";
  position: absolute;
  left: 15px;
  top: 19px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg,#f7c55f,#dc8b22);
  color: #fff7dc;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(128,75,12,.24),inset 0 1px 0 rgba(255,255,255,.5);
  font-size: 15px;
}
.kids-month-chip span { color: #7b684e; font-size: 9px; font-weight: 800; }
.kids-month-chip strong { font-size: 21px; line-height: 1.12; letter-spacing: .02em; }
.kids-month-chip small {
  max-width: 128px;
  overflow: hidden;
  color: #927b5d;
  font-size: 7px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kids-map-chip { font-size: 12px; font-weight: 800; }
.kids-goal-strip {
  position: absolute;
  left: 14px;
  right: 14px;
  top: calc(100px + env(safe-area-inset-top));
  z-index: 20;
  padding: 10px 12px;
  border-radius: 16px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.kids-goal-strip-top,
.kids-goal-meta { display: flex; justify-content: space-between; align-items: center; }
.kids-goal-strip-top strong {
  max-width: 80%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}
.kids-goal-strip-top b { color: #25745a; font-size: 12px; }
.kids-goal-track {
  display: block;
  height: 7px;
  margin: 6px 0 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(101,83,52,.18);
}
.kids-goal-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg,#80c779,#36a374);
  box-shadow: 0 0 10px rgba(54,163,116,.38);
}
.kids-goal-meta { font-size: 9.5px; font-weight: 700; color: #7b684e; }
.kids-town-open {
  position: absolute;
  inset: 0;
  width: 100%;
  z-index: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kids-town-open:hover,
.kids-town-open:focus,
.kids-town-open:active {
  background: transparent;
  outline: none;
}
.kids-home-v3-header,
.kids-map-chip,
.kids-goal-carousel,
.kids-bubble-v3,
.kids-toast-v3,
.kids-home-v3 > .kids-nav-v3 {
  transition: opacity .24s ease, transform .24s ease;
}
.kids-home-v3.kids-home-v3-ui-hidden .kids-home-v3-header,
.kids-home-v3.kids-home-v3-ui-hidden .kids-map-chip,
.kids-home-v3.kids-home-v3-ui-hidden .kids-goal-carousel,
.kids-home-v3.kids-home-v3-ui-hidden .kids-bubble-v3,
.kids-home-v3.kids-home-v3-ui-hidden .kids-toast-v3,
.kids-home-v3.kids-home-v3-ui-hidden > .kids-nav-v3 {
  opacity: 0;
  pointer-events: none;
}
.kids-home-v3.kids-home-v3-ui-hidden .kids-home-v3-header,
.kids-home-v3.kids-home-v3-ui-hidden .kids-goal-carousel { transform: translateY(-12px); }
.kids-home-v3.kids-home-v3-ui-hidden > .kids-nav-v3 { transform: translateY(16px); }
.kids-maneko-v3 {
  position: absolute;
  left: 50%;
  bottom: var(--walk-to-y);
  width: 184px;
  height: 255px;
  z-index: 8;
  transform: translateX(-50%) scale(var(--walk-to-scale));
  transform-origin: bottom center;
  cursor: pointer;
  filter: drop-shadow(0 10px 9px rgba(48,29,10,.28));
}
.kids-maneko-v3.is-moving {
  animation: maneko-walk-forward 1.8s cubic-bezier(.2,.75,.3,1) both;
}
.kids-maneko-v3.is-tapped img { animation: maneko-hop .72s ease; }
.kids-maneko-v3 img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  user-select: none;
  -webkit-user-drag: none;
}
.kids-maneko-v3 .kids-maneko-season-costume {
  z-index: 2;
  pointer-events: none;
  object-fit: contain;
  object-position: center bottom;
}
.kids-maneko-v3 .kids-maneko-season-costume-body {
  transform: translateY(8%);
}
.kids-maneko-v3 .kids-maneko-season-costume-hat {
  z-index: 3;
}
.kids-maneko-v3.costume-summer-festival .kids-maneko-season-costume-hat {
  transform: translateY(-3%);
}
.kids-maneko-v3.costume-autumn-artist .kids-maneko-season-costume-body {
  transform: translateY(13%);
}
.kids-maneko-v3.costume-autumn-harvest .kids-maneko-season-costume-body {
  transform: translateY(14%);
}
.kids-maneko-v3-shadow {
  position: absolute;
  left: 25%;
  right: 25%;
  bottom: 7px;
  height: 14px;
  border-radius: 50%;
  background: rgba(39,27,16,.36);
  filter: blur(6px);
}
@keyframes maneko-walk-forward {
  0% { bottom: var(--walk-from-y); transform: translateX(-50%) translateX(-4px) scale(var(--walk-from-scale)); }
  18% { transform: translateX(-50%) translateX(5px) translateY(-8px) scale(var(--walk-from-scale)); }
  38% { transform: translateX(-50%) translateX(-4px) scale(var(--walk-from-scale)); }
  58% { transform: translateX(-50%) translateX(5px) translateY(-8px) scale(var(--walk-to-scale)); }
  78% { transform: translateX(-50%) translateX(-3px) scale(var(--walk-to-scale)); }
  100% { bottom: var(--walk-to-y); transform: translateX(-50%) scale(var(--walk-to-scale)); }
}
@keyframes maneko-hop {
  0%,100% { transform: translateY(0) rotate(0); }
  45% { transform: translateY(-25px) rotate(3deg); }
}
.kids-bubble-v3 {
  position: absolute;
  left: 50%;
  bottom: 390px;
  z-index: 18;
  max-width: 250px;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 15px;
  background: rgba(255,250,239,.92);
  color: #4e3d2b;
  box-shadow: 0 8px 22px rgba(39,25,12,.2);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  transform: translate(-50%,8px);
  transition: .25s ease;
  pointer-events: none;
}
.kids-bubble-v3.show { opacity: 1; transform: translate(-50%,0); }
.kids-place-label {
  position: absolute;
  left: 15px;
  bottom: 154px;
  z-index: 14;
  display: flex;
  flex-direction: column;
  color: #fff;
  text-shadow: 0 2px 8px rgba(34,22,10,.7);
}
.kids-place-label span { font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.kids-place-label strong { font-size: 18px; }
.kids-record-fab {
  position: absolute;
  right: 14px;
  bottom: 153px;
  z-index: 18;
  min-height: 43px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px;
  background: linear-gradient(180deg,#ffe58b,#f4bd3d);
  box-shadow: 0 8px 22px rgba(102,63,9,.35);
  color: #6b450b;
  font: 800 12px "M PLUS Rounded 1c", sans-serif;
}
.kids-record-fab span { font-size: 18px; vertical-align: -1px; }
.kids-toast-v3 {
  position: absolute;
  left: 50%;
  bottom: 220px;
  z-index: 30;
  max-width: 82%;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(42,38,32,.87);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: translate(-50%,8px);
  transition: .25s ease;
  pointer-events: none;
}
.kids-toast-v3.show { opacity: 1; transform: translate(-50%,0); }

.kids-nav-v3 {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 1200;
  min-height: 76px;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  align-items: center;
  padding: 6px 7px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 25px;
  background: rgba(255,250,239,.88);
  box-shadow: 0 12px 32px rgba(45,30,15,.24);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.kids-nav-v3-item {
  min-width: 0;
  min-height: 62px;
  border: 0;
  border-radius: 19px;
  background: transparent;
  color: #796b58;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font: 800 10px "M PLUS Rounded 1c", sans-serif;
}
.kids-nav-v3-item.active {
  background: rgba(244,190,55,.22);
  color: #684817;
}
.kids-nav-v3-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: saturate(.72) sepia(.12);
  transition: .18s ease;
}
.kids-nav-v3-item.active .kids-nav-v3-icon {
  filter: saturate(1.08) drop-shadow(0 3px 4px rgba(119,70,9,.18));
  transform: translateY(-1px) scale(1.05);
}

/* Secondary tabs keep the town visible while the cream sheet protects legibility. */
body.theme-kids .pc-scroll.kids-tab-shell {
  padding-top: 184px;
  padding-bottom: calc(132px + env(safe-area-inset-bottom) + var(--kb,0px));
  background-position: center 50%;
  background-size: cover;
  background-repeat: no-repeat;
  isolation: isolate;
}
body.theme-kids .pc-scroll.kids-tab-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,transparent 0 125px,rgba(255,249,237,.72) 190px,#fff9ed 285px,#f8f0df 100%);
  pointer-events: none;
}
body.theme-kids .kids-tab-add { background-image: linear-gradient(rgba(34,34,30,.05),rgba(34,34,30,.05)),url("/assets/kids/stage-1.webp"); }
body.theme-kids .kids-tab-savings { background-image: linear-gradient(rgba(34,34,30,.04),rgba(34,34,30,.04)),url("/assets/kids/stage-2.webp"); }
body.theme-kids .kids-tab-report { background-image: linear-gradient(rgba(34,34,30,.08),rgba(34,34,30,.08)),url("/assets/kids/stage-3.webp"); }
body.theme-kids .kids-tab-family { background-image: linear-gradient(rgba(34,34,30,.08),rgba(34,34,30,.08)),url("/assets/kids/stage-1.webp"); }
body.theme-kids .kids-tab-settings {
  background-image: linear-gradient(rgba(19,29,53,.34),rgba(19,29,53,.2)),url("/assets/kids/stage-4.webp");
  background-position: center 28%;
}
body.theme-kids .pc-scroll.kids-tab-shell .card {
  position: relative;
  background: rgba(255,252,244,.94);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 10px 30px rgba(72,50,23,.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Full-screen 3D journey. */
.jr-overlay.journey-v3-overlay {
  overflow: hidden;
  background: #203f69;
}
.journey-v3-canvas {
  position: relative;
  width: min(100%,47.3684dvh,460px);
  height: 100dvh;
  min-height: 720px;
  margin: 0 auto;
  overflow: hidden;
  background: url("/assets/kids/journey-3d.webp") center / 100% 100% no-repeat;
  color: #fff;
}
.journey-v3-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,rgba(12,29,56,.3),transparent 23%,transparent 70%,rgba(18,28,30,.38));
}
.journey-v3-mist {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg,rgba(236,244,255,.18) 0%,rgba(236,244,255,.06) calc(100% - var(--reveal)),transparent calc(108% - var(--reveal)));
  mix-blend-mode: screen;
  transition: .5s ease;
}
.journey-v3-header {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 10px;
}
.journey-v3-back,
.journey-v3-goal,
.journey-v3-footer {
  border: 1px solid rgba(255,255,255,.58);
  background: rgba(25,39,53,.58);
  box-shadow: 0 10px 30px rgba(10,20,35,.24);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}
.journey-v3-back {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
}
.journey-v3-header > div {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.journey-v3-header span { font-size: 16px; font-weight: 900; }
.journey-v3-header strong { font-size: 24px; }
.journey-v3-goal {
  position: absolute;
  left: 50%;
  top: calc(66px + env(safe-area-inset-top));
  z-index: 12;
  width: min(330px,calc(100% - 40px));
  min-height: 46px;
  border-radius: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: opacity .24s ease,transform .24s ease;
}
.journey-v3-goal button {
  width: 40px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
}
.journey-v3-goal > img {
  width: 42px;
  height: 42px;
  margin-left: 4px;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(24,18,10,.2));
}
.journey-v3-goal > span {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.journey-v3-goal strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.journey-v3-goal small { font-size: 9.5px; color: rgba(255,255,255,.78); }
.journey-v3-stage {
  position: absolute;
  z-index: 4;
  max-width: 118px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,.74);
  text-shadow: 0 2px 7px rgba(0,0,0,.68);
}
.journey-v3-stage span {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(24,38,51,.62);
  border: 1px solid rgba(255,255,255,.56);
  font-size: 9px;
  font-weight: 900;
}
.journey-v3-stage strong { font-size: 10px; line-height: 1.2; }
.journey-v3-stage.current { color: #fff5b3; }
.journey-v3-stage.current span { background: #e8a52c; color: #fff; }
.journey-v3-stage.done span { background: #3a9e73; color: #fff; }
.journey-v3-stage.future { opacity: .6; filter: saturate(.65); }
.journey-v3-marker {
  position: absolute;
  z-index: 9;
  width: 78px;
  transform: translate(-50%,-100%);
  transition: left .7s ease,top .7s ease;
  filter: drop-shadow(0 8px 9px rgba(22,15,8,.42));
}
.journey-v3-marker span {
  position: absolute;
  left: 50%;
  top: -2px;
  transform: translate(-50%,-100%);
  padding: 3px 8px;
  border-radius: 999px;
  background: #d84a3a;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}
.journey-v3-marker img { display: block; width: 100%; height: 102px; object-fit: contain; object-position: bottom; }
.journey-v3-footer {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 12;
  padding: 10px 13px;
  border-radius: 18px;
  transition: opacity .24s ease,transform .24s ease;
}
.journey-v3-footer div { display: flex; justify-content: space-between; align-items: center; }
.journey-v3-footer strong { font-size: 13px; }
.journey-v3-footer span { font-size: 12px; font-weight: 900; color: #ffe584; }
.journey-v3-footer i {
  display: block;
  height: 7px;
  margin: 6px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.24);
}
.journey-v3-footer b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#f4bc42,#fff09a); }
.journey-v3-footer p { margin: 0; font-size: 9.5px; font-weight: 700; color: rgba(255,255,255,.84); text-align: center; }
.journey-v3-canvas.journey-v3-ui-hidden .journey-v3-goal {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%,-14px);
}
.journey-v3-canvas.journey-v3-ui-hidden .journey-v3-footer {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
}

@media (prefers-reduced-motion: reduce) {
  .kids-maneko-v3,
  .kids-maneko-v3 img { animation: none !important; }
}
.quick-place {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.quick-place-status { margin: 0; font-size: 11px; }
.quick-place-status.found {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 10px;
  background: #e8f6ed;
  color: #247353 !important;
  font-weight: 800;
}
.family-tab-intro { overflow: hidden; }
.family-tab-kicker {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
  color: #a87b24;
}
.settings-drawer {
  border-radius: 18px;
  background: rgba(255,252,244,.9);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 10px 30px rgba(72,50,23,.12);
  overflow: hidden;
}
.settings-drawer > summary {
  padding: 15px 16px;
  list-style: none;
  cursor: pointer;
  color: #6c5124;
  font-size: 13px;
  font-weight: 900;
}
.settings-drawer > summary::-webkit-details-marker { display: none; }
.settings-drawer > summary::after { content: "＋"; float: right; }
.settings-drawer[open] > summary::after { content: "−"; }
.settings-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 10px 12px;
}
.settings-drawer-body .card { box-shadow: none !important; }

/* Approved concept-faithful secondary screens. */
.kids-photo-page {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  display: block;
  gap: 0;
  overflow: hidden;
  isolation: isolate;
  color: #5b371b;
  background: #d8ebf1;
  font-family: "M PLUS Rounded 1c", sans-serif;
}
.kids-photo-scene {
  position: absolute;
  inset: 0;
  height: auto;
  overflow: hidden;
  z-index: 0;
}
.kids-photo-scene-bg {
  position: absolute;
  inset: 0;
  background-position: center 50%;
  background-size: cover;
  transform: scale(1.02);
}
.kids-photo-record .kids-photo-scene-bg { background-image: url("/assets/kids/scene-record.webp"); background-position: center 50%; }
.kids-photo-report .kids-photo-scene-bg { background-image: url("/assets/kids/scene-record.webp"); background-position: center 44%; }
.kids-photo-savings .kids-photo-scene-bg { background-image: url("/assets/kids/scene-savings.webp"); background-position: center 50%; }
.kids-photo-family .kids-photo-scene-bg { background-image: url("/assets/kids/scene-family.webp"); background-position: center 50%; }
.kids-photo-settings .kids-photo-scene-bg { background-image: url("/assets/kids/scene-settings.webp"); background-position: center 50%; }
.kids-photo-scene-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,rgba(31,25,18,.03),rgba(31,25,18,.05) 42%,rgba(47,30,14,.38) 100%);
}
.kids-photo-settings .kids-photo-scene-shade {
  background: linear-gradient(90deg,rgba(29,24,29,.7),rgba(27,35,54,.3)),linear-gradient(0deg,rgba(15,20,33,.3),transparent);
}
.kids-photo-scene-maneko {
  position: absolute;
  z-index: 2;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 12px 12px rgba(43,25,10,.28));
}
.kids-photo-record .kids-photo-scene-maneko,
.kids-photo-report .kids-photo-scene-maneko { width: 195px; height: 260px; right: -5px; top: 58px; }
.kids-photo-savings .kids-photo-scene-maneko { width: 176px; height: 250px; left: 50%; top: 54px; transform: translateX(-50%); }
.kids-photo-family .kids-photo-scene-maneko { width: 178px; height: 248px; right: -1px; top: 61px; }
.kids-photo-settings .kids-photo-scene-maneko { width: 225px; height: 285px; left: 50%; top: 28px; transform: translateX(-50%); }
.kids-photo-sheet {
  position: absolute;
  left: 0;
  right: 0;
  top: 270px;
  bottom: 0;
  z-index: 5;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.kids-photo-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  display: block;
  padding: 12px 12px calc(102px + env(safe-area-inset-bottom) + var(--kb,0px));
}
.kids-photo-content-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 16px 14px 18px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 27px;
  background:
    radial-gradient(circle at 24% 0,rgba(255,255,255,.72),transparent 38%),
    rgba(255,248,233,.94);
  box-shadow: 0 10px 28px rgba(65,40,17,.24),inset 0 1px 0 #fff;
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
}
.kids-photo-page > .kids-nav-v3 {
  z-index: 1200;
  background: rgba(255,250,239,.97);
  box-shadow: 0 10px 28px rgba(45,30,15,.3);
}
.kids-photo-title {
  margin: 0 0 2px;
  color: #5a351a;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 800;
  text-align: center;
  letter-spacing: .05em;
}
.kids-photo-price {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #573317;
}
.kids-photo-price > span { font-size: 28px; font-weight: 800; }
.kids-photo-price .kids-photo-amount {
  width: 200px;
  height: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #573317;
  font: 800 45px/1 "M PLUS Rounded 1c",sans-serif;
  letter-spacing: .04em;
  text-align: center;
  box-shadow: none;
  outline: none;
}
.kids-photo-amount::-webkit-inner-spin-button { -webkit-appearance: none; }
.kids-photo-categories {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 7px;
}
.kids-photo-category {
  height: 48px;
  min-width: 0;
  border: 1px solid #ead6b4;
  border-radius: 12px;
  background: linear-gradient(180deg,#fffaf0,#f9edd5);
  color: #684623;
  box-shadow: 0 3px 8px rgba(92,59,20,.08),inset 0 1px 0 #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: inherit;
}
.kids-line-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  color: currentColor;
}
.kids-line-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kids-photo-category .kids-line-icon { width: 19px; height: 19px; }
.kids-photo-category strong { font-size: 10px; white-space: nowrap; }
.kids-photo-category.active {
  border-color: #ef9e18;
  background: linear-gradient(180deg,#ffb12b,#f19109);
  color: #fff;
  box-shadow: 0 4px 10px rgba(229,133,4,.28),inset 0 1px 0 rgba(255,255,255,.54);
}
.kids-photo-wide-row,
.kids-photo-primary,
.kids-photo-secondary,
.kids-photo-next-row,
.kids-photo-history-row {
  width: 100%;
  min-height: 50px;
  border-radius: 13px;
  font-family: inherit;
  font-weight: 800;
}
.kids-photo-wide-row {
  border: 1px solid #ead7b5;
  background: linear-gradient(180deg,#fffaf0,#faefd9);
  color: #684623;
  box-shadow: 0 3px 8px rgba(92,59,20,.1),inset 0 1px 0 #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 14px;
}
.kids-photo-ocr-quota {
  display: block;
  margin: -5px 4px 1px;
  color: #9a7446;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}
.kids-photo-row-icon { width: 20px; height: 20px; color: #8b5d2a; }
.kids-photo-detected {
  display: none;
  margin: -5px 6px 0;
  color: #4e8c3b;
  font-size: 9.5px;
  font-weight: 800;
  text-align: right;
}
.kids-photo-detected.show { display: block; }
.kids-photo-info-box {
  overflow: hidden;
  border: 1px solid #ead7b5;
  border-radius: 13px;
  background: rgba(255,250,239,.76);
  box-shadow: 0 3px 9px rgba(92,59,20,.07),inset 0 1px 0 #fff;
}
.kids-photo-info-row {
  width: 100%;
  min-height: 45px;
  padding: 0 11px;
  border: 0;
  border-bottom: 1px solid #eadcc4;
  background: transparent;
  color: #674522;
  display: grid;
  grid-template-columns: 24px 48px minmax(0,1fr) 14px;
  align-items: center;
  gap: 9px;
  font-family: inherit;
  text-align: left;
}
.kids-photo-info-row:last-child { border-bottom: 0; }
.kids-photo-info-row strong { font-size: 12px; }
.kids-photo-destinations-row {
  padding: 10px 11px 12px;
  background: rgba(255,250,239,.35);
}
.kids-destination-head {
  min-height: 28px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 9px;
  color: #674522;
}
.kids-destination-head strong { font-size: 12px; }
.kids-destination-summary {
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff0ce;
  color: #9b661d;
  font-size: 8px;
  font-weight: 900;
}
.kids-destination-summary.empty { background: #f8e1dd; color: #a65349; }
.kids-destination-options {
  margin-top: 7px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 6px;
}
.kids-destination-option {
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #ead7b5;
  border-radius: 11px;
  background: #fffaf0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #704b27;
  font-size: 9px;
  font-weight: 800;
}
.kids-destination-option:has(input:checked) {
  border-color: #efa42d;
  background: #fff0cf;
  box-shadow: inset 0 0 0 1px rgba(239,164,45,.2);
}
.kids-destination-option input {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: #eb961c;
}
.kids-destination-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kids-photo-payer-panel {
  padding: 10px 11px 12px;
  border-top: 1px solid #eadcc4;
  background: rgba(255,248,234,.55);
}
.kids-payer-title {
  min-height: 28px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 9px;
  color: #674522;
}
.kids-payer-title strong { font-size: 12px; }
.kids-payer-row {
  min-height: 39px;
  margin-top: 7px;
  display: grid;
  grid-template-columns: minmax(72px,.8fr) minmax(0,1.4fr);
  align-items: center;
  gap: 8px;
  color: #80603b;
  font-size: 9px;
  font-weight: 800;
}
.kids-payer-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kids-payer-row select {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 28px 0 10px;
  border: 1px solid #e1c99f;
  border-radius: 11px;
  background-color: #fffaf0;
  color: #704b27;
  font: 800 10px "M PLUS Rounded 1c",sans-serif;
}
.kids-payer-loading {
  margin-top: 7px;
  padding: 10px;
  border: 1px dashed #dfc69d;
  border-radius: 10px;
  color: #98784e;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}
.kids-photo-row-value,
.kids-photo-native-input {
  min-width: 0;
  margin-left: 0;
  color: #704b27;
  font: 700 10px "M PLUS Rounded 1c",sans-serif;
  text-align: right;
}
.kids-photo-native-input {
  width: 100%;
  max-width: none;
  height: 34px;
  padding: 2px 4px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.kids-photo-items-block {
  padding: 10px 11px 11px;
  border-bottom: 1px solid #eadcc4;
  color: #674522;
  display: grid;
  grid-template-columns: 24px 48px minmax(0,1fr);
  align-items: center;
  gap: 7px 9px;
}
.kids-photo-items-block > strong { font-size: 12px; }
.kids-photo-items-help {
  justify-self: end;
  color: #8b7659;
  font-size: 7.5px;
  font-weight: 800;
}
.kids-photo-item-list {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid #ead7b5;
  border-radius: 11px;
  background: rgba(255,255,255,.54);
}
.kids-photo-item-row {
  min-height: 47px;
  padding: 6px 7px 6px 10px;
  border-bottom: 1px solid #eee0c8;
  display: grid;
  grid-template-columns: minmax(0,1fr) 104px;
  align-items: center;
  gap: 8px;
}
.kids-photo-item-row:last-child { border-bottom: 0; }
.kids-photo-item-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.kids-photo-item-name strong {
  overflow: hidden;
  font-size: 9.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kids-photo-manual-item-name {
  width: 100%;
  min-width: 0;
  height: 29px;
  margin: 0;
  padding: 3px 7px;
  border: 1px solid #e4cca4;
  border-radius: 8px;
  outline: 0;
  background: #fffdf7;
  color: #674522;
  font: 800 9.5px "M PLUS Rounded 1c",sans-serif;
}
.kids-photo-manual-item-name:focus {
  border-color: #efa42d;
  box-shadow: 0 0 0 2px rgba(239,164,45,.12);
}
.kids-photo-manual-item-name::placeholder { color: #a9967d; }
.kids-photo-item-name small {
  margin-top: 2px;
  color: #9a805f;
  font-size: 7.5px;
  font-weight: 750;
}
.kids-photo-item-genre {
  width: 104px;
  height: 31px;
  padding: 3px 21px 3px 8px;
  border: 1px solid #e4cca4;
  border-radius: 9px;
  outline: 0;
  background-color: #fffaf0;
  color: #704b27;
  font: 800 8.5px "M PLUS Rounded 1c",sans-serif;
}
.kids-photo-item-genre:focus,
.kids-photo-item-genre.changed {
  border-color: #efa42d;
  background-color: #fff0cf;
}
/* 明細の ✕（いらない商品を消す）。行の右はしの小さい丸ボタン。 */
.kids-photo-item-row.has-delete {
  grid-template-columns: minmax(0,1fr) 104px 26px;
  gap: 6px;
  padding-right: 6px;
}
.kids-photo-item-remove {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #ecc9c2;
  border-radius: 50%;
  background: #fff7f4;
  color: #b0544a;
  font: 800 11px "M PLUS Rounded 1c",sans-serif;
  line-height: 1;
  display: grid;
  place-items: center;
}
.kids-photo-item-remove:active { background: #ffe6df; }
.kids-photo-item-empty {
  padding: 15px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  color: #8b7659;
}
.kids-photo-item-empty strong { font-size: 11px; color: #a8583f; }
.kids-photo-item-empty small { font-size: 8.5px; font-weight: 750; }
.kids-photo-item-manual-back {
  min-height: 30px;
  margin-top: 4px;
  padding: 0 12px;
  border: 1px solid #e4cca4;
  border-radius: 9px;
  background: #fffaf0;
  color: #704b27;
  font: 800 9.5px "M PLUS Rounded 1c",sans-serif;
}
/* 読み取れなかった商品を足す「＋ 品目をついか」（明細リストの末尾） */
.kids-photo-item-add {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-top: 1px dashed #e6d2ae;
  border-radius: 0 0 10px 10px;
  background: rgba(255,247,232,.86);
  color: #8a5c25;
  font: 800 10px "M PLUS Rounded 1c",sans-serif;
  text-align: center;
}
.kids-photo-item-add:active { background: #ffeecd; }
.kids-photo-chevron { margin-left: 2px; font-size: 18px; color: #9a784f; }
.kids-record-mode-switch {
  align-self: center;
  display: grid;
  grid-template-columns: repeat(2,1fr);
  width: 178px;
  padding: 3px;
  border: 1px solid rgba(224,197,154,.9);
  border-radius: 999px;
  background: rgba(239,221,190,.72);
}
.kids-record-mode-switch button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8a6841;
  font: 800 10px "M PLUS Rounded 1c",sans-serif;
}
.kids-record-mode-switch button.active {
  background: #fffaf0;
  color: #714514;
  box-shadow: 0 2px 7px rgba(96,57,15,.12);
}
.kids-entry-type-switch {
  align-self: center;
  width: min(100%,260px);
  min-height: 54px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) 42px;
  align-items: center;
  border: 1px solid #ead6b4;
  border-radius: 18px;
  background: linear-gradient(180deg,rgba(255,253,247,.96),rgba(250,237,213,.96));
  box-shadow: 0 4px 12px rgba(92,59,20,.09),inset 0 1px 0 #fff;
  color: #603b1c;
  touch-action: pan-y;
}
.kids-entry-type-switch.income {
  border-color: #bbdfca;
  background: linear-gradient(180deg,rgba(248,255,250,.98),rgba(225,244,232,.96));
  color: #286c49;
}
.kids-entry-arrow {
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 500 30px/1 system-ui,sans-serif;
}
.kids-entry-type-label {
  min-width: 0;
  text-align: center;
}
.kids-entry-type-label span,
.kids-entry-type-label small {
  display: block;
}
.kids-entry-type-label span {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .05em;
}
.kids-entry-type-label small {
  margin-top: 2px;
  color: #9a7853;
  font-size: 8px;
  font-weight: 800;
}
.kids-entry-type-switch.income .kids-entry-type-label small { color: #65917a; }
.kids-photo-price.income { color: #28714c; }
.kids-photo-price.income .kids-photo-amount { color: #28714c; }
.kids-income-name-row {
  grid-template-columns: 24px 48px minmax(0,1fr) 30px;
}
.kids-income-name-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #674522;
  font: 800 11px "M PLUS Rounded 1c",sans-serif;
  box-shadow: none;
  outline: none;
}
.kids-income-name-input::placeholder { color: #b49d82; font-weight: 700; }
.kids-photo-optional {
  color: #a98b66;
  font-size: 8px;
  font-weight: 800;
  text-align: right;
}
.kids-income-note {
  margin: -2px 4px 0;
  color: #8e7659;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.55;
  text-align: center;
}
.kids-photo-primary {
  border: 1px solid #f0a41d;
  background: linear-gradient(180deg,#ffad25,#ef8a05);
  color: #fff;
  box-shadow: 0 5px 12px rgba(213,119,4,.3),inset 0 1px 0 rgba(255,255,255,.55);
  font-size: 16px;
  text-shadow: 0 1px 1px rgba(134,72,0,.25);
}
.kids-photo-primary:disabled {
  filter: grayscale(.6);
  opacity: .5;
  box-shadow: none;
}

/* Savings screen */
.kids-photo-goal-select {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #ead7b5;
  border-radius: 10px;
  background: #fffaf0;
  color: #684623;
  font: 800 13px/20px "M PLUS Rounded 1c",sans-serif;
  box-sizing: border-box;
}
.kids-photo-goal-card {
  min-height: 150px;
  padding: 17px 15px;
  border: 1px solid #ead5b1;
  border-radius: 18px;
  background: rgba(255,250,239,.83);
  box-shadow: 0 4px 12px rgba(92,59,20,.1),inset 0 1px 0 #fff;
  display: flex;
  align-items: center;
  gap: 16px;
}
.kids-photo-goal-emoji {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(95,57,17,.14));
}
.kids-photo-goal-main { min-width: 0; flex: 1; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px; }
.kids-photo-goal-name { grid-column: 1 / -1; font-size: 12px; text-align: center; }
.kids-photo-goal-numbers { font-size: 18px; font-weight: 800; white-space: nowrap; }
.kids-photo-goal-percent { font-size: 18px; }
.kids-photo-progress {
  grid-column: 1 / -1;
  height: 10px;
  margin-top: 8px;
  border: 1px solid #dac7a6;
  border-radius: 999px;
  overflow: hidden;
  background: #eadfc9;
}
.kids-photo-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#ffae25,#ef920e); }
.kids-goal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: -4px;
}
.kids-goal-action {
  min-height: 40px;
  border: 1px solid #dec9a6;
  border-radius: 12px;
  background: rgba(255,250,239,.88);
  color: #75512d;
  font: 800 12px "M PLUS Rounded 1c",sans-serif;
  box-shadow: 0 2px 7px rgba(92,59,20,.08);
}
.kids-goal-action.delete { color: #a74a42; border-color: #e5c0ba; }
.kids-goal-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px max(14px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
  background: rgba(49,31,13,.46);
  backdrop-filter: blur(5px);
}
.kids-goal-edit-sheet {
  width: min(430px,100%);
  max-height: min(82vh,720px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 24px;
  background: linear-gradient(180deg,#fffaf0,#f8ecd5);
  color: #684623;
  box-shadow: 0 18px 48px rgba(54,32,9,.28);
}
.kids-goal-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.kids-goal-edit-head span { color: #a27b4a; font-size: 10px; font-weight: 800; }
.kids-goal-edit-head h2 { margin: 2px 0 0; font-size: 22px; }
.kids-goal-edit-close {
  width: 36px;
  height: 36px;
  border: 1px solid #e2ceb0;
  border-radius: 50%;
  background: #fffaf0;
  color: #805c34;
  font-size: 22px;
  line-height: 1;
}
.kids-goal-edit-field { display: grid; gap: 6px; margin: 0 0 12px; }
.kids-goal-edit-field > span { color: #8a6337; font-size: 11px; font-weight: 800; }
.kids-goal-edit-field > input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #e1ccaa;
  border-radius: 12px;
  background: #fffdf7;
  color: #654522;
  font: 800 15px "M PLUS Rounded 1c",sans-serif;
  box-sizing: border-box;
}
.kids-goal-edit-buttons { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; margin-top: 16px; }
.kids-goal-edit-buttons button {
  min-height: 48px;
  border-radius: 13px;
  font: 800 13px "M PLUS Rounded 1c",sans-serif;
}
.kids-goal-edit-cancel { border: 1px solid #ddc7a5; background: #fffaf0; color: #79552e; }
.kids-goal-edit-save {
  border: 1px solid #ed9814;
  background: linear-gradient(180deg,#ffad25,#ef8a05);
  color: #fff;
  box-shadow: 0 5px 12px rgba(213,119,4,.25);
}
.kids-photo-quick-amounts { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.kids-photo-quick-amounts button,
.kids-photo-quick-amounts input {
  min-width: 0;
  height: 49px;
  border: 1px solid #ead7b5;
  border-radius: 12px;
  background: linear-gradient(180deg,#fffaf0,#f9edd5);
  color: #684623;
  font: 800 14px "M PLUS Rounded 1c",sans-serif;
  text-align: center;
  box-shadow: 0 3px 8px rgba(92,59,20,.08);
}
.kids-photo-quick-amounts button.active { border-color: #eda021; box-shadow: inset 0 0 0 2px #ffc55c; }
.kids-photo-next-row,
.kids-photo-history-row {
  border: 1px solid #ead7b5;
  background: rgba(255,250,239,.78);
  color: #684623;
  display: grid;
  grid-template-columns: 28px 1fr 18px;
  align-items: center;
  text-align: left;
  padding: 0 12px;
  font-size: 11px;
}
.kids-photo-next-row span:first-child { font-size: 20px; }
.kids-photo-next-row b,
.kids-photo-history-row b { text-align: right; font-size: 17px; color: #a17d50; }
.kids-photo-manage {
  border: 1px solid #ead7b5;
  border-radius: 12px;
  background: rgba(255,250,239,.64);
}
.kids-photo-manage > summary {
  padding: 11px 13px;
  color: #8a6337;
  font-size: 10px;
  font-weight: 800;
  list-style: none;
}
.kids-photo-manage-body { display: flex; flex-direction: column; gap: 9px; padding: 0 10px 10px; }
.kids-photo-manage-body input { height: 42px; border: 1px solid #ead7b5; border-radius: 10px; background: #fffaf0; }
.kids-photo-secondary { border: 1px solid #d9bd91; background: #fff8e9; color: #684623; }
.kids-goal-icon-label { color: #8a6337; font-size: 10px; font-weight: 800; }
.kids-goal-icon-picker {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 5px;
}
.kids-goal-icon-option {
  min-width: 0;
  aspect-ratio: 1;
  padding: 5px;
  border: 1px solid #ead7b5;
  border-radius: 10px;
  background: #fffaf0;
  color: #79552e;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: inherit;
}
.kids-goal-icon-option img { width: 100%; height: 100%; max-width: 50px; max-height: 50px; object-fit: contain; }
.kids-goal-icon-option.active {
  border-color: #ef9e18;
  background: #fff0cf;
  box-shadow: inset 0 0 0 1px #ffc45d;
}
.kids-goal-icon-option.locked {
  position: relative;
  filter: saturate(.58);
  opacity: .72;
}
.kids-goal-icon-lock {
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(83,55,29,.9);
  color: #fff8e8;
  font-size: 9px;
  line-height: 1;
}
.kids-photo-item-price-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #ead7b5;
  border-radius: 8px;
  background: #fffaf0;
  color: #79552e;
  font: 700 11px "M PLUS Rounded 1c",sans-serif;
  box-sizing: border-box;
}
.kids-record-delete {
  min-height: 44px;
  border: 1px solid #e5b9b2;
  border-radius: 12px;
  background: rgba(255,247,244,.9);
  color: #a8423a;
  font: 800 12px "M PLUS Rounded 1c",sans-serif;
}
.rc-edit-button {
  width: 100%;
  min-height: 40px;
  margin-top: 10px;
  border: 1px solid #ddc7a5;
  border-radius: 11px;
  background: linear-gradient(180deg,#fffaf0,#f8ecd5);
  color: #714d28;
  font: 800 12px "M PLUS Rounded 1c",sans-serif;
}

/* 着せ替え選択（2026-07-31 再編）: 服だけの画像ではなく「着たマネコ」全身像を並べる。
   3列＋高めのサムネ枠で、小さい画面でも顔と衣装が見分けられるサイズにしている。 */
.costume-group-title {
  margin: 14px 0 6px;
  color: #7b5731;
  font-size: 12px;
  font-weight: 900;
}
.costume-group-title:first-of-type { margin-top: 8px; }
.costume-locked-note { margin: 0 0 8px; }
.season-costume-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 7px;
}
.season-costume-option {
  position: relative;
  min-width: 0;
  padding: 6px 5px 6px;
  border: 1px solid #ead7b5;
  border-radius: 14px;
  background: #fffaf0;
  color: #79552e;
  display: grid;
  grid-template-rows: 138px auto;
  justify-items: center;
  gap: 3px;
  font-family: inherit;
}
.season-costume-option img {
  width: 100%;
  height: 138px;
  /* 全身像なので contain。足元を枠の下端に置き、上の余白（帽子ぶん）を逃がす。 */
  object-fit: contain;
  object-position: center bottom;
}
.season-costume-option span { font-size: 9px; font-weight: 800; line-height: 1.25; text-align: center; }
.season-costume-option b {
  position: absolute;
  right: 7px;
  top: 7px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(83,55,29,.88);
  color: white;
  font-size: 10px;
}
.season-costume-option.active {
  border: 2px solid #ef9e18;
  padding: 7px 6px 6px;
  background: #fff0cf;
  box-shadow: inset 0 0 0 2px #ffc45d,0 4px 10px rgba(202,116,8,.18);
}
.season-costume-option.active::after {
  content: "✓ 選択中";
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 1;
  min-height: 19px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ef9814;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  line-height: 15px;
  box-shadow: 0 2px 5px rgba(121,70,10,.2);
}
.season-costume-option.locked { filter: saturate(.28); opacity: .68; }

/* 🎉 はじめて割（マネコプラス スタート・初月¥350）。購入カードの最上部に1枚だけ出す。 */
.iap-start-offer {
  margin: 12px 0 4px;
  padding: 14px 15px 12px;
  border-radius: 18px;
  border: 2px solid #ffbf4b;
  background: linear-gradient(155deg,#fff5da,#ffe7ae);
  box-shadow: 0 6px 16px rgba(191,120,16,.18);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.iap-start-offer-title { color: #8a5410; font-size: 15px; font-weight: 900; }
.iap-start-offer-lead { margin: 0; color: #6f4a1c; font-size: 11px; font-weight: 700; line-height: 1.55; }
.iap-start-offer-list { margin: 0; padding-left: 17px; color: #7a5423; font-size: 11px; font-weight: 700; }
.iap-start-offer-list li { margin: 2px 0; }
.iap-start-offer .iap-buy { width: 100%; margin-top: 2px; }
.iap-start-offer-note { color: #8b6a41; font-size: 9px; font-weight: 700; line-height: 1.5; }

/* Kids report: adult report information, reduced to one glance. */
.kids-report-summary {
  padding: 15px 17px;
  border-radius: 18px;
  background: linear-gradient(145deg,rgba(60,45,31,.96),rgba(43,35,28,.96));
  color: #fff9e9;
  box-shadow: 0 8px 18px rgba(45,29,15,.25);
  display: flex;
  flex-direction: column;
}
.kids-report-summary span { color: #d8c7ad; font-size: 10px; font-weight: 800; }
.kids-report-summary strong { margin: 2px 0; font-size: 30px; line-height: 1.2; }
.kids-report-summary small { color: #e7d9c3; font-size: 9px; font-weight: 700; }
.kids-report-wallet {
  padding: 13px 17px;
  border: 1px solid rgba(255,255,255,.84);
  border-radius: 18px;
  background: linear-gradient(145deg,rgba(255,250,235,.97),rgba(246,226,184,.96));
  color: #5c3a1c;
  box-shadow: 0 6px 16px rgba(64,40,15,.16),inset 0 1px 0 #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2px 12px;
}
.kids-report-wallet span {
  color: #947451;
  font-size: 10px;
  font-weight: 850;
}
.kids-report-wallet strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: #4d7b55;
  font-size: 24px;
  line-height: 1.2;
  text-align: right;
}
.kids-report-wallet small {
  color: #a08769;
  font-size: 7.5px;
  font-weight: 750;
}
.kids-report-card {
  padding: 13px;
  border: 1px solid #ead7b5;
  border-radius: 16px;
  background: rgba(255,250,239,.8);
  box-shadow: 0 3px 9px rgba(92,59,20,.08);
}
.kids-report-card h2 { margin: 0 0 10px; color: #654322; font-size: 12px; }
.kids-report-category-row {
  display: grid;
  grid-template-columns: 58px 1fr 66px;
  align-items: center;
  gap: 7px;
  margin: 8px 0;
}
.kids-report-category-row > span { font-size: 9px; font-weight: 800; }
.kids-report-category-row > div { height: 8px; overflow: hidden; border-radius: 999px; background: #eadfc9; }
.kids-report-category-row i { display: block; height: 100%; border-radius: inherit; background: var(--bar-color); }
.kids-report-category-row strong { text-align: right; font-size: 9px; }
.kids-report-trend {
  height: 116px;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  align-items: end;
  gap: 9px;
}
.kids-report-trend > div { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.kids-report-trend strong { width: 100%; overflow: hidden; color: #8a6841; font-size: 7px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.kids-report-trend i { width: 22px; max-height: 76px; margin: 4px 0; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg,#ffc155,#ec9015); }
.kids-report-trend span { color: #8a6841; font-size: 8px; font-weight: 800; }
.kids-report-record-button {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.kids-report-record-button .kids-line-icon { width: 18px; height: 18px; }
.kids-photo-content-card > .card {
  margin: 0;
  padding: 13px;
  border: 1px solid #ead7b5;
  border-radius: 16px;
  background: rgba(255,250,239,.88);
  box-shadow: 0 3px 9px rgba(92,59,20,.08);
}
.kids-photo-content-card > .card h2 {
  color: #654322;
  font-size: 12px;
}
.kids-photo-content-card .gr-row {
  grid-template-columns: 74px minmax(42px,1fr) 64px;
  gap: 6px;
}
.kids-photo-content-card .gr-chip { padding-inline: 5px; font-size: 9px; }
.kids-photo-content-card .gr-amount { font-size: 9px; }
.kids-photo-content-card .gr-percent { font-size: 8px; }
.kids-photo-content-card .chart-box.wide { height: 190px; }
.kids-photo-content-card .cal-head {
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) 32px;
  gap: 6px;
}
.kids-photo-content-card .cal-head h2 { text-align: center; }
.kids-photo-content-card .cal-head .spacer { display: none; }
.kids-photo-content-card .cal-month-total {
  grid-column: 1 / -1;
  text-align: right;
  font-size: 10px;
}
.kids-photo-content-card .cal-nav { padding: 3px; }
.kids-photo-content-card .cal-grid { gap: 2px; }
.kids-photo-content-card .cal-cell {
  min-width: 0;
  min-height: 46px;
  padding: 3px 1px;
}
.kids-photo-content-card .cal-d { font-size: 9px; }
.kids-photo-content-card .cal-t { font-size: 6.5px; }

/* Family screen */
.kids-family-connection { display: grid; grid-template-columns: 1fr 100px 1fr; align-items: center; margin: -3px 10px 0; }
.kids-family-person { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.kids-family-person img {
  width: 69px;
  height: 69px;
  object-fit: contain;
  border-radius: 50%;
  background: #f5dfb8;
  border: 3px solid #fff8e8;
  box-shadow: 0 3px 8px rgba(93,57,19,.18);
}
.kids-family-person strong { max-width: 90px; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kids-family-heart { display: flex; align-items: center; justify-content: center; gap: 4px; color: #bc8f58; }
.kids-family-heart b { color: #cc7b23; font-size: 22px; }
.kids-family-block {
  overflow: hidden;
  border: 1px solid #ead7b5;
  border-radius: 14px;
  background: rgba(255,250,239,.78);
  box-shadow: 0 3px 8px rgba(92,59,20,.08);
}
.kids-family-block-title { min-height: 31px; padding: 7px 12px 2px; color: #62401f; font-size: 12px; font-weight: 800; }
.kids-family-money-row {
  width: 100%;
  min-height: 48px;
  padding: 0 11px;
  border: 0;
  border-top: 1px solid #eadcc4;
  background: transparent;
  color: #674522;
  display: grid;
  grid-template-columns: 1fr auto 16px;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  text-align: left;
}
.kids-family-money-row span { font-size: 10px; }
.kids-family-money-row strong { color: #558a34; font-size: 17px; }
.kids-family-money-row b { color: #9b7d58; }
.kids-photo-empty { margin: 0; padding: 13px; color: #9a805f; font-size: 10px; text-align: center; }
.kids-photo-history-row span { font-size: 18px; }
.kids-family-manage .settings-drawer,
.kids-family-manage .card { background: #fffaf0; }

/* Family screen v2: settings-style navigation with role-aware actions */
.family-v2-router { min-height: 420px; }
.family-v2-summary {
  min-height: 88px;
  margin: 2px 0 10px;
  padding: 10px 13px;
  border: 1px solid rgba(234,215,181,.9);
  border-radius: 18px;
  background: linear-gradient(135deg,rgba(255,253,245,.94),rgba(255,235,201,.88));
  box-shadow: 0 7px 18px rgba(92,59,20,.12),inset 0 1px 0 #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}
.family-v2-summary img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(92,59,20,.18));
}
.family-v2-summary div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.family-v2-summary strong { color: #674522; font-size: 13px; }
.family-v2-summary small { color: #987953; font-size: 8px; font-weight: 700; line-height: 1.5; }
.family-v2-menu button { min-height: 52px; }
.family-v2-section-label {
  margin: 14px 4px 7px;
  color: #694721;
  font-size: 12px;
  letter-spacing: .04em;
}
.family-v2-detail-body > .card + .card { margin-top: 0; }
.family-v2-card > .family-v2-empty { padding: 11px 4px; }
.family-v2-member,
.family-v2-action-row,
.family-v2-history-row {
  min-width: 0;
  min-height: 50px;
  padding: 8px 0;
  border-top: 1px solid #eadcc4;
  display: flex;
  align-items: center;
  gap: 9px;
}
.family-v2-member:first-of-type,
.family-v2-action-row:first-of-type,
.family-v2-history-row:first-of-type { border-top: 0; }
.family-v2-avatar,
.family-v2-history-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  background: #f6e3bd;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.family-v2-member-copy,
.family-v2-action-row > span,
.family-v2-history-row > span:not(.family-v2-history-icon) {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.family-v2-member-copy strong,
.family-v2-action-row strong,
.family-v2-history-row strong {
  overflow: hidden;
  color: #684722;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.family-v2-member-copy small,
.family-v2-action-row small,
.family-v2-history-row small { color: #9b7e5b; font-size: 8px; font-weight: 700; }
.family-v2-role,
.family-v2-plan-badge {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f4dba7;
  color: #865d2b;
  font-size: 8px;
  white-space: nowrap;
}
.family-v2-member-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.family-v2-member .link-btn,
.family-v2-action-row .link-btn,
.family-v2-action-row .primary {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 10px;
  font-size: 8px;
  white-space: nowrap;
}
.family-v2-primary { width: 100%; }
.family-v2-invite-result {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.family-v2-invite-result:not(:empty) {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed #d5b378;
  border-radius: 14px;
  background: rgba(255,250,238,.8);
}
.family-v2-code-label { color: #987953; font-size: 8px; font-weight: 800; }
.family-v2-code { color: #5e3b19; font-size: 24px; letter-spacing: .16em; }
.family-v2-invite-result small { color: #9a7a53; font-size: 8px; }
.family-v2-url {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
}
.family-v2-join { display: flex; flex-direction: column; gap: 8px; }
.family-v2-join input { text-align: center; text-transform: uppercase; letter-spacing: .12em; }
.family-v2-history-row > b {
  color: #7f633f;
  font-size: 10px;
  white-space: nowrap;
}
.family-v2-history-row > b.plus { color: #4d8d45; }
.family-v2-history-row > b.minus { color: #c66c4b; }
.family-v2-plan {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg,#fffaf0,#ffe1aa) !important;
}
.family-v2-plan::after {
  content: "＋";
  position: absolute;
  right: -8px;
  top: -24px;
  color: rgba(219,139,43,.12);
  font-size: 96px;
  font-weight: 900;
}
.family-v2-plan-badge { position: relative; z-index: 1; display: inline-block; margin-bottom: 6px; }
.family-v2-plan-price {
  position: relative;
  z-index: 1;
  margin: 8px 0;
  color: #69431c;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.family-v2-plan-price strong { font-size: 18px; }
.family-v2-plan-price span { font-size: 10px; font-weight: 800; }
.family-v2-coming {
  position: relative;
  z-index: 1;
  padding: 9px;
  border-radius: 11px;
  background: rgba(255,255,255,.55);
  color: #8b6a42;
  font-size: 8px;
  font-weight: 750;
  line-height: 1.5;
  text-align: center;
}

/* Settings screen */
.kids-photo-settings-menu {
  overflow: hidden;
  border: 1px solid #ead7b5;
  border-radius: 14px;
  background: rgba(255,250,239,.82);
  box-shadow: 0 4px 12px rgba(92,59,20,.1),inset 0 1px 0 #fff;
}
.kids-photo-settings-menu button {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 0;
  border-bottom: 1px solid #eadcc4;
  background: transparent;
  color: #674522;
  display: grid;
  grid-template-columns: 28px 1fr 16px;
  align-items: center;
  text-align: left;
  font-family: inherit;
}
.kids-photo-settings-menu button:last-child { border-bottom: 0; }
.kids-photo-settings-menu button span { font-size: 18px; }
.kids-photo-settings-menu button strong { font-size: 12px; }
.kids-photo-settings-menu button b { font-size: 17px; color: #9a784f; }
.kids-settings-menu-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.kids-photo-settings-menu button .kids-settings-menu-copy strong { font-size: 12px; }
.kids-photo-settings-menu button .kids-settings-menu-copy small {
  overflow: hidden;
  color: #9b7e5b;
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kids-settings-router {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  transition: height .32s cubic-bezier(.22,.72,.28,1);
}
.kids-settings-pane {
  width: 100%;
  transition: opacity .3s ease, transform .34s cubic-bezier(.22,.72,.28,1);
  will-change: opacity,transform;
}
.kids-settings-top {
  position: relative;
  opacity: 1;
  transform: translateX(0);
}
.kids-settings-detail {
  position: absolute;
  left: 0;
  top: 0;
  opacity: .5;
  pointer-events: none;
  transform: translateX(104%);
}
.kids-settings-router.show-detail .kids-settings-top {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-28%);
}
.kids-settings-router.show-detail .kids-settings-detail {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.kids-settings-detail-head {
  min-height: 36px;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
}
.kids-settings-detail-head .kids-photo-title {
  margin: 0;
  text-align: center;
}
.kids-settings-back {
  width: 34px;
  height: 34px;
  padding: 0 0 3px;
  border: 1px solid #e4cfaa;
  border-radius: 50%;
  background: rgba(255,250,239,.92);
  color: #815a30;
  box-shadow: 0 3px 8px rgba(92,59,20,.1);
  font: 800 26px/1 "M PLUS Rounded 1c",sans-serif;
}
.kids-photo-legal { display: flex; justify-content: center; gap: 12px; margin: 7px 0; color: #9d805a; font-size: 9px; }
.kids-photo-legal a { color: inherit; text-decoration: none; }
.kids-photo-settings-details {
  border: 0;
  border-radius: 18px;
  background: transparent;
}
.kids-photo-settings-details > summary {
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid #ead7b5;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,253,246,.95), rgba(255,244,223,.91));
  box-shadow: 0 6px 16px rgba(92,59,20,.12), inset 0 1px 0 #fff;
  color: #694621;
  display: grid;
  grid-template-columns: 38px 1fr 20px;
  align-items: center;
  gap: 9px;
  list-style: none;
  cursor: pointer;
}
.kids-photo-settings-details > summary::-webkit-details-marker { display: none; }
.kids-settings-summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(145deg, #eba85a, #c87223);
  box-shadow: 0 3px 8px rgba(166,91,24,.25), inset 0 1px 0 rgba(255,255,255,.45);
  color: #fffaf0;
  display: grid;
  place-items: center;
  font-size: 18px;
  text-shadow: 0 1px 2px rgba(87,46,12,.25);
}
.kids-settings-summary-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kids-settings-summary-copy strong { font-size: 12px; }
.kids-settings-summary-copy small { color: #9a7a53; font-size: 8.5px; font-weight: 650; }
.kids-photo-settings-details > summary > b {
  color: #a17d52;
  font-size: 18px;
  text-align: center;
  transition: transform .2s ease;
}
.kids-photo-settings-details[open] > summary > b { transform: rotate(180deg); }
.kids-photo-settings-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px 0 0;
}
.kids-photo-settings-body > .card {
  margin: 0;
  padding: 13px;
  border: 1px solid #ead7b5;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,253,246,.94), rgba(255,246,228,.9));
  box-shadow: 0 5px 14px rgba(92,59,20,.1), inset 0 1px 0 #fff;
}
.kids-photo-settings-body > .card h2 {
  margin: 0 0 5px;
  color: #66431f;
  font-size: 13px;
}
.kids-photo-settings-body > .card .muted {
  margin: 3px 0 9px;
  color: #9a7a53;
  font-size: 9px;
  line-height: 1.55;
}
.kids-settings-tutorial-button {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  border: 1px solid #e2cda6;
  border-radius: 13px;
  background: rgba(255,249,235,.96);
  color: #79552e;
  font: 800 10px "M PLUS Rounded 1c",sans-serif;
}
.kids-photo-settings-body > .card > .row {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
}
.kids-photo-settings-body > .card .field {
  width: 100%;
  gap: 4px;
  color: #7e5c35;
  font-size: 9px;
  font-weight: 800;
}
.kids-photo-settings-body > .card input,
.kids-photo-settings-body > .card select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #e7d3af;
  border-radius: 12px;
  background: rgba(255,253,247,.94);
  color: #62401f;
  box-shadow: inset 0 1px 3px rgba(91,57,20,.07);
  font-family: inherit;
}
.kids-photo-settings-body > .card button,
.kids-photo-settings-body > .card .link-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
}
.kids-photo-settings-body > .card button.primary {
  border: 1px solid #cc761f;
  background: linear-gradient(145deg, #f1aa52, #d47a24);
  box-shadow: 0 3px 8px rgba(166,91,24,.2), inset 0 1px 0 rgba(255,255,255,.4);
  color: #fff;
}
.kids-photo-settings-body > .card .link-btn {
  border: 1px solid #e3cda9;
  background: rgba(255,249,237,.92);
  color: #76502a;
}
.kids-photo-settings-body > .card .link-btn.danger {
  border-color: #e8c3b4;
  color: #ae543c;
}
.kids-settings-toggle-row {
  min-height: 58px;
  padding: 8px 0;
  border-top: 1px solid #eadcc4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.kids-settings-toggle-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kids-settings-toggle-copy strong { color: #694621; font-size: 10px; }
.kids-settings-toggle-copy small { color: #9a7a53; font-size: 8px; line-height: 1.4; }
.kids-settings-switch {
  position: relative;
  width: 43px;
  height: 26px;
  flex: 0 0 auto;
}
.kids-photo-settings-body > .card .kids-settings-switch input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 43px;
  min-height: 26px;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.kids-settings-switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8c8ae;
  box-shadow: inset 0 1px 3px rgba(84,54,21,.14);
  transition: background .2s ease;
}
.kids-settings-switch i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fffdf7;
  box-shadow: 0 2px 5px rgba(75,49,21,.24);
  transition: transform .2s ease;
}
.kids-settings-switch input:checked + i { background: #e99a2e; }
.kids-settings-switch input:checked + i::after { transform: translateX(17px); }

body.maneko-reduce-motion *,
body.maneko-reduce-motion *::before,
body.maneko-reduce-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}

@media (max-height: 760px) {
  .kids-photo-sheet { top: 208px; }
  .kids-photo-record .kids-photo-scene-maneko,
  .kids-photo-report .kids-photo-scene-maneko { top: 18px; }
  .kids-photo-savings .kids-photo-scene-maneko,
  .kids-photo-family .kids-photo-scene-maneko { top: 14px; }
  .kids-photo-settings .kids-photo-scene-maneko { top: -5px; }
}

/* Home proportions from the approved single-screen concept. */
.kids-home-v3-header {
  left: 18px;
  right: auto;
  top: calc(62px + env(safe-area-inset-top));
}
.kids-map-chip {
  position: absolute;
  right: 17px;
  top: calc(242px + env(safe-area-inset-top));
  z-index: 20;
  width: 57px;
  height: 57px;
  min-height: 57px;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  font-size: 27px;
}
.kids-goal-carousel {
  position: absolute;
  left: 18px;
  top: calc(145px + env(safe-area-inset-top));
  z-index: 20;
  width: 260px;
  transition: opacity .24s ease, transform .24s ease;
}
.kids-goal-swipe {
  display: flex;
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  border-radius: 17px;
}
.kids-goal-swipe::-webkit-scrollbar { display: none; }
.kids-goal-strip {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 9px 12px 8px 53px;
  border-radius: 17px;
}
.kids-goal-dots {
  position: absolute;
  left: 50%;
  top: calc(100% + 5px);
  display: flex;
  gap: 4px;
  transform: translateX(-50%);
}
.kids-goal-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,250,239,.64);
  box-shadow: 0 1px 3px rgba(39,25,12,.28);
  transition: width .18s ease, background .18s ease;
}
.kids-goal-dots i.active {
  width: 13px;
  border-radius: 999px;
  background: #ffad25;
}
.kids-goal-icon {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.kids-goal-strip .kids-goal-track i {
  background: linear-gradient(90deg,#ffad25,#ef920e);
  box-shadow: 0 0 8px rgba(239,146,14,.28);
}
.kids-goal-strip-top strong { font-size: 10px; }
.kids-goal-meta { font-size: 8.5px; }
.kids-town-open { inset: 0; }
.kids-maneko-v3 {
  bottom: 130px;
  width: 278px;
  height: 390px;
}
.kids-record-fab {
  right: auto;
  left: 50%;
  bottom: 122px;
  width: 88px;
  height: 88px;
  min-height: 88px;
  padding: 0;
  transform: translateX(-50%);
  border: 4px solid #fff3d3;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: radial-gradient(circle at 34% 25%,#ffc34b,#ed8e08 72%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124,68,2,.38),inset 0 0 0 2px #e7a224;
  text-shadow: 0 2px 2px rgba(132,70,0,.3);
}
.kids-record-fab span { font-size: 27px; line-height: 1; }
.kids-record-fab strong { font-size: 13px; }
/* 吹き出しは bottom 基準なので、行が増えると上へ伸びて「◯月のつかいみち」カードに潜り込む
   （実機は safe-area 分だけカードが下がるのでさらに近づく）。マネコの頭のすぐ上まで下げて、
   3〜4行でもカードと交差しない位置に置く。 */
.kids-bubble-v3 { bottom: 410px; }

.journey-v3-stage {
  width: 136px;
  max-width: 136px;
  min-height: 66px;
  padding: 7px 55px 7px 19px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 14px;
  background: rgba(255,249,235,.84);
  box-shadow: 0 6px 16px rgba(30,28,22,.2),inset 0 1px 0 #fff;
  color: #654426;
  text-shadow: none;
}
.journey-v3-stage span {
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
}
.journey-v3-stage strong { font-size: 10px; }
.journey-v3-stage > img {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 54px;
  height: 61px;
  object-fit: contain;
  object-position: bottom;
}
.journey-v3-stage.current { color: #9a5d07; border-color: #f2c66f; }
.journey-v3-stage.future { opacity: .76; }
.journey-v3-marker { width: 82px; }
.journey-v3-marker img { height: 106px; }

/* 認証画面 v2: マネコタウンの風景をそのまま入口にする */
body.theme-auth {
  height: 100%;
  overflow: hidden;
  background: #d8ebf1;
}
body.theme-auth main#app {
  display: block;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.auth-v2-page {
  --auth-ink: #54371f;
  --auth-muted: #94785a;
  --auth-line: #ead8ba;
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 460px;
  height: 100vh;
  height: 100dvh;
  min-height: 590px;
  margin: 0 auto;
  overflow: hidden;
  background: #ccdee2;
  color: var(--auth-ink);
  font-family: "M PLUS Rounded 1c", "Hiragino Sans", system-ui, sans-serif;
}
.auth-v2-scene {
  position: absolute;
  z-index: -4;
  inset: 0;
  background-image: url("/assets/kids/home-stage-2.webp");
  background-position: center 48%;
  background-size: cover;
  transform: scale(1.025);
  transition: background-image .3s ease, background-position .3s ease;
}
.auth-v2-page.is-register .auth-v2-scene {
  background-image: url("/assets/kids/home-stage-0.webp");
  background-position: center 43%;
}
.auth-v2-shade {
  position: absolute;
  z-index: -3;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(31,35,35,.34) 0%, rgba(31,35,35,.06) 30%, rgba(255,243,216,.02) 45%, rgba(71,43,17,.28) 100%);
}
.auth-v2-brand {
  position: absolute;
  z-index: 3;
  top: calc(25px + env(safe-area-inset-top));
  left: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(34,22,10,.46);
}
.auth-v2-brand img {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  box-shadow: 0 5px 14px rgba(55,29,4,.28);
}
.auth-v2-brand strong,
.auth-v2-brand small {
  display: block;
}
.auth-v2-brand strong {
  font-size: 16px;
  line-height: 1;
  letter-spacing: .08em;
}
.auth-v2-brand small {
  margin-top: 4px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .04em;
  opacity: .92;
}
.auth-v2-hero {
  position: absolute;
  z-index: 2;
  top: calc(83px + env(safe-area-inset-top));
  right: 24px;
  left: 24px;
  color: #fff;
  text-shadow: 0 3px 14px rgba(36,23,9,.58);
}
.auth-v2-eyebrow {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}
.auth-v2-hero h1 {
  max-width: 305px;
  margin: 5px 0 0;
  color: inherit;
  font-size: clamp(23px, 6.3vw, 27px);
  line-height: 1.28;
  letter-spacing: .02em;
}
.auth-v2-hero h1 span {
  display: block;
  white-space: nowrap;
}
.auth-v2-hero p {
  max-width: 230px;
  margin: 8px 0 0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.65;
}
.auth-v2-maneko {
  position: absolute;
  z-index: 1;
  top: calc(90px + env(safe-area-inset-top));
  right: -3px;
  width: 151px;
  height: auto;
  filter: drop-shadow(0 12px 14px rgba(68,37,6,.32));
  pointer-events: none;
  transition: width .25s ease, top .25s ease;
}
.auth-v2-page.is-register .auth-v2-maneko {
  top: calc(80px + env(safe-area-inset-top));
  right: 3px;
  width: 135px;
}
.auth-v2-sheet {
  position: absolute;
  z-index: 5;
  right: 12px;
  bottom: calc(11px + env(safe-area-inset-bottom));
  left: 12px;
  height: min(492px, calc(100vh - 205px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  height: min(492px, calc(100dvh - 205px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  min-height: 390px;
  max-height: 492px;
  margin: 0;
  padding: 18px 21px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 30px;
  background: linear-gradient(155deg, rgba(255,253,247,.97), rgba(255,245,225,.95));
  box-shadow:
    0 -7px 30px rgba(65,39,14,.17),
    0 18px 40px rgba(59,37,15,.25),
    inset 0 1px 0 #fff;
  color: var(--auth-ink);
  scrollbar-width: none;
  backdrop-filter: blur(19px) saturate(1.1);
  -webkit-backdrop-filter: blur(19px) saturate(1.1);
  transition: height .25s ease, max-height .25s ease;
}
.auth-v2-page.is-register .auth-v2-sheet {
  height: min(570px, calc(100vh - 130px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  height: min(570px, calc(100dvh - 130px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  max-height: 570px;
}
.auth-v2-sheet::-webkit-scrollbar {
  display: none;
}
.auth-v2-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 13px;
  border-radius: 999px;
  background: #ddc8a7;
  opacity: .75;
}
.auth-v2-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.auth-v2-sheet-head h2 {
  margin: 0;
  color: var(--auth-ink);
  font-size: 21px;
  line-height: 1.25;
}
.auth-v2-sheet-head p {
  margin: 5px 0 0;
  color: var(--auth-muted);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.55;
}
.auth-v2-step {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff0cb;
  color: #b56b0a;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}
.auth-v2-invite {
  margin: -4px 0 8px;
  padding: 7px 10px;
  border-radius: 11px;
  background: #fff0cc;
  color: #9c671e;
  font-size: 9px;
  font-weight: 850;
  text-align: center;
}
.auth-v2-field {
  display: block;
  margin-top: 10px;
}
.auth-v2-field[hidden],
.auth-v2-terms[hidden],
.auth-v2-secure[hidden] {
  display: none !important;
}
.auth-v2-field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 5px;
  color: #76593b;
  font-size: 9px;
  font-weight: 900;
}
.auth-v2-input {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1.5px solid var(--auth-line);
  border-radius: 15px;
  background: rgba(255,255,255,.9);
  box-shadow: inset 0 1px 3px rgba(104,70,27,.04);
}
.auth-v2-input:focus-within {
  border-color: #eca137;
  box-shadow: 0 0 0 3px rgba(236,161,55,.13);
}
.auth-v2-input-icon {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: #fff2d5;
  color: #b86e12;
  font-size: 10px;
  font-weight: 900;
}
.auth-v2-input input {
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: #58391e;
  font: 800 13px/1.3 inherit;
}
.auth-v2-input input:focus {
  outline: 0;
  box-shadow: none;
}
.auth-v2-input input::placeholder {
  color: #bca68a;
  opacity: 1;
}
.auth-v2-forgot,
.auth-v2-eye,
.auth-v2-switch-button {
  min-height: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.auth-v2-forgot {
  padding: 2px 0;
  color: #c77a13;
  font: 900 9px/1 inherit;
}
.auth-v2-eye {
  flex: 0 0 auto;
  padding: 5px 0 5px 5px;
  color: #aa9379;
  font-size: 12px;
  line-height: 1;
}
.auth-v2-terms {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 11px 2px 0;
  color: #9f8468;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.55;
}
.auth-v2-terms b {
  display: grid;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 5px;
  background: #ed9a20;
  color: #fff;
  font-size: 9px;
}
.auth-v2-terms a {
  color: #94622b;
}
.auth-v2-error {
  margin: 9px 2px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff0ee;
  color: #b6463d;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.45;
}
.auth-v2-sheet .auth-v2-primary {
  width: 100%;
  height: 50px;
  min-height: 50px;
  margin: 15px 0 0;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8b333, #e98614) !important;
  box-shadow: 0 9px 20px rgba(197,112,12,.27), inset 0 1px rgba(255,255,255,.45);
  color: #fff !important;
  font: 900 13px/1 inherit;
  letter-spacing: .03em;
}
.auth-v2-sheet .auth-v2-primary:active {
  transform: translateY(1px);
  filter: brightness(.98);
}
.auth-v2-sheet .auth-v2-primary:disabled {
  cursor: wait;
  filter: saturate(.55);
  opacity: .72;
}
.auth-v2-guest {
  width: 100%;
  min-height: 42px;
  margin-top: 9px;
  border: 1px solid rgba(174, 121, 56, .28);
  border-radius: 14px;
  background: rgba(255, 252, 244, .76);
  color: #76502c;
  font: 900 11px/1 inherit;
}
.auth-v2-guest:disabled {
  cursor: wait;
  opacity: .62;
}
.auth-v2-guest-note {
  margin: 6px 0 0;
  color: #a0876d;
  font-size: 7.5px;
  font-weight: 750;
  text-align: center;
}
.auth-v2-switch {
  margin: 13px 0 0;
  color: #8e7358;
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}
.auth-v2-switch-button {
  padding: 3px;
  color: #c9740c;
  font: 900 10px/1 inherit;
}
.auth-v2-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 11px;
  color: #ad9377;
  font-size: 7.5px;
  font-weight: 800;
}
.auth-v2-secure::before {
  content: "◆";
  color: #dfa135;
  font-size: 6px;
}
.guest-upgrade {
  display: grid;
  gap: 10px;
}
.guest-upgrade > img {
  width: 92px;
  height: 92px;
  margin: -16px auto -5px;
  object-fit: contain;
}
.guest-upgrade-reason {
  margin: 0;
  color: #5b3c22;
  font-weight: 900;
  line-height: 1.55;
  text-align: center;
}
.guest-upgrade .field,
.guest-upgrade .muted,
.guest-upgrade-terms {
  margin: 0;
}
.guest-upgrade input,
.guest-upgrade .primary {
  width: 100%;
}
.guest-upgrade-terms {
  color: #8e765f;
  font-size: 11px;
  line-height: 1.55;
}
.guest-upgrade-terms a {
  color: #a86210;
}
.guest-account-status {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff0cf;
  color: #9b6012;
  font-size: 12px;
  font-weight: 900;
}
.auth-v2-page.is-register .auth-v2-field {
  margin-top: 8px;
}
.auth-v2-page.is-register .auth-v2-input {
  height: 44px;
}
.auth-v2-page.is-register .auth-v2-sheet-head {
  margin-bottom: 11px;
}
.auth-v2-page.is-register .auth-v2-sheet .auth-v2-primary {
  margin-top: 12px;
}
.auth-v2-page.is-register .auth-v2-switch {
  margin-top: 9px;
}

@media (min-width: 461px) {
  body.theme-auth {
    background:
      linear-gradient(rgba(216,235,241,.76), rgba(216,235,241,.76)),
      url("/assets/kids/home-stage-2.webp") center / cover;
  }
  .auth-v2-page {
    box-shadow: 0 0 55px rgba(48,67,70,.28);
  }
}
@media (max-width: 370px) {
  .auth-v2-sheet {
    right: 9px;
    left: 9px;
    padding-right: 17px;
    padding-left: 17px;
  }
  .auth-v2-hero {
    left: 20px;
  }
  .auth-v2-hero h1 {
    max-width: 235px;
    font-size: 22px;
  }
  .auth-v2-maneko {
    right: -12px;
    width: 137px;
  }
}
@media (max-height: 700px) {
  .auth-v2-brand {
    top: calc(14px + env(safe-area-inset-top));
  }
  .auth-v2-hero {
    top: calc(69px + env(safe-area-inset-top));
  }
  .auth-v2-hero p {
    display: none;
  }
  .auth-v2-maneko {
    top: calc(63px + env(safe-area-inset-top));
    width: 128px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-v2-scene,
  .auth-v2-maneko,
  .auth-v2-sheet {
    transition: none;
  }
}

/* ======================================================================
   マネコタウン2.0 — 見下ろしタウンマップ（town-map.ts / P1-a）
   記録から建った建物をアイソメ配置で表示する。アセット未着の間はジャンル色の
   ブロック（.tm-ph）を描き、/assets/town/*.webp が読めたら .has-art で
   本物のスプライトへ自動で切り替わる。
   ====================================================================== */
.jr-overlay.tm-overlay {
  overflow: hidden;
  background: #29435f;
}
.tm-canvas {
  position: relative;
  width: min(100%, 47.3684dvh, 460px);
  height: 100dvh;
  min-height: 560px;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, #9ed2ef 0%, #cfe9f3 42%, #dcefdc 100%);
  color: #3d2f22;
  font-family: 'M PLUS Rounded 1c', sans-serif;
}
.tm-canvas.tm-activity-quiet { background: linear-gradient(180deg, #a9b8c4 0%, #cdd8de 45%, #d9e2d6 100%); }
.tm-canvas.tm-activity-festival { background: linear-gradient(180deg, #ffd9a0 0%, #cfe9f3 40%, #dcefdc 100%); }

.tm-header {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 14px 12px;
  background: linear-gradient(180deg, rgba(255,252,244,.94), rgba(255,252,244,0));
  pointer-events: none;
}
.tm-header > * { pointer-events: auto; }
.tm-back {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: rgba(255,250,239,.94);
  box-shadow: 0 6px 18px rgba(39,25,12,.18);
  color: #3d2f22;
  font-size: 17px;
  cursor: pointer;
}
.tm-title { display: flex; flex-direction: column; line-height: 1.2; }
.tm-title span { font-size: 9.5px; font-weight: 800; color: #7b684e; }
.tm-title strong { font-size: 16px; }
.tm-activity {
  margin-left: auto;
  padding: 6px 11px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px;
  background: rgba(255,250,239,.9);
  box-shadow: 0 6px 18px rgba(39,25,12,.14);
  font-size: 10.5px;
  font-weight: 800;
}

.tm-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}
.tm-viewport:active { cursor: grabbing; }
/* 位置合わせは JS の translate/scale がすべて担う（transform-origin は左上に固定）。
   ここで % マージンを使うと基準がビューポート幅になり中央寄せが崩れる。 */
.tm-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.tm-ground, .tm-buildings { position: absolute; inset: 0; }

/* 地面（CSSだけのアイソメグリッド。実寸は town-map.ts の TILE_W/TILE_H が入る） */
.tm-tile {
  position: absolute;
  background: #a9dd8d;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}
.tm-tile.alt { background: #9ed484; }
.tm-activity-quiet .tm-tile { background: #b5c7a9; }
.tm-activity-quiet .tm-tile.alt { background: #adc0a1; }

/* 建物（アンカーはタイル中央。足元がタイルの中心に来るように上へずらす） */
.tm-building {
  position: absolute;
  width: 96px;
  height: 104px;
  margin-left: -48px;
  margin-top: -86px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tm-building:focus-visible { outline: 3px solid #ffd54a; outline-offset: 3px; border-radius: 12px; }
.tm-shadow {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 70px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(40,60,30,.26);
  filter: blur(3px);
}
.tm-art {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 88px;
  height: 92px;
  transform: translateX(-50%);
  display: block;
}
.tm-art .tm-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  opacity: 0;
}
.tm-art.has-art .tm-img { opacity: 1; }
.tm-art.has-art .tm-ph { display: none; }

/* プレースホルダ（ジャンル色のブロック）。画像が置かれたら自動で消える。 */
.tm-ph {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 68px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tm-ph-roof {
  width: 0;
  height: 0;
  border-left: 34px solid transparent;
  border-right: 34px solid transparent;
  border-bottom: 22px solid var(--tm-roof);
}
.tm-ph-body {
  width: 58px;
  height: 46px;
  margin-top: -1px;
  border-radius: 4px 4px 6px 6px;
  background: var(--tm-color);
  box-shadow: inset 0 -9px 0 rgba(0,0,0,.14), inset 0 2px 0 rgba(255,255,255,.22), 0 5px 12px rgba(35,25,10,.22);
  display: grid;
  place-items: center;
}
.tm-ph-glyph { font-size: 20px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.28)); }
.tm-building.is-home .tm-ph-body { width: 64px; height: 52px; }

.tm-queue {
  position: absolute;
  right: 0;
  bottom: 6px;
  width: 28px;
  height: auto;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.28));
}
/* 屋根のすぐ上に置く（建物の上に浮きすぎるとどの店のバッジか分からなくなる） */
.tm-level {
  position: absolute;
  left: 4px;
  top: 14px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #fffaef;
  border: 1px solid rgba(120,90,40,.28);
  box-shadow: 0 3px 8px rgba(39,25,12,.2);
  font-size: 8.5px;
  font-weight: 900;
  color: #8a6a1f;
}
.tm-level[data-level="3"] { background: #ffe9b0; }
.tm-level[data-level="4"] { background: #ffd54a; }
/* 看板は建物に重ねる（アセット到着後は town-assets.json の看板領域へ移す） */
.tm-sign {
  position: absolute;
  left: 50%;
  bottom: 2px;
  max-width: 92px;
  padding: 1px 6px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: rgba(255,250,239,.95);
  border: 1px solid rgba(120,90,40,.24);
  box-shadow: 0 3px 8px rgba(39,25,12,.18);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-hint {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 25;
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,250,239,.88);
  box-shadow: 0 6px 18px rgba(39,25,12,.16);
  font-size: 10px;
  font-weight: 700;
  color: #7b684e;
  text-align: center;
  pointer-events: none;
  transition: opacity .2s ease;
}
.tm-sheet-open .tm-hint { opacity: 0; }

/* 建物カード（ボトムシート） */
.tm-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 0 10px calc(10px + env(safe-area-inset-bottom));
}
.tm-sheet[hidden] { display: none; }
.tm-card {
  position: relative;
  max-height: 62dvh;
  overflow-y: auto;
  padding: 14px 15px 16px;
  border-radius: 18px 18px 12px 12px;
  background: rgba(255,252,244,.97);
  box-shadow: 0 -8px 30px rgba(39,25,12,.24);
}
.tm-card-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.06);
  font-size: 13px;
  cursor: pointer;
}
.tm-card h3 { margin: 0 34px 2px 0; font-size: 17px; }
.tm-card-meta { margin: 0 0 8px; font-size: 11px; font-weight: 700; color: #7b684e; }
.tm-paws { display: flex; gap: 3px; margin-bottom: 10px; }
.tm-paws i { font-style: normal; font-size: 15px; opacity: .22; filter: grayscale(1); }
.tm-paws i.on { opacity: 1; filter: none; }
.tm-card-list ul { list-style: none; margin: 0; padding: 0; }
.tm-card-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px dashed rgba(120,90,40,.2);
  font-size: 11.5px;
}
.tm-card-list li span { min-width: 40px; color: #9b8667; font-weight: 700; }
.tm-card-list li b { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tm-card-list li i { font-style: normal; font-weight: 900; }
.tm-card-empty { margin: 4px 0; font-size: 11px; color: #9b8667; }
.tm-card-sign { margin-top: 12px; }
.tm-card-sign label { display: block; font-size: 11px; font-weight: 800; color: #7b684e; }
.tm-card-sign > div { display: flex; gap: 8px; margin-top: 6px; }
.tm-card-sign input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(120,90,40,.3);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 13px;
}
.tm-sign-save {
  padding: 9px 15px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(145deg,#f7c55f,#dc8b22);
  color: #4a3208;
  font: inherit;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
}
.tm-sign-note { display: block; margin-top: 5px; font-size: 10px; color: #9b8667; }

/* ホームの 🏘 タウンマップ導線（🗺 世界を見る の下に並べる） */
.kids-townmap-chip { top: calc(308px + env(safe-area-inset-top)); }

/* ======================================================================
   家計モデルP2: 予算必須モーダル（.bg-*）と月末しめ（.cl-*）
   どちらも閉じるボタンなし（.cm-locked）。中のボタンで進むまで残る。
   ====================================================================== */
.cm-overlay.cm-locked { background: rgba(46,42,36,.6); }
.cm-locked .cm-card { border: 3px solid #E8B62B; }

.bg-body { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.bg-guide { display: flex; align-items: center; gap: 10px; }
.bg-guide img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.bg-lead { margin: 0; font-size: 16px; font-weight: 900; color: #5a351a; line-height: 1.35; }
.bg-note { margin: 2px 0 4px; font-size: 11.5px; font-weight: 700; color: #7b6043; line-height: 1.6; }
.bg-body .tut-input-label { font-size: 11px; }
.bg-body .primary { width: 100%; }

.cl-body { display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.cl-head { display: flex; align-items: center; gap: 10px; }
.cl-head img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.cl-lead { margin: 0; font-size: 14.5px; font-weight: 900; color: #5a351a; line-height: 1.35; }
.cl-rows { display: flex; flex-direction: column; gap: 2px; background: #FBF8F1; border-radius: 12px; padding: 8px 12px; }
.cl-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; font-weight: 800; color: #5C544A; }
.cl-row strong { font-size: 14px; color: #2E2A24; }
.cl-row-sub { font-size: 11px; color: #8C8375; }
.cl-row-sub strong { font-size: 12px; color: #8C8375; }
.cl-leftover {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #FFF6DC; border: 2px solid #F0DCA2; border-radius: 14px; padding: 10px 12px;
}
.cl-leftover.over { background: #FDF0EC; border-color: #F0C8B8; }
.cl-leftover-label { font-size: 11px; font-weight: 800; color: #8C8375; }
.cl-leftover strong { font-size: 32px; font-weight: 900; color: #B07C12; line-height: 1.1; }
.cl-leftover.over strong { color: #B4593A; }
.cl-note { margin: 0; font-size: 11.5px; font-weight: 700; color: #7b6043; line-height: 1.6; }
.cl-income-note {
  margin: 0; padding: 7px 11px; border-radius: 11px;
  background: #EAF7EE; border: 1.5px solid #BCE3C8;
  font-size: 11.5px; font-weight: 800; color: #1E7A43;
}
.cl-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.cl-choice {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left;
  width: 100%; padding: 11px 14px; cursor: pointer;
  border: 1.5px solid #E7D7BC; border-radius: 14px; background: #FFFDF6; font: inherit;
}
.cl-choice strong { font-size: 13.5px; font-weight: 900; color: #5a351a; }
.cl-choice small { font-size: 11px; font-weight: 700; color: #8C8375; }
.cl-choice.primary-choice { border-color: #EF9E20; background: #FFF0CC; }
.cl-choice:disabled { opacity: .55; cursor: default; }

/* --- 2026-07 方向転換: レポートタブ／ホームの予算サマリー -------------------- */
/* レポート用の3Dナビアイコンがまだ無いので、暫定でインラインSVGを使う。 */
.kids-nav-v3-icon-svg { fill: currentColor; filter: none; opacity: .8; }
.kids-nav-v3-item.active .kids-nav-v3-icon-svg { filter: none; opacity: 1; }

/* 目標カードの跡地に置く予算サマリー（タップでレポートへ） */
.kids-budget-card {
  position: absolute;
  left: 18px;
  top: calc(145px + env(safe-area-inset-top));
  z-index: 20;
  width: 262px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 13px 8px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 17px;
  background: rgba(255,250,239,.88);
  box-shadow: 0 8px 24px rgba(39,25,12,.2);
  backdrop-filter: blur(15px) saturate(1.1);
  -webkit-backdrop-filter: blur(15px) saturate(1.1);
  color: #3d2f22;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: opacity .24s ease, transform .24s ease;
}
.kids-budget-head { display: flex; justify-content: space-between; align-items: baseline; }
.kids-budget-head strong { font-size: 14px; font-weight: 900; }
.kids-budget-head b { font-size: 12px; font-weight: 800; color: #25745a; }
.kids-budget-track {
  display: block; height: 7px; overflow: hidden;
  border-radius: 999px; background: rgba(101,83,52,.18);
}
.kids-budget-track i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg,#f7c55f,#dc8b22);
}
.kids-budget-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 9.5px; font-weight: 700; color: #7b684e; }
.kids-budget-genres { display: flex; flex-direction: column; gap: 1px; }
.kids-budget-genre { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; font-weight: 800; color: #6a5941; }
.kids-budget-genre b { color: #3d2f22; }
.kids-budget-empty { font-size: 10px; font-weight: 700; color: #8a7a63; }
.kids-budget-go { font-size: 9.5px; font-weight: 900; color: #b07c12; text-align: right; }
.kids-home-v3.kids-home-v3-ui-hidden .kids-budget-card {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
}

/* 月の切り替え */
.rp-month { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rp-month-nav {
  width: 40px; height: 40px; flex: none; padding: 0;
  border: 1.5px solid #E7D7BC; border-radius: 12px; background: #FFFDF6;
  font: 900 18px/1 "M PLUS Rounded 1c", sans-serif; color: #5a351a; cursor: pointer;
}
.rp-month-nav:disabled { opacity: .35; cursor: default; }
.rp-month-title { font-size: 16px; font-weight: 900; color: #3d2f22; }
.rp-groups { padding-top: 10px; padding-bottom: 10px; }

/* 月サマリー */
.rp-summary-main { display: flex; flex-direction: column; gap: 1px; }
.rp-summary-main > span { font-size: 11px; font-weight: 800; color: #8C8375; }
.rp-summary-main > strong { font-size: 28px; font-weight: 900; color: #B4593A; line-height: 1.15; }
.rp-summary-diff { font-size: 11px; font-weight: 800; color: #8C8375; }
.rp-summary-diff.up { color: #B4593A; }
.rp-summary-diff.down { color: #2E7D5B; }
.rp-summary-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; margin-top: 10px; }
.rp-summary-stats > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 6px;
  padding: 7px 10px; border-radius: 11px; background: #FBF8F1;
}
.rp-summary-stats span { font-size: 10.5px; font-weight: 800; color: #8C8375; }
.rp-summary-stats b { font-size: 13px; font-weight: 900; color: #2E2A24; }
/* 収入は参考情報。支出の数字より一段控えめに出す（予算計算には入らない） */
.rp-summary-income {
  display: block; margin-top: 9px; padding: 6px 10px; border-radius: 10px;
  background: #EAF7EE; border: 1.5px solid #BCE3C8;
  font-size: 11.5px; font-weight: 800; color: #1E7A43;
}
.rp-comment {
  margin: 10px 0 0; padding: 9px 11px; border-radius: 12px;
  background: #FFF6DC; border: 1.5px solid #F0DCA2;
  font-size: 12px; font-weight: 800; color: #5a351a; line-height: 1.55;
}

/* ジャンル別内訳（前月比つき） */
.rp-genre-row { flex-wrap: wrap; }
.rp-genre-diff { width: 100%; text-align: right; font-size: 10px; font-weight: 800; color: #8C8375; }
.rp-genre-diff.up { color: #B4593A; }
.rp-genre-diff.down { color: #2E7D5B; }

/* ジャンル別6ヶ月推移（自前のミニ棒グラフ） */
.rp-trend-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rp-trend-name {
  flex: none; width: 74px; padding: 3px 6px; border-radius: 8px;
  font-size: 10px; font-weight: 800; text-align: center;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.rp-trend-bars { flex: 1; display: flex; align-items: flex-end; gap: 4px; height: 34px; }
.rp-trend-bars i { flex: 1; border-radius: 3px 3px 0 0; opacity: .45; }
.rp-trend-bars i.now { opacity: 1; }
.rp-trend-value { flex: none; width: 68px; text-align: right; font-size: 11px; font-weight: 900; color: #2E2A24; }
.rp-trend-months { display: flex; gap: 4px; padding-left: 82px; padding-right: 68px; }
.rp-trend-months span { flex: 1; text-align: center; font-size: 9px; font-weight: 800; color: #A79880; }

/* 店別・品目ランキング */
.rp-rank-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid #F1E9D9;
}
.rp-rank-row:last-of-type { border-bottom: 0; }
.rp-rank-no {
  flex: none; width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 50%; background: #F5E9CE; color: #8a6337; font-size: 10px; font-weight: 900;
}
.rp-rank-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; font-weight: 800; color: #3d2f22; }
.rp-rank-count { flex: none; font-size: 10px; font-weight: 800; color: #8C8375; }
.rp-rank-amount { flex: none; font-size: 12.5px; font-weight: 900; color: #2E2A24; }

/* 月次レポートモーダル（旧・月末しめ） */
.cl-compare {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 12px; border-radius: 12px; background: #FBF8F1;
  font-size: 12px; font-weight: 800; color: #5C544A;
}
.cl-compare strong { font-size: 14px; font-weight: 900; color: #5C544A; }
.cl-compare strong.up { color: #B4593A; }
.cl-compare strong.down { color: #2E7D5B; }
.cl-sec { font-size: 11px; font-weight: 900; color: #8C8375; margin-top: 2px; }
.cl-genre-row { display: flex; align-items: center; gap: 8px; }
.cl-genre-chip {
  flex: none; min-width: 74px; padding: 3px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; text-align: center;
}
.cl-genre-row strong { flex: 1; text-align: right; font-size: 13px; font-weight: 900; color: #2E2A24; }
.cl-genre-diff { flex: none; width: 74px; text-align: right; font-size: 10px; font-weight: 800; color: #A79880; }
.cl-genre-diff.up { color: #B4593A; }
.cl-genre-diff.down { color: #2E7D5B; }
.cl-comment {
  margin: 4px 0 0; padding: 9px 11px; border-radius: 12px;
  background: #FFF6DC; border: 1.5px solid #F0DCA2;
  font-size: 12px; font-weight: 800; color: #5a351a; line-height: 1.55;
}
.cl-close-only { align-items: center; text-align: center; }

/* --- 月次レポートの直後に出す「今月の予算をきめよう」カード ------------------ */
/* 予算ゲート（.bg-body）と同じ見た目。先月の予算がプリフィルされているので1タップで終わる。 */
.mb-body { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.mb-body .tut-input-label { font-size: 11px; }
.mb-body .primary { width: 100%; }
.mb-body .bg-note b { color: #5a351a; font-weight: 900; }

/* --- アプリ内アップデート告知（What's New）--------------------------------- */
.wn-body { display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.wn-head { display: flex; align-items: center; gap: 10px; }
.wn-head img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.wn-lead { margin: 0; font-size: 16px; font-weight: 900; color: #5a351a; line-height: 1.35; }
.wn-line {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border-radius: 12px; background: #FBF8F1;
}
.wn-mark { flex: none; font-size: 12px; line-height: 1.6; }
.wn-line p { margin: 0; font-size: 12px; font-weight: 800; color: #4A4238; line-height: 1.6; }
.wn-close { width: 100%; margin-top: 4px; }

/* --- 強制アップデート（全画面ブロック）------------------------------------- */
.fu-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 32px 28px calc(32px + env(safe-area-inset-bottom));
  text-align: center; background: #fff4d8;
}
.fu-maneko { width: 132px; height: auto; object-fit: contain; }
.fu-title { margin: 6px 0 0; font-size: 20px; font-weight: 900; color: #5a351a; line-height: 1.4; }
.fu-note { margin: 0; max-width: 300px; font-size: 13px; font-weight: 700; color: #7b6043; line-height: 1.7; }
.fu-cta {
  margin-top: 10px; padding: 14px 26px; border-radius: 999px;
  background: #E8B62B; color: #3a2a00; text-decoration: none;
  font-size: 15px; font-weight: 900; box-shadow: 0 8px 20px rgba(122,77,24,.22);
}
.fu-build { font-size: 10px; font-weight: 700; color: #a2895f; }

/* ======================================================================
   分析タウン Phase B（analysis-town.ts / analysis-report.ts）— .at-*
   街ホームの 🏔 チップ → 全画面オーバーレイ（探索 → ズーム → 店舗A → 店舗B）。
   z-index は journey(4000)/tm(4000系)より上の 12000 系。
   ====================================================================== */
/* 旧マップチップは 57px の丸（.kids-map-chip）だが、この導線はラベル入りなので
   横長のピルに上書きする。丸のままだと「マネコタウン」が縦に折り返して欠ける。 */
.kids-analysis-chip {
  /* 可変高の予算サマリー（最大3ジャンル）の下へ出し、カードと重ねない。 */
  top: calc(276px + env(safe-area-inset-top));
  width: auto;
  height: auto;
  min-height: 42px;
  padding: 8px 14px;
  gap: 6px;
  border-radius: 999px;
  font-size: 18px;
  white-space: nowrap;
}
.kids-analysis-chip b { font-size: 12px; font-weight: 900; letter-spacing: .01em; }

.at-overlay {
  z-index: 12000;
  overflow: hidden;
  /* 素の背景は真っ黒にしない（ズームアウト時に黒枠が見えるのを避ける暖色系ダーク） */
  background: #2b2016;
  color: #3d2f22;
  touch-action: none;
}
.at-explore { position: absolute; inset: 0; }
.at-viewport {
  position: absolute; inset: 0;
  overflow: hidden;
  touch-action: none;
  background: #2b2016;
}
/* ステージの下に敷くボケ背景。contain/最小ズームでもステージの外に黒が出ない。 */
.at-backdrop {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.15);
  filter: blur(26px) brightness(.62) saturate(.85);
  pointer-events: none;
}
.at-stage { position: absolute; left: 0; top: 0; z-index: 1; transform-origin: 0 0; will-change: transform; }
.at-master { display: block; width: 100%; height: 100%; }
.at-hotspots { position: absolute; inset: 0; }
.at-hot {
  position: absolute;
  padding: 0; border: 0; border-radius: 0;
  background: transparent !important;
  color: inherit;
  box-shadow: none !important;
  outline: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.at-hot:hover,
.at-hot:focus,
.at-hot:active {
  background: transparent !important;
  box-shadow: none !important;
  filter: none;
}
.at-hot:focus-visible {
  outline: 2px solid rgba(232,182,43,.92);
  outline-offset: 3px;
}
/* 店全体を覆うリングは長押し時に白い選択面のように見えるため、
   タップ地点を示す小さな金色パルスだけにする。 */
.at-hot-ring {
  position: absolute; left: 50%; top: 50%;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%;
  opacity: 0; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(236,190,102,.94);
}
.at-hot.is-pressed .at-hot-ring { animation: at-ring .6s ease-out; }
@keyframes at-ring {
  0%   { opacity: .95; transform: scale(.88); }
  100% { opacity: 0;   transform: scale(1.26); }
}
.at-hot-badge {
  position: absolute; left: 50%; top: -4px; transform: translateX(-50%);
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255,251,241,.94); color: #5b4526;
  font-size: 17px; font-weight: 900; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(30,20,8,.28);
}
.at-debug .at-hot { outline: 2px dashed rgba(255,64,64,.95); background: rgba(255,64,64,.16); }
.at-debug .at-hot::after {
  content: attr(data-spot);
  position: absolute; left: 2px; bottom: 2px;
  font-size: 15px; font-weight: 900; color: #fff; text-shadow: 0 1px 3px #000;
}

.at-head {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: linear-gradient(180deg, rgba(16,22,18,.55), rgba(16,22,18,0));
  color: #fffdf6;
}
.at-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.at-head-text strong { font-size: 16px; font-weight: 900; }
.at-head-text span {
  font-size: 10.5px; font-weight: 700; opacity: .92;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.at-back, .at-rback {
  flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(255,251,241,.92); color: #4a3a26;
  font-size: 22px; font-weight: 900; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 12px rgba(20,14,6,.28);
}
.at-fit {
  flex: none; border: 0; border-radius: 999px; padding: 8px 12px;
  background: rgba(255,251,241,.92); color: #4a3a26;
  font-size: 11.5px; font-weight: 900; cursor: pointer;
}
.at-hint {
  position: absolute; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom));
  margin: 0; padding: 9px 12px; border-radius: 14px;
  background: rgba(24,20,14,.5); color: #fffdf6;
  font-size: 11px; font-weight: 700; text-align: center;
}
/* 家計簿スペースの切替レール（所属が2つ以上のときだけ出る）。
   ヘッダーの下に横スクロールで並べ、暖色トーンは .at-head のボタン類に合わせる。 */
.at-groups {
  position: absolute; left: 0; right: 0; z-index: 4;
  top: calc(58px + env(safe-area-inset-top));
  display: flex; gap: 7px;
  padding: 0 12px 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
}
.at-groups::-webkit-scrollbar { display: none; }
.at-groups[hidden] { display: none; }
.at-group {
  flex: 0 0 auto;
  border: 1.5px solid rgba(255,251,241,.5); border-radius: 999px;
  padding: 6px 13px;
  background: rgba(38,29,18,.62); color: #FFF6E2;
  font-size: 11.5px; font-weight: 800; white-space: nowrap; cursor: pointer;
  box-shadow: 0 3px 9px rgba(20,14,6,.24);
}
.at-group.active {
  border-color: #E39A21;
  background: linear-gradient(180deg,#FFF1C8,#FFE2A0);
  color: #68430D;
}
.at-group[disabled] { opacity: .55; cursor: default; }

/* ズームで寄っていくあいだは探索用の見出しを引っ込める（映像の邪魔をしない） */
.at-head, .at-hint, .at-groups { transition: opacity .22s ease; }
.at-explore.is-zooming .at-head,
.at-explore.is-zooming .at-groups,
.at-explore.is-zooming .at-hint { opacity: 0; pointer-events: none; }
/* ズーム中はバッジ・押下リングも一緒に拡大されて「白く抜けた」ように見えるため、
   カメラが動き出したらホットスポット層ごと素早く消す（探索復帰で自然に戻る） */
.at-hotspots { transition: opacity .06s linear; } /* タップ瞬間の白（バッジ）を残さないよう即消し */
.at-explore.is-zooming .at-hotspots { opacity: 0; }
/* PCのマウスドラッグで画像がテキスト選択され青くハイライトされるのを防ぐ */
.at-overlay { user-select: none; -webkit-user-select: none; }
.at-overlay img {
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ---- ズーム後のシーン（detail → report-bg → A案UI → Bシート） ---- */
/* シーンは透明な入れ物。背景を塗ると①のマスター拡大が隠れてしまうため、
   全画面を覆うのは object-fit:cover の画像レイヤーに任せる。 */
.at-scene { position: absolute; inset: 0; z-index: 5; overflow: hidden; background: transparent; }
.at-scene .at-rhead { opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.at-scene.is-live .at-rhead { opacity: 1; pointer-events: auto; }
.at-layer {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform-origin: 50% 60%;
}
/* アニメ中の押下に即答するリング（ホットスポットの .at-hot-ring と同じ見た目） */
.at-tap {
  position: absolute; z-index: 6;
  width: 76px; height: 76px; margin: -38px 0 0 -38px;
  border-radius: 50%; opacity: 0; pointer-events: none;
  box-shadow: 0 0 0 3px rgba(236,190,102,.92);
}
.at-tap.is-on { animation: at-ring .6s ease-out; }
/* マネコは report-bg が定着してから（＝A案UIと同じ段階で）現れる。
   ズーム前半・map-detail のあいだに姿が見えると、住人が先回りしてしまう。 */
.at-home-maneko {
  position: absolute; right: 1%; bottom: 21%; z-index: 3;
  width: 45%; height: auto;
  opacity: 0; transition: opacity .26s ease;
  filter: drop-shadow(0 12px 18px rgba(30,20,8,.35));
  pointer-events: none;
}
.at-home-maneko.is-in { opacity: 1; }
.at-rhead {
  /* B案シート（z-index 8）の暗幕より上。もどるボタンをシート表示中もタップできるようにする */
  position: absolute; left: 0; right: 0; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
}
.at-rhead-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  padding: 7px 13px; border-radius: 16px;
  background: rgba(255,251,241,.9);
  box-shadow: 0 6px 16px rgba(28,18,8,.2);
}
.at-rhead-text strong {
  font-size: 14.5px; font-weight: 900; color: #3d2f22;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.at-rhead-text span { font-size: 10px; font-weight: 700; color: #8c775a; }
.at-month-chip {
  flex: none; padding: 8px 12px; border-radius: 999px;
  background: #F5D06A; color: #5b4104;
  font-size: 12px; font-weight: 900; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(60,40,6,.24);
}

.at-report-slot {
  position: absolute; z-index: 5;
  left: 0; right: 0;
  top: calc(78px + env(safe-area-inset-top));
  bottom: calc(12px + env(safe-area-inset-bottom));
  padding: 0 13px;
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(16px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
.at-report-slot.is-in { opacity: 1; transform: none; }
.at-report { display: flex; flex-direction: column; height: 100%; gap: 10px; }
.at-report > * { pointer-events: auto; }
.at-report-home { justify-content: space-between; }
.at-report-home .at-card-main { width: 70%; }
.at-report-shop { justify-content: flex-start; }
.at-report-shop .at-card-shop { width: 68%; max-height: 62%; overflow-y: auto; }
.at-report-shop .at-shopkeeper { margin-top: auto; }

.at-card {
  padding: 13px 14px;
  border-radius: 20px;
  background: rgba(255,251,242,.94);
  box-shadow: 0 10px 26px rgba(38,26,10,.24);
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
}
.at-card-label { display: block; font-size: 10.5px; font-weight: 800; color: #8c775a; }
.at-amount { display: block; color: #3d2f22; line-height: 1.05; }
.at-amount b { font-size: 33px; font-weight: 900; letter-spacing: .005em; }
.at-amount small { font-size: 14px; font-weight: 800; margin-left: 2px; }
.at-amount.is-over b { color: #B4552F; }
.at-over-note { display: block; margin-top: 4px; font-size: 10.5px; font-weight: 700; color: #9c7a5c; }
.at-card-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 7px; font-size: 11px; font-weight: 800; color: #7c6849;
}
.at-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.at-card-head strong { font-size: 13.5px; font-weight: 900; color: #3d2f22; }
.at-card-head span { font-size: 10.5px; font-weight: 800; color: #8c775a; }
.at-bar {
  display: block; height: 9px; margin-top: 8px;
  border-radius: 999px; background: #EAE3D3; overflow: hidden;
}
.at-bar i { display: block; height: 100%; border-radius: 999px; }
.at-bar.is-over i { background: #C4643E !important; }
.at-chip {
  flex: none; padding: 4px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; white-space: nowrap;
}
.at-chip.is-up { background: #F8E7DF; color: #B4552F; }
.at-chip.is-down { background: #E6F1E4; color: #3E7A4E; }
.at-chip.is-flat { background: #F0EADD; color: #7B6B52; }
.at-empty { margin: 4px 0 0; font-size: 11.5px; font-weight: 700; color: #9c8a6d; line-height: 1.6; }
.at-budget-empty { margin-top: 9px; }
.at-budget-empty p { margin: 0 0 8px; font-size: 11.5px; font-weight: 700; color: #8c775a; line-height: 1.5; }
.at-budget-set {
  width: 100%; padding: 9px 12px; border: 0; border-radius: 999px;
  background: #E8B62B; color: #4a3400;
  font-size: 12px; font-weight: 900; cursor: pointer;
}
.at-genre-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.at-genre-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.at-genre-cell .at-genre-name {
  max-width: 100%; font-size: 10px; font-weight: 800; color: #7c6849;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.at-genre-cell b { font-size: 10.5px; font-weight: 900; color: #3d2f22; white-space: nowrap; }
.at-genre-dot {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 12px;
  font-size: 11px; font-weight: 900;
}
.at-cta {
  width: 100%; margin-top: 10px; padding: 13px 14px;
  border: 0; border-radius: 16px;
  color: #fffdf6; font-size: 13.5px; font-weight: 900;
  cursor: pointer; box-shadow: 0 8px 20px rgba(30,20,8,.28);
}
.at-shop-title { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.at-shop-title strong { font-size: 14px; font-weight: 900; color: #3d2f22; }
.at-mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.at-mini-stats > div {
  padding: 7px 9px; border-radius: 13px; background: #F4EEE0;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.at-mini-stats span { font-size: 9.5px; font-weight: 800; color: #8c775a; }
.at-mini-stats b { font-size: 12.5px; font-weight: 900; color: #3d2f22; overflow-wrap: anywhere; }
.at-mini-stats b.is-up { color: #B4552F; }
.at-mini-stats b.is-down { color: #3E7A4E; }
.at-items { margin-top: 11px; }
.at-items-cap { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 900; color: #5f4f38; }
.at-item-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  padding: 5px 0; border-top: 1px solid #EFE7D8;
}
.at-item-no {
  width: 16px; height: 16px; border-radius: 5px; background: #EFE7D8;
  display: grid; place-items: center; font-size: 9px; font-weight: 900; color: #8c775a;
}
.at-item-name { font-size: 11.5px; font-weight: 800; color: #4a3d2b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-item-row b { font-size: 11.5px; font-weight: 900; white-space: nowrap; }
.at-shopkeeper {
  align-self: flex-end;
  width: 60%; padding: 10px 13px;
  border-radius: 16px 16px 6px 16px;
  background: rgba(255,251,242,.94);
  box-shadow: 0 8px 20px rgba(38,26,10,.22);
  pointer-events: auto;
}
.at-shopkeeper p { margin: 0; font-size: 11.5px; font-weight: 800; color: #4a3d2b; line-height: 1.6; }
.at-shopkeeper p + p { margin-top: 3px; }

/* ---- B案シート（下から引き上げ） ---- */
.at-sheet-slot {
  position: absolute; inset: 0; z-index: 8;
  display: flex; align-items: flex-end;
  background: rgba(24,18,10,0);
  transition: background .36s ease;
  pointer-events: none;
}
.at-sheet-slot.is-open { background: rgba(24,18,10,.3); pointer-events: auto; }
.at-sheet {
  width: 100%; max-height: 84%;
  display: flex; flex-direction: column;
  border-radius: 26px 26px 0 0;
  background: #FFFCF4;
  box-shadow: 0 -12px 34px rgba(24,16,6,.32);
  transform: translateY(100%);
  transition: transform .36s cubic-bezier(.22,.8,.28,1);
}
.at-sheet-slot.is-open .at-sheet { transform: none; }
.at-sheet-grab {
  flex: none; width: 46px; height: 5px; margin: 9px auto 4px;
  border-radius: 999px; background: #DED5C2;
}
.at-sheet-scroll {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 8px 16px calc(24px + env(safe-area-inset-bottom));
}
.at-score-row { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.at-score {
  position: relative; flex: none;
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--score) * 1%), #E8E1D0 0);
}
.at-score::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #FFFCF4; }
.at-score span { position: relative; font-size: 25px; font-weight: 900; color: var(--accent); }
.at-score-text { min-width: 0; }
.at-score-cap { display: block; font-size: 10.5px; font-weight: 800; color: #8c775a; }
.at-score-text strong { display: block; font-size: 18px; font-weight: 900; color: #3d2f22; line-height: 1.35; }
.at-score-text p { margin: 5px 0 0; font-size: 10.5px; font-weight: 700; color: #8c775a; line-height: 1.6; }
.at-insights { display: flex; flex-direction: column; gap: 8px; }
.at-insight {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: 16px; background: #F5F1E6;
}
.at-insight-icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: #FFFCF4; color: #8c775a;
  font-size: 12px; font-weight: 900;
}
.at-insight-body { min-width: 0; display: flex; flex-direction: column; }
.at-insight-body strong { font-size: 12.5px; font-weight: 900; color: #3d2f22; }
.at-insight-body small { font-size: 10px; font-weight: 700; color: #8c775a; }
.at-insight-amount { font-size: 12.5px; font-weight: 900; white-space: nowrap; color: #6b5c44; }
.at-insight.tone-down .at-insight-amount { color: #3E7A4E; }
.at-insight.tone-up .at-insight-amount { color: #B4552F; }
.at-insight.tone-up .at-insight-icon { background: #F8E7DF; color: #B4552F; }
.at-insight.tone-down .at-insight-icon { background: #E6F1E4; color: #3E7A4E; }
.at-weeks { margin-top: 12px; background: #F5F1E6; box-shadow: none; }
.at-weeks-total { font-size: 10.5px; font-weight: 800; color: #8c775a; }
.at-week-bars { display: flex; align-items: stretch; gap: 9px; height: 118px; }
.at-week { flex: 1; display: grid; grid-template-rows: 1fr auto; gap: 5px; min-width: 0; }
.at-week i { align-self: end; width: 100%; border-radius: 11px 11px 5px 5px; }
.at-week span { font-size: 9.5px; font-weight: 800; color: #8c775a; text-align: center; }
.at-maneko-note {
  margin: 12px 0 0; padding: 11px 13px; border-radius: 16px;
  background: var(--soft, #F0EDE2);
  font-size: 11.5px; font-weight: 800; color: #4a3d2b; line-height: 1.6;
}
/* 月次B はモックどおり、いちばん上がマネコの一言 */
.at-sheet-home .at-maneko-note { margin: 2px 0 12px; }
.at-score-empty { margin: 6px 0 14px; background: #F5F1E6; box-shadow: none; }
.at-score-empty strong { display: block; font-size: 15px; font-weight: 900; color: #3d2f22; }
.at-score-empty p { margin: 6px 0 0; font-size: 11px; font-weight: 700; color: #8c775a; line-height: 1.6; }

/* ---- 店舗B: タブ・推移・品目・記録 ---- */
.at-tabs {
  flex: none; display: flex; gap: 4px; margin: 4px 16px 12px;
  padding: 4px; border-radius: 14px; background: #F1ECE0;
}
.at-tab {
  flex: 1; padding: 9px 6px; border: 0; border-radius: 11px;
  background: transparent; color: #8c775a;
  font-size: 12px; font-weight: 900; cursor: pointer;
}
.at-tab.active { background: #FFFCF4; color: #3d2f22; box-shadow: 0 2px 8px rgba(40,28,10,.12); }
.at-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.at-trend { margin-top: 12px; background: #F5F1E6; box-shadow: none; }
.at-trend-bars, .at-trend-big { display: flex; align-items: stretch; gap: 8px; height: 122px; }
.at-trend-big { height: 190px; }
.at-trend-bar { flex: 1; display: grid; grid-template-rows: 1fr auto auto; gap: 4px; min-width: 0; }
.at-trend-bar i { align-self: end; width: 100%; border-radius: 10px 10px 4px 4px; opacity: .55; }
.at-trend-bar.is-now i { opacity: 1; }
.at-trend-bar span { font-size: 9.5px; font-weight: 800; color: #8c775a; text-align: center; }
.at-trend-bar b { font-size: 9.5px; font-weight: 900; color: #4a3d2b; text-align: center; }
.at-pane-note { margin: 12px 0 0; font-size: 11px; font-weight: 700; color: #8c775a; line-height: 1.6; }
.at-note {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px;
  margin-top: 11px; padding: 11px 13px; border-radius: 16px; background: #FAF0DA;
}
.at-note span {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: #F3E0AF; color: #8a6a12; font-size: 13px; font-weight: 900;
}
.at-note p { margin: 0; font-size: 11px; font-weight: 800; color: #6f5a2c; line-height: 1.6; }
.at-big { margin-top: 11px; background: #F5F1E6; box-shadow: none; }
.at-big-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  padding: 7px 0; border-top: 1px solid #E8E0CE;
}
.at-big-name {
  min-width: 0; display: flex; flex-direction: column;
  font-size: 12px; font-weight: 800; color: #4a3d2b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.at-big-name small { font-size: 9.5px; font-weight: 700; color: #9c8a6d; }
.at-big-row b { font-size: 12.5px; font-weight: 900; white-space: nowrap; }
.at-share-row {
  display: grid; grid-template-columns: 34% 1fr auto; align-items: center; gap: 9px;
  padding: 7px 0; border-top: 1px solid #EFE7D8;
}
.at-share-name { font-size: 11.5px; font-weight: 800; color: #4a3d2b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-share-bar { height: 8px; border-radius: 999px; background: #EDE6D6; overflow: hidden; }
.at-share-bar i { display: block; height: 100%; border-radius: 999px; }
.at-share-row b { font-size: 11.5px; font-weight: 900; white-space: nowrap; color: #3d2f22; }
.at-share-row b small { margin-left: 4px; font-size: 9.5px; font-weight: 800; color: #9c8a6d; }
.at-records { margin-top: 6px; }
.at-record-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px;
  padding: 7px 0; border-top: 1px solid #EFE7D8;
  font-size: 11.5px; font-weight: 800; color: #4a3d2b;
}
.at-record-row > span:first-child { font-size: 10px; color: #9c8a6d; white-space: nowrap; }
.at-record-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-record-row b { white-space: nowrap; }

.at-loading {
  position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%);
  z-index: 20; padding: 8px 14px; border-radius: 999px;
  background: rgba(24,18,10,.78); color: #fffdf6;
  font-size: 11.5px; font-weight: 800;
}
/* 街の中のトースト（app-toast と同じ見た目・オーバーレイの中に出す） */
.at-toast {
  position: absolute; left: 50%; top: 96px; transform: translateX(-50%);
  z-index: 30; width: max-content; max-width: 84%;
  padding: 10px 18px; border-radius: 18px;
  background: #FFFDF6; border: 2.5px solid #E8B62B;
  color: #7A5A20; font-size: 12.5px; font-weight: 800; line-height: 1.5; text-align: center;
  box-shadow: 0 8px 20px rgba(120,80,20,.32);
  cursor: pointer;
}
.at-toast[hidden] { display: none; }

/* 小さい端末: シートは内側スクロール、カードは高さを詰める */
@media (max-height: 700px) {
  .at-sheet { max-height: 90%; }
  .at-amount b { font-size: 28px; }
  .at-week-bars { height: 96px; }
  .at-trend-big { height: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  .at-sheet { transition: transform .12s linear; }
  .at-report-slot { transition: opacity .12s linear; }
  .at-hot.is-pressed .at-hot-ring,
  .at-tap.is-on { animation-duration: .3s; }
}

/* ==========================================================================
   編集経路の改善（2026-07）
   ①記録タブの「さいきんの記録」 ②その場ジャンル変更チップ ③ランキングからの逆引き
   ========================================================================== */

/* ② 共通のジャンルチップ（明細1件ぶんの費目を見せて、タップで直す） */
.genre-chip {
  flex: none; border: 1.5px solid rgba(46,42,36,.10); border-radius: 999px;
  padding: 3px 9px; font-size: 11px; font-weight: 800; line-height: 1.35;
  white-space: nowrap; cursor: pointer; font-family: inherit;
}
.genre-chip.is-small { padding: 2px 8px; font-size: 10px; }
.genre-chip:disabled { opacity: .55; cursor: progress; }

/* 明細カードの行は 品名 / チップ / 金額 の3列にする */
.rc-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; }

/* ① さいきんの記録 */
.rr-sec { margin-top: 14px; }
.rr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rr-head strong { font-size: 14px; font-weight: 900; color: #2E2A24; }
.rr-head small { font-size: 10.5px; font-weight: 700; color: #8C8375; }
.rr-list { display: flex; flex-direction: column; margin-top: 6px; }
.rr-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  column-gap: 9px; row-gap: 4px; padding: 8px 2px;
  border-top: 1px solid #F1E9D9; cursor: pointer;
}
.rr-row:first-child { border-top: 0; }
.rr-row:hover { background: #FBF8F1; }
.rr-date { font-size: 10.5px; font-weight: 800; color: #9c8a6d; white-space: nowrap; }
.rr-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; font-weight: 800; color: #3d2f22;
}
.rr-amount { font-size: 13px; font-weight: 900; color: #2E2A24; white-space: nowrap; text-align: right; }
.rr-chips { grid-column: 2 / 4; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.rr-more { font-size: 10px; font-weight: 800; color: #8C8375; align-self: center; }

/* ③ ランキング行 → 記録一覧（軽いモーダル） */
.rp-rank-row.is-tappable { cursor: pointer; }
.rp-rank-row.is-tappable:hover { background: #FBF8F1; }
.rd-list { display: flex; flex-direction: column; }
.rd-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px;
  padding: 9px 2px; border-top: 1px solid #F1E9D9; cursor: pointer;
}
.rd-row:first-child { border-top: 0; }
.rd-row:hover { background: #FBF8F1; }
.rd-date { font-size: 10.5px; font-weight: 800; color: #9c8a6d; white-space: nowrap; }
.rd-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; font-weight: 800; color: #3d2f22;
}
.rd-amount { font-size: 13px; font-weight: 900; color: #2E2A24; white-space: nowrap; }

/* ③ 分析タウン 店舗シートBの記録リスト（チップ列を足したので列数を1つ増やす） */
.at-big-row { grid-template-columns: 1fr auto auto; }
.at-record-row { grid-template-columns: auto 1fr auto auto; }
.at-big-row.is-tappable, .at-record-row.is-tappable { cursor: pointer; }
.at-big-row.is-tappable:active, .at-record-row.is-tappable:active { background: rgba(255,255,255,.5); }
