:root {
  --bg: #F6F3EC;
  --card: #FFFFFF;
  --ink: #3B3733;
  --sub: #8D857B;
  /* アクセントカラー（スキン設定）はくすみトーン（彩度26〜42%）で統一。teal含む全8色が
     計算根拠つきでコントラスト条件を満たす（グランドファザーなし。詳細は下のコメント参照） */
  --teal: #3F7F7A;
  --teal-dark: #30615D;
  --coral: #F2845C;
  --line: #E7E2D8;
  --danger: #D9534F;
  --radius: 14px;
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --header-bg: rgba(246, 243, 236, .92);
  --toast-bg: #3B3733;
  --toast-ink: #fff;
  --control-off: #D8D3C9;
  --control-border: #C9C3B8;
  --control-bg: #FFFFFF;
  --accent-ink: #fff;
  /* 文字・細線・進捗バー用の濃いめ同系色（--card/--bgに対し4.5:1以上、--lineに対し3:1以上を確保） */
  --accent-line: #3B7872;
  /* スウォッチ表示専用（見た目の丸のみに使用。テーマに応じたライト/ダーク値を切替） */
  --sw-teal: #3F7F7A;
  --sw-coral: #B55A53;
  --sw-pink: #AD5986;
  --sw-lavender: #8066BE;
  --sw-blue: #5277A6;
  --sw-green: #408252;
  --sw-mustard: #A9A28D;
  --sw-banana: #C9B96A;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #23211D;
  --card: #2E2B26;
  --ink: #EFEAE0;
  --sub: #A59D91;
  --teal: #4A968F;
  --teal-dark: #5EAFA9;
  --coral: #F2936F;
  --line: #443F38;
  --danger: #E06B67;
  --header-bg: rgba(35, 33, 29, .92);
  --toast-bg: #EFEAE0;
  --toast-ink: #23211D;
  --control-off: #55504A;
  --control-border: #6B655D;
  --control-bg: #3A3630;
  --accent-ink: #23211D;
  --accent-line: #4FA19A;
  --sw-teal: #4A968F;
  --sw-coral: #C1756F;
  --sw-pink: #BA7499;
  --sw-lavender: #947DC7;
  --sw-blue: #698CB5;
  --sw-green: #4B9960;
  --sw-mustard: #92896E;
  --sw-banana: #B5A75C;
  color-scheme: dark;
}
:root[data-theme="dark"] .card-badge { color: #23211D; }

/* ---- アクセントカラー（スキン設定） ----
   data-accent未指定＝teal（:rootの既定値。今回のくすみ化でteal自身も下記コメントの基準を満たす値に更新した。
   グランドファザーは廃止）。
   全8色（彩度26〜42%のくすみトーン）は以下を計算で満たす：
   「--teal塗り × --accent-ink文字」「--teal-dark(:active)塗り × --accent-ink文字」ともに4.5:1以上、
   「--accent-line」はvsCard・vsBgともに4.5:1以上・vsLineが3:1以上（文字・細線・進捗バー用の濃いめ同系色）。
   mustard/bananaはaccent-inkが濃色（#3B3733/#23211D）のため、:active(--teal-dark)は暗くせず明るめに振っている。
   計算根拠・数値は実装ログ参照。 */
:root[data-accent="coral"] { --teal: #B55A53; --teal-dark: #994842; --accent-ink: #fff; --accent-line: #AF514B; }
:root[data-accent="pink"] { --teal: #AD5986; --teal-dark: #91486F; --accent-ink: #fff; --accent-line: #A5527E; }
:root[data-accent="lavender"] { --teal: #8066BE; --teal-dark: #674AAC; --accent-ink: #fff; --accent-line: #795DBA; }
:root[data-accent="blue"] { --teal: #5277A6; --teal-dark: #426187; --accent-ink: #fff; --accent-line: #4D709C; }
:root[data-accent="green"] { --teal: #408252; --teal-dark: #31643F; --accent-ink: #fff; --accent-line: #3C7A4D; }
:root[data-accent="mustard"] { --teal: #A9A28D; --teal-dark: #BDB7A7; --accent-ink: #3B3733; --accent-line: #756D58; }
:root[data-accent="banana"] { --teal: #C9B96A; --teal-dark: #D5C98C; --accent-ink: #3B3733; --accent-line: #7B6E2D; }

:root[data-theme="dark"][data-accent="coral"] { --teal: #C1756F; --teal-dark: #CF938F; --accent-ink: #23211D; --accent-line: #C7817B; }
:root[data-theme="dark"][data-accent="pink"] { --teal: #BA7499; --teal-dark: #C992B0; --accent-ink: #23211D; --accent-line: #C180A2; }
:root[data-theme="dark"][data-accent="lavender"] { --teal: #947DC7; --teal-dark: #AE9DD5; --accent-ink: #23211D; --accent-line: #9D89CC; }
:root[data-theme="dark"][data-accent="blue"] { --teal: #698CB5; --teal-dark: #88A3C4; --accent-ink: #23211D; --accent-line: #7696BC; }
:root[data-theme="dark"][data-accent="green"] { --teal: #4B9960; --teal-dark: #61B176; --accent-ink: #23211D; --accent-line: #51A467; }
:root[data-theme="dark"][data-accent="mustard"] { --teal: #92896E; --teal-dark: #A69E89; --accent-ink: #23211D; --accent-line: #9B937B; }
:root[data-theme="dark"][data-accent="banana"] { --teal: #B5A75C; --teal-dark: #C3B87C; --accent-ink: #23211D; --accent-line: #A29449; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.5;
}

.hidden { display: none !important; }

button { font-family: inherit; color: inherit; cursor: pointer; }

/* ---- ヘッダー ---- */
.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.app-header h1 {
  flex: 1; margin: 0; font-size: 17px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon-btn {
  width: 38px; height: 38px; border: none; border-radius: 50%;
  background: transparent; color: var(--sub);
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:active { background: var(--line); }

main { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 32px); }

.tagline { color: var(--sub); font-size: 13px; text-align: center; margin: 4px 0 16px; white-space: pre-line; }

/* ---- だじゃれフレンズ ---- */
.mascot-hero { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 4px; }
.mascot-hero img { width: 92px; height: auto; animation: float 3s ease-in-out infinite; }
.hero-bubble {
  position: relative; max-width: 230px; margin: 0;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 10px 14px; font-size: 13px;
}
.hero-bubble::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  border: 7px solid transparent; border-right-color: var(--card);
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.cheer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: -4px 0 12px; }
.cheer img { width: 56px; height: auto; animation: float 2.6s ease-in-out infinite; }
.cheer span { font-size: 12px; color: var(--sub); }
.celebrate-img { width: 150px; height: auto; }
.celebrate-sub-img { width: 90px; margin-left: -14px; }
.celebrate-sub { font-size: 14px; color: var(--sub); font-weight: normal; }

/* ---- ボタン ---- */
.primary-btn {
  display: block; width: 100%; padding: 14px; margin-top: 16px;
  border: none; border-radius: var(--radius);
  background: var(--teal); color: var(--accent-ink); font-size: 16px; font-weight: bold;
  transition: transform .15s var(--bounce);
}
.primary-btn:active { transform: scale(.97); background: var(--teal-dark); }
.ghost-btn {
  display: block; width: 100%; padding: 12px; margin-top: 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--card); font-size: 14px;
}
.ghost-btn:active { background: var(--bg); }
.ghost-btn.danger { color: var(--danger); }

/* ---- ホーム：並び順 ---- */
#list-sort-segment { margin-bottom: 10px; }

/* ---- ホーム：リストカード ---- */
#list-cards { list-style: none; margin: 0; padding: 0; }
.list-card {
  display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 10px; padding: 6px 10px 6px 0;
  box-shadow: 0 1px 3px rgba(59, 55, 51, .05);
}
.card-main {
  flex: 1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px;
  border: none; background: transparent; padding: 12px 0 12px 16px; text-align: left;
}
.card-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 16px; font-weight: bold; }
.card-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-progress { color: var(--sub); font-size: 13px; }
.card-bar {
  grid-column: 1 / -1; display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden;
}
.card-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--accent-line); transition: width .3s; }
.card-actions { display: flex; flex-direction: column; gap: 2px; }
.card-actions button, .mini-btn {
  border: none; background: transparent; opacity: .55;
  width: 32px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.card-actions button:active, .mini-btn:active { background: var(--line); opacity: 1; }
.card-actions button:disabled, .mini-btn:disabled { opacity: .35; }
.card-actions button:disabled:active, .mini-btn:disabled:active { background: transparent; }
/* カテゴリの並び替えボタン（ON中）：枠と文字色でアクセント表示する。他のmini-btnには影響しないよう.cat-sort-btnにスコープする */
.cat-sort-btn.active { opacity: 1; color: var(--accent-line); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.cat-sort-btn.active:active { background: var(--line); }
/* SVGアイコンの共通サイズ。色はボタンのcurrentColorを継承する */
.mini-btn svg, .icon-btn svg { width: 18px; height: 18px; }
.icon-btn svg { width: 20px; height: 20px; }
.icon { display: flex; }
.card-badge {
  flex: 0 0 auto; display: inline-block; padding: 2px 8px;
  font-size: 11px; font-weight: bold; color: #fff;
  background: var(--coral); border-radius: 10px;
}

/* ---- 並び替え（≡ハンドルのドラッグ） ---- */
/* touch-action: none がないと、指を下ろした瞬間にブラウザの縦スクロールが始まってドラッグできない */
.drag-handle {
  flex: none; border: none; background: transparent; color: var(--sub);
  font-size: 18px; line-height: 1; padding: 0; border-radius: 8px;
  touch-action: none; cursor: grab; opacity: .7;
}
.drag-handle:active { cursor: grabbing; opacity: 1; background: var(--line); }
.drag-handle:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; }
/* リストカード：左端に縦センター。幅32pxでもカード高さ（60px超）でタップ領域44pxを確保する */
.list-card > .drag-handle { align-self: stretch; width: 32px; min-height: 44px; }
.list-card > .drag-handle + .card-main { padding-left: 4px; }
/* アイテム：✏️×があった右端。指で押しやすいよう44px角にする */
.item .drag-handle { width: 44px; height: 44px; font-size: 19px; }
/* ドラッグ中はスクロールに邪魔されないよう選択も止める */
.sorting, .sorting * { user-select: none; -webkit-user-select: none; }
/* つかんでいる行は影で少し浮かせる（半透明にすると下の行が透けて読みにくいので不透明のまま） */
.dragging {
  position: relative; z-index: 5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}
.item.dragging { background: var(--card); border-radius: 10px; border-top-color: transparent; }
.cat-nav-reorder-item.dragging { background: var(--bg); }

/* ---- チェックリスト：出発日・カウントダウン ---- */
.departure-row {
  display: flex; align-items: center; min-height: 44px; width: 100%; text-align: left; margin-bottom: 8px;
  border: none; background: transparent; color: var(--sub); font-size: 13px; padding: 4px 0;
}
.countdown {
  margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--card); border: 1.5px solid var(--coral);
  font-size: 14px; font-weight: bold; color: var(--coral); text-align: center;
}

/* ---- チェックリスト：進捗 ---- */
.progress-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.progress-bar { flex: 1; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
#progress-fill { height: 100%; width: 0; border-radius: 5px; background: var(--accent-line); transition: width .3s; }
#progress-text { font-size: 13px; color: var(--sub); min-width: 44px; text-align: right; }

/* ---- チェックリスト：カテゴリナビ（ジャンプ／ならびかえ） ---- */
/* カテゴリが2件以上のときだけ #cat-nav を表示する2カラム。1件以下はJS側で.no-navを付けて1カラムに戻す */
#categories-row { display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: start; }
#categories-row.no-nav { grid-template-columns: 1fr; }
/* グリッドアイテムは既定でmin-width:autoのため、中の長い1行テキスト（.category h2のnowrap）が
   あるとこの列ごと外側に広がってしまう。0にして1fr幅で頭打ちにし、内側のellipsisを効かせる */
#categories { min-width: 0; }
#cat-nav {
  position: sticky;
  /* ヘッダー（sticky, 高さ約58px＋セーフエリア）の下に張り付く分の余白 */
  top: calc(env(safe-area-inset-top) + 62px);
  max-height: calc(100vh - env(safe-area-inset-top) - 84px);
  overflow-y: auto;
}
/* 「ジャンプ」「ならびかえ」を横並びにすると88px幅（320px以下は76px）では
   「ならびかえ」5文字が収まらずラップ／クリップしてしまう（実測で確認）。
   縦積みにして幅いっぱいを使うことで、読める大きさのまま1行に収める */
.cat-nav-tabs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.cat-nav-tab {
  width: 100%; padding: 5px 4px; font-size: 11px; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.cat-nav-tab.selected { border-color: var(--accent-line); color: var(--accent-line); font-weight: bold; }
.cat-nav-list { display: flex; flex-direction: column; gap: 6px; }
.cat-nav-jump-btn {
  display: block; width: 100%; text-align: left; font-size: 12px; padding: 7px 6px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-nav-jump-btn:active { background: var(--bg); }
/* ナビは幅88px（320px以下は76px）と狭いので、チップ全体をつかめるハンドルにしている
   （.drag-handleの共通スタイルを、ナビ用の見た目で上書きする） */
.cat-nav-reorder-item.drag-handle {
  display: flex; align-items: center; gap: 4px; width: 100%; min-height: 36px;
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px;
  background: var(--card); color: inherit; opacity: 1; text-align: left;
}
.cat-nav-reorder-item.drag-handle:active { background: var(--bg); }
.cat-nav-reorder-grip { flex: none; font-size: 14px; color: var(--sub); line-height: 1; }
.cat-nav-reorder-name {
  flex: 1; min-width: 0; font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 320px前後の極小幅ではナビ幅を少し絞る */
@media (max-width: 340px) {
  #categories-row { grid-template-columns: 76px 1fr; gap: 8px; }
}
/* ---- チェックリスト：カテゴリ ---- */
.category {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 14px; padding: 4px 14px 10px;
  /* stickyな #cat-nav に隠れないよう、ジャンプ時のスクロール位置に余白を確保（実機で調整） */
  scroll-margin-top: 70px;
  box-shadow: 0 1px 3px rgba(59, 55, 51, .05);
}
.category > header { display: flex; align-items: center; gap: 4px; padding: 8px 0 4px; }
.category h2 {
  flex: 1; min-width: 0; margin: 0; font-size: 15px; color: var(--coral);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; border-top: 1px solid var(--line); }
.item-actions { display: flex; }

/* ---- チェックUI（共通） ---- */
.check { flex: 1; display: flex; align-items: center; gap: 12px; padding: 11px 0; cursor: pointer; position: relative; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.iname { font-size: 15px; transition: opacity .2s; }
.item.checked .iname { opacity: .4; text-decoration: line-through; }

/* トグルスイッチ表示（body.style-toggle のとき） */
.style-toggle .control {
  flex: none; width: 48px; height: 28px; border-radius: 14px;
  background: var(--control-off); position: relative; transition: background .25s;
}
.style-toggle .control::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  /* つまみの輪郭：明るいアクセント色（mustard/banana等）の上でも境界が見えるよう
     半透明の濃色リングを追加（境界の視認性を確保） */
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 0 0 1.5px rgba(0, 0, 0, .35);
  transition: transform .25s var(--bounce);
}
.style-toggle .check input:checked + .control { background: var(--teal); }
.style-toggle .check input:checked + .control::after { transform: translateX(20px); }
.style-toggle .check:active .control::after { transform: scale(1.1); }
.style-toggle .check input:checked + .control:active::after { transform: translateX(20px) scale(1.1); }

/* チェックボックス表示（body.style-checkbox のとき） */
.style-checkbox .control {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid var(--control-border); background: var(--control-bg);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s;
}
.style-checkbox .control::after {
  content: "✓"; color: var(--accent-ink); font-size: 16px; font-weight: bold;
  transform: scale(0); transition: transform .25s var(--bounce);
}
.style-checkbox .check input:checked + .control { background: var(--teal); border-color: var(--teal); }
.style-checkbox .check input:checked + .control::after { transform: scale(1); }

/* ---- その場追加 ---- */
.add-item { padding: 4px 0 2px; }
.add-item-btn {
  border: none; background: transparent; color: var(--accent-line); font-size: 14px; font-weight: bold;
  padding: 8px 4px;
}
.add-item input, .dialog-input {
  width: 100%; padding: 10px 12px; font-size: 15px; font-family: inherit;
  border: 1.5px solid var(--accent-line); border-radius: 10px; outline: none;
}

/* ---- 設定 ---- */
.section-title { font-size: 14px; color: var(--sub); margin: 22px 0 8px; }
.segment { display: flex; gap: 8px; }
.segment button {
  flex: 1; padding: 10px 4px; font-size: 13px;
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--card);
}
.style-options { display: flex; gap: 8px; }
.style-option {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px; border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--card); font-size: 13px;
}
.segment button.selected, .style-option.selected { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
.swatch-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; margin: 4px 0 0; }
/* 320px前後の極小幅では4個ずつ2行にきれいに折り返す */
@media (max-width: 340px) {
  .swatch-row { grid-template-columns: repeat(4, 1fr); }
}
.swatch {
  width: auto; aspect-ratio: 1 / 1; max-width: 40px; border-radius: 50%; border: 2px solid var(--line);
  padding: 0;
}
.swatch.selected { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--accent-line); }
.swatch[data-accent-value="teal"] { background: var(--sw-teal); }
.swatch[data-accent-value="coral"] { background: var(--sw-coral); }
.swatch[data-accent-value="pink"] { background: var(--sw-pink); }
.swatch[data-accent-value="lavender"] { background: var(--sw-lavender); }
.swatch[data-accent-value="blue"] { background: var(--sw-blue); }
.swatch[data-accent-value="green"] { background: var(--sw-green); }
.swatch[data-accent-value="mustard"] { background: var(--sw-mustard); }
.swatch[data-accent-value="banana"] { background: var(--sw-banana); }
.preview-toggle {
  width: 44px; height: 26px; border-radius: 13px; background: var(--teal); position: relative;
}
.preview-toggle .knob {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 0 0 1.5px rgba(0, 0, 0, .35);
}
.preview-checkbox {
  width: 26px; height: 26px; border-radius: 8px; background: var(--teal);
  color: var(--accent-ink); font-weight: bold; display: flex; align-items: center; justify-content: center;
}
.note { font-size: 12px; color: var(--sub); margin-top: 18px; }

/* ---- つかいかたページ ---- */
.help-text { font-size: 14px; color: var(--ink); line-height: 1.8; margin: 0 0 4px; }

/* ---- そんなバナナくんについて ---- */
.about-banana { text-align: center; }
.about-banana img { width: 100px; height: auto; }
.about-banana p { font-size: 13px; color: var(--sub); white-space: pre-line; }
.about-link { text-decoration: none; display: block; color: inherit; }

/* ---- お祝い ---- */
#celebrate {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59, 55, 51, .25); pointer-events: none;
}
.celebrate-card {
  background: var(--card); border-radius: 20px; padding: 28px 44px;
  font-size: 22px; font-weight: bold; text-align: center; line-height: 1.6;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
  animation: pop-in .45s var(--bounce);
}
@keyframes pop-in {
  from { transform: scale(.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---- チュートリアル ---- */
#tutorial {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59, 55, 51, .5); padding: 24px;
}
.tutorial-card {
  position: relative; background: var(--card); border-radius: 20px;
  padding: 40px 24px 24px; width: 100%; max-width: 340px; text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
  animation: pop-in .35s var(--bounce);
}
.tutorial-skip {
  position: absolute; top: 10px; right: 14px;
  border: none; background: transparent; color: var(--sub); font-size: 13px; padding: 6px;
}
.tutorial-card img { width: 120px; height: auto; aspect-ratio: 1 / 1; }
.tutorial-card p { font-size: 15px; line-height: 1.7; min-height: 76px; margin: 12px 0 4px; }
.tutorial-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 4px; }
.tutorial-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tutorial-dots span.on { background: var(--accent-line); }

/* ---- トースト ---- */
#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px);
  transform: translateX(-50%); z-index: 40;
  background: var(--toast-bg); color: var(--toast-ink); font-size: 13px;
  padding: 10px 18px; border-radius: 20px; max-width: 86%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}

/* ---- ダイアログ ---- */
#dialog-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59, 55, 51, .35); padding: 24px;
}
.dialog {
  background: var(--card); border-radius: 18px; padding: 20px;
  width: 100%; max-width: 340px; max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
  animation: pop-in .3s var(--bounce);
}
.dialog-img { display: block; width: 84px; aspect-ratio: 1 / 1; margin: 0 auto 10px; flex-shrink: 0; }
.dialog p { margin: 0 0 14px; font-size: 15px; text-align: center; flex-shrink: 0; }
#dialog-buttons { overflow-y: auto; }
#dialog-buttons .primary-btn, #dialog-buttons .ghost-btn { margin-top: 10px; padding: 12px; }
.dialog-row { display: flex; gap: 10px; }
.dialog-row > * { flex: 1; }

/* ---- 改行制御 ---- */
/* 文言の改行位置はJS側の\nで明示する（自動折り返しの不自然な位置での改行を防ぐ） */
.hero-bubble, .cheer span, .celebrate-sub, .dialog p, .countdown, #toast, .tutorial-card p {
  white-space: pre-line;
}
