:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #2b2b2b;
  --sub: #6f6a62;
  --line: #e4e0d8;
  --accent: #2f8f83;
  /* 選んだ印・押した時の色。2026-11-24 に薄い緑から灰色にした（著者「なんで変えたところも薄緑なの？」） */
  --accent-soft: #e7e3db;
  --sun: #d6453d;
  --sat: #2f6fc0;
  --danger: #c8443c;
  --seg-bg: #e9e6df;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
/* 下に引っ張って更新（ブラウザの機能）を止める。Android の Chrome は html の指定を見る */
html { touch-action: manipulation; overscroll-behavior-y: none; }
html.size-l { font-size: 18px; }
html.size-s { font-size: 14px; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  line-height: 1.5; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: max(16px, 1rem); }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

/* 上の帯 */
.top {
  position: sticky; top: 0; z-index: 5; background: var(--card);
  padding: calc(var(--safe-t) + 8px) 12px 8px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 1.25rem; margin: 0; flex: 1; text-align: center; font-weight: 700; }
/* 設定のページの見出しは、左の「‹」（幅44px）と同じ空きを右にも置いて、画面の真ん中に出す（2026-11-24 著者「タイトルが右に少し寄ってる」） */
.top #set-back + h1 { margin-right: 52px; }
.icon-btn {
  border: none; background: none; min-width: 44px; height: 44px; border-radius: 12px;
  font-size: 1.3rem; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:active { background: var(--accent-soft); }
.today-btn { font-size: .85rem; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px; }

#view { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); }

/* 月の表 */
.weekhead, .grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekhead { background: var(--card); font-size: .75rem; text-align: center; color: var(--sub); padding: 4px 0; border-bottom: 1px solid var(--line); }
.weekhead .sun { color: var(--sun); }
.weekhead .sat { color: var(--sat); }
.grid { background: var(--line); gap: 1px; border-bottom: 1px solid var(--line); }
.cell {
  background: var(--card); min-height: 4.6rem; padding: 2px 2px 4px; overflow: visible; min-width: 0;
  border: none; text-align: left; display: flex; flex-direction: column; gap: 1px;
}
.cell.other { background: #faf9f6; }
.cell.other .num { opacity: .4; }
.cell.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.num { font-size: .8rem; font-weight: 600; width: 1.6rem; height: 1.6rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cell.today .num { background: var(--accent); color: #fff; }
.cell.sun .num, .cell.hol .num { color: var(--sun); }
.cell.sat .num { color: var(--sat); }
.cell.today.sun .num, .cell.today.sat .num, .cell.today.hol .num { color: #fff; }
.holname { font-size: .55rem; color: var(--sun); line-height: 1.1; white-space: nowrap; overflow: hidden; }
.chip-ev {
  font-size: .62rem; line-height: 1.35; padding: 0 3px; border-radius: 3px; white-space: nowrap; overflow: hidden;
  text-overflow: clip; color: #fff;
}
.more { font-size: .6rem; color: var(--sub); padding-left: 3px; }

/* 1日の予定 */
.daylist { padding: 12px; }
.daylist h2 { font-size: 1.05rem; margin: 4px 4px 10px; display: flex; align-items: baseline; gap: 8px; }
.daylist h2 small { color: var(--sun); font-weight: 400; font-size: .8rem; }
.ev {
  display: flex; gap: 10px; width: 100%; text-align: left; background: var(--card); border: none;
  border-radius: 14px; padding: 12px; margin-bottom: 8px; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.ev .bar { width: 5px; align-self: stretch; border-radius: 3px; }
.ev .time { font-size: .8rem; color: var(--sub); min-width: 4.6em; }
.ev .title { font-weight: 600; flex: 1; word-break: break-word; }
.ev .meta { font-size: .75rem; color: var(--sub); }
.dot { width: .65rem; height: .65rem; border-radius: 50%; display: inline-block; }
.empty { color: var(--sub); text-align: center; padding: 20px 0; font-size: .9rem; }

/* 右下の追加ボタン */
.fab {
  position: fixed; right: 18px; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); z-index: 6;
  width: 60px; height: 60px; border-radius: 50%; border: none; background: var(--accent); color: #fff;
  font-size: 2rem; box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* 下のタブ */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b); height: calc(var(--tab-h) + var(--safe-b));
}
.tabs button {
  flex: 1; border: none; background: none; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; font-size: .75rem; color: var(--sub);
}
.tabs button span { font-size: 1.4rem; line-height: 1; }
.tabs button.on { color: var(--accent); font-weight: 700; }

/* 下から出る板 */
.overlay, .overlay-out { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.overlay { animation: fade-in .22s ease-out; }
.overlay-out { animation: fade-out .22s ease-in forwards; pointer-events: none; }
.sheet {
  background: var(--bg); width: 100%; max-width: 640px; max-height: min(92vh, 92%); overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 8px 16px calc(var(--safe-b) + 20px);
  animation: sheet-up .3s cubic-bezier(.2,.9,.3,1);
  transition: transform .25s cubic-bezier(.2,.9,.3,1);
}
.overlay-out .sheet { animation: sheet-down .22s ease-in forwards; }
/* 板から板へ移る時は、下から出し直さずに中身だけを入れ替える */
.overlay.swap { animation: none; }
.overlay.swap .sheet { animation: fade-in .16s ease-out; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 8px; position: sticky; top: -8px; background: var(--bg); padding: 14px 0 8px; z-index: 1; touch-action: none; }
/* 下に引けば閉じられることを示す、上の短い線 */
.sheet-head::before { content: ""; position: absolute; top: 5px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: #d3cec4; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 1.1rem; }

/* 入力 */
.card { background: var(--card); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.card h4 { margin: 0 0 8px; font-size: .95rem; }
label.field, div.field { display: block; margin-bottom: 12px; }
label.field > span, div.field > span { display: block; font-size: .8rem; color: var(--sub); margin-bottom: 4px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card); min-height: 44px;
}
textarea.input { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; min-height: 40px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; }
.swatch.on { border-color: var(--ink); }
.swatches { gap: 6px; flex-wrap: nowrap; }
.swatches .swatch { width: 32px; height: 32px; flex: none; }
/* 予定の色の欄は「ラベルの色」の札が入るので、狭い画面では折り返す */
#ev-colors { flex-wrap: wrap; align-items: center; }
#ev-colors .chip { flex: none; white-space: nowrap; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
/* オンオフの切り替えは、四角の印ではなく、左右に動くスイッチにする */
.toggle input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 48px; height: 28px; margin: 0;
  border-radius: 14px; background: #cfcac1; cursor: pointer; transition: background-color .2s;
}
.toggle input[type=checkbox]::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.toggle input[type=checkbox]:checked { background: var(--accent); }
.toggle input[type=checkbox]:checked::before { transform: translateX(20px); }
.toggle input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.dark .toggle input[type=checkbox]:not(:checked) { background: #565b63; }
@media (prefers-reduced-motion: reduce) { .toggle input[type=checkbox], .toggle input[type=checkbox]::before { transition: none; } }
/* 設定の画面の「通知の設定 ›」のように、別の画面を開く1行 */
.set-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; border: none; font: inherit; color: inherit; text-align: left; font-weight: 700; font-size: .95rem; cursor: pointer; }
.set-link .meta { font-weight: 400; }
.set-arrow { font-size: 1.4rem; color: var(--sub); }
.btn {
  border: none; border-radius: 12px; padding: 12px 16px; min-height: 48px; font-weight: 700;
  background: var(--accent); color: #fff; width: 100%;
}
.btn.sub { background: var(--card); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn.danger { background: var(--card); color: var(--danger); border: 1px solid #ecc9c5; }.btn:disabled { opacity: .5; }
.btns { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.note { font-size: .8rem; color: var(--sub); margin: 6px 0 0; }
.account-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.account-buttons:empty, #account-login-card .err:empty, #account-settings .err:empty { display: none; }
.account-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 44px; padding: 0 16px; border: 1px solid #747775; border-radius: 8px;
  background: #fff; color: #1f1f1f; font: inherit; font-weight: 600; cursor: pointer;
}
.account-button.account-apple { background: #000; color: #fff; border-color: #767676; }
.account-button svg { width: 18px; height: 18px; flex: none; }
.account-button:disabled { opacity: .55; cursor: default; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.account-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.account-row button { flex: none; width: auto; min-height: 40px; padding: 8px 14px; }
.err { color: var(--danger); font-size: .85rem; margin: 6px 0; min-height: 1em; }

/* 予定の中身 */
.detail-title { font-size: 1.3rem; font-weight: 700; margin: 4px 0 6px; word-break: break-word; }
.detail-line { display: flex; gap: 10px; padding: 6px 0; align-items: flex-start; }
.detail-line .k { width: 1.6em; text-align: center; }
/* 設定の一覧（削除した予定・ウィジェット・色分け）とプリントの持ち物の、添え書きの行は、予定表と同じ小さい灰色の字にする */
.detail-line .meta { font-size: .8rem; color: var(--sub); }
/* プリントの画面の持ち物と Todo の行。押すと品の編集の画面が開く */
.print-item { width: 100%; min-height: 44px; align-items: center; background: none; border: 0; border-top: 1px solid var(--line, rgba(127,127,127,.2)); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.print-item .print-item-t { flex: 1; word-break: break-word; }
.memo { white-space: pre-wrap; word-break: break-word; }
.detail-line a.link { color: var(--accent); text-decoration: underline; word-break: break-all; }
.days-left { margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: var(--accent); color: #fff; font-size: .75rem; white-space: nowrap; }
/* ラベルの無い予定の右の通知先の名前。長い名前で予定の名前を狭めないよう、幅を決めて省く */
.owner-names { display: inline-block; max-width: 6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.comment { padding: 8px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: none; }
.comment .who { font-size: .75rem; font-weight: 700; }
.comment .when { font-size: .7rem; color: var(--sub); margin-left: 6px; font-weight: 400; }
.comment .body { white-space: pre-wrap; word-break: break-word; }

/* 買い物・やること */
.seg { display: flex; background: var(--seg-bg); border-radius: 12px; padding: 3px; margin: 12px; }
.seg button { flex: 1; border: none; background: none; border-radius: 10px; padding: 8px; min-height: 40px; font-weight: 600; color: var(--sub); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.items { padding: 0 12px; }
.item { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 6px 6px 6px 12px; margin-bottom: 6px; min-height: 52px; }
.item input[type=checkbox] { width: 26px; height: 26px; accent-color: var(--accent); flex: none; }
.item .text { flex: 1; word-break: break-word; cursor: pointer; }
.item.done .text { text-decoration: line-through; color: var(--sub); }
.additem { display: flex; gap: 8px; padding: 0 12px 12px; }
.additem .btn { width: auto; padding: 0 18px; }

/* 写真の読み込み */
.photo-ev { background: var(--card); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.photo-ev .row { margin-top: 6px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
/* 日付は見切れないように1行を使い、時刻は次の行に「始まり 〜 終わり」で並べる */
.photo-ev .row [name=start_date] { grid-column: 1 / -1; }
.photo-ev .row .sep { color: var(--sub); }
.photo-ev .row .input { min-width: 0; width: 100%; }
.photo-ev .head { display: flex; gap: 10px; align-items: center; }
.photo-ev .head input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 30px auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* はじめの画面 */
.setup { max-width: 520px; margin: 0 auto; padding: calc(var(--safe-t) + 24px) 16px 40px; }
.setup h1 { font-size: 1.5rem; text-align: center; margin: 8px 0 4px; }
.setup .lead { text-align: center; color: var(--sub); margin: 0 0 20px; }
.banner { background: #fff6dc; border: 1px solid #f0dfa6; border-radius: 12px; padding: 10px 12px; font-size: .85rem; margin-bottom: 12px; }
.code { font-size: 2rem; letter-spacing: .25em; font-weight: 700; text-align: center; padding: 8px 0; font-family: ui-monospace, Menlo, monospace; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 90px); transform: translateX(-50%);
  background: rgba(30,30,30,.88); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .9rem; z-index: 40;
  max-width: 90vw; text-align: center;
}
.offline { background: #fde6e4; color: var(--danger); font-size: .8rem; text-align: center; padding: 4px; }
/* 下のタブと追加ボタンに隠れないように、スクロールで止まる位置を上げる */
.ev, .item, .cell, .btn { scroll-margin-bottom: calc(var(--tab-h) + var(--safe-b) + 90px); }
.print-row img { width: 64px; height: 84px; object-fit: cover; border-radius: 8px; background: var(--line); flex: none; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; margin-bottom: 10px; border-radius: 10px; background: var(--accent-soft, var(--line)); font-size: .9rem; font-weight: 600; }
.filter-bar .today-btn { flex: none; margin: 0; }
.left-name { margin: 10px 0 2px; font-weight: 600; }
.left-name:first-child { margin-top: 0; }
.left-row { display: flex; justify-content: space-between; font-size: .9rem; color: var(--sub); margin-top: 6px; }
.left-row b { color: var(--text, inherit); font-size: 1.05rem; }
.left-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 3px; }
.left-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.left-bar.low i { background: #e0883a; }
.left-reset { margin: 2px 0 0; font-size: .8rem; color: var(--sub); text-align: right; }
mark { background: #fff0a8; color: inherit; padding: 0 1px; border-radius: 2px; }
details summary { cursor: pointer; margin: 6px 0; }
/* 設定の「表示」の欄の中の小見出し */
.set-sub { margin: 14px 0 6px; font-weight: 600; }
.set-sub:first-child { margin-top: 0; }
.additem .btn { white-space: nowrap; }

/* ---- 動き ---- */
/* 月の表：払うと指に付いて動き、次の月が横から入る */
.grid-wrap { overflow: hidden; background: var(--card); touch-action: pan-y; }
.grid { will-change: transform; }
.grid.in-next { animation: in-next .28s cubic-bezier(.2,.8,.2,1) both; }
.grid.in-prev { animation: in-prev .28s cubic-bezier(.2,.8,.2,1) both; }
h1.month.in-next { animation: title-next .28s ease-out both; }
h1.month.in-prev { animation: title-prev .28s ease-out both; }
@keyframes in-next { from { transform: translateX(45%); opacity: 0; } }
@keyframes in-prev { from { transform: translateX(-45%); opacity: 0; } }
@keyframes title-next { from { transform: translateX(24px); opacity: 0; } }
@keyframes title-prev { from { transform: translateX(-24px); opacity: 0; } }
/* 日を選んだ時：選んだ枠が弾み、その日の予定が順に下から出る */
.cell { transition: background-color .15s; }
.cell:active { background: var(--accent-soft); }
.cell.selected.pop .num { animation: pop .25s ease-out; }
@keyframes pop { 50% { transform: scale(1.25); } }
.daylist.fade h2 { animation: rise .25s ease-out both; animation-delay: var(--d, 0ms); }
.daylist.fade .ev { animation: rise .28s ease-out both; animation-delay: calc(var(--d, 0ms) + var(--i, 0) * 40ms + 40ms); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
/* タブを切り替えた時 */
#view.tabin { animation: fade-in .2s ease-out; }
/* 押した時に少し沈む */
.ev, .btn, .chip, .item, .today-btn, .seg button { transition: transform .12s, background-color .15s, box-shadow .15s; }
.ev:active, .btn:active, .chip:active, .today-btn:active { transform: scale(.97); }
.fab { transition: transform .15s; }
.fab:active { transform: scale(.9) rotate(90deg); }
.tabs button span { transition: transform .2s; }
.tabs button.on span { transform: translateY(-2px) scale(1.12); }
/* 買い物・持ち物・やること：足した行は光り、済んだ行と消した行は縮んで消える */
.item.adding { animation: item-in .5s ease-out; }
@keyframes item-in { from { transform: translateY(-6px); opacity: 0; background: var(--accent-soft); } 40% { opacity: 1; background: var(--accent-soft); } }
.item .text { transition: color .2s; }
.item.moving { animation: item-out .32s ease-in forwards; animation-delay: .1s; }
.item.removing { animation: item-gone .22s ease-in forwards; }
@keyframes item-out { to { opacity: 0; transform: scale(.96); } }
@keyframes item-gone { to { opacity: 0; transform: translateX(40px); } }
/* 知らせの帯 */
/* 知らせは板の上にも重なるので、知らせの上をなぞっても後ろの画面を動かさない（2026-11-29。持ち物のセットの板の見出しに重なった知らせをなぞると、後ろの画面が95px 動いた）。押すのはできる */
.toast { touch-action: none; }
.toast { animation: toast-in .25s cubic-bezier(.2,.9,.3,1.3); transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translate(-50%, 10px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px) scale(.9); } }
/* 動きを減らす設定の端末では、動きを止める */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

/* ラベル（だれの予定か） */
.lpills { display: inline-flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; }
.lpill { color: #fff; font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; vertical-align: 1px; }

/* AI に相談 */
.chat { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.msg.new { animation: rise .25s ease-out; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--card); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.msg-bad { align-self: flex-start; margin: -4px 0 0 6px; padding: 2px 8px; border: 0; background: none; color: var(--sub); font-size: .75rem; }
.msg-bad:disabled { opacity: .7; }
/* AI の答えの元にしたプリント（答えの吹き出しの下に並べる） */
.msg-prints { align-self: flex-start; width: min(85%, 360px); display: grid; gap: 6px; }
.msg-prints .print-row { margin: 0; }
.msg-prints .print-row img { width: 48px; height: 64px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sub); animation: blink 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
/* 答える親鳥「シマちゃん」（2026-11-25）。AI の吹き出しの左下に顔を置き、返事を待つ間は顔が跳ねる */
.bot-row { align-self: flex-start; display: flex; align-items: flex-end; gap: 6px; max-width: 94%; }
.bot-row.new { animation: rise .25s ease-out; }
.bot-row .msg { max-width: none; min-width: 0; }
.shima-face { flex: none; width: 36px; height: 36px; border-radius: 50%; }
.shima-face.thinking { animation: shima-hop 1.1s infinite ease-in-out; }
@keyframes shima-hop { 0%, 60%, 100% { transform: none; } 20% { transform: translateY(-5px) rotate(-6deg); } 40% { transform: rotate(4deg); } }
/* 会話が空の時の、シマちゃんのあいさつ */
.shima-hello { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 8px 8px 4px; text-align: center; }
.shima-hello .shima-wave { margin-top: 26px; animation: rise .4s ease-out; }
.shima-hello p { margin: 0; color: var(--sub); font-size: .9rem; line-height: 1.6; }
.ai-form {
  position: sticky; bottom: calc(var(--tab-h) + var(--safe-b)); display: flex; gap: 8px; align-items: flex-end;
  padding: 8px 12px; background: var(--bg); border-top: 1px solid var(--line);
}
.ai-form textarea { min-height: 44px; resize: none; }
/* AIに相談の画面：会話が短くても、入力欄はタブのすぐ上に置く */
#view.ai-view { display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
#view.ai-view .chat { flex: 1; }
/* 入力欄は横いっぱいにして、撮る・アルバム・送るはその下に並べる */
.ai-form-btns { display: flex; gap: 8px; align-items: stretch; }
.ai-form-btns .btn { margin-left: auto; min-width: 96px; }
.ai-form .btn { width: auto; flex: none; padding: 0 18px; }

/* 給食の献立（持ち物などのタブ） */
.menu-day { background: var(--card); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; }
.menu-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.menu-body { display: flex; align-items: flex-start; gap: 6px; line-height: 1.6; }
.menu-body > .icon-btn { margin-left: auto; flex: none; min-width: 36px; height: 36px; }
.seg button { padding: 8px 2px; font-size: .9rem; white-space: nowrap; }

/* AI の入れる案と、送る写真 */
.proposal { align-self: stretch; background: var(--card); border: 2px solid var(--accent); border-radius: 16px; padding: 10px 12px; animation: rise .25s ease-out; }
.proposal.saved { border-color: var(--line); }
.proposal h4 { margin: 0 0 6px; font-size: .95rem; color: var(--accent); }
.proposal.saved h4 { color: var(--sub); }
.prow { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 1px solid var(--line); line-height: 1.5; }
.prow input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin-top: 2px; }
.proposal .btn { margin-top: 6px; }
/* 案を出し直したので消した札の跡 */
.proposal-gone { align-self: flex-start; margin: -4px 0 0 6px; font-size: .8rem; }
.msg-photo { display: block; max-width: 160px; max-height: 200px; border-radius: 10px; margin-bottom: 6px; }
.attach { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.attach img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.ai-form { flex-direction: column; align-items: stretch; }
.ai-form .row > textarea { flex: 1; }
.ai-cam { flex: none !important; font-size: 1.5rem; }

/* プリントを AI で探した答え */
.ai-answer { background: var(--card); border: 2px solid var(--accent); border-radius: 14px; padding: 10px 12px; margin-top: 10px; line-height: 1.6; animation: rise .25s ease-out; }
.ai-answer .print-row { background: var(--bg); box-shadow: none; }

/* 下のタブ：選んでいるタブの絵だけを色付きで出し、ほかは灰色で薄くする */
.tabs button span { filter: grayscale(1); opacity: .45; transition: transform .2s, filter .2s, opacity .2s; }
.tabs button.on span { filter: none; opacity: 1; transform: translateY(-2px) scale(1.15); }
.tabs button.on { position: relative; }
.tabs button.on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }

/* 写真を付けるボタン（AI のタブと、持ち物などの「AI にお願い」） */
.cam-btn {
  flex: none !important; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 52px; height: 48px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; font-size: 1.2rem; line-height: 1;
}
.cam-btn span { font-size: .65rem; color: var(--sub); margin-top: 3px; }
/* 音声入力で聞いている間 */
.cam-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cam-btn.on span { color: var(--accent); }
.item-ai { margin: 0 12px 10px; padding: 10px; background: var(--accent-soft); border-radius: 14px; }
.item-ai .input { background: var(--card); }
.item-ai .ai-answer { margin-top: 8px; }

/* 予定表の上の段と、その下の「予定／献立」の切り替え、献立を出した表 */
.cal-top { padding-left: 4px; gap: 4px; }
.cal-top h1 { flex: none; font-size: 1.15rem; }
.cal-top .icon-btn { min-width: 36px; }
.cal-pick { flex: 1; min-width: 0; margin-left: 4px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.view-seg-row { background: var(--card); padding: 0 12px 6px; }
.view-seg { display: flex; padding: 2px; border-radius: 999px; background: var(--seg-bg); }
.view-seg button {
  flex: 1; border: none; background: none; border-radius: 999px; padding: 4px 10px; font-size: .85rem; font-weight: 700;
  color: var(--sub); white-space: nowrap; transition: background-color .2s, color .2s;
}
.daylist { padding-bottom: 140px; }
.view-seg button[data-v=events].on { background: var(--accent); color: #fff; }
.view-seg button[data-v=menu].on { background: #e3a33b; color: #1f2328; }
.grid.menu-mode .cell:not(.other) { background: #fffaf0; }
.cell-menu {
  font-size: .62rem; line-height: 1.35; color: #6b4a12; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; word-break: break-all;
}
.grid.mode-in { animation: fade-in .25s ease-out both; }
.daylist.fade .menu-day { animation: rise .28s ease-out both; animation-delay: calc(var(--d, 0ms) + var(--i, 0) * 40ms + 40ms); }
@media (prefers-reduced-motion: reduce) { .grid.mode-in, .daylist.fade .menu-day { animation: none; } }

/* 何日も続く予定は、マスをまたぐ1本の帯にする */
.chip-ev.blank { background: transparent; }
.chip-ev.span { margin: 0 -3px; border-radius: 0; }
.chip-ev.span.open { margin-left: 0; border-top-left-radius: 3px; border-bottom-left-radius: 3px; }
.chip-ev.span.close { margin-right: 0; border-top-right-radius: 3px; border-bottom-right-radius: 3px; }
.chip-ev.span.head { position: relative; z-index: 1; overflow: visible; }
.chip-ev.span.head span { display: block; overflow: hidden; width: calc(var(--n) * (100% + 1px) - 6px); }

/* やることのタブ（タブが6つになったので、文字を少し小さくする） */
.tabs button { font-size: .68rem; min-width: 0; white-space: nowrap; }
.todo-head.late { color: var(--danger); }
.todo-filter { padding: 0 12px 8px; overflow-x: auto; flex-wrap: nowrap; }
.todo-filter .chip { flex: none; min-height: 36px; padding: 4px 12px; font-size: .88rem; }
.todo-head { margin: 14px 4px 6px; font-weight: 700; }
.item.todo .text { border: none; background: none; text-align: left; padding: 6px 0; font: inherit; color: inherit; line-height: 1.5; }
.item.todo .meta { margin-right: 4px; }
.rp-type { margin: 0 0 6px; }
.rp-type button { font-size: .8rem; padding-left: 4px; padding-right: 4px; }
.rp-label { margin: 8px 2px 4px; }
.rp-days .chip { min-width: 40px; justify-content: center; padding: 4px 6px; min-height: 36px; }
.rp-next { margin: 10px 2px 0; }
.rp-hint { margin: 0 2px 2px; font-size: .8rem; }
/* 曜日の7つ・第何週の6つ・間隔の4つを、折り返さずに1行に同じ幅で並べる */
.rp-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px; }
.rp-grid .chip { justify-content: center; padding-left: 0; padding-right: 0; min-width: 0; white-space: nowrap; font-size: .9rem; }
.daylist .item.todo { background: var(--card); }
#rp .chips { gap: 6px; }
#rp .chip { min-width: 40px; justify-content: center; padding: 4px 8px; min-height: 38px; }
.fab.fab-photo { background: #e3a33b; color: #1f2328; font-size: 1.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.fab.fab-photo span { font-size: .6rem; font-weight: 700; margin-top: 3px; }
/* 横に動かす札の行は、目盛り（スクロールバー）を出さない。ページ全体は横に動かない */
.todo-filter { scrollbar-width: none; -ms-overflow-style: none; }
.todo-filter::-webkit-scrollbar { display: none; }
html, body { overflow-x: clip; }
.item-ai-title { margin: 0 2px 6px; font-weight: 700; font-size: .9rem; }
.item-ai textarea { width: 100%; resize: none; min-height: 3.2em; }
.item-ai-done { margin: 8px 2px 0; font-weight: 700; color: var(--accent, #2a8a7a); }
.chip .chip-ev-name { display: inline-block; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; margin-left: 0; font-weight: 700; }
.item-ai-title { display: flex; align-items: center; justify-content: space-between; }
.item-ai-title .icon-btn { font-size: 1rem; color: var(--sub); }
.add-extra[hidden] { display: none; }
.prep-head { padding: 0 12px; }
/* 持ち物のグループの見出しと、長押しで動かす時の見た目 */
.prep-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 4px 6px; }
.prep-title .note { flex: 1; margin: 0; font-weight: 700; }
.prep-title .chip { flex: none; padding: 4px 10px; font-size: .8rem; }
.prep-list { position: relative; }
.prep-grp { display: flex; align-items: center; gap: 6px; margin: 14px 4px 6px; font-size: .85rem; font-weight: 700; color: var(--sub); }
.lifting { position: relative; z-index: 4; box-shadow: 0 8px 20px rgba(0,0,0,.25); opacity: .95; transition: none !important; }
.drop-line { position: absolute; left: 4px; right: 4px; height: 4px; border-radius: 2px; background: var(--accent); z-index: 5; pointer-events: none; }
.prep-link { margin-top: 8px; text-align: left; }
/* 2回続けて触った時に、画面の文字が選ばれないようにする（入力欄の文字は選べる） */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; }
/* 予定のメモ・場所と AI の返事は、長押しで選んで LINE などに貼れるようにする */
.detail-line, .msg, .ai-answer, #set-version { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
#set-version { text-align: center; margin: 16px 0 8px; }
.discard { background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.discard p { margin: 0 0 8px; font-weight: 700; }
.folder { background: var(--card); border-radius: 12px; margin-bottom: 6px; overflow: hidden; }
.folder-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 6px 14px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.folder-head > span:first-child { flex: 1; }
.folder-head .chev { color: var(--sub); width: 1em; }
.folder-body { padding: 0 6px 6px; }
.folder-body .item { background: var(--bg); }
.menu-tags { padding: 0 12px 6px; }
.group-del { margin-top: 2px; }

/* ダークモード（設定の「画面の色」）。色は変数で入れ替え、直接書いた色だけをここで上書きする */
html.dark {
  color-scheme: dark;
  --bg: #16181a;
  --card: #24272b;
  --ink: #e8e6e1;
  --sub: #a7a197;
  --line: #3b3f45;
  --accent: #3aa797;
  --accent-soft: #34383e;
  --sun: #ef6f67;
  --sat: #6fa5ee;
  --danger: #ef6f67;
  --seg-bg: #2e3136;
}
html.dark .cell.other { background: #1c1e21; }
html.dark .grid.menu-mode .cell:not(.other) { background: #272218; }
html.dark .cell-menu { color: #e8c27e; }
html.dark .banner { background: #3a3220; border-color: #5c4b22; }
html.dark mark { background: #6b5a10; }
html.dark .offline { background: #4a2522; }
html.dark .btn.danger { border-color: #6a3530; }
html.dark .sheet-head::before { background: #4a4e55; }
html.dark .overlay, html.dark .overlay-out { background: rgba(0,0,0,.55); }
html.dark .item-ai .input { background: var(--bg); }
html.dark img.msg-photo, html.dark .attach img { opacity: .92; }
.item-ai .ai-ex { flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin: 8px -10px 0; padding: 0 10px 2px; scrollbar-width: none; }
.item-ai .ai-ex::-webkit-scrollbar { display: none; }
.item-ai .ai-ex .chip { flex: none; min-height: 34px; padding: 4px 10px; font-size: .85rem; background: var(--card); }
html.dark .item-ai .ai-ex .chip { background: var(--bg); }

/* 下のタブで選んでいる画面の名前は、上に出さない（スマホの上端の余白だけ残す） */
.top.bare { padding: var(--safe-t) 0 0; border-bottom: none; min-height: 0; }

/* Todo と買い物の右下のボタン（＋は手で追加、✨ は AIにお願い） */
.fab-box { position: fixed; right: 18px; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fab-box { transition: transform .25s ease, opacity .25s ease; }
.fab-box.away { transform: translateX(calc(100% + 30px)); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .fab-box { transition: none; } }
.fab-box .fab { position: static; line-height: 1; display: flex; align-items: center; justify-content: center; }
.fab-box .fab-ai { width: 52px; height: 52px; font-size: 1.3rem; flex-direction: column; background: var(--card); color: var(--ink); box-shadow: 0 3px 10px rgba(0,0,0,.2), inset 0 0 0 1px var(--line); }
.fab-box .fab-ai span { font-size: .7rem; font-weight: 700; margin-top: -2px; }
.fab-box .fab-ai:active { transform: scale(.94); }
.items.with-fab { padding-bottom: 150px; }
#item-ai-host .item-ai { margin: 0; }

/* 予定の詳しい画面：名前の右上に、編集と削除の小さなボタン。名前の2行目からは、ボタンの下を右まで使う */
.detail-btns { float: right; display: flex; gap: 6px; margin: 1px 0 0 8px; font-weight: 400; line-height: 1.4; }
.detail-btns .today-btn { padding: 3px 10px; }
.detail-btns .del-btn { color: var(--danger); }

/* 板の中で引っ張っても、後ろの画面や更新に伝えない。取っ手を引く動きはアプリだけで扱う */
.overlay, .sheet { overscroll-behavior: contain; }
.sheet-head { touch-action: none; }
/* 板の外の暗い所をなぞっても、後ろの画面を動かさない（2026-11-24）。html に overflow-x: clip があるので、板を開いた時の
   body の overflow: hidden は画面全体のスクロールを止めない。板の中は板（.sheet）が自分でスクロールするので、この指定は効かない。
   右の欄の板と、半分に折った時の板（pane）は、ほかの所の画面を触れるままにする */
.overlay:not(.pane) { touch-action: none; }

/* 消した直後の「元に戻す」の知らせ */
.toast.undo { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 16px; white-space: nowrap; }
.toast.undo span { overflow: hidden; text-overflow: ellipsis; }
.toast.undo button { flex: none; border: none; background: none; color: #7fe0cf; font-weight: 700; padding: 8px 12px; border-radius: 999px; }
.toast.undo button:active { background: rgba(255,255,255,.12); }

/* 予定表の「月／週／献立」の横の、探すボタン */
.view-seg-row { display: flex; align-items: center; gap: 6px; }
.view-seg-row .view-seg { flex: 1; }
.search-btn { flex: none; min-width: 36px; height: 32px; font-size: 1rem; }
.view-seg button[data-v=week].on { background: var(--accent); color: #fff; }
.search-head { margin: 14px 4px 6px; font-weight: 700; }
#sr { margin-top: 8px; }
#sr .ev .time { font-size: .8rem; }
mark { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 1px; }
html.dark mark { background: #6b5a14; }

/* LINE で送るボタン */
.line-mini {
  display: block; margin: 10px 4px 0 auto; border: 1px solid #06c755; background: var(--card); color: #05a046;
  border-radius: 999px; padding: 3px 12px; font-size: .8rem; font-weight: 700;
}
.daylist h2 .line-mini { margin: 0 0 0 auto; align-self: center; }
.card .line-mini { margin-top: 12px; }
/* 予定の詳しい画面の下の「別の日にコピー」と「LINEで送る」 */
.ev-acts { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ev-acts .today-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; }
.card .ev-acts .line-mini { margin: 0; min-height: 36px; }
html.dark .line-mini { color: #3ddc84; }

/* Todo の通知の時刻 */
.rm-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.rm-row select { width: 7.5em; flex: none; }
.rm-row input { flex: 1; min-width: 0; }
.rm-row .icon-btn { flex: none; font-size: 1rem; color: var(--sub); }
.rm-note { margin: 6px 0 0; }

/* 週の表示：横に7日、縦に時刻 */
.wk { background: var(--card); }
.wk.in-next { animation: in-next .28s cubic-bezier(.2,.8,.2,1) both; }
.wk.in-prev { animation: in-prev .28s cubic-bezier(.2,.8,.2,1) both; }
.wk-head, .wk-allday, .wk-inner { display: grid; grid-template-columns: 34px repeat(7, minmax(0, 1fr)); }
.wk-head { border-bottom: 1px solid var(--line); }
.wk-day { border: none; background: none; padding: 2px 0 4px; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.wk-day small { font-size: .7rem; color: var(--sub); }
.wk-day b { font-size: .95rem; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.wk-day.sun small, .wk-day.sun b { color: var(--sun); }
.wk-day.sat small, .wk-day.sat b { color: var(--sat); }
.wk-day.selected b { box-shadow: inset 0 0 0 2px var(--accent); }
.wk-day.today b { background: var(--accent); color: #fff; }
.wk-allday { border-bottom: 1px solid var(--line); }
.wk-allday > .wk-gut { font-size: .62rem; color: var(--sub); display: flex; align-items: center; justify-content: center; }
.wk-ad { display: flex; flex-direction: column; gap: 2px; padding: 2px 1px; min-width: 0; border-left: 1px solid var(--line); }
.wk-chip, .wk-ev {
  border: none; border-radius: 4px; font-size: .68rem; line-height: 1.25; text-align: left; padding: 1px 3px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0;
}
.wk-body { overflow-y: auto; overscroll-behavior: contain; position: relative; }
.wk-inner { position: relative; }
.wk-inner > .wk-gut { position: relative; }
.wk-inner > .wk-gut span { position: absolute; right: 4px; transform: translateY(-50%); font-size: .62rem; color: var(--sub); }
.wk-col {
  position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 44px);
}
.wk-col.today { background-color: var(--accent-soft); }
.wk-ev { position: absolute; white-space: normal; word-break: break-all; box-shadow: 0 0 0 1px var(--card); }
.wk-ev b { font-weight: 700; }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--sun); z-index: 2; pointer-events: none; }
.wk-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); }
@media (prefers-reduced-motion: reduce) { .wk.in-next, .wk.in-prev { animation: none; } }

/* 持ち物を手で足す時の、グループの札 */
.add-grps { margin: -2px 12px 10px; }
.add-grps .chip { min-height: 34px; padding: 4px 10px; font-size: .85rem; }

/* 誕生日：月の表では祝日の名前と同じ行に、日の欄では予定の上に出す */
.holname.bday { color: var(--accent); }
.bday-line { margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 700; }
.wk-chip.bday { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--ink); }

/* 持ち物の見出しの右のボタン（コピー・ジャンル分け） */
.prep-acts { display: flex; flex-wrap: wrap; gap: 6px; flex: none; max-width: 100%; }

/* 家族の登録 */
.fam-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.fam-sub { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.fam-child { display: flex; align-items: center; gap: 4px; flex: none; font-size: .9rem; }
.fam-bd { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; font-size: .85rem; color: var(--sub); }
.fam-bd span { flex: none; }
.fam-bd .input { flex: 1; min-width: 0; }

/* iPhone の Safari で開いた時の、ホーム画面に追加する手順 */
.ios-add h4 { margin-bottom: 12px; }
.ios-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.ios-steps li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.6; }
.ios-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; margin-top: 1px; }
.ios-ico { width: 1.3em; height: 1.3em; vertical-align: -.3em; color: var(--accent); }

/* リマインダー：右下の横長のボタンと、通知から開いた時の文 */
.fab-box .fab-ai.fab-rmd { width: auto; height: 44px; padding: 0 14px; border-radius: 22px; flex-direction: row; gap: 4px; font-size: 1.05rem; }
.fab-box .fab-ai.fab-rmd span { font-size: .8rem; margin-top: 0; }
.rmd-text { font-size: 1.25rem; font-weight: 700; margin: 4px 0 6px; line-height: 1.5; }

/* リマインダーの日時を選ぶ欄：日・時・分の列を上下に回し、真ん中の帯の行が選んだ値 */
.wheel { position: relative; display: grid; grid-template-columns: 1.6fr 1fr 1fr; height: 200px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.wh-col { position: relative; height: 200px; overflow-y: auto; scroll-snap-type: y mandatory; padding: 80px 0; scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.wh-col::-webkit-scrollbar { display: none; }
.wh-item { height: 40px; line-height: 40px; text-align: center; scroll-snap-align: center; color: var(--sub); font-size: 1rem; cursor: pointer; user-select: none; }
.wh-item.on { color: inherit; font-weight: 700; font-size: 1.1rem; }
.wh-band { position: absolute; left: 6px; right: 6px; top: 80px; height: 40px; border-radius: 8px; background: var(--accent-soft); pointer-events: none; }

/* 月の表の見せ方（表だけ・表と一覧・一覧を重ねる）。高さは app.js が画面に合わせて決める */
#view.cal-month { padding-bottom: 0; }
.mv { position: relative; overflow: hidden; }
.mv .grid-wrap { transition: height .32s cubic-bezier(.2,.8,.2,1); }
.mv .grid { height: 100%; grid-auto-rows: minmax(0, 1fr); }
.mv .cell { min-height: 0; }
.day-panel {
  position: absolute; left: 0; right: 0; top: 0; height: 100%; z-index: 3; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 16px 16px 0 0; box-shadow: 0 -3px 14px rgba(0,0,0,.14);
  transform: translateY(var(--off, 100%)); transition: transform .32s cubic-bezier(.2,.8,.2,1); will-change: transform;
}
.mv .grid-wrap.still, .day-panel.still { transition: none; }
.panel-grip { flex: none; width: 100%; height: 24px; border: none; background: none; display: flex; align-items: center; justify-content: center; touch-action: none; }
.panel-grip span { width: 40px; height: 5px; border-radius: 3px; background: #cfcac0; }
html.dark .panel-grip span { background: #4a4e55; }
.day-panel .daylist { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-top: 0; padding-bottom: calc(var(--off, 0px) + 140px); }
.day-panel .daylist h2 { touch-action: none; }
@media (prefers-reduced-motion: reduce) { .mv .grid-wrap, .day-panel { transition: none; } }
/* 縮めた一覧では中身をスクロールさせず、指の動きで板ごと動かす */
.day-panel[data-mode="split"] .daylist { touch-action: none; }

/* 線の絵 */
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
/* 撮る・アルバム・PDF の手描きの絵（web/state.js の pic）。太い線とふちの余白があるので、線の絵より少し大きくする */
.ic.pic { width: 1.4em; height: 1.4em; vertical-align: -0.32em; object-fit: contain; }
.add-mini .ic.pic { width: 1.5rem; height: 1.5rem; }
.cam-btn:disabled .ic.pic { opacity: .45; }
.tabs button span { filter: none; opacity: 1; font-size: 1.5rem; display: flex; }
.tabs button.on span { transform: translateY(-2px) scale(1.08); }
.tabs button .ic { width: 1.5rem; height: 1.5rem; stroke-width: 1.8; }
.tabs button.on .ic { stroke-width: 2.2; }
.view-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.view-seg button .ic { width: 1.05em; height: 1.05em; }
.search-btn .ic { width: 1.35rem; height: 1.35rem; }
.detail-line .k { display: inline-flex; justify-content: center; padding-top: .15em; color: var(--sub); }
.detail-line .k .ic { width: 1.2rem; height: 1.2rem; }
.detail-btns .today-btn { display: inline-flex; align-items: center; gap: 4px; }

/* 月の表のマス：時刻のある1日の予定は、色の点と名前 */
.chip-ev.tdot { background: none; color: var(--ink); padding-left: 1px; font-weight: 500; }
.chip-ev.tdot i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 2px; vertical-align: .12em; }
/* 前後の月の日の予定は薄くして、今月の日と分ける */
.cell.other .chip-ev, .cell.other .holname, .cell.other .more { opacity: .45; }

/* 一覧の見出しの「＋」（一覧を出している間は、右下の丸いボタンを引っ込めて、ここから追加する） */
.add-mini { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--accent); color: #fff; align-self: center; }
.add-mini .ic { width: 1.2rem; height: 1.2rem; stroke-width: 2.4; }
.daylist h2 .h2-btns { margin-left: auto; display: flex; align-items: center; gap: 6px; align-self: center; }
.daylist h2 .h2-btns .line-mini { margin: 0; }
.add-mini:active { transform: scale(.92); }

/* 一覧を左右に払って、隣の日に移る */
.daylist.day-next { animation: day-next .2s cubic-bezier(.2,.8,.2,1) both; }
.daylist.day-prev { animation: day-prev .2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes day-next { from { transform: translateX(30%); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes day-prev { from { transform: translateX(-30%); opacity: .2; } to { transform: none; opacity: 1; } }
.day-panel[data-mode="sheet"] .daylist { touch-action: pan-y; }

/* 年と月を選ぶ画面 */
.month h1, h1.month { cursor: pointer; }
.mp-year { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.mp-year b { font-size: 1.2rem; }
.mp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mp-grid button { min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; }
.mp-grid button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.mp-grid button.now { border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .daylist.day-next, .daylist.day-prev { animation: none; } }

/* 献立の表で一覧を出している間は、右下の「献立表」のボタンも引っ込める */
.fab.fab-photo { transition: transform .25s ease, opacity .25s ease; }
.fab.fab-photo.away { transform: translateX(calc(100% + 30px)); opacity: 0; pointer-events: none; }
.add-mini.menu-cam { background: #e3a33b; color: #1f2328; }
html.dark .day-panel { box-shadow: 0 -1px 0 #3a3e45, 0 -4px 16px rgba(0,0,0,.5); }

/* 新しい版を出した時の帯（下のタブのすぐ上） */
.update-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: 8;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 14px;
  background: var(--card); color: var(--ink); box-shadow: 0 4px 16px rgba(0,0,0,.2), inset 0 0 0 1px var(--line);
  font-weight: 600; animation: rise .25s ease-out;
}
.update-bar span { flex: 1; }
.update-bar .btn { width: auto; min-height: 40px; padding: 0 18px; }
/* 帯を出している間は、右下のボタンと AI の入力欄を帯の上へ上げる（帯の下に隠れて＋を押せなくならないように） */
body.has-update .fab, body.has-update .fab-box { bottom: calc(var(--tab-h) + var(--safe-b) + 84px); }
body.has-update #view.ai-view { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 84px); }

/* 週の表の予定：月の表の一覧と同じく、左に色の線と薄い地。狭い箱では名前を折らずに横のまま切る */
.wk-ev { background: color-mix(in srgb, var(--c) 24%, var(--card)); color: var(--ink); border-left: 3px solid var(--c); border-radius: 3px 5px 5px 3px; padding: 2px 3px 2px 4px; box-shadow: 0 0 0 1px var(--card); }
.wk-ev b { color: var(--sub); font-weight: 600; }
.wk-ev.narrow { white-space: nowrap; word-break: normal; text-overflow: clip; font-size: .6rem; padding: 2px 1px 2px 3px; }
html.dark .wk-ev { background: color-mix(in srgb, var(--c) 30%, var(--card)); }

/* 献立の行：たたくと直す画面を開く */
.menu-day.menu-edit { display: block; width: 100%; border: none; text-align: left; color: inherit; }
.menu-day.menu-edit:active { background: var(--accent-soft); }
.menu-go { margin-left: auto; flex: none; color: var(--sub); padding: 4px 2px 0 8px; }
#menu-del { margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* マスの文字の大きさは画面の幅で決める（app.js の cellFont と同じ値） */
.mv .chip-ev, .mv .cell-menu { font-size: var(--cf, .62rem); }

/* 表の見た目を整える：線を細く薄く、選んだ日は地の色で、前後の月は文字だけ薄く */
:root { --grid-line: #ece9e2; --menu-ink: #b77a17; }
html.dark { --grid-line: #2c2f34; --menu-ink: #e3a33b; }
.grid { background: var(--grid-line); border-bottom-color: var(--grid-line); }
.weekhead { border-bottom-color: var(--grid-line); }
.cell.other, html.dark .cell.other,
.grid.menu-mode .cell:not(.other), html.dark .grid.menu-mode .cell:not(.other) { background: var(--card); }
.cell.other > * { opacity: .4; }
.cell.other .num { opacity: 1; }
.cell.selected { box-shadow: none; background: var(--accent-soft) !important; }
.cell { transition: background-color .15s; }

/* マスの献立は、料理を1行に1つ */
.cell-menu, html.dark .cell-menu {
  display: flex; flex-direction: column; gap: 0; padding: 0 2px; word-break: normal;
  color: color-mix(in srgb, var(--ink) 75%, transparent);
}
.cell-menu span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-menu .more { color: var(--sub); font-size: .9em; }

/* 下の一覧の献立も、料理を1行に1つ */
.dish-list { flex: 1; min-width: 0; }
.dish-list .meta { display: block; margin-bottom: 2px; }
.dish-list ul { list-style: none; margin: 0; padding: 0; }
.dish-list li { position: relative; padding-left: 14px; line-height: 1.75; }
.dish-list li::before { content: ''; position: absolute; left: 2px; top: .75em; width: 5px; height: 5px; border-radius: 50%; background: var(--menu-ink); }
.menu-day.menu-edit { padding: 12px 14px; border-radius: 14px; }

/* 献立表を撮るボタンは、小さな線の絵に */
.add-mini.menu-cam { background: transparent; color: var(--menu-ink); box-shadow: inset 0 0 0 1.5px currentColor; }
.add-mini.menu-cam .ic { stroke-width: 2; }

/* 献立の週の表：1日を1行にして、料理の名前を大きく出す */
.mw-box { position: relative; }
.mw-wrap { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 90px 34px; }
.mw-list { display: flex; flex-direction: column; gap: 6px; }
.mw-day {
  display: flex; align-items: stretch; gap: 0; width: 100%; padding: 0; border: none; text-align: left; color: var(--ink);
  background: var(--card); border-radius: 14px; overflow: hidden; font: inherit;
}
button.mw-day:active { background: var(--accent-soft); }
.mw-date {
  flex: none; width: 3.4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  padding: 10px 0; border-right: 1px solid var(--grid-line);
}
.mw-date b { font-size: 1.35rem; line-height: 1.1; font-weight: 700; }
.mw-date small { font-size: .72rem; color: var(--sub); }
.mw-day.sun .mw-date, .mw-day.hol .mw-date, .mw-day.sun .mw-date small, .mw-day.hol .mw-date small { color: var(--sun); }
.mw-day.sat .mw-date, .mw-day.sat .mw-date small { color: var(--sat); }
.mw-day.today { box-shadow: inset 4px 0 0 var(--accent); }
.mw-day.today .mw-date b { color: var(--accent); }
.mw-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 12px; }
.mw-meal { display: flex; flex-wrap: wrap; gap: 2px 0; font-size: 1rem; line-height: 1.5; }
.mw-meal span:not(:last-child)::after, .mw-snack span:not(:last-child)::after { content: '・'; color: var(--sub); margin: 0 .15em; }
.mw-meal { font-weight: 500; }
.mw-snack { display: flex; flex-wrap: wrap; font-size: .82rem; color: var(--sub); line-height: 1.5; }
.mw-snack::before { content: 'おやつ'; flex: none; font-size: .7rem; padding: 1px 6px; margin-right: 6px; border-radius: 999px; background: color-mix(in srgb, var(--menu-ink) 18%, transparent); color: var(--menu-ink); align-self: center; }
.mw-hol { font-size: .72rem; color: var(--sun); }
.mw-day.none { background: transparent; box-shadow: inset 0 0 0 1px var(--grid-line); }
.mw-day.none .mw-date { padding: 6px 0; }
.mw-day.none .mw-date b { font-size: 1.05rem; }
.mw-empty { font-size: .8rem; color: var(--sub); }
.mw-day.none.today { box-shadow: inset 4px 0 0 var(--accent), inset 0 0 0 1px var(--grid-line); }

.mw-list.mode-in { animation: fade-in .25s ease-out both; }
.mw-list.in-next { animation: in-next .28s cubic-bezier(.2,.8,.2,1) both; }
.mw-list.in-prev { animation: in-prev .28s cubic-bezier(.2,.8,.2,1) both; }
.mw-month { position: sticky; top: 0; z-index: 2; margin: 0 -12px 0 -34px; padding: 6px 12px 6px 46px; font-size: .85rem; font-weight: 700; color: var(--sub); background: var(--bg); }
.mw-list > .mw-day { margin-bottom: 6px; }
.mw-list { gap: 0; }
/* 左の目次（長押しして上下になぞると、その日まで飛ぶ） */
.mw-index {
  position: absolute; left: 6px; top: 8px; bottom: 12px; width: 22px; z-index: 3;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  border-radius: 11px; touch-action: none; transition: background-color .15s;
}
.mw-index span { font-size: .58rem; line-height: 1; color: var(--sub); opacity: .65; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mw-index span.dot { font-size: 0; width: 3px; height: 3px; border-radius: 50%; background: var(--sub); opacity: .4; }
.mw-index span.on { color: var(--accent); opacity: 1; font-weight: 700; }
.mw-index span.dot.on { background: var(--accent); }
.mw-index.active { background: color-mix(in srgb, var(--sub) 18%, transparent); }
.mw-index.active span { opacity: 1; }
.mw-bubble {
  position: absolute; left: 38px; z-index: 4; padding: 6px 14px; border-radius: 999px; pointer-events: none;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .95rem; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

/* 押しやすさ（2026-11-23 scripts/ui-audit.mjs で測って直した。スマホで押しやすい大きさは 40〜44px）。
   完了の四角は、見た目は26pxのまま、まわりの押せる所を44pxに広げる（外して名前を押すと編集が開いていた） */
.chk { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -9px -8px -9px -9px; flex: none; cursor: pointer; }
.view-seg button { min-height: 40px; }
#cal-switch, #today { min-height: 40px; }
.cal-top .icon-btn { min-width: 40px; }
.search-btn { min-width: 40px; min-height: 40px; }
.detail-btns { gap: 12px; }
.detail-btns .today-btn { min-height: 36px; padding: 6px 12px; }
/* 予定の入力の「保存」は、画面の下に固定して、下まで送らなくても押せるようにする */
.save-bar { position: sticky; bottom: calc(-1 * (var(--safe-b) + 20px)); margin: 0 -16px calc(-1 * (var(--safe-b) + 20px)); padding: 8px 16px calc(var(--safe-b) + 20px); background: var(--bg); border-top: 1px solid var(--line); z-index: 2; }
.save-bar .err:empty { display: none; }
.add-mini { width: 40px; height: 40px; }
.same-pair { gap: 8px; margin-bottom: 12px; }
.same-pair figure { flex: 1; margin: 0; text-align: center; }
.same-pair img, .unreadable-photo { width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; background: var(--line); display: block; }
.same-pair figcaption { font-size: .8rem; color: var(--sub); margin-top: 4px; }
.unreadable-photo { margin-bottom: 8px; }
.photo-ev .change-title { font-weight: 700; }
.code-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%; min-height: 44px; margin: 8px 0 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.code-copy .code-v { font-weight: 700; font-size: 1.05rem; letter-spacing: .03em; }
.qr-open { display: block; text-align: center; text-decoration: none; margin-top: 8px; }

/* ---- 広い画面（Fold を開いた時・タブレット）と折りたたみ（2026-11-24。web/layout.js が body に wide・fold-v・fold-h を付ける） ----
   右の欄（.side-col）は、画面の上の端から下のタブの上まで。右の欄のある画面（#view.has-side）は、右の欄の幅だけ右を空ける */
body.wide #view.has-side { margin-right: var(--side-w); }
body.wide:has(#view.has-side) .offline { margin-right: var(--side-w); }
body.wide:has(#view.has-side) .toast { left: calc((100% - var(--side-w)) / 2); }
body.wide #view.has-side .fab-box, body.wide #view.has-side > .fab { right: calc(var(--side-w) + 18px); }
body.wide .side-col {
  position: fixed; top: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); width: var(--side-w); z-index: 4;
  overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-left: 1px solid var(--line);
  padding: calc(var(--safe-t) + 12px) 12px 24px;
}
/* 何も開いていない時の右の欄 */
body.wide .side-empty { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--sub); font-size: .9rem; }
body.wide .side-empty .ic { width: 2.6rem; height: 2.6rem; opacity: .45; margin-bottom: 6px; }
.side-hint { text-align: center; margin: 16px 0 0; }
body.wide .list-side .item-ai { margin: 0; }

/* カレンダー：1日の予定の板を、右の欄にする（取っ手で上下に動かす板は使わない） */
body.wide .day-panel.side-col {
  left: auto; height: auto; display: block; transform: none; transition: none; will-change: auto;
  border-radius: 0; box-shadow: none; padding: calc(var(--safe-t) + 6px) 0 0;
}
body.wide .day-panel.side-col .daylist { overflow: visible; padding: 4px 12px 24px; touch-action: auto; }
body.wide .day-panel.side-col .daylist h2 { touch-action: auto; }

/* AIに相談：右の欄にカレンダーの予定 */
.ai-side .side-title { display: flex; align-items: center; gap: 6px; font-size: 1rem; margin: 4px 2px 8px; }
.side-date { font-size: .85rem; font-weight: 700; color: var(--sub); margin: 14px 2px 6px; }
.side-date.today { color: var(--accent); }
.side-date small { color: var(--sun); font-weight: 400; margin-left: 6px; }
.side-none { font-weight: 400; color: var(--sub); margin-left: 10px; }
.ai-side .ev { padding: 8px 10px; margin-bottom: 6px; }
/* AIに相談では、予定の欄を左に、会話と入力欄を右に置く（#view.side-l。右手で打ちやすいように）。予定を押して出る板も左の欄に重ね、会話を隠さない */
body.wide #view.has-side.side-l { margin-right: 0; margin-left: var(--side-w); }
body.wide #view.side-l .side-col { right: auto; left: 0; border-left: none; border-right: 1px solid var(--line); }
body.wide:has(#view.side-l) .offline { margin-right: 0; margin-left: var(--side-w); }
body.wide:has(#view.side-l) .toast { left: calc((100% + var(--side-w)) / 2); }
body.wide:has(#view.side-l) :is(.overlay, .overlay-out).dock { left: 0; right: auto; }
body.wide:has(#view.side-l) :is(.overlay, .overlay-out).dock .sheet { border-left: none; border-right: 1px solid var(--line); box-shadow: 6px 0 18px rgba(0,0,0,.08); animation-name: pane-in-l; }
body.wide:has(#view.side-l) .overlay-out.dock .sheet { animation-name: pane-out-l; }
body.wide:has(#view.side-l) .stage.dock { left: var(--side-w); right: 0; }
/* 左に欄のある画面の右下の＋は、画面の右の端から置く */
body.wide #view.has-side.side-l .fab-box, body.wide #view.has-side.side-l > .fab { right: 18px; }
@keyframes pane-in-l { from { transform: translateX(-24px); opacity: 0; } }
@keyframes pane-out-l { to { transform: translateX(-24px); opacity: 0; } }

/* 下のタブ：広い画面では、絵と字を横に並べて帯を低くする。選んでいるタブは、上の線の代わりに薄い色で塗る
   （2026-11-24 著者「間延びしてる」。縦に積んだままだと、1つのタブが125pxの幅になり、空きが目立った） */
body.wide { --tab-h: 56px; }
body.wide .tabs { padding-left: 6px; padding-right: 6px; gap: 4px; }
body.wide .tabs button { flex-direction: row; gap: 8px; font-size: .88rem; margin: 6px 0; border-radius: 12px; }
body.wide .tabs button span, body.wide .tabs button.on span { transform: none; font-size: 1.3rem; }
body.wide .tabs button .ic { width: 1.3rem; height: 1.3rem; }
body.wide .tabs button.on { background: var(--accent-soft); }
body.wide .tabs button.on::before { display: none; }

/* Todo のタブ：左の列に買い物、右の列に Todo（web/todos.js の splitOn）。列ごとに送れるように、画面の高さに収める */
body.wide #view.split { padding-bottom: 0; }
.todo-split { display: grid; grid-template-columns: 1fr 1fr; height: calc(100dvh - var(--tab-h) - var(--safe-b)); }
.split-col { overflow-y: auto; overscroll-behavior: contain; padding: calc(var(--safe-t) + 6px) 0 24px; }
.split-col + .split-col { border-left: 1px solid var(--line); }
.split-head { display: flex; align-items: center; gap: 2px; padding: 2px 8px 6px 16px; }
.split-head h2 { flex: 1; display: flex; align-items: center; gap: 6px; margin: 0; font-size: 1.05rem; }
.split-head .split-add { font-size: 1.5rem; color: var(--accent); }

/* プリント：左に出しているプリントに印。設定の左の一覧と同じく、枠を付けずに薄い色で塗る */
.print-row.on { background: var(--accent-soft); }

/* 設定：左に行の一覧、右にページ */
/* 左の一覧は目次なので、札にせず題名だけの行にし、選んでいる行は薄い色で塗る（2026-11-24 著者「緑枠…ダサい」） */
body.wide .set-split { display: grid; grid-template-columns: minmax(170px, 26%) minmax(0, 1fr); gap: 16px; padding: 12px 16px; align-items: start; }
body.wide .set-nav { position: sticky; top: calc(var(--safe-t) + 12px); padding-top: 42px; }
body.wide .set-link { background: none; margin: 0 0 2px; padding: 0 12px; min-height: 44px; border-radius: 10px; font-weight: 600; color: var(--sub); }
body.wide .set-link .meta, body.wide .set-link br, body.wide .set-arrow { display: none; }
body.wide .set-link.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.set-title { font-size: 1.15rem; margin: 8px 4px 12px; }

/* 板の出し方（web/sheet.js の sheetMode）
   dock：右の欄に重ねる。左の画面は暗くせず、触れるまま */
body.wide .overlay.dock, body.wide .overlay-out.dock {
  left: auto; width: var(--side-w); bottom: calc(var(--tab-h) + var(--safe-b)); background: none; align-items: stretch; z-index: 9;
}
body.wide :is(.overlay, .overlay-out).dock .sheet {
  max-width: none; max-height: none; height: 100%; border-radius: 0; border-left: 1px solid var(--line);
  box-shadow: -6px 0 18px rgba(0,0,0,.08); padding-top: calc(var(--safe-t) + 4px); animation: pane-in .2s ease-out;
}
body.wide .overlay-out.dock .sheet { animation: pane-out .18s ease-in forwards; }
body.wide .overlay.dock.swap .sheet { animation: fade-in .16s ease-out; }
@keyframes pane-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes pane-out { to { transform: translateX(24px); opacity: 0; } }
/* center：右の欄の無い画面では、真ん中の窓にする */
body.wide .overlay.center, body.wide .overlay-out.center { align-items: center; padding: 24px; }
body.wide :is(.overlay, .overlay-out).center .sheet { max-width: 560px; max-height: 100%; border-radius: 18px; animation: pop-in .2s ease-out; }
body.wide .overlay-out.center .sheet { animation: pop-out .16s ease-in forwards; }
body.wide .overlay.center.swap .sheet { animation: fade-in .16s ease-out; }
@keyframes pop-in { from { transform: scale(.96); opacity: 0; } }
@keyframes pop-out { to { transform: scale(.96); opacity: 0; } }
/* 右の欄の板と真ん中の窓は、下に引いて閉じないので、上の短い線を出さない */
body.wide :is(.dock, .center) .sheet-head::before { display: none; }
/* fold：上下に半分に折った時は、板を折り目の下の半分に出す。上の半分は暗くせず、触れるまま */
body.fold-v .overlay.fold, body.fold-v .overlay-out.fold { top: var(--fold-bottom); background: none; }
body.fold-v :is(.overlay, .overlay-out).fold .sheet { max-width: none; max-height: 100%; height: 100%; box-shadow: 0 -4px 16px rgba(0,0,0,.14); }

/* 板の中の写真を、板の外の空いた所（折り目の上の半分か、左の画面の上）に大きく出す（web/sheet.js の showStage） */
.stage { position: fixed; z-index: 19; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: calc(var(--safe-t) + 8px) 8px 8px; animation: fade-in .2s ease-out; }
.stage.fold { top: 0; left: 0; right: 0; height: var(--fold-top); }
.stage.dock { top: 0; left: 0; right: var(--side-w); bottom: calc(var(--tab-h) + var(--safe-b)); }
.stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.15); background: #fff; }
body.has-stage .overlay [data-stage], body.has-stage .overlay .stage-hide { display: none !important; }

/* ほかのアプリから写真や文を引いてきた時の帯（web/layout.js） */
.drop-hint {
  position: fixed; inset: 8px; z-index: 40; pointer-events: none; display: flex; align-items: center; justify-content: center;
  border: 3px dashed var(--accent); border-radius: 18px; background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.drop-hint p { margin: 0 16px; padding: 14px 20px; border-radius: 14px; background: var(--card); color: var(--ink); font-weight: 700; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
@media (prefers-reduced-motion: reduce) { body.wide .sheet, .stage { animation: none !important; } }

/* ---- 緑を減らす（2026-11-24 著者「緑多くない？」「なんで変えたところも薄緑なの？」） ----
   緑を使うのは、画面で一番押してほしいボタン（保存・送信・お願いする・プリントを撮る・右下の＋）と、今日の日付の丸・オンの切り替え・
   いま開いているタブの印だけにする。選んだ印（選んだ日・札・行）と小さいボタンは、灰色（--accent-soft）の塗りと黒い字にする */
/* 入力欄の横の「追加」と、列の見出しの＋：白いボタンに黒い字 */
.additem .btn { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.split-head .split-add { color: var(--ink); }
/* 月・週の切り替え：Todo と買い物の切り替え（.seg）と同じく、選んだ方を白く浮かせる */
.view-seg button[data-v=events].on, .view-seg button[data-v=week].on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
/* 日の一覧の「＋」と、予定の日までの日数 */
.add-mini { background: var(--accent-soft); color: var(--ink); }
.days-left { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
/* 選んだ札・写真の欄で選んだボタン・設定の左の一覧：緑の枠と緑の字をやめる */
.chip.on { border-color: transparent; }
.cam-btn.on { border-color: var(--line); color: var(--ink); }
body.wide .set-link.on { color: var(--ink); }
/* AI の会話：自分の吹き出しは灰色、AI の案と返事の札は灰色の枠 */
.msg.user { background: var(--accent-soft); color: var(--ink); }
.proposal, .ai-answer { border: 1px solid var(--line); }
/* 持ち物の「AIにお願い」の欄：ほかの札と同じ白い札にする */
.item-ai { background: var(--card); border: 1px solid var(--line); }

/* ---- 色合い（設定の「表示」。html に style-pop・style-std・style-calm を付ける。web/tools.js の applyTheme） ----
   ポップ（既定。2026-11-24 著者「もうちょっとカラフルにしない？」「ポップな感じにしたい」）：開いているタブの色を --accent にして、
   保存などの大きいボタン・今日の丸・選んだ印（薄い色）をその色で出す。下のタブの絵は、いつもそれぞれの色で出す。
   ログインの画面など、タブの無い画面は緑のまま。標準は緑1色、控えめは紺1色（初めは灰色がかった青。2026-11-24 著者の案で、設定のタブはからし色、控えめは紺にした） */
/* 2026-11-24 著者「プリントとAIの色が近い」で、AIに相談を紫から水色にし、水色と近くならないように、カレンダーを紫寄りの青、持ち物を青みの少ない緑にずらした */
:root { --c-cal: #3466e0; --c-prints: #ec7a2c; --c-items: #2e9e57; --c-todo: #e0508a; --c-ai: #0a95b8; --c-settings: #c08a00; }
html.dark { --c-cal: #6b93f2; --c-prints: #f39352; --c-items: #4cbf74; --c-todo: #ee72a2; --c-ai: #2bb8d8; --c-settings: #e2b341; }
html.style-pop body[data-tab=cal] { --accent: var(--c-cal); }
html.style-pop body[data-tab=prints] { --accent: var(--c-prints); }
html.style-pop body[data-tab=items] { --accent: var(--c-items); }
html.style-pop body[data-tab=todo] { --accent: var(--c-todo); }
html.style-pop body[data-tab=ai] { --accent: var(--c-ai); }
html.style-pop body[data-tab=settings] { --accent: var(--c-settings); }
html.style-pop body[data-tab] { --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--card)); }
html.dark.style-pop body[data-tab] { --accent-soft: color-mix(in srgb, var(--accent) 26%, var(--card)); }
html.style-pop .tabs button[data-tab=cal] { --tc: var(--c-cal); }
html.style-pop .tabs button[data-tab=prints] { --tc: var(--c-prints); }
html.style-pop .tabs button[data-tab=items] { --tc: var(--c-items); }
html.style-pop .tabs button[data-tab=todo] { --tc: var(--c-todo); }
html.style-pop .tabs button[data-tab=ai] { --tc: var(--c-ai); }
html.style-pop .tabs button[data-tab=settings] { --tc: var(--c-settings); }
html.style-pop .tabs button span { color: var(--tc); }
html.style-pop .tabs button.on { color: var(--tc); }
html.style-calm { --accent: #2c4f8f; }
html.dark.style-calm { --accent: #7d9be0; }
/* 見出しの絵・列の＋・入力欄の横の「追加」の字は、開いているタブの色にする */
.split-head h2 .ic, .split-head .split-add, .additem .btn { color: var(--accent); }

/* 予定を引いて別の日に動かす（2026-11-24。web/cal-views.js の bindEvDrag）。札は指の少し上に出し、置く先の日付を下に添える */
.ev.dragging { opacity: .35; }
.ev-ghost {
  position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, calc(-100% - 18px));
  background: var(--card); color: var(--ink); border-left: 5px solid var(--c); border-radius: 10px;
  padding: 8px 12px; font-size: .9rem; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 220px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ev-ghost[data-to]:not([data-to=""])::after { content: "→ " attr(data-to); display: block; font-size: .78rem; font-weight: 400; color: var(--sub); }
.drop-on { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft) !important; }

/* 設定の選ぶボタンの形（2026-11-24 著者「選択ボタンが味気ない」で、Claude の案を著者が選んだ）。
   見本で違いが分かる「画面の色」「文字の大きさ」は見本の絵が付いた札（.set-tiles）、ほかは月・週の切り替えと同じつながった帯（.set-seg） */
.set-seg { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--seg-bg); border-radius: 12px; }
.set-seg .chip { flex: 1 1 0; min-width: 5.5em; padding: 6px 6px; justify-content: center; border: 0; background: transparent; border-radius: 9px; color: var(--sub); font-weight: 500; white-space: nowrap; }
.set-seg .chip.on { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.16); }
html.dark .set-seg .chip.on { background: #464b53; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.set-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.set-tiles .chip {
  position: relative; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 8px 6px 10px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--card); font-size: .82rem; color: var(--sub); text-align: center; line-height: 1.3;
}
.set-tiles .chip.on { border-color: var(--accent); background: var(--card); color: var(--ink); font-weight: 700; }
.set-tiles .chip.on::after {
  content: "✓"; position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: .78rem; line-height: 22px; font-weight: 900;
}
.set-tiles .pv { display: flex; flex-direction: column; gap: 5px; width: 100%; height: 50px; padding: 8px; box-sizing: border-box; border-radius: 8px; border: 1px solid var(--line); }
.set-tiles .pv i { display: block; height: 6px; border-radius: 3px; }
.set-tiles .pv i:first-child { width: 70%; } .set-tiles .pv i:last-child { width: 50%; }
.set-tiles .pv-light { background: #f6f4ef; } .set-tiles .pv-light i { background: #d8d3c9; }
.set-tiles .pv-dark { background: #101214; } .set-tiles .pv-dark i { background: #3b3f45; }
.set-tiles .pv-auto { background: linear-gradient(90deg, #f6f4ef 50%, #101214 50%); }
.set-tiles .pv-auto i { background: linear-gradient(90deg, #d8d3c9 50%, #3b3f45 50%); }
.set-tiles .pv-aa { display: flex; align-items: flex-end; justify-content: center; height: 50px; font-weight: 700; line-height: 1; color: var(--ink); }
.set-tiles .pv-aa.pv-s { font-size: 18px; } .set-tiles .pv-aa.pv-m { font-size: 26px; } .set-tiles .pv-aa.pv-l { font-size: 36px; }
/* 設定の選ぶ所に色を付ける（2026-11-24 著者「流石に色が欲しいかな」）。帯で選んだ所はタブの色で塗る。暗い見た目では塗る色が明るいので、字を濃い色にする */
.set-seg .chip.on, html.dark .set-seg .chip.on { background: var(--accent); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
html.dark .set-seg .chip.on, html.dark .set-tiles .chip.on::after { color: #16121f; }
.set-tiles .chip.on { background: var(--accent-soft); }
/* ポップの設定のからし色は明るいので、塗った所の字と ✓ は、明るい見た目でも濃い色にする */
html.style-pop body[data-tab=settings] .set-seg .chip.on, html.style-pop body[data-tab=settings] .set-tiles .chip.on::after { color: #241c05; }

/* 天気予報とほかのカレンダー（2026-11-24。web/outside.js） */
.cell:has(.wx) { position: relative; }
.cell .wx { position: absolute; top: 2px; right: 3px; font-size: .72rem; line-height: 1; pointer-events: none; }
.wk-day .wx { display: block; font-size: .72rem; line-height: 1.1; }
.wx-line { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: .85rem; font-weight: 500; color: var(--sub); }
.daylist h2 .wx-line { display: flex; width: 100%; order: 3; margin-top: 2px; }
.wx-t { color: var(--ink); }
.wx-pop { color: #3d8bd9; }
/* ほかのカレンダーの予定は、少し薄くして、家族の予定と見分ける */
.chip-ev.ext { opacity: .72; }
.chip-ev.tdot.ext { font-style: italic; }
.ev.ext { background: transparent; border: 1.5px dashed var(--line); box-shadow: none; }
.wk-ev.ext, .wk-chip.ext { opacity: .72; }
.err-text { color: var(--danger); }
.ext-help { margin: 0 0 10px; }
.ext-help summary { cursor: pointer; color: var(--ink); }
.ext-add { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.daylist h2:has(.wx-line) { flex-wrap: wrap; }

/* 見るだけの参加者（body.viewer）には、書き込みのボタンを出さない。サーバーも書き込みを断る（src/calendars.js の viewerGate） */
.viewer .fab, .viewer .fab-box, .viewer .add-mini, .viewer #add, .viewer #day-add, .viewer #day-photo, .viewer #menu-photo,
.viewer .additem, .viewer .add-extra, .viewer .add-grps, .viewer .item:not(.todo) .icon-btn.del, .item.ro .icon-btn.del, .viewer .group-del,
.viewer .split-add, .viewer .split-form, .viewer [data-split-rmd], .viewer #prep-copy, .viewer #prep-sets, .viewer #prep-save, .viewer #prep-clear, .viewer #clear, .viewer #todo-clear,
.viewer .print-edit, .viewer .p-del-note,
.viewer #edit, .viewer #del, .viewer #ev-colors, .viewer #ev-copy, .viewer #ev-prep, .viewer #f-comment, .viewer .del-btn,
.viewer #p-new, .viewer #p-album, .viewer #p-pdf, .viewer #p-del, .viewer #p-rotate, .viewer #p-retake, .viewer #p-realbum, .viewer #p-ai,
.viewer .menu-go, .viewer #menu-del, .viewer .menu-cam, .viewer .ext-add { display: none !important; }
/* 献立の1か月の表の下の欄は、献立の文が直す画面を開くボタン（.menu-edit）の中にあるので、ボタンは残し、鉛筆の絵（.menu-go）だけを隠す */
.viewer .menu-day.menu-edit:active { background: none; }
/* チェックは押せない形で出す（済んだかどうかは見える）。Todo は、入っている全部のカレンダーの物を並べるので、閲覧者のカレンダーの行（.ro）だけを止める */
.viewer .item:not(.todo) .chk, .item.ro .chk { pointer-events: none; opacity: .6; }

/* プリントの名前と文字起こしは読めるように残し、保存のボタンだけを隠す */
.viewer #f-print .btn { display: none !important; }

/* ---- 手描きのタブの絵と、シマエナガの挿絵（2026-11-25。絵は public/shima/、作り方は scripts/shima-images.mjs） ---- */
/* 選んでいないタブの絵は色を少し薄くし、選んだタブの絵だけ色を濃くして、選んだ時に1回跳ねる */
.tabs button .tab-pic { display: block; width: 1.75rem; height: 1.75rem; opacity: .8; filter: saturate(.7); transition: opacity .2s, filter .2s; }
.tabs button.on .tab-pic { opacity: 1; filter: none; animation: tab-hop .35s ease-out; }
@keyframes tab-hop { 40% { transform: translateY(-4px) rotate(-6deg); } }
body.wide .tabs button .tab-pic { width: 1.5rem; height: 1.5rem; }
/* 一覧が空の時などに、文の上に出す挿絵 */
.shima-pic { display: block; position: relative; width: fit-content; max-width: 70%; margin: 0 auto 6px; }
.shima-pic img { display: block; height: 96px; width: auto; max-width: 100%; }
/* 写真の読み取りを待つ間は、眼鏡の親鳥がプリントを読む（コマ送りで首をかしげる） */
.shima-reading { display: flex; justify-content: center; padding-top: 8px; }
.shima-reading .shima-pic { margin-bottom: 0; }
.shima-reading .shima-pic img { height: 120px; }
/* 右下の「シマちゃんにお願い」の丸いボタンと、欄の見出しのシマちゃんの顔 */
.fab-box #fab-ai { padding: 0; overflow: visible; }
.fab-shima { width: 46px; height: 46px; }
.btn-shima { width: 1.4em; height: 1.4em; vertical-align: -.35em; }
/* ---- シマエナガの動き（2026-11-25 著者「もう少し動きを入れたい」「羽をパタパタしてもかわいい」） ---- */
/* あいさつの親鳥は、部品を重ねた組み絵（web/state.js の shimaRig）。3秒ごとに羽で2回はばたき、体が少し跳ねて尾羽も揺れる。
   ほかに、まばたき（4.3秒ごと）・呼吸（体が少しふくらむ）・首をかしげる（11秒ごと）をする。押すと速く4回はばたいて大きく跳ねる（.excited）。
   2026-11-25 著者「右手の羽だけ振っているのが気になる」で、奥の羽・尾羽・まばたき・呼吸・首をかしげる動きを足した。
   初めは手前の白い羽（hello-wing）を振り、奥の羽も白い羽を左右反転して足したが、体の絵の茶色い羽と合わせて3枚に見えた。
   著者が「向き的に隠れるはず」と手前の羽も外したので、体の絵の茶色い羽そのものを動かす */
.shima-wave { position: relative; width: 170px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.shima-wave img { display: block; width: 100%; height: auto; }
.shima-wave .rig { position: relative; display: block; transform-origin: 45% 100%; animation: shima-bob 3s infinite ease-in-out, shima-breathe 2.6s infinite ease-in-out, shima-look 11s infinite ease-in-out; }
.shima-wave .rig > * { position: absolute; inset: 0; }
/* 体：尾羽と奥の羽（--wing の形）をくり抜いて見せる */
.shima-wave .rig { --wing: polygon(56.9% 13.9%, 71.4% 13.9%, 71.4% 55%, 69.4% 57%, 65.3% 55.8%, 59.7% 53%, 54.2% 49.4%, 50% 45%, 46.7% 38.6%); }
.shima-wave .rig > .body { position: relative; z-index: 1; clip-path: polygon(evenodd, 0 0, 71.9% 0, 71.9% 100%, 0 100%, 0 0, 56.9% 13.9%, 71.4% 13.9%, 71.4% 55%, 69.4% 57%, 65.3% 55.8%, 59.7% 53%, 54.2% 49.4%, 50% 45%, 46.7% 38.6%, 56.9% 13.9%); }
/* 尾羽：体と同じ絵を重ね、尾羽（体から離れる左から71.7%より右）だけを見せて、付け根を軸に上下させる。
   はばたき（3秒ごと）とは別に、4.7秒ごとに2回はね上げる（著者「尾羽のうごくタイミングを独立させる？」） */
.shima-wave .tail { z-index: 1; clip-path: inset(0 0 0 71.5%); transform-origin: 71.7% 59.8%; animation: shima-tail 4.7s 1.2s infinite ease-in-out; }
/* 羽：体の絵に描かれた茶色い羽（--wing の形）を切り出し、肩（左から51.4%・上から28.7%）を軸に持ち上げる。薄い影で体との重なりを見せる。
   持ち上げた跡が透けないように、羽の下にある体の輪郭の内側を、体の色で塗った絵（.fill）を敷く */
.shima-wave .fill { z-index: 1; clip-path: polygon(56.9% 13.9%, 62.5% 17.9%, 66.7% 33.9%, 68.6% 43.8%, 68.9% 51.8%, 68.1% 56.2%, 65.3% 55.8%, 59.7% 53%, 54.2% 49.4%, 50% 45%, 46.7% 38.6%); filter: brightness(0) invert(1) sepia(.12) brightness(.98); }
.shima-wave .bw { z-index: 1; transform-origin: 51.4% 28.7%; filter: drop-shadow(0 1px 1.5px rgba(90, 60, 40, .3)); animation: shima-flap-back 3s .04s infinite ease-in-out; }
.shima-wave .back-wing { clip-path: var(--wing); }
/* まばたき：目（scripts/shima-images.mjs の dress の eyes と同じ位置）に、体の色の丸と下のふちの線（閉じた目）をかぶせる */
.shima-wave .lid { z-index: 2; inset: auto; width: 4.6%; height: 6.6%; margin: -3.3% 0 0 -2.3%; background: #fcf7f0; border-bottom: 1.5px solid #4a2c1c; border-radius: 0 0 50% 50%; transform: rotate(-12deg) scaleY(0); transform-origin: 50% 0; animation: shima-blink 4.3s infinite; }
.shima-wave .lid.l { left: 28.1%; top: 23.3%; }
.shima-wave .lid.r { left: 41.1%; top: 17.1%; }
@keyframes shima-blink { 0%, 90%, 94%, 96%, 100% { transform: rotate(-12deg) scaleY(0); } 92%, 95.5% { transform: rotate(-12deg) scaleY(1); } }
@keyframes shima-flap-back { 0%, 36%, 100% { transform: none; } 6%, 18% { transform: rotate(-15deg); } 12%, 24% { transform: rotate(2deg); } 30% { transform: rotate(-4deg); } }
@keyframes shima-tail { 0%, 70%, 92%, 100% { transform: none; } 74% { transform: rotate(-9deg); } 78% { transform: rotate(2deg); } 82% { transform: rotate(-6deg); } 87% { transform: rotate(1deg); } }
/* 跳ねる・呼吸・首をかしげるは、translate・scale・rotate の別々の値で動かすので、同時に動いても打ち消し合わない */
@keyframes shima-bob { 0%, 36%, 100% { translate: 0 0; } 9% { translate: 0 -4px; } 21% { translate: 0 -3px; } }
@keyframes shima-breathe { 0%, 100% { scale: 1 1; } 50% { scale: 1.012 .988; } }
@keyframes shima-look { 0%, 52%, 72%, 100% { rotate: 0deg; } 56%, 68% { rotate: -5deg; } }
.shima-wave.excited { animation: shima-jump .7s ease-out; }
.shima-wave.excited .bw { animation: shima-flap-fast-back .16s 4 ease-in-out; }
.shima-wave.excited .tail { animation: shima-tail-fast .16s 4 ease-in-out; }
@keyframes shima-jump { 35% { transform: translateY(-14px) rotate(-4deg); } 70% { transform: translateY(0) scale(1.04, .96); } }
@keyframes shima-flap-fast-back { 50% { transform: rotate(-18deg); } }
@keyframes shima-tail-fast { 50% { transform: rotate(-8deg); } }
/* 挿絵はコマ送り：同じ場面の2コマ（名前-1 と 名前-2）を重ね、交互に出す。1コマを出す時間は場面ごとに --koma で決める。
   空飛ぶ親鳥だけは、コマ送りに合わせて体もふわふわ上下させる */
.shima-pic img:last-child { position: absolute; inset: 0; height: 100%; width: 100%; }
.shima-pic img:first-child { animation: koma-1 calc(var(--koma) * 2) infinite step-end; }
.shima-pic img:last-child { animation: koma-2 calc(var(--koma) * 2) infinite step-end; }
@keyframes koma-1 { 0% { visibility: visible; } 50% { visibility: hidden; } }
@keyframes koma-2 { 0% { visibility: hidden; } 50% { visibility: visible; } }
.pic-no-events { --koma: .9s; }
.pic-no-prints { --koma: .22s; animation: shima-fly 1.8s infinite ease-in-out; }
@keyframes shima-fly { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.pic-no-items { --koma: 1.1s; }
.pic-all-done { --koma: .3s; }
.pic-reading { --koma: .8s; }
.pic-not-found { --koma: .9s; }
/* 右下の「シマちゃんにお願い」のボタンは、6秒ごとに1回だけ小さく跳ねる */
.fab-shima { animation: shima-idle 6s infinite ease-in-out; }
@keyframes shima-idle { 0%, 88%, 100% { transform: none; } 92% { transform: translateY(-5px) rotate(-8deg); } 96% { transform: translateY(0) rotate(4deg); } }
/* 動きを減らす設定の端末では、繰り返す動きを止める（上の「動きを減らす」の決まりだけだと、1ミリ秒ごとに繰り返して画面がちらつく） */
@media (prefers-reduced-motion: reduce) {
  .shima-pic img:last-child { display: none; }
  .shima-wave img, .shima-wave .rig, .shima-wave .bw, .shima-wave .lid, .shima-wave.excited, .shima-pic, .shima-pic img, .fab-shima, .shima-face.thinking, .shima-reading .shima-pic { animation: none !important; }
}
/* 「シマちゃんにお願い」の欄の一番上：小さなシマちゃん（羽をパタパタ）と吹き出しの一言。返事を待つ間は跳ねる */
.shima-say { display: flex; align-items: flex-end; gap: 8px; margin: 0 0 8px; }
.shima-say .shima-wave { flex: none; width: 64px; }
.shima-say .shima-wave.thinking { animation: shima-hop 1.1s infinite ease-in-out; }
.shima-say .say { position: relative; flex: 1; min-width: 0; margin: 0 0 14px; padding: 6px 12px; background: var(--accent-soft); border-radius: 14px; font-size: .9rem; font-weight: 700; line-height: 1.5; }
.shima-say .say::before { content: ""; position: absolute; left: -6px; bottom: 8px; border: 6px solid transparent; border-right-color: var(--accent-soft); border-left: 0; }
.shima-say .icon-btn { align-self: flex-start; flex: none; font-size: 1rem; color: var(--sub); }
@media (prefers-reduced-motion: reduce) { .shima-say .shima-wave.thinking { animation: none; } }

/* シマちゃんの遊び心（2026-11-25）。下のタブのシマちゃんは、押すと羽を広げた絵と交互に出してはばたく */
.tab-flap { position: relative; }
.tab-flap img { position: absolute; inset: 0; width: 100%; height: 100%; }
.tab-flap img:last-child { visibility: hidden; }
.tab-flap.flap { animation: tab-flap-hop .5s ease-out; }
.tab-flap.flap img:first-child { animation: koma-1 .14s 4 step-end; }
.tab-flap.flap img:last-child { animation: koma-2 .14s 4 step-end; }
@keyframes tab-flap-hop { 40% { transform: translateY(-6px); } }
/* あいさつの親鳥は、寝ている時（.sleeping）と怒っている時（.angry）に、2コマの絵（web/ai.js の shimaMood）と入れ替える */
.shima-wave .mood { display: none; position: absolute; left: 50%; bottom: 0; height: 112%; max-width: none; margin: 0; transform: translateX(-50%); }
.shima-wave .mood img:first-child { width: auto; height: 100%; max-width: none; }
.shima-wave.sleeping > .rig, .shima-wave.angry > .rig { visibility: hidden; }
.shima-wave.sleeping .pic-sleep, .shima-wave.angry .pic-angry { display: block; }
.pic-sleep { --koma: 1.3s; }
.pic-angry { --koma: .2s; }
.shima-wave.huff { animation: shima-huff .4s ease-in-out; }
@keyframes shima-huff { 20%, 60% { transform: translateX(-4px) rotate(-3deg); } 40%, 80% { transform: translateX(4px) rotate(3deg); } }
.shima-wave .mood-say { position: absolute; left: 0; right: 0; top: -28px; width: fit-content; margin: 0 auto; z-index: 1; display: none; padding: 3px 10px; background: var(--accent-soft); border-radius: 12px; font-size: .82rem; font-weight: 700; white-space: nowrap; color: var(--ink); }
.shima-wave .mood-say.on { display: block; animation: rise .25s ease-out; }
.shima-wave.angry .mood-say { right: auto; left: -64px; background: #ffe1e1; color: #b3261e; }
@media (prefers-reduced-motion: reduce) {
  .tab-flap.flap, .tab-flap.flap img, .shima-wave.huff, .shima-wave .mood-say.on { animation: none !important; }
}

/* シマちゃんのタブの1問1答（2026-11-25）。今の答えは、大きいシマちゃん（.shima-big）の横の吹き出しに出す */
.shima-turn-row { display: flex; align-items: flex-start; gap: 4px; }
.shima-turn-row.new { animation: rise .25s ease-out; }
.shima-turn-row .shima-wave { flex: none; width: 96px; margin-top: 30px; }
.shima-turn-row .shima-wave.thinking { animation: shima-hop 1.1s infinite ease-in-out; }
.shima-turn-row .mood-say, .shima-turn-row .shima-wave.angry .mood-say { left: 0; right: auto; margin: 0; }
.msg.shima-says { position: relative; flex: 1; min-width: 0; max-width: none; margin-top: 10px; border-radius: 18px; padding: 10px 14px 12px; }
.msg.shima-says::before { content: ""; position: absolute; left: -8px; top: 26px; border: 8px solid transparent; border-right-color: var(--card); border-left: 0; }
.shima-says .who { display: block; font-size: .72rem; color: var(--sub); }
/* 前のやりとり（覚えている1つ前の質問と答え）。たたんで1行にし、押すと開く */
.prev-turn { border: 1px dashed var(--line); border-radius: 12px; background: var(--card); opacity: .85; }
.prev-turn > summary { padding: 8px 12px; font-size: .82rem; color: var(--sub); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prev-turn > summary b { color: var(--ink); font-weight: 600; }
.prev-turn[open] { opacity: 1; }
.prev-body { display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 10px; }
/* シマちゃんが入れた物（札で入れてから30分は「元に戻す」を押せる）。入力欄のすぐ上 */
.ai-added { max-height: 32vh; overflow: auto; margin-bottom: 8px; padding: 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.ai-added > summary { padding: 7px 0; font-size: .8rem; color: var(--sub); cursor: pointer; }
.ai-added-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .88rem; line-height: 1.45; }
.ai-added-row > span { flex: 1; min-width: 0; }
.ai-added-row .meta { color: var(--sub); font-size: .8rem; }
.ai-added-row .today-btn { flex: none; }
@media (prefers-reduced-motion: reduce) { .shima-turn-row .shima-wave.thinking { animation: none; } }

/* 考え中（眼鏡で手帳を読む）と、眠そう（15秒さわらないとあくび）。どちらも親鳥の絵と入れ替えて出す（2026-11-25） */
.shima-wave.thinking > .rig, .shima-wave.drowsy > .rig { visibility: hidden; }
.shima-wave.thinking .pic-think, .shima-wave.drowsy .pic-drowsy { display: block; }
.shima-turn-row .shima-wave.thinking, .shima-say .shima-wave.thinking { animation: none; }
.pic-think { --koma: .9s; }
/* 眠そうな時は、とろんとした目のコマを長く、あくびのコマを短く出す */
.pic-drowsy img:first-child { animation: drowsy-1 4s infinite step-end; }
.pic-drowsy img:last-child { animation: drowsy-2 4s infinite step-end; }
@keyframes drowsy-1 { 0% { visibility: visible; } 65% { visibility: hidden; } }
@keyframes drowsy-2 { 0% { visibility: hidden; } 65% { visibility: visible; } }
/* まれに飛んでくるひな鳥（web/ai.js の shimaChick）。右から羽ばたいて頭に止まり、4秒後に左上へ飛んでいく */
.shima-wave .chick { position: absolute; left: 17%; bottom: 89%; width: 36%; pointer-events: none; z-index: 2; }
.shima-wave .chick img { visibility: hidden; }
.shima-wave .chick img + img { position: absolute; inset: 0; }
.chick.in img:nth-child(1), .chick.out img:nth-child(1) { animation: koma-1 .24s infinite step-end; }
.chick.in img:nth-child(2), .chick.out img:nth-child(2) { animation: koma-2 .24s infinite step-end; }
.shima-wave .chick.sit img.sit { visibility: visible; }
.chick.in { animation: chick-in 1.6s ease-out both; }
.chick.sit { animation: chick-land .3s ease-out; }
.chick.out { animation: chick-out 1.4s ease-in both; }
@keyframes chick-in { 0% { transform: translate(280px, -140px); } 70% { transform: translate(20px, -16px); } 100% { transform: none; } }
@keyframes chick-land { 50% { transform: translateY(2px) scale(1.06, .94); } }
@keyframes chick-out { 0% { transform: none; } 100% { transform: translate(-300px, -200px); } }

/* 自分だけに表示する予定の印（日の一覧の予定の名前の前） */
.ev-lock { color: var(--sub); margin-right: 3px; }
.ev-lock .ic { width: .95em; height: .95em; }
/* カレンダーを選ぶ板の、メンバーが本人1人だけのカレンダーの印（2026-11-25） */
.solo-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft, #e8eefc); color: var(--sub); font-size: .72rem; font-weight: 600; vertical-align: 2px; }
/* 長い知らせ（30字を超える物）は、丸い帯だと両端の字が欠けるので、角の丸い箱にする（2026-11-25） */
.toast.long { border-radius: 14px; width: 86vw; max-width: 420px; text-align: left; line-height: 1.6; padding: 12px 16px; }
/* 予定の画面に出す、元のプリントのリンクとコード（2026-11-25） */
.ev-links { margin-top: 10px; }
.ev-links h4 { margin: 0 0 6px; font-size: .9rem; }

/* まれに親鳥が飛んでいく（web/ai.js の shimaTrip。2026-11-25 著者の案）。飛ぶ間は親鳥の組み絵を隠し、手帳だけの絵（notebook）を残す。
   飛ぶ親鳥（fly-1・2）は左向きの2コマで、左上へ飛んでいき、戻る時は左右を反転して左上から戻る。
   交代の時は、ひな鳥（chick-fly-1・2）が右から飛んできて、手帳に立つひな鳥（standin-1・2）になり、タブを離れるまで答える */
.shima-wave .book { position: absolute; inset: 0; display: none; }
.shima-wave.away .book, .shima-wave.standin .book { display: block; }
.shima-wave.standin .book { position: relative; }
.shima-wave.away > .rig { visibility: hidden; }
.shima-wave .flyer, .shima-wave .arrive { position: absolute; z-index: 3; pointer-events: none; }
.shima-wave .flyer img + img, .shima-wave .arrive img + img { position: absolute; inset: 0; }
.shima-wave .flyer img:nth-child(1), .shima-wave .arrive img:nth-child(1) { animation: koma-1 .24s infinite step-end; }
.shima-wave .flyer img:nth-child(2), .shima-wave .arrive img:nth-child(2) { animation: koma-2 .24s infinite step-end; }
.shima-wave .flyer { left: 8%; top: -8%; width: 84%; }
.shima-wave .flyer.off { animation: fly-off 1.1s ease-in forwards; }
.shima-wave .flyer.back { animation: fly-back 1.2s ease-out forwards; }
.shima-wave .flyer.back img { scale: -1 1; }
@keyframes fly-off { 0% { transform: none; } 100% { transform: translate(-340px, -260px) scale(.7); } }
@keyframes fly-back { 0% { transform: translate(-340px, -240px) scale(.7); } 100% { transform: none; } }
.shima-wave .arrive, .shima-wave .pic-standin { left: 31%; bottom: 19%; width: 38%; }
.shima-wave .arrive { animation: chick-in 1.4s ease-out forwards; }
.shima-wave .pic-standin { position: absolute; max-width: none; margin: 0; }
.shima-wave .pic-standin img { width: 100%; height: auto; }
/* 手帳に立つひな鳥は、立っている絵を長く、羽を挙げる絵を短く出す */
.pic-standin img:first-child { animation: standin-1 5s infinite step-end; }
.pic-standin img:last-child { animation: standin-2 5s infinite step-end; }
@keyframes standin-1 { 0% { visibility: visible; } 80% { visibility: hidden; } }
@keyframes standin-2 { 0% { visibility: hidden; } 80% { visibility: visible; } }
.shima-turn-row .shima-wave.standin.thinking, .shima-say .shima-wave.standin.thinking, .shima-wave.standin.thinking { animation: shima-hop 1.1s infinite ease-in-out; }
@media (prefers-reduced-motion: reduce) { .shima-wave.standin.thinking, .shima-turn-row .shima-wave.standin.thinking { animation: none; } }
/* 代わりに答えるひな鳥も、5秒さわらないと眠そうに（hina-drowsy）、15秒で寝る（hina-sleep）。web/ai.js の napLater */
.shima-wave .hina-mood { display: none; position: absolute; left: 31%; bottom: 19%; width: 38%; max-width: none; margin: 0; }
.shima-wave .hina-mood img { width: 100%; height: auto; }
.shima-wave.standin.drowsy .pic-standin, .shima-wave.standin.sleeping .pic-standin { visibility: hidden; }
.shima-wave.standin.drowsy .pic-hina-drowsy, .shima-wave.standin.sleeping .pic-hina-sleep { display: block; }
.pic-hina-drowsy img:first-child { animation: drowsy-1 4s infinite step-end; }
.pic-hina-drowsy img:last-child { animation: drowsy-2 4s infinite step-end; }
.pic-hina-sleep { --koma: 1.3s; }

/* 予定を消す札を押した後に、札の中で「削除しますか？」と聞く欄（web/ai.js の askDelete） */
.proposal .del-ask { margin-top: 8px; padding: 10px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 8%, transparent); }
.proposal .del-ask p { margin: 0; font-weight: 600; }
.proposal .del-ask .btns { margin-top: 6px; }

/* iPhone のアプリの中（web/shell.js）。下のタブはアプリが iPhone の部品で出すので、Web の下のタブを隠し、その高さを空けない */
html.shell .tabs { display: none; }
html.shell, html.shell body { --tab-h: 0px; }
/* アプリのカレンダーのタブを出している間（web/shell.js の shellTabSync）。カレンダーはアプリの部品が描くので、Web の画面の背景を透かし、
   アプリから頼まれた板（シマちゃんにお願い・献立表を撮るなど）だけを、アプリのカレンダーの上に出す */
html.shell-cal, html.shell-cal body { background: transparent; }
html.shell-cal #view, html.shell-cal .offline { display: none; }

/* 持ち物のセット（web/lists.js の openPrepSets。2026-11-28） */
.pset-list { display: flex; flex-direction: column; gap: 8px; }
.pset { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.pset-main { flex: 1; min-width: 0; }
.pset-main .note { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pset-acts { display: flex; flex-direction: column; gap: 6px; flex: none; }
.pset-acts .btn { min-height: 40px; padding: 6px 14px; width: auto; }
.pset-pick { display: flex; flex-direction: column; margin: 4px 0 8px; }
.pset-row { display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--line); }
.pset-row > span { flex: 1; }
.pset-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }

