/* app/assets/stylesheets/ui-kit.css
   画面をまたいで見た目をそろえる共通部品。基準は「住所入力」のカード。
   レイアウトの最後に読み込み、各画面の個別指定より後に効かせる。
   新しい入力欄・カード・モーダルは、ここのクラスを使う（画面ごとに色や角丸を決めない）。 */

:root {
  --ui-card-bg:      rgba(255, 255, 255, 0.55);  /* 住所入力の内側カード */
  --ui-card-border:  rgba(255, 255, 255, 0.70);
  --ui-well-bg:      rgba(255, 255, 255, 0.50);  /* カードの中の区切り */
  --ui-modal-bg:     var(--panel-bg);            /* 画面の上に重なる窓も、カスタマイズ画面のパネルと同じすりガラス */
  --ui-object-bg:    rgba(255, 255, 255, 0.50);  /* パネルの上に置く物（カード・ボタン・皿）。白で塗りつぶさない */
  --ui-field-bg:     rgba(255, 255, 255, 0.50);
  --ui-field-border: rgba(45, 43, 61, 0.18);     /* どこに入力するかが分かる濃さ */
  --ui-line:         rgba(45, 43, 61, 0.10);
  --ui-backdrop:     rgba(45, 43, 61, 0.28);
  --ui-field-h:      44px;                        /* 指で押せる高さ */
}

/* ── カード ── */
.ui-card {
  background: var(--ui-card-bg);
  border: 1px solid var(--ui-card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--panel-shadow);
  color: var(--color-text-primary);
}
.ui-well {
  background: var(--ui-well-bg);
  border: 1px solid var(--ui-card-border);
  border-radius: var(--radius-md);
  padding: 12px;
}
.ui-card-head {
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--ui-line);
}

/* ── 文字 ── */
.ui-title {
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
}
.ui-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}
.ui-value {
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--color-accent);
}
.ui-placeholder {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}
.ui-required { color: var(--color-danger); }
.ui-danger-link {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #B3261E;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
}
.ui-danger-link:hover { background: var(--cherry-soft); }

/* ── 入力欄 ── */
/* input[type=text|date] は application.css が同じ値で整える。ここは、それ以外の入力欄。 */
.ui-field,
.budget-modal-panel input[type="number"] {
  min-height: var(--ui-field-h);
  padding: 8px 12px;
  border: 1.5px solid var(--ui-field-border);
  border-radius: var(--radius-sm);
  background: var(--ui-field-bg);
  color: var(--color-text-primary);
  font-size: 16px; /* 16px未満だとiOSがフォーカス時に拡大する */
  outline: none;
}
.ui-field::placeholder { color: var(--color-text-muted); }
.ui-field:focus,
.ui-field:focus-within,
.budget-modal-panel input[type="number"]:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-bg);
}
.ef-allergy-custom-input input {
  background: var(--ui-field-bg);
  border: 1.5px solid var(--ui-field-border);
  color: var(--color-text-primary);
  font-size: 16px;
}
.ef-allergy-custom-input input::placeholder { color: var(--color-text-muted); }
/* 入力欄が既定の幅より縮まず、「追加」が枠の外へ押し出されていた */
.ef-allergy-custom-input input { min-width: 0; }
.ef-allergy-custom-input .ef-btn { flex: none; white-space: nowrap; }

/* 会話の中の家族フォームは、1画面に収めるために少し詰める */
.slide-form .person-card .ui-field,
.slide-form .person-card input.ui-field { min-height: 38px; padding: 4px 10px; font-size: 16px; }
.slide-form .person-card .input-button { min-height: 36px; }
.slide-form .person-card .ui-well { padding: 8px 10px; }
.slide-form .person-card .ui-label { font-size: max(12px, var(--fs-xs)); margin-bottom: 2px; }
.slide-form .person-card .ui-card-head { padding-bottom: 6px; margin-bottom: 8px; }
.ui-field-picker { align-items: center; }

/* ── 画面の上に重なる窓（モーダル） ──
   中央に出る窓と、左から出る大きな窓の2種類。色・見出し・閉じるボタンは同じ。 */
.modal-card,
.confirm-modal-card,
.ef-allergy-modal-body,
.prep-category-modal-panel,
.prep-upgrade-panel,
.meal-modal-panel,
body.page-customise .budget-modal-panel,
.customise-body .budget-modal-panel {
  background: var(--ui-modal-bg);
  border-color: var(--ui-card-border);
  color: var(--color-text-primary);
  -webkit-backdrop-filter: var(--panel-blur);
  backdrop-filter: var(--panel-blur);
}
.modal-card,
.confirm-modal-card,
.ef-allergy-modal-body,
.prep-category-modal-panel,
body.page-customise .budget-modal-panel,
.customise-body .budget-modal-panel {
  border-radius: var(--radius-xl);
}
.modal-backdrop,
.confirm-modal-backdrop,
.prep-category-modal-backdrop,
body.page-customise .budget-modal-backdrop,
.customise-body .budget-modal-backdrop {
  background: var(--ui-backdrop);
}

/* 見出し */
.modal-header h2,
.confirm-modal-card h2,
.ef-allergy-modal-body h3,
.prep-category-modal-head h3,
.prep-upgrade-head h3,
.meal-modal-title,
body.page-customise .budget-modal-head h3,
.customise-body .budget-modal-head h3 {
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
}

/* ── アレルギー選択（暗い配色の名残を明るい地に合わせる） ── */
.ef-allergy-group-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text-secondary);
}
.ef-allergy-suggest {
  background: var(--ui-well-bg);
  border: 1px solid var(--ui-line);
}
.ef-suggest-item {
  color: var(--color-text-primary);
  background: var(--color-accent-bg);
  border-color: var(--color-accent-border);
}
.ef-suggest-item:hover { background: var(--color-accent-border); }
.ef-allergy-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.ui-modal-overlay {
  background: var(--ui-backdrop);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ef-allergy-custom-input .ef-btn {
  min-height: var(--ui-field-h);
  background: var(--color-accent-bg);
  border: 1.5px solid var(--color-accent-border);
  color: var(--color-accent);
}

/* ── 選択ボタン（性別・体形など）: 白いカードの上でも押せる場所が分かるように ── */
.input-button {
  min-height: 40px;
  background: var(--ui-field-bg);
  border-color: var(--ui-field-border);
  color: var(--color-text-primary);
}
.input-button.selected { color: #fff; }

/* ── フォームの中は左ぞろえ（外側の案内文が中央ぞろえでも、入力欄のラベルは左） ── */
.slide-form-inner,
.person-card { text-align: left; }

/* ── カスタマイズの家族編集 ──
   カードが 60vw 固定で枠からはみ出し、右端が切れていた。横に送る並びもやめて、
   家族を上から順に並べる（この画面は縦にスクロールするので、続きに気づける）。 */
#customise-profile-form #forms-container {
  flex-direction: column;
  gap: 16px;
  overflow: visible;
}
#customise-profile-form .person-card-container {
  display: block;
  width: 100%;
  padding: 0;
}
#customise-profile-form .person-card-container > .flex { align-items: stretch; }
#customise-profile-form .person-card {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: none;
}

/* 住所入力のラベルも、家族フォームと同じ見た目に */
.slide-form-inner .form-row > label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* ── 主ボタン ──
   ふつうの .btn.primary は liquid_button.js が紫の丸いボタンに描きかえる。
   ふりがな入りなどで描きかえを外したもの（data-liquid-exclude）も、同じ色と形にする。 */
.btn.primary[data-liquid-exclude] {
  min-height: var(--ui-field-h);
  padding: 8px 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #4A7BF7, #8B6CF6);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(74, 123, 247, 0.25);
}
.btn.primary[data-liquid-exclude] rt { color: inherit; }

/* ── 閉じるボタン: どの窓でも同じ「閉じる」の丸いボタン（× だけの印は使わない） ── */
.ui-close {
  flex: none;
  min-height: 40px;
  padding: 6px 16px;
  border: 1.5px solid var(--ui-field-border);
  border-radius: var(--radius-pill);
  background: var(--ui-object-bg);
  color: var(--color-text-primary);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.ui-close:hover { border-color: var(--color-accent); color: var(--color-accent); }
.ui-close-plain { color: var(--color-text-secondary); font-weight: 600; }

/* ── スクロールできる場所の目印 ──
   下端の中身が透けていくので、続きがあると分かる。いちばん下まで行くと、
   透けるのは下の余白だけになる（何も無い所や、ボタンの上には何も重ならない）。 */
.prep-category-modal-body,
.meal-modal-preview,
.meal-modal-picker {
  padding-bottom: 28px;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
}

/* ── 食事の編集画面（スマホ幅） ──
   上下2つの枠と候補リストが別々にスクロールして、選んだ献立が画面の外に隠れていた。
   スクロールを縦1本にまとめ、選んだ献立はいちばん上に固定する。
   個別の候補だけは横に送る（縦のスクロールとぶつからない）。 */
@media (max-width: 760px) {
  .meal-modal-split {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .meal-modal-preview,
  .meal-preview-grid { display: contents; }
  .meal-modal-split .meal-selected-panel,
  .meal-modal-split .meal-custom-panel,
  .meal-modal-split .meal-modal-picker { flex: none; }
  .meal-modal-split .meal-selected-panel {
    order: -1;
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fffaf4;
    border-top: 0;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 6px 14px rgba(45, 43, 61, 0.12);
  }
  .meal-modal-split .meal-selected-panel .meal-orbit-preview {
    --main-size: 84px;
    --side-size: 40px;
    --dessert-size: 46px;
    margin-top: 0;
  }
  .meal-modal-split .meal-set-drop-zone { margin-top: 4px; padding: 4px; }
  .meal-modal-split .meal-modal-picker {
    overflow: visible;
    padding-bottom: 12px;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .meal-modal-split .custom-options-list {
    grid-template-columns: none;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: 44%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
  }
}

/* ── 食事の編集画面: タップでの追加・入れかえ ── */
.meal-set-drop-zone .orbit-circle.is-armed {
  outline: 3px solid var(--color-accent, #e88c3c);
  outline-offset: 2px;
  animation: armed-pulse 1.1s ease-in-out infinite;
}
@keyframes armed-pulse { 50% { outline-offset: 5px; } }
@media (prefers-reduced-motion: reduce) { .meal-set-drop-zone .orbit-circle.is-armed { animation: none; } }
.meal-modal-panel .custom-option-item { cursor: pointer; }
/* 空の皿は「＋」で、追加できると分かるようにする（間食は1品だけなので出さない） */
.meal-set-drop-zone:not(.is-snack) .orbit-side:not(:has(.orbit-picked-icon))::after,
.meal-set-drop-zone:not(.is-snack) .orbit-dessert:not(:has(.orbit-picked-icon))::after {
  content: "＋";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: rgba(74, 72, 96, 0.55);
}
.item-sheet-swap {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  background: #e88c3c;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

/* ── 「ここですること」と「なぜ聞くのか」 ── */
.slide-note {
  position: relative;
  margin: 10px 4px 16px;
  padding: 12px 16px;
  word-break: auto-phrase;
  /* 流体の背景が描かれるまで（または動きを止めた環境）の見た目 */
  border-radius: 20px;
  background: #F7F9FF;
  box-shadow: 0 0 0 3px #6f74f6;
}
/* 流体の背景（liquid_panel.js が描く）。文字はその上に乗せる */
.slide-note.is-liquid { background: none; box-shadow: none; }
.slide-note .liquid-panel-bg { position: absolute; top: -12px; left: -12px; pointer-events: none; overflow: visible; }
.slide-note > p { position: relative; }
.slide-note p { margin: 0; line-height: 1.7; color: var(--color-text-primary); }
.slide-note-what { font-size: 16px; font-weight: 800; }
.slide-note-why { font-size: 14px; }
.why-btn {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: 6px;
  padding: 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-secondary, #4a4860);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
  position: relative;
}
.why-btn::after { content: ""; position: absolute; inset: -10px; } /* 押せる範囲を44pxに広げる */
.why-btn[aria-expanded="true"] { background: var(--color-text-secondary, #4a4860); color: #fff; border-color: var(--color-text-secondary, #4a4860); }
.why-note {
  display: block;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--color-text-primary);
}
.why-note[hidden] { display: none; }
/* 見出しは1行に切りつめる作りなので、説明が入る見出しだけ折り返せるようにする */
.ui-label:has(.why-btn) { display: block; white-space: normal; overflow: visible; text-overflow: clip; }
.why-note { white-space: normal; }
/* ── 生年月日の欄 ──
   iPhone の日付欄は中身の幅を優先して width:100% を無視し、となりの「実年齢」に重なる。
   標準の見た目を外すと指定した幅に収まる（外すと空のとき高さがつぶれるので高さを保つ）。 */
.person-card input[type="date"].ui-field {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
  max-width: 100%;
  min-height: 2.375rem; /* となりの「実年齢」と同じ高さ */
}
.person-card input[type="date"].ui-field::-webkit-date-and-time-value { text-align: center; }

/* ── 疾患等・医療機器等（1件ずつ、見せる／見せない） ── */
.note-list-items { display: grid; gap: 6px; margin: 4px 0 6px; }
.note-list-items:empty { display: none; }
.note-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--ui-line, rgba(45, 43, 61, 0.12)); }
.note-item-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 600; color: var(--color-text-primary); }
.note-item-vis { flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--ui-field-border, #c9c7d6); background: #fff; color: var(--color-text-secondary); font-size: 13px; font-weight: 700; cursor: pointer; }
.note-item-vis[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.note-item-del, .own-del { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--color-text-secondary); font-size: 18px; cursor: pointer; }
.note-list-add { display: flex; gap: 8px; }
.note-list-add input { flex: 1; min-width: 0; }
.note-list-add-btn { flex: none; min-height: var(--ui-field-h, 44px); padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--color-accent-border, #b9c8fb); background: var(--color-accent-bg, #eef2ff); color: var(--color-accent); font-weight: 700; white-space: nowrap; cursor: pointer; }
.note-consent { white-space: normal; margin: 0; font-size: 13px; line-height: 1.6; color: var(--color-text-secondary); }

/* ── 自分で入れる物・避難所で見せるカード ── */
.own-items .own-member + .own-member, .shelter-member + .shelter-member { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(45, 43, 61, 0.1); }
.own-member h3, .shelter-member h3 { margin: 0 0 6px; font-size: 15px; font-weight: 800; color: var(--color-text-primary); }
.own-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.own-list li { display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(45, 43, 61, 0.12); font-size: 15px; }
.own-list li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.own-empty { margin: 0 0 8px; font-size: 14px; color: var(--color-text-secondary); }
.own-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.own-example { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px dashed var(--ui-field-border, #c9c7d6); background: transparent; color: var(--color-text-secondary); font-size: 13px; font-weight: 700; cursor: pointer; }
.own-nudge { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #FFF4DC; color: #5A4200; font-size: 14px; line-height: 1.6; }
.own-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.own-check input { width: 22px; height: 22px; accent-color: var(--color-accent); }
.own-check input:checked + span { text-decoration: line-through; color: #5B5870; }
.own-status { margin: 10px 0 4px; font-weight: 800; }
.own-status.is-done { color: #1E7A45; }
.own-edit-link { font-size: 14px; color: var(--color-accent); text-decoration: underline; }
.shelter-card summary { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 16px; font-weight: 900; cursor: pointer; }
.shelter-note { margin: 4px 0 10px; font-size: 13px; line-height: 1.6; color: #5B5870; }
.shelter-row { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px; padding: 6px 0; font-size: 15px; }
.shelter-row dt { font-weight: 800; color: #5B5870; }
.shelter-row dd { margin: 0; overflow-wrap: anywhere; }
.shelter-member dl { margin: 0; }
/* マイページのお知らせ欄（.mypage-news）と同じ見た目の箱 */
.mypage-card { margin-top: 12px; padding: 12px 14px; background: #FFFDF7; border-radius: 16px; box-shadow: 0 6px 16px rgba(0,0,0,.25); color: #2D2B3D; text-align: left; }
.mypage-card h2 { margin: 0 0 6px; font-size: 16px; font-weight: 900; display: flex; align-items: center; gap: 8px; }

/* ── 文字の下限 ──
   design-tokens の決まり（13px未満は使わない）から外れていた補助ラベルを引き上げる。 */
body .progress-label,
body .status-label,
body .person-name-top,
body .person-hover-kcal,
body .person-hover-cta,
body .person-drop-placeholder,
body .cell-title,
body .cell-genre,
body .cell-edit,
body .budget-remaining-label,
body .btn.budget-add-btn,
body .meal-preview-hint,
body .prep-puzzle-title,
body .prep-item-name,
body .hint,
body .calendar-cell .cell-edit,
body .hazard-tile-name {
  /* この画面は基準の文字サイズ(rem)を小さくしている所があるので、px でも下限を決めておく */
  font-size: max(12px, var(--fs-xs));
}

/* ── 薄くて読みにくかった文字 ── */
body .person-drop-placeholder { color: var(--color-text-secondary); }

/* 選んだアレルギーの札: アクセント色の地に白文字だと薄いので、淡い地に濃い文字 */
.ef-tag,
.ef-tag-custom {
  background: var(--color-accent-bg);
  border: 1px solid var(--color-accent-border);
  color: var(--color-text-primary);
  box-shadow: none;
}
.ef-tag-custom { border-style: dashed; }
.ef-tag-x {
  min-width: 32px;
  min-height: 32px;
  color: var(--color-text-secondary);
}

/* ── 小さくて押しにくかったボタン ── */
body .cz-help-btn { min-width: 32px; min-height: 32px; }
.ui-danger-link { min-height: 36px; }

/* ── 献立の編集: 見出しの行 ── */
.nav-arrow {
  background: var(--ui-object-bg);
  border: 1.5px solid var(--ui-field-border);
  color: var(--color-text-primary);
}
.nav-arrow:hover { background: var(--card-hover-bg); border-color: var(--color-accent); color: var(--color-accent); }
.meal-modal-header { border-bottom-color: var(--ui-line); }
/* スマホ: 4つを1行に並べると右の「＞」が画面の外に出るので、ボタンは2行目に回す */
@media (max-width: 640px) {
  .meal-modal-header { grid-template-columns: 44px 1fr 44px; }
  .meal-modal-header > .nav-arrow:last-child { grid-column: 3; grid-row: 1; }
  .meal-modal-actions { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
}

/* ── 献立の編集: 皿が見えるように ──
   窓の地を白くしたので、白い皿（丸）が地に溶けて見えなくなった。
   皿を置く面にうすい色を敷き、皿には線と影を付ける。 */
.meal-modal-panel .meal-set-orbit,
.meal-modal-panel .meal-set-drop-zone {
  background: rgba(255, 243, 230, 0.45);
  border-color: rgba(45, 43, 61, 0.22);
}
.meal-modal-panel .meal-set-card,
.meal-modal-panel .custom-accordion-toggle,
.meal-modal-panel .custom-option-item {
  background: var(--ui-object-bg);
  border: 1.5px solid var(--ui-field-border);
}
.meal-modal-panel .meal-set-card .meal-set-orbit { background: rgba(255, 243, 230, 0.45); border-radius: var(--radius-sm); }
.meal-modal-panel .orbit-circle {
  background: var(--ui-object-bg);
  border: 1.5px solid rgba(45, 43, 61, 0.24);
  box-shadow: 0 2px 6px rgba(45, 43, 61, 0.12);
}

/* ── 白で塗りつぶしていた物を、すりガラスにそろえる ──
   基準はカスタマイズ画面のパネル（白55%＋ぼかし）。その上に置く物は白50%。
   つまみ・商品写真の地など、白でないと役目を果たさない物はそのまま。 */
.person-hover-panel,
.item-sheet-panel,
.mypage-menu,
.mypage-line-status,
.mypage-news,
.mypage-legal,
.gauge-budget.is-expanded .budget-footer-detail {
  background: var(--panel-bg);
  -webkit-backdrop-filter: var(--panel-blur);
  backdrop-filter: var(--panel-blur);
  border: 1px solid var(--panel-border);
}
.prep-item-tile,
.prep-upgrade-option,
.prep-person-card,
.meal-set-hover-card,
.person-snack-item:hover,
.bag-style,
.bag-mesh,
.budget-guide-chip,
.orders-plan-btn,
body.page-customise #budget-other-input,
.customise-body #budget-other-input,
body.page-customise .budget-modal-panel .btn.ghost,
.customise-body .budget-modal-panel .btn.ghost {
  background: var(--ui-object-bg);
}
.cell-gear { background: rgba(255, 255, 255, 0.7); }
/* 色つきの説明枠（なぜ必要？・個数・中に入れる物）も、色みは残して透かす */
.prep-upgrade-why { background: rgba(255, 246, 229, 0.6); }
.prep-upgrade-qty { background: rgba(255, 248, 231, 0.6); }
.prep-upgrade-contents { background: rgba(241, 246, 255, 0.6); }

/* ── カスタマイズ画面の横ゆれ防止 ──
   家族のふきだし（.person-hover-panel）は見えていないあいだも右に張り出していて、
   スマホで画面全体が横にスクロールし、右端が切れて見えていた。 */
html:has(> body.page-customise),
body.page-customise { overflow-x: clip; }

/* 献立表の見出し行: ボタンが入りきらない幅では折り返す（「リセット」の右端が切れていた） */
.section-head-actions { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }

/* 「予算を追加」: 文字と押せる高さを下限まで引き上げる */
body .btn.budget-add-btn {
  min-height: 36px;
  font-size: max(12px, var(--fs-xs));
}

/* 備えの品名: 文字を大きくしたぶん、長い名前（着替え（下着/靴下/長袖）など）は3行まで見せる */
.prep-item-name { -webkit-line-clamp: 3; }
/* 生年月日: 欄が細く「年/月/日」の右端が切れるので、左右の余白を詰める */
.slide-form .person-card input[type="date"].ui-field { padding-inline: 6px; }
.slide-form .person-card input[type="date"].ui-field::-webkit-calendar-picker-indicator { margin-inline-start: 0; padding: 0; }

/* ── 備えの品目を選ぶ窓 ── */
.prep-upgrade-actions .btn.ghost {
  border: 1.5px solid var(--ui-field-border);
  border-radius: var(--radius-pill);
  background: var(--ui-object-bg);
  color: var(--color-text-primary);
  box-shadow: none;
}
.prep-upgrade-actions .btn.primary { font-size: 15px; }
body .prep-upgrade-axis,
body .prep-upgrade-score { font-size: max(12px, var(--fs-xs)); }
/* スマホ: 品名の右端が ⓘ ボタンの下にもぐるのを避ける */
@media (max-width: 640px) {
  .prep-upgrade-option-name { padding-right: 28px; }
}

/* 家族フォーム: 選択ボタンの列は折り返す（スマホで「菜食」が画面の外に出ていた） */
[id^="religion-group-"],
[id^="gender-group-"],
[id^="body-type-group-"] { flex-wrap: wrap; row-gap: 6px; }
[id^="gender-group-"] > * + *,
[id^="body-type-group-"] > * + * { margin-left: 0.5rem; }

/* カスタマイズの家族編集: 「＋」はカードの横でなく下に置き、どのカードも同じ幅にする */
#customise-profile-form .person-card-container > .flex { flex-wrap: wrap; }
#customise-profile-form .add-button-wrapper { flex: 1 0 100%; display: flex; justify-content: center; }

/* スマホ: 家族・住所の編集は外側の余白を詰めて、入力欄の幅を確保する */
@media (max-width: 640px) {
  .col-profile-edit .flow-card,
  .col-address-edit .flow-card { padding: 20px 12px; }
}

/* ── 確認画面 ──
   カバンの絵の下の見出しは、暗い帯の上に暗い文字で読めなかった。ほかの画面と同じ白い帯にする。 */
.model-hero-overlay { background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6) 55%); }
.model-hero-overlay h2 { color: var(--color-text-primary); }
.model-hero-overlay p { color: var(--color-text-secondary); font-size: var(--fs-sm); }
/* 「スクロールで内容を確認」: 薄い白文字で気づけなかったので、札の形にしてはっきり見せる */
.model-scroll-hint {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid var(--color-accent-border);
  color: var(--color-accent);
  font-size: var(--fs-xs);
  font-weight: 700;
  box-shadow: var(--sticker-shadow);
}
@keyframes pulseHint { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
/* 選んでいないタブの文字も読める濃さに */
.sliding-tab { color: var(--color-text-secondary); }

/* ── マイページ: 利用規約などのリンクを押しやすい高さに ── */
.mypage-legal a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; }
/* スマホ: 案内の札が「◯アイテム選択済み」に重なるので、絵の右上に置く */
@media (max-width: 640px) {
  .model-scroll-hint { top: 0.75rem; right: 0.75rem; bottom: auto; }
}

/* ── スマホ: 家族カードを画面幅いっぱい近くまで広げる ──
   外側の余白が5重（ページ・パネル・カード・区切り…）に重なり、入力欄が画面の6割しか無かった。 */
@media (max-width: 640px) {
  .customise-page:has(.col-profile-edit:not(.is-hidden-by-tab)),
  .customise-page:has(.col-address-edit:not(.is-hidden-by-tab)) { padding-left: 0; padding-right: 0; }
  .col-profile-edit .flow-card,
  .col-address-edit .flow-card { padding: 20px 8px; }
  .person-card.person-card { padding: 12px 10px; }
  .person-card .ui-well,
  .slide-form .person-card .ui-well { padding: 10px 8px; }
  /* 会話の中の入力スライド（家族・住所・予算）も同じだけ広げる */
  .onboarding-root.is-form-slide { padding-left: 0; padding-right: 0; }
  .onboarding-root.is-form-slide .chat-shell { padding-left: 8px; padding-right: 8px; }
  .onboarding-root.is-form-slide .slide { padding-left: 4px; padding-right: 4px; }
}
