/* サブスク管理人 */
:root {
  --bg: #f8f5ee;
  --surface: #fffdf8;
  --surface-2: #f1ede3;
  --line: #e4ddcf;
  --text: #33363a;
  --text-sub: #6d6f72;
  --main: #4f7a6b;
  --main-dark: #3d6356;
  --main-soft: #e3ede8;
  --warn: #d9822b;
  --warn-soft: #fbeedd;
  --danger: #b9504a;
  --danger-soft: #f7e3e0;
  --ok: #4b8f5c;
  --ok-soft: #e2f0e4;
  --trial: #8a6fb3;
  --trial-soft: #eee8f6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(60, 50, 30, .05), 0 4px 14px rgba(60, 50, 30, .06);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}
a { color: var(--main-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--text-sub); }
.small { font-size: .8rem; }
.text-danger { color: var(--danger); }

/* ── 上部バー ── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 20px 10px;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: .04em; display: inline-flex; gap: 6px; align-items: center; }
.brand__mark { font-size: 1.1rem; }
.banner { margin: 0 16px 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: .9rem; }

.view { max-width: 720px; margin: 0 auto; padding: 4px 16px 24px; outline: none; }
.loading { text-align: center; color: var(--text-sub); padding: 60px 0; }
.page-title { font-size: 1.35rem; margin: 6px 4px 14px; letter-spacing: .02em; }

/* ── カード・セクション ── */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px; border: 1px solid var(--line);
}
.card__title { font-size: 1rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.section { margin: 22px 0; }
.section__title { font-size: 1rem; margin: 0 4px 10px; display: flex; align-items: center; gap: 8px; }
.none { color: var(--text-sub); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0; font-size: .92rem; }
.hint { color: var(--text-sub); font-size: .82rem; margin: 6px 0 0; line-height: 1.55; }
.count { background: var(--danger); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 8px; line-height: 1.6; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--danger { background: var(--danger); }
.dot--warn { background: var(--warn); }

/* ── ボタン ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: transform .08s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--main); border-color: var(--main); color: #fff; }
.btn--primary:hover { background: var(--main-dark); }
.btn--warn { background: var(--warn-soft); border-color: #f0cfa6; color: #95561a; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger-ghost { background: transparent; border-color: #e6c3bf; color: var(--danger); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--main-dark); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: .85rem; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-col { display: grid; gap: 10px; margin: 12px 0; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  font-size: 1.5rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; color: var(--text); flex: none;
}

/* ── 管理人さん ── */
.keeper {
  display: flex; align-items: center; gap: 14px;
  background: var(--main-soft); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
}
.keeper--renewal_soon { background: var(--warn-soft); }
.keeper--cancel_deadline { background: var(--danger-soft); }
.keeper__bubble {
  position: relative; flex: 1; min-width: 0;
  background: var(--surface); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow);
}
.keeper__bubble::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  border: 8px solid transparent; border-right-color: var(--surface); border-left: 0;
}
.keeper__name { margin: 0; font-size: .75rem; color: var(--text-sub); }
.keeper__msg { margin: 2px 0 0; font-weight: 700; font-size: 1.02rem; line-height: 1.5; }

/* CSSの仮の猫（画像に差し替え可能） */
.cat { position: relative; flex: none; }
.cat img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cat--sm { width: 48px; height: 48px; }
.cat--md { width: 64px; height: 64px; }
.cat--lg { width: 78px; height: 78px; }
.cat--css { --fur: #c9b9a0; --fur-dark: #a8957a; }
.cat--css .cat__face {
  position: absolute; inset: 14% 4% 0; border-radius: 50% 50% 46% 46%;
  background: var(--fur); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .05);
}
.cat__ear { position: absolute; top: 2%; width: 34%; height: 36%; background: var(--fur); border-radius: 30% 70% 0 0; }
.cat__ear--l { left: 8%; transform: rotate(-18deg); }
.cat__ear--r { right: 8%; transform: rotate(18deg) scaleX(-1); }
.cat__ear::after { content: ""; position: absolute; inset: 28% 30% 20% 24%; background: #e6b8a8; border-radius: 30% 70% 0 0; }
.cat__eye {
  position: absolute; top: 42%; width: 18%; height: 4%; background: #3a3530; border-radius: 4px;
  /* 半目（無愛想） */
}
.cat__eye--l { left: 22%; }
.cat__eye--r { right: 22%; }
.cat__nose { position: absolute; top: 56%; left: 50%; width: 9%; height: 6%; background: #d78f84; border-radius: 50%; transform: translateX(-50%); }
.cat__whisker { position: absolute; top: 62%; width: 22%; height: 2px; background: rgba(60, 50, 40, .35); }
.cat__whisker--l { left: -4%; transform: rotate(6deg); }
.cat__whisker--r { right: -4%; transform: rotate(-6deg); }
.cat[data-state="renewal_soon"] .cat__eye { height: 9%; top: 39%; border-radius: 50%; width: 11%; }
.cat[data-state="renewal_soon"] .cat__eye--l { left: 26%; }
.cat[data-state="renewal_soon"] .cat__eye--r { right: 26%; }
.cat[data-state="cancel_deadline"] .cat__eye { height: 13%; top: 37%; width: 13%; border-radius: 50%; }
.cat[data-state="cancel_deadline"] .cat__eye--l { left: 24%; }
.cat[data-state="cancel_deadline"] .cat__eye--r { right: 24%; }
.cat__mark {
  position: absolute; right: -6px; top: -4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--danger); color: #fff; font-weight: 800; font-size: .8rem;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface);
}
.cat__mark--soft { background: var(--warn); }
@media (prefers-reduced-motion: no-preference) {
  .cat--css { animation: breathe 4s ease-in-out infinite; transform-origin: bottom center; }
  @keyframes breathe { 50% { transform: scaleY(.97); } }
}

/* ── お知らせ ── */
.reminders { border-color: #ecd6c8; }
.reminder-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.reminder { border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); border-left: 4px solid var(--main); }
.reminder--danger { background: var(--danger-soft); border-left-color: var(--danger); }
.reminder--warn { background: var(--warn-soft); border-left-color: var(--warn); }
.reminder__text { margin: 0 0 8px; font-size: .93rem; overflow-wrap: anywhere; }
.reminder__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.new { display: inline-block; background: var(--warn); color: #fff; font-size: .68rem; font-weight: 700; padding: 0 6px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; }

/* ── 支出 ── */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.stat--main { grid-column: 1 / -1; background: var(--main); color: #fff; border-color: var(--main); }
.stat__label { margin: 0; font-size: .82rem; opacity: .85; }
.stat__value { margin: 2px 0 0; font-size: 1.45rem; font-weight: 800; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.stat--main .stat__value { font-size: 2rem; }
.stat__note { margin: 2px 0 0; font-size: .78rem; opacity: .85; }
.stat__trial { grid-column: 1 / -1; margin: 0; font-size: .82rem; color: var(--trial); background: var(--trial-soft); border-radius: var(--radius-sm); padding: 8px 12px; }

/* ── サブスクカード ── */
.cards { display: grid; gap: 10px; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.sub-card {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  border-left: 5px solid var(--line); min-width: 0;
  transition: transform .08s;
}
.sub-card:active { transform: scale(.99); }
.sub-card--soon { border-left-color: #e9c27d; }
.sub-card--warn { border-left-color: var(--warn); background: linear-gradient(90deg, var(--warn-soft), var(--surface) 55%); }
.sub-card--danger { border-left-color: var(--danger); background: linear-gradient(90deg, var(--danger-soft), var(--surface) 55%); }
.sub-card--ok { border-left-color: var(--main-soft); }
.sub-card.is-cancelled { opacity: .62; border-left-color: var(--line); box-shadow: none; }
.sub-card__icon { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.sub-card__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sub-card__top { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; min-width: 0; }
.sub-card__name {
  font-weight: 700; min-width: 0; overflow-wrap: anywhere; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sub-card__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.price { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.price__sub { font-size: .85rem; color: var(--trial); font-weight: 700; }
.cycle { color: var(--text-sub); font-size: .82rem; }
.sub-card__date { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .85rem; }
.card__meta { font-size: .78rem; }
.due--danger { color: var(--danger); font-weight: 700; }
.days { font-weight: 700; font-size: .8rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); }
.days--soon { background: #fbf0d6; color: #8d6516; }
.days--warn { background: var(--warn); color: #fff; }
.days--danger { background: var(--danger); color: #fff; }
.sub-card__alert { position: absolute; right: 12px; bottom: 10px; color: var(--danger); font-weight: 900; }
.sub-card--warn .sub-card__alert { color: var(--warn); }

.badge { flex: none; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--text-sub); }
.badge--active { background: var(--ok-soft); color: var(--ok); }
.badge--cancel_planned { background: var(--danger-soft); color: var(--danger); }
.badge--cancelled { background: var(--surface-2); color: var(--text-sub); }
.badge--trial { background: var(--trial-soft); color: var(--trial); }
.badge--soon { background: var(--surface-2); color: var(--text-sub); font-weight: 600; }

/* ── 一覧ツールバー ── */
.toolbar { display: grid; gap: 10px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .88rem; font-weight: 600;
}
.chip.is-on { background: var(--main); border-color: var(--main); color: #fff; }
.chip__n { font-size: .75rem; opacity: .75; }
.chip--check { position: relative; padding: 0; }
.chip--check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip--check span { padding: 0 16px; line-height: 40px; border-radius: 999px; }
.chip--check input:checked + span { background: var(--main); color: #fff; }
.chip--check input:focus-visible + span { outline: 2px solid var(--main-dark); outline-offset: 2px; }
.sort { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: .85rem; color: var(--text-sub); white-space: nowrap; }
.sort select { width: auto; min-width: 0; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; color: var(--text); }

/* ── フォーム ── */
.form-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.form-head .page-title { margin: 0; }
.quick { padding: 14px 16px; }
.quick__label { margin: 0 0 8px; font-size: .82rem; color: var(--text-sub); }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .label { font-weight: 700; font-size: .9rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }
.req { font-size: .68rem; color: #fff; background: var(--warn); border-radius: 4px; padding: 0 5px; margin-left: 4px; vertical-align: 2px; font-weight: 700; }
.opt { font-size: .72rem; color: var(--text-sub); font-weight: 500; margin-left: 4px; }
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: #fff; padding: 10px 14px; font-size: 16px; /* iOSのズーム防止 */
  -webkit-appearance: none; appearance: none;
}
input[type="date"] { display: block; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--text-sub) 50%), linear-gradient(135deg, var(--text-sub) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--main) 50%, transparent); border-color: var(--main); }
.has-error input, .has-error textarea { border-color: var(--danger); background: #fffafa; }
.err { color: var(--danger); font-size: .82rem; margin: 0; min-height: 0; }
.err:empty { display: none; }
.field--inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.field--inline label { font-weight: 500; font-size: .85rem; color: var(--text-sub); }
.input--xs { width: 76px !important; min-height: 40px !important; padding: 6px 10px !important; }
.calc { font-size: .88rem; }
.calc summary { cursor: pointer; color: var(--main-dark); font-weight: 600; padding: 4px 0; }
.calc__body { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.calc__body input { flex: 1; min-width: 160px; }
.seg { display: flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px; gap: 4px; }
.seg__opt { flex: 1; position: relative; }
.seg__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg__opt span { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 9px; font-weight: 600; font-size: .9rem; text-align: center; padding: 0 4px; }
.seg__opt input:checked + span { background: var(--surface); box-shadow: var(--shadow); color: var(--main-dark); }
.seg__opt input:focus-visible + span { outline: 2px solid var(--main); }
.seg--3 .seg__opt input[value="cancel_planned"]:checked + span { color: var(--danger); }
.seg--3 .seg__opt input[value="cancelled"]:checked + span { color: var(--text-sub); }
.trial-box { background: var(--trial-soft); border-radius: var(--radius-sm); padding: 14px; display: grid; gap: 10px; margin-top: -8px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__ui { width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch__ui::after { 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, .2); transition: transform .15s; }
.switch input:checked + .switch__ui { background: var(--trial); }
.switch input:checked + .switch__ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--main); outline-offset: 2px; }
.switch input:disabled + .switch__ui { opacity: .5; }
.form-actions { display: grid; gap: 10px; }
.meta { text-align: center; }

/* ── カレンダー ── */
.cal { padding: 14px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal__title { display: grid; text-align: center; font-size: 1.05rem; line-height: 1.3; }
.cal__title .muted { font-size: .78rem; }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal__week span { text-align: center; font-size: .75rem; color: var(--text-sub); padding-bottom: 4px; }
.cal__cell {
  aspect-ratio: 1 / 1.05; min-height: 44px; border: 0; background: transparent; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 6px 0 0; cursor: pointer; gap: 3px;
}
.cal__cell--blank { cursor: default; }
.cal__cell:not(.cal__cell--blank):hover { background: var(--surface-2); }
.cal__num { font-size: .9rem; font-variant-numeric: tabular-nums; width: 28px; height: 28px; line-height: 28px; border-radius: 50%; text-align: center; }
.is-sun, .cal__cell.is-sun .cal__num { color: #b9504a; }
.is-sat, .cal__cell.is-sat .cal__num { color: #4a6fa5; }
.cal__cell.is-today .cal__num { background: var(--main); color: #fff; font-weight: 700; }
.cal__cell.is-selected { background: var(--main-soft); outline: 2px solid var(--main); }
.cal__marks { display: flex; gap: 3px; height: 8px; }
.mk { display: inline-block; width: 8px; height: 8px; flex: none; }
.mk--renewal { background: var(--main); border-radius: 50%; }
.mk--deadline { background: var(--danger); transform: rotate(45deg) scale(.85); border-radius: 1px; }
.mk--trial { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--warn); }
.cal__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 12px; font-size: .78rem; color: var(--text-sub); }
.cal__legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal__legend .btn { margin-left: auto; }
.day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.day-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; text-decoration: none; color: inherit; min-height: 52px; }
.day-item__name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.day-item__kind { flex: none; font-size: .82rem; color: var(--text-sub); }
.day-item--deadline .day-item__kind { color: var(--danger); font-weight: 700; }
.day-item--trial_end .day-item__kind { color: var(--warn); font-weight: 700; }

/* ── 設定 ── */
.settings .setting { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.settings .setting:first-of-type { border-top: 0; padding-top: 0; }
.setting--col { flex-direction: column; }
.setting__name { margin: 0; font-weight: 700; font-size: .95rem; }
.setting.is-disabled .setting__name { color: var(--text-sub); }
.settings .btn-col label.btn { position: relative; }
.about__head { display: flex; gap: 12px; align-items: center; }
.about__name { margin: 0; font-weight: 800; }
.about__head .muted { margin: 0; font-size: .85rem; }
.footer { text-align: center; color: var(--text-sub); font-size: .78rem; margin: 24px 0 0; }

/* ── 空の状態 ── */
.empty { text-align: center; padding: 30px 20px; display: grid; justify-items: center; gap: 14px; }
.empty__text { margin: 0; color: var(--text-sub); }
.empty .btn-row { justify-content: center; }
.error-card pre { white-space: pre-wrap; font-size: .75rem; overflow-wrap: anywhere; }

/* ── 下部ナビ ── */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.nav__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 100%; font-size: .68rem; color: var(--text-sub); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.nav__icon { font-size: 1.25rem; line-height: 1.2; filter: grayscale(.8); opacity: .7; }
.nav__item.is-active { color: var(--main-dark); font-weight: 700; }
.nav__item.is-active .nav__icon { filter: none; opacity: 1; }
.nav__item--add .nav__plus {
  width: 52px; height: 52px; border-radius: 50%; background: var(--main); color: #fff; font-size: 1.7rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(79, 122, 107, .35); margin-top: -18px;
}
body[data-route="new"] .nav__item--add .nav__plus, body[data-route="edit"] .nav__item--add .nav__plus { opacity: .5; }

@media (min-width: 900px) {
  .nav { left: 50%; right: auto; transform: translateX(-50%); width: 520px; bottom: 16px; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow); padding-bottom: 0; height: var(--nav-h); }
  body { padding-bottom: calc(var(--nav-h) + 40px); }
}

/* ── ダイアログ・トースト ── */
.dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: min(420px, calc(100vw - 32px)); width: 100%; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.dialog::backdrop { background: rgba(40, 35, 25, .4); }
.dialog__inner { padding: 22px; }
.dialog__title { margin: 0 0 10px; font-size: 1.1rem; }
.dialog__body { color: var(--text); font-size: .93rem; overflow-wrap: anywhere; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); width: max-content;
  background: #3a3d40; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: .9rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2); transition: opacity .2s, transform .2s;
  display: flex; align-items: center; gap: 10px;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast--ok { background: #3e6b55; }
.toast--warn { background: #9a5a1a; }
.toast--danger { background: var(--danger); }
.toast .btn { min-height: 32px; }
