/* はんこカレンダー 見た目。色は「きせかえ」で差し替える */
:root {
  --accent: #f0739b;
  --accent-weak: #ffe3ec;
  --accent-text: #ffffff;
  --bg: #fff8fa;
  --panel: #ffffff;
  --line: #f1d5de;
  --text: #4a3b40;
  --muted: #9a858c;
  --sun: #e2526f;
  --sat: #4a8fd6;
  --danger: #d64545;
  --radius: 12px;
  --shelf-h: 260px;
  --accent-deep: #f04f86;
  --band: #ece8e4;
  --band-text: #3d3632;
  --band-sat: #bfe6f2;
  --band-sat-strong: #8ed3e6;
  --band-sun: #ffc9d6;
  --band-sun-strong: #f9a3b8;
  --grid-gap: #efeae6;
  --dash: #e3ddd8;
  --month-line: #5a4a42;
  --holiday-bg: #fff0f4;
  --today: #2fb3a3;
  --today-weak: #fdf3d8;
  --shelf-bg: #fbf7ee;
  --pager: #c9b99c;
  font-family: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
:root[data-theme="mint"] { --accent-deep: #2a9c83; --accent: #3fb59a; --accent-weak: #dcf5ee; --bg: #f6fcfa; --line: #cfe9e1; --text: #2f4a43; --muted: #7c9b92; }
:root[data-theme="sky"] { --accent-deep: #2f7fc6; --accent: #4a9be0; --accent-weak: #dfeefb; --bg: #f6fafe; --line: #cfe0f0; --text: #2f4052; --muted: #7d92a8; }
:root[data-theme="lemon"] { --accent-deep: #b88a00; --accent: #d9a400; --accent-weak: #fff3c9; --bg: #fffdf4; --line: #efe2b3; --text: #4d4326; --muted: #9a8c5c; }
:root[data-theme="lavender"] { --accent-deep: #7560c4; --accent: #8f7ad8; --accent-weak: #ebe5fb; --bg: #faf8ff; --line: #dcd4f2; --text: #3e3658; --muted: #8b82a8; }
:root[data-theme="ink"] { --accent-deep: #2f3743; --accent: #4b5563; --accent-weak: #e5e7eb; --bg: #f7f7f8; --line: #d7dae0; --text: #24272d; --muted: #7b808a; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
/* iPhone: 長押しで出る吹き出し・文字の選択・ダブルタップの拡大を止める（入力欄は除く） */
#app, #sheet-root .modal, #lock { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
input, textarea, select { -webkit-user-select: text; user-select: text; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

#app {
  height: 100dvh;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ---- 上の帯 ---- */
#topbar {
  display: flex; align-items: center; gap: 2px;
  padding: calc(5px + env(safe-area-inset-top)) calc(6px + env(safe-area-inset-right)) 5px calc(6px + env(safe-area-inset-left));
  background: var(--accent); color: var(--accent-text); flex: none;
  border-bottom: 4px solid var(--band-sat-strong);
}
#ym-wrap { flex: 0 1 auto; min-width: 0; display: flex; }
#ym {
  min-width: 0; min-height: 38px; padding: 0 4px; border: 0; border-radius: 10px; background: transparent; color: inherit;
  font-size: 21px; font-weight: 700; letter-spacing: 1.5px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
#ym:disabled { cursor: default; font-size: 16px; letter-spacing: 0; }
#ym:not(:disabled):hover, #ym:focus-visible { background: rgba(255, 255, 255, 0.25); }
.topbar-space { flex: 1; min-width: 0; }
.icon-btn {
  flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; font-size: 21px; line-height: 1; color: inherit; padding: 0;
}
.icon-btn:hover, .icon-btn:focus-visible { background: rgba(255, 255, 255, 0.25); }
#topbar .month-arrow { width: 32px; height: 38px; font-size: 17px; border-radius: 10px; }
.chip-btn {
  flex: none; min-height: 36px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 18px;
  background: transparent; color: inherit; font-size: 13px; white-space: nowrap;
}
.chip-btn:hover, .chip-btn:focus-visible { background: rgba(255, 255, 255, 0.25); }

/* ---- 月の表示 ---- */
#calendar-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#weekdays {
  flex: none; display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 13px; letter-spacing: 1px; background: var(--band); color: var(--band-text);
}
#weekdays span { padding: 3px 0; }
#weekdays .sun { background: var(--band-sun); color: var(--sun); }
#weekdays .sat { background: var(--band-sat); color: var(--sat); }
#calendar {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  touch-action: pan-y; overscroll-behavior: contain; position: relative;
}
.cal-inner { position: relative; width: 100%; }
.week {
  position: absolute; left: 0; right: 0; top: 0; height: var(--row-h, 80px);
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
}
/* マス: 上に日付の帯、その下を点線で4分割 */
.cell {
  position: relative; min-width: 0; height: 100%;
  border-right: 2px solid var(--grid-gap); background: var(--panel);
  display: flex; flex-direction: column; overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
.cell:last-child { border-right: 0; }
.cell-head {
  flex: none; position: relative; height: 19px; display: flex; align-items: center; justify-content: center;
  background: var(--band); color: var(--band-text);
}
.cell.sat .cell-head { background: var(--band-sat); }
.cell.sun .cell-head { background: var(--band-sun); }
.daynum { font-size: 13px; line-height: 19px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.yearnum { position: absolute; left: 3px; top: 0; font-size: 8px; line-height: 19px; color: var(--muted); }
@media (max-width: 600px) { .yearnum { display: none; } }
.marks { position: absolute; right: 2px; top: 0; display: flex; gap: 1px; font-size: 9px; line-height: 19px; color: var(--muted); white-space: nowrap; }
.mark-more { color: var(--accent); font-weight: 700; }
.mark-diary { color: var(--accent); }
/* 祝日の名前（日付の帯のすぐ下） */
.holiday-strip {
  flex: none; height: 12px; line-height: 12px; text-align: center; white-space: nowrap; overflow: hidden;
  font-size: clamp(8px, 2.1vw, 11px); font-weight: 700; letter-spacing: -0.2px; color: var(--sun); background: var(--holiday-bg);
}
.quad { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.quad::before, .quad::after { content: ""; position: absolute; pointer-events: none; }
.quad::before { left: 50%; top: 0; bottom: 0; border-left: 1px dashed var(--dash); }
.quad::after { top: 50%; left: 0; right: 0; border-top: 1px dashed var(--dash); }
.cell.sat .quad::before, .cell.sat .quad::after { border-color: var(--band-sat-strong); }
.cell.sun .quad::before, .cell.sun .quad::after { border-color: var(--band-sun-strong); }
.q { position: relative; z-index: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.placed { border: 0; padding: 0; background: transparent; display: flex; touch-action: pan-y; }
.placed.armed .stamp { transform: scale(1.18); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); }
/* 日の色・今日 */
.cell.colored .quad { background: var(--day-color); }
.cell.today .cell-head { background: var(--today); color: #fff; }
.cell.today .quad { background: var(--today-weak); }
.cell.today.colored .quad { background: var(--day-color); }
/* 月の変わり目の太い線・今日の枠（マスの上に重ねて描く） */
.cell::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.cell.mb-top::after { border-top: 3px solid var(--month-line); }
.cell.mb-left::after { border-left: 3px solid var(--month-line); }
.cell.today::after { box-shadow: inset 0 0 0 2px var(--today); }
.cell.drop::after { box-shadow: inset 0 0 0 3px var(--accent); }
.cell.drop[data-drop-slot="0"] .q[data-slot="0"],
.cell.drop[data-drop-slot="1"] .q[data-slot="1"],
.cell.drop[data-drop-slot="2"] .q[data-slot="2"],
.cell.drop[data-drop-slot="3"] .q[data-slot="3"] { background: var(--accent-weak); }
body[data-mode="stamp"] .cell[data-date], body[data-mode="move"] .cell[data-date], body[data-mode="copy"] .cell[data-date] { cursor: copy; }

/* ---- スタンプ ---- */
.stamp {
  position: relative; flex: none; width: var(--size); height: var(--size); border-radius: 26%;
  background: var(--bg-stamp, var(--bg)); background: var(--bg);
  color: var(--fg, #444); display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07); transition: transform 0.12s;
  font-family: "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", "Yu Gothic UI", sans-serif;
}
.stamp-g { font-size: calc(var(--size) * 0.58); line-height: 1; font-weight: 700; white-space: nowrap; }
.stamp-t {
  position: absolute; left: 0; right: 0; bottom: 0; text-align: center; white-space: nowrap;
  font-size: calc(var(--size) * 0.24); line-height: 1.25; font-weight: 700;
  background: rgba(255, 255, 255, 0.86); color: #444;
  font-family: "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", sans-serif;
}
.stamp:has(.stamp-t) .stamp-g { transform: translateY(-12%); }
.stamp-img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.stamp-add { background: var(--panel); color: var(--accent); font-size: 22px; box-shadow: inset 0 0 0 2px var(--line); }
.stamp.ghost {
  position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); opacity: 0.95;
}
body.dragging { cursor: grabbing; }

/* ---- 案内の帯 ---- */
#modebar {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--text); color: #fff; font-size: 13px;
}
#modebar-text { flex: 1; min-width: 0; }
#modebar .chip-btn { border-color: rgba(255, 255, 255, 0.7); }

/* ---- スタンプ棚（ページ送り） ---- */
#shelf {
  flex: none; position: relative; display: flex; flex-direction: column;
  background: var(--shelf-bg); padding-bottom: env(safe-area-inset-bottom);
}
#shelf-bar {
  flex: none; display: flex; align-items: flex-end; gap: 6px; height: 40px; padding: 0 6px 0 10px;
  background: var(--accent); color: var(--accent-text);
}
.shelf-mode {
  flex: none; height: 32px; padding: 0 9px; border: 0; border-radius: 4px 4px 0 0; border-top: 4px solid transparent;
  background: rgba(255, 255, 255, 0.35); color: var(--accent-text); font-size: 13px; white-space: nowrap;
}
.shelf-mode.on { background: var(--shelf-bg); color: var(--accent); font-weight: 700; border-top-color: var(--accent-deep); }
#shelf-mode-plan.on { color: var(--today); border-top-color: var(--today); }
#shelf-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; height: 36px; font-size: 14px; }
#shelf-search-input {
  flex: 1; min-width: 0; height: 30px; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.6); border-radius: 0;
  background: transparent; color: var(--accent-text); font: inherit; font-size: 16px; padding: 0 2px; /* 16px未満だと iPhone が入力時に画面を拡大する */
}
#shelf-search-input::placeholder { color: var(--accent-text); opacity: 0.95; }
#shelf-search-input:focus { outline: none; border-bottom-color: #fff; }
#shelf-toggle { width: 34px; height: 36px; font-size: 15px; border-radius: 8px; }
#shelf-body { flex: none; }
#shelf.collapsed #shelf-body { display: none; }
#shelf-pager { display: flex; align-items: center; padding-top: 6px; }
.pager-arrow {
  flex: none; width: 28px; height: 60px; border: 0; background: transparent; color: var(--pager); font-size: 17px; padding: 0;
}
.pager-arrow:disabled { opacity: 0.25; cursor: default; }
#shelf-grid {
  flex: 1; min-width: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  touch-action: pan-x; overscroll-behavior: contain; scrollbar-width: none;
}
#shelf-grid::-webkit-scrollbar { display: none; }
.shelf-page {
  flex: none; width: 100%; height: 162px; scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); grid-template-rows: repeat(3, 54px); align-content: start;
}
.shelf-page-empty { display: flex; align-items: center; justify-content: center; }
.shelf-empty { color: var(--muted); font-size: 13px; padding: 0 12px; text-align: center; }
.shelf-item {
  position: relative; border: 0; background: transparent; padding: 2px 0 0; min-width: 0; height: 54px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; border-radius: 10px;
  touch-action: pan-x; user-select: none; -webkit-user-select: none;
}
.shelf-item.selected { background: var(--accent-weak); box-shadow: inset 0 0 0 2px var(--accent); }
.shelf-item.armed .stamp { transform: scale(1.15); }
.shelf-item.is-fav::after { content: "★"; position: absolute; top: 0; right: 3px; font-size: 11px; color: #f5a623; }
.shelf-label {
  width: 100%; font-size: 9.5px; line-height: 1.2; text-align: center; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 1px;
}
#shelf-dots { height: 14px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pager); opacity: 0.45; }
.dot.on { opacity: 1; background: var(--month-line); }
.dots-text { font-size: 11px; color: var(--muted); }
#shelf-tabs {
  display: flex; gap: 8px; padding: 4px 10px 8px; overflow-x: auto; scrollbar-width: none; justify-content: safe center;
}
#shelf-tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-width: 44px; min-height: 32px; padding: 0 9px; border: 1px dashed var(--accent); border-radius: 4px;
  background: var(--accent-weak); font-size: 12.5px; white-space: nowrap; color: var(--accent);
}
.tab.on { background: var(--accent-deep); border-color: #fff; color: #fff; font-weight: 700; }
#shelf-plan { height: 226px; overflow-y: auto; padding: 6px 8px 8px; }
.plan-day { margin-bottom: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.plan-date { display: block; width: 100%; text-align: left; border: 0; background: var(--band); color: var(--band-text); padding: 4px 10px; font-size: 12.5px; font-weight: 700; }
.plan-day .event-row { min-height: 44px; padding: 4px 10px; }
#shelf-trash {
  display: none; position: absolute; inset: 0; align-items: center; justify-content: center; z-index: 3;
  background: rgba(255, 255, 255, 0.94); color: var(--danger); font-weight: 700; border: 2px dashed var(--danger);
}
body.dragging-event #shelf-trash { display: flex; }
#shelf.drop-trash #shelf-trash { background: #ffe1e1; }

/* ---- リスト表示 ---- */
#listview { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 10px 20px; position: relative; }
.list-day { margin-bottom: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-day.past { opacity: 0.72; }
.list-day { border-left: 6px solid var(--day-color, var(--line)); }
.list-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.list-date {
  display: block; width: 100%; text-align: left; border: 0; background: var(--accent-weak);
  padding: 7px 10px; font-size: 13px; font-weight: 700;
}
.list-diary { padding: 6px 12px 9px; font-size: 13px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.list-empty { padding: 30px 10px; text-align: center; }

/* ---- 予定の行 ---- */
.event-list { display: flex; flex-direction: column; }
.event-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; text-align: left;
  border: 0; border-top: 1px solid var(--line); background: var(--panel); padding: 6px 10px;
}
.event-list .event-row:first-child { border-top: 0; }
.event-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.event-row-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-row-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-row-alarm { flex: none; font-size: 14px; }

/* ---- せり上がる画面・小窓 ---- */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 100; }
.backdrop-modal { z-index: 300; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110; margin: 0 auto; max-width: 640px;
  max-height: 86dvh; display: flex; flex-direction: column; background: var(--bg);
  border-radius: 18px 18px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.2);
}
.sheet-full { top: 0; max-height: none; border-radius: 0; }
.sheet + .backdrop { z-index: 120; }
.sheet + .backdrop + .sheet { z-index: 130; }
.sheet-head {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-close { color: var(--text); }
.sheet-close:hover { background: var(--accent-weak); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); }
.sheet-body h3 { font-size: 13px; color: var(--accent); margin: 14px 0 6px; }
.sheet-body h3:first-child { margin-top: 2px; }
.sheet-body .event-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); margin-bottom: 8px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; padding: 6px 4px; }
.holiday-name { color: var(--sun); font-size: 13px; font-weight: 700; }
.modal {
  position: fixed; z-index: 310; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(88vw, 360px); background: var(--panel); border-radius: 16px; padding: 18px 16px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.modal-msg { font-size: 15px; line-height: 1.6; margin-bottom: 12px; overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.menu-list { display: flex; flex-direction: column; gap: 8px; }

/* ---- ボタン・入力 ---- */
.btn {
  min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 21px;
  background: var(--panel); font-size: 14px; white-space: nowrap;
}
.btn:hover, .btn:focus-visible { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.btn-danger { color: var(--danger); border-color: #f0c4c4; }
.btn-wide { display: block; width: 100%; }
.btn-small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.input {
  width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text); font: inherit; font-size: 16px;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea.input { resize: vertical; line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; min-width: 0; flex: 1; }
.field > span { font-size: 12.5px; color: var(--muted); }
.field-row { display: flex; gap: 10px; }
.counter { margin-left: 6px; }
.editor-top { display: flex; align-items: center; gap: 14px; }

/* ---- 写真 ---- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-bottom: 8px; }
.photo-thumb { border: 0; padding: 0; background: var(--line); border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-full { display: block; max-width: 100%; max-height: 72dvh; margin: 0 auto; border-radius: 8px; }

/* ---- 今日の画面 ---- */
.weather { background: var(--accent-weak); border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.6; }
.week-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.week-row {
  display: flex; gap: 10px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line);
  background: var(--panel); padding: 9px 10px; font-size: 14px; min-height: 42px; align-items: baseline;
}
.week-row:first-child { border-top: 0; }
.week-row.today { background: var(--accent-weak); font-weight: 700; }
.week-date { flex: none; width: 4.6em; }
.week-row.sun .week-date { color: var(--sun); }
.week-row.sat .week-date { color: var(--sat); }
.week-events { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ---- 設定 ---- */
.set-section { margin-bottom: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.set-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.set-label { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.set-row .input { flex: none; width: 150px; }
.set-row input[type="checkbox"] { flex: none; width: 24px; height: 24px; accent-color: var(--accent); }
.set-line { font-size: 14px; margin: 6px 0 8px; }
.theme-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.theme-btn {
  display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 21px; background: var(--panel); font-size: 13px; white-space: nowrap;
}
.theme-btn.on { border-color: var(--swatch); box-shadow: 0 0 0 2px var(--swatch); font-weight: 700; }
.swatch { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--swatch); }
.custom-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.custom-item { display: flex; align-items: center; gap: 10px; }
.custom-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.about { text-align: center; }

/* ---- お知らせ ---- */
#toast-root {
  position: fixed; left: 0; right: 0; bottom: calc(var(--shelf-h) + 14px); z-index: 400;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 12px;
}
.toast {
  max-width: 100%; background: rgba(50, 40, 44, 0.94); color: #fff; padding: 9px 16px; border-radius: 20px;
  font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; transition: opacity 0.35s;
}
.toast.out { opacity: 0; }

/* ---- ロック ---- */
#lock { position: fixed; inset: 0; z-index: 900; background: var(--accent); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.lock-box { width: min(86vw, 300px); text-align: center; }
.lock-title { font-size: 20px; font-weight: 700; margin-bottom: 18px; }
#lock-dots { font-size: 26px; letter-spacing: 10px; margin-bottom: 8px; }
#lock-msg { font-size: 13px; margin-bottom: 16px; min-height: 1.5em; }
#lock-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lock-key {
  height: 58px; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 29px; background: transparent;
  color: inherit; font-size: 22px;
}
.lock-key:active { background: rgba(255, 255, 255, 0.3); }
.fatal { padding: 20px; color: var(--danger); }


/* ---- 日の色・年月を選ぶ窓 ---- */
.color-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.color-chip {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.12); background: var(--chip, var(--panel));
  font-size: 11px; color: var(--muted); padding: 0;
}
.color-chip.on { box-shadow: 0 0 0 3px var(--accent); border-color: var(--panel); }
.row-actions-left { justify-content: flex-start; margin-top: 8px; }
body[data-mode="paint"] .cell[data-date], body[data-mode="paintRange"] .cell[data-date] { cursor: cell; }
.mp-year-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.mp-year-row .input { flex: 1; min-width: 0; text-align: center; }
.mp-step { flex: none; padding: 0 10px; font-size: 13px; }
.mp-months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.mp-month { padding: 0; min-height: 46px; }
.mp-month.is-today { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---- ホーム画面アプリ: 画面の上の欠け（ノッチ）をよける ---- */
.sheet-full .sheet-head { padding-top: calc(8px + env(safe-area-inset-top)); }
#lock { padding-top: env(safe-area-inset-top); }
