:root {
  --pink: #ff5c8a; --pink-soft: #ffe3ec; --purple: #a78bfa;
  --ink: #2b2b2b; --muted: #8a8a8a; --bg: #fdf3f7; --card: #fff;
  --radius: 18px; --shadow: 0 4px 16px rgba(0,0,0,.06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: -apple-system, "Hiragino Sans", sans-serif;
  background: var(--bg); color: var(--ink); overflow-x: hidden;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
#screen { padding: 16px; max-width: 480px; margin: 0 auto; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px; }
.big-amount { font-size: clamp(34px, 9vw, 44px); font-weight: 800; letter-spacing: -1px; }

/* 見込みカード：グラデーション＋内側メトリクスパネルで“カードらしく” */
.estimate-card { text-align: center;
  background: linear-gradient(155deg, #ffffff 0%, #fff6fa 55%, #ffe9f2 100%);
  border: 1px solid #ffdfec; }
.estimate-head { display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 14px; }
.estimate-card .big-amount { color: var(--pink); margin: 4px 0 2px; }
.metric-grid { display: flex; margin-top: 14px; padding: 12px 0;
  background: var(--card); border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.metric-grid > div { flex: 1; }
.metric-grid > div + div { border-left: 1px solid #f2e6ec; }
.metric-grid .muted { display: block; margin-bottom: 3px; }
.metric-grid strong { font-size: 15px; }
.mom-up { color: var(--pink); font-weight: 700; }

/* 今日の給与ヒーロー：このアプリの主役。働いた分が数字として見える */
.today-hero { text-align: left;
  background: linear-gradient(150deg, #ffffff 0%, #fff2f8 45%, #f3ecff 100%);
  border: 1px solid #ffdfec; }
.th-greet { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.th-greet .th-heart { color: var(--pink); margin-left: 2px; }
.th-label { font-size: 13px; color: var(--muted); }
.th-amount { color: var(--pink); font-weight: 800; letter-spacing: -1.5px;
  font-size: clamp(38px, 11vw, 50px); line-height: 1.05; margin: 2px 0 2px; }
.th-empty { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.th-break { background: var(--card); border-radius: 14px; padding: 2px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); margin: 12px 0 14px; }
.th-brow { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; font-size: 14px; }
.th-brow + .th-brow { border-top: 1px solid #f4e8ee; }
.th-brow span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.th-brow span .ic { width: 15px; height: 15px; }
.th-brow strong { font-weight: 700; font-size: 15px; }
.th-cta { display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 100%; border: none; cursor: pointer; margin-top: 4px;
  background: linear-gradient(135deg, var(--pink), #ff8bad); color: #fff;
  border-radius: 16px; padding: 13px 14px; box-shadow: 0 6px 16px rgba(255, 92, 138, .28); }
.th-cta:active { transform: scale(.98); }
.th-cta-main { font-weight: 800; font-size: 16px; }
.th-cta-sub { font-size: 12px; opacity: .92; }

/* 保存後のお祝い（今日の給与が増えた体感） */
.save-cele { text-align: center;
  background: linear-gradient(160deg, #ffffff 0%, #fff2f8 50%, #f3ecff 100%); }
.sc-spark { font-size: 26px; color: var(--purple); }
.sc-greet { font-weight: 700; font-size: 15px; margin-top: 2px; }
.sc-label { font-size: 13px; color: var(--muted); margin-top: 10px; }
.sc-amount { color: var(--pink); font-weight: 800; letter-spacing: -1.5px;
  font-size: clamp(38px, 11vw, 48px); line-height: 1.1; margin: 2px 0 4px; }
.sc-backs { text-align: left; background: var(--card); border-radius: 14px;
  padding: 2px 14px; box-shadow: 0 2px 10px rgba(0,0,0,.05); margin: 10px 0 4px; }
.sc-back-row { display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; font-size: 14px; }
.sc-back-row + .sc-back-row { border-top: 1px solid #f4e8ee; }
.sc-back-name { color: var(--ink); min-width: 0; }
.sc-back-amt { font-weight: 700; color: var(--pink); flex: 0 0 auto; }
.sc-back-amt.neg { color: #e0518a; }
.sc-ok { margin-top: 14px; }

/* 目標専用画面 */
.goal-hero { text-align: center;
  background: linear-gradient(160deg, #ffffff 0%, #f6f0ff 55%, #ffe9f2 100%);
  border: 1px solid #eadfff; }
.goal-hero.achieved { border-color: #ffd0e2;
  background: linear-gradient(160deg, #fff8fb 0%, #ffe9f2 60%, #f3ecff 100%); }
.goal-hero .gl-ico { color: var(--purple); }
.goal-hero .gl-ico .ic { width: 34px; height: 34px; }
.gl-badge { display: inline-block; background: var(--pink); color: #fff; font-weight: 800;
  font-size: 13px; letter-spacing: .5px; padding: 4px 14px; border-radius: 999px; margin-bottom: 8px; }
.gl-cap { color: var(--muted); font-size: 13px; }
.gl-target { color: var(--pink); font-weight: 800; letter-spacing: -1.5px;
  font-size: clamp(34px, 10vw, 46px); line-height: 1.1; margin: 2px 0 8px; }
.goal-hero .goal-bar { margin: 4px 0 8px; }
.gl-progress { display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--muted); }
.gl-progress strong { color: var(--pink); font-size: 15px; }
.gl-remain { font-size: 15px; margin: 12px 0 14px; }
.gl-remain strong { color: var(--pink); font-weight: 800; font-size: 20px; }
.gl-empty-title { font-weight: 800; font-size: 18px; margin: 8px 0 6px; }
.gl-empty-sub { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0 0 16px; }
.gl-hints { list-style: none; margin: 4px 0 0; padding: 0; }
.gl-hints li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0;
  font-size: 14px; line-height: 1.6; }
.gl-hints li + li { border-top: 1px solid #f4e8ee; }
.gl-hints li.dim { color: var(--muted); }
.gl-check { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 800;
  background: var(--pink-soft); color: var(--pink); font-size: 13px; }
.gl-hints li.dim .gl-check { background: #f0eef2; color: var(--muted); }

/* 収入履歴（月別リスト） */
.hist-item { padding: 14px 16px; }
.hist-head { display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; padding: 0; cursor: pointer; gap: 10px; }
.hist-when { display: flex; flex-direction: column; gap: 2px; text-align: left; min-width: 0; }
.hist-my { font-weight: 800; font-size: 16px; color: var(--ink); }
.hist-days { font-size: 12px; color: var(--muted); }
.hist-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.hist-total { font-weight: 800; font-size: 18px; color: var(--pink); letter-spacing: -.4px; }
.hist-chev { color: var(--pink); font-size: 20px; }
.hist-bar { height: 6px; background: var(--pink-soft); border-radius: 999px; margin: 10px 0 0; overflow: hidden; }
.hist-bar-fill { height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--purple)); }
.hist-detail { margin-top: 12px; }
.hist-drow { display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; font-size: 14px; }
.hist-drow + .hist-drow { border-top: 1px solid #f4e8ee; }
.hist-drow span { color: var(--muted); }
.hist-drow strong { font-weight: 700; }
.hist-drow strong.neg { color: #e0518a; }
.hist-dsep { height: 1px; background: #eee; margin: 6px 0; }
.badge { background: var(--pink-soft); color: var(--pink); font-size: 11px;
  padding: 2px 8px; border-radius: 10px; margin-left: 8px; vertical-align: middle; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; min-width: 0; }
/* フレックス子要素が固有幅で突っ張って横はみ出しするのを防ぐ（特に time/number 入力） */
.row > * { min-width: 0; }
.chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.chip { flex: 0 0 auto; background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px 14px; text-align: center; min-width: 96px; }
input, select, button, textarea { font: inherit; }
/* 入力欄を縮小可能に：time/number 等がフレックス枠から飛び出すのを防ぐ */
input, select { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field input, .field select { padding: 10px 12px; border: 1px solid #eee; border-radius: 12px; width: 100%; min-width: 0; }
/* 設定のバック項目など、.field の外に並ぶインライン入力（フレックス子なので width:100% は付けない） */
.inline-input { padding: 10px 12px; border: 1px solid #eee; border-radius: 12px; min-width: 0; }
/* iOS Safari は input[type=date] の width を最小幅としてしか扱わず、ネイティブ枠が
   指定幅を超えてはみ出す。-webkit-appearance を無効化すると width 指定を厳守する。 */
input[type="date"] { -webkit-appearance: none; appearance: none; width: 100%; max-width: 100%; }
/* デスクトップのカレンダー起動ボタンは押しやすいよう残す */
input[type="date"]::-webkit-calendar-picker-indicator { margin-left: auto; }
/* 空の日付欄に「薄い今日の日付」をプレースホルダー表示（値はセットしない）。
   空のときだけネイティブの「年/月/日」を透明にし、::before で薄い日付を重ねる。 */
.date-ph-wrap { position: relative; display: inline-flex; align-items: center; }
.date-ph-wrap[data-empty="1"] input[type="date"]::-webkit-datetime-edit { color: transparent; }
.date-ph-wrap[data-empty="1"]::before {
  content: attr(data-ph); position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); opacity: .45; pointer-events: none; white-space: nowrap; font-size: 14px;
}
/* お知らせの開始日/終了日ラベル（日付入力の上に小さく表示） */
.ann-date { display: flex; flex-direction: column; }
.ann-date-lbl { font-size: 11px; color: #999; margin-bottom: 3px; }
/* バックアップのボタン下に添える補足（ファイル書き出し/読み込み） */
.backup-hint { font-size: 11px; color: #999; text-align: center; margin-top: 4px; }

/* 操作ログ */
#auditLogBox { max-height: 320px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.log-day { font-size: 11px; color: var(--muted); font-weight: 700; margin: 10px 0 4px; }
.log-day:first-child { margin-top: 0; }
.log-row { display: flex; align-items: center; gap: 8px; padding: 5px 0;
  border-top: 1px solid #f3e6ee; font-size: 13px; }
.log-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.log-badge { font-size: 10px; font-weight: 700; border-radius: 6px; padding: 1px 7px; flex: 0 0 auto; }
.log-badge.log-put { background: var(--pink-soft); color: var(--pink); }
.log-badge.log-del { background: #ffe1e1; color: #e0466a; }
.log-badge.log-info { background: #ece7ff; color: var(--purple); }
.log-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { background: var(--pink); color: #fff; border: none; border-radius: 14px;
  padding: 12px 16px; font-weight: 700; width: 100%; }
.btn-ghost { background: var(--pink-soft); color: var(--pink); }
/* コンテンツ領域(min-height)を最優先で確保し、その外側にセーフエリア分のパディングを足す。
   box-sizing:content-box なので min-height はアイコン+ラベルの領域そのもの＝端末のセーフエリア
   値(ノッチ/ホームインジケータ)に関係なく縦が潰れず、上下とも切れない。iPhone/Android共通で有効。 */
#tabbar { position: fixed; bottom: 0; left: 0; right: 0; box-sizing: content-box; min-height: 56px; background: #fff;
  display: flex; justify-content: space-around; align-items: center;
  gap: 4px; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); overflow: hidden;
  box-shadow: 0 -2px 12px rgba(0,0,0,.05); }
#tabbar button { flex: 1 1 0; min-width: 0; background: none; border: none;
  color: var(--muted); font-size: 20px; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px; }
#tabbar button span { font-size: 10px; white-space: nowrap; }
#tabbar button.active { color: var(--pink); }
#tabbar .fab { flex: 0 0 auto; background: var(--pink); color: #fff; width: 52px; height: 52px;
  border-radius: 50%; font-size: 28px; box-shadow: 0 4px 12px rgba(255,92,138,.4);
  justify-content: center; align-items: center; gap: 0; line-height: 1; padding: 3px 0 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-grid.head { color: var(--muted); font-size: 12px; text-align: center; margin: 8px 0 4px; }
.cal-cell { background: var(--card); border-radius: 10px; min-height: 56px; padding: 4px;
  box-shadow: var(--shadow); font-size: 11px; }
.cal-day { font-weight: 600; }
.cal-amt { color: var(--pink); font-weight: 700; font-size: 11px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-align: center; }
.cal-cell.has-confirmed { outline: 2px solid var(--pink); }
.cal-cell.has-draft { outline: 1px dashed var(--purple); }
/* 当日の目印：セルを淡く塗り、日付を塗りつぶしのバッジにする */
.cal-cell.is-today { background: var(--pink-soft); }
.cal-cell.is-today .cal-day { display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--pink); color: #fff; }
.cal-amt.planned { color: var(--purple); font-weight: 600; font-size: 10px; }
.cal-tag { color: var(--purple); font-size: 9px; opacity: .85; }
/* 欠勤：セルをグレー枠にし、金額の代わりに「欠勤」を淡色表示 */
.cal-cell.has-absent { outline: 2px dashed #b0b0b8; }
/* まとめ入力：選択中の日 */
.cal-cell.bulk-selected { position: relative; outline: 3px solid var(--pink); background: var(--pink-soft); }
.cal-cell.bulk-selected::after { content: '✓'; position: absolute; top: 1px; right: 4px;
  color: var(--pink); font-weight: 800; font-size: 12px; }
/* まとめ入力パネル */
.bulk-panel { background: var(--pink-soft); border: 2px solid var(--pink); border-radius: 14px;
  padding: 12px; margin: 10px 0; }
.bulk-panel .bulk-head { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
/* 日払い入力 */
.daypay-box { background: var(--pink-soft); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
/* ホーム見込みカードの日払い行 */
.daypay-line { margin-top: 6px; font-size: 13px; color: var(--ink); }
.daypay-line strong { color: var(--pink); }
.cal-amt.absent { color: #8a8a92; }
/* 欠勤チェック時：時給欄をグレーアウトして無効化 */
#sTimeRow.is-absent { opacity: .45; pointer-events: none; }

/* ============ ボトムシート（カレンダー日別入力） ============ */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.35);
  opacity: 0; transition: opacity .25s ease; }
.sheet-backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  width: 100%; max-width: 480px; margin: 0 auto;
  background: #fff; border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
.sheet.show { transform: translateY(0); }
.sheet-handle { position: relative; width: 80px; height: 24px; margin: 0 auto 6px;
  cursor: grab; touch-action: none; }
.sheet-handle:active { cursor: grabbing; }
.sheet-handle::before { content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 4px; border-radius: 2px; background: #e3e3e3; }
.bi-row { border: 1px solid #eee; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.bi-row.active { border-color: var(--pink); background: var(--pink-soft); }
.bi-head { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.bi-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #ddd; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  color: var(--muted); }
.bi-row.active .bi-check { background: var(--pink); border-color: var(--pink); color: #fff; }
.bi-hint { font-size: 11px; }
.bi-row.active .bi-hint { display: none; }
.bi-minus, .bi-plus { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid #eee;
  background: #fff; border-radius: 12px; font-size: 20px; line-height: 1; color: var(--pink); }
.bi-minus:active, .bi-plus:active { background: var(--pink-soft); }
.sheet-total { display: flex; justify-content: space-between; align-items: center;
  margin: 14px 0; padding: 12px 14px; background: var(--pink-soft); border-radius: 14px; }
.sheet-total strong { color: var(--pink); }
.sheet-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.sheet-sub strong { color: var(--purple); font-size: 14px; }
.saved-at { display: flex; align-items: center; gap: 5px; font-size: 12px; margin: -4px 0 12px; }
.saved-at .ic { width: 14px; height: 14px; }

/* ============ やることリスト（カレンダー下） ============ */
.todo-card { padding: 16px; }
.todo-add { gap: 8px; margin-bottom: 10px; }
.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.todo-empty { text-align: center; padding: 10px 0; margin: 0; }
.todo-item { display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.todo-check { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px;
  border: 2px solid var(--pink); background: #fff; color: #fff; font-size: 14px;
  line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.done > .todo-check, .done > .res-check,
.todo-item.done .todo-check, .visit-item.done .todo-check, .res-item.done .res-check { background: var(--pink); }
.todo-text { flex: 1; cursor: pointer; word-break: break-word; }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo-del { flex: 0 0 auto; border: none; background: none; color: var(--muted);
  font-size: 15px; cursor: pointer; padding: 4px; }
.todo-del:active { color: var(--pink); }
.todo-clear { margin-top: 10px; }
.todo-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo-due-chip { align-self: flex-start; font-size: 11px; padding: 1px 8px; border-radius: 10px;
  background: var(--pink-soft); color: var(--pink); }
.todo-due-chip.today { background: #fff2cc; color: #b8860b; }
.todo-due-chip.overdue { background: #ffe0e0; color: #e23; }
.todo-date-btn { flex: 0 0 auto; position: relative; cursor: pointer; font-size: 16px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--bg); }
.todo-due-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.todo-add label { display: inline-flex; align-items: center; }

/* カレンダーセルの期限Todoマーク */
.cal-todo { color: var(--purple); font-size: 10px; font-weight: 700; margin-top: 2px; }
.cal-todo.done { color: var(--muted); }

/* ボトムシート内「この日のやること」 */
.sheet-todos { background: var(--bg); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
.sheet-todos ul { list-style: none; margin: 0; padding: 0; }
.sheet-todos li { font-size: 14px; padding: 2px 0; }
.sheet-todos li.done { text-decoration: line-through; color: var(--muted); }

/* 本日の予定：今日のTodo */
.today-todos { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.today-todos li { display: flex; align-items: center; gap: 10px; }
.today-todos li.done span { text-decoration: line-through; color: var(--muted); }

/* アプリ内リマインダー（ホーム上部） */
.remind-card { border: 1px solid #ffd9c2; background: #fff8f2; }
.remind-head { font-weight: 700; margin-bottom: 8px; }
.remind-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.remind-item { display: flex; align-items: center; gap: 10px; }
.remind-text { flex: 1; word-break: break-word; }
.remind-tag { flex: 0 0 auto; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.remind-tag.today { background: #fff2cc; color: #b8860b; }
.remind-tag.soon { background: #ffe3ee; color: #d6266e; }
.remind-tag.overdue { background: #ffe0e0; color: #e23; }
.remind-ico { flex: 0 0 auto; font-size: 16px; line-height: 1; }

/* ============ スプラッシュ画面 ============ */
#splash {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #ffe7f0 0%, #fdeef6 55%, #f3e9fb 120%);
  color: var(--ink); text-align: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  transition: opacity .5s ease;
}
#splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.splash-logo { width: clamp(190px, 58vw, 260px); height: auto; display: block;
  border-radius: 28px;
  filter: drop-shadow(0 12px 30px rgba(217, 122, 162, .35));
  animation: splash-float 2s ease-in-out infinite; }
.splash-dots { display: flex; gap: 7px; margin-top: 24px; }
.splash-dots span { width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 92, 138, .7); animation: splash-blink 1.2s ease-in-out infinite; }
.splash-dots span:nth-child(2) { animation-delay: .2s; }
.splash-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes splash-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes splash-blink { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .splash-logo, .splash-dots span { animation: none; }
  #splash { transition: none; }
}

/* ============ レスポンシブ ============ */

/* タブレット: コンテンツ幅とカレンダーセルを拡大 */
@media (min-width: 600px) {
  #screen { max-width: 640px; padding: 24px; }
  .chips { flex-wrap: wrap; overflow-x: visible; }
  .chip { flex: 1 1 calc(25% - 10px); }
  .cal-cell { min-height: 72px; font-size: 13px; }
}

/* PC: 下部タブバーを左サイドバーに変換 */
@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 92px; }
  #tabbar {
    top: 0; bottom: 0; right: auto; width: 92px; height: auto;
    flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: 20px 0 0; padding-bottom: 0;
    box-shadow: 2px 0 14px rgba(0,0,0,.05);
  }
  #tabbar button { flex: 0 0 auto; width: 100%; padding: 12px 0; font-size: 22px; }
  #tabbar button span { font-size: 11px; }
  #tabbar .fab { margin: 6px auto; }
  #screen { max-width: 760px; padding: 32px; }
  .cal-cell { min-height: 88px; }
}

/* 大画面: 最大幅をさらに拡張 */
@media (min-width: 1200px) {
  #screen { max-width: 1040px; }
}

/* マウス操作のホバー（タッチ端末では無効） */
@media (hover: hover) {
  .chip, .cal-cell, #tabbar button { transition: transform .12s ease, color .12s ease; cursor: pointer; }
  .chip:hover, .cal-cell:hover { transform: translateY(-2px); }
  .btn { cursor: pointer; }
}

/* 収支レポート（損益計算書スタイル） */
.pl-card { padding-top: 8px; }
.pl-section-head { font-weight: 700; font-size: 14px; color: var(--muted);
  margin: 4px 0 6px; letter-spacing: .02em; }
.pl-line { display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; font-size: 15px; }
.pl-line > span:first-child { color: var(--ink); padding-left: 10px; }
.pl-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-neg .pl-amt { color: var(--pink); }
.pl-subtotal { border-top: 1px dashed #eadfe4; margin-top: 2px; font-weight: 600; }
.pl-subtotal > span:first-child { color: var(--muted); font-size: 14px; }
.pl-gap { height: 8px; }
.pl-event-title { font-weight: 700; font-size: 14px; color: var(--ink); margin: 6px 0 2px; }
.pl-net { display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding: 14px 12px; border-radius: 14px;
  background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }
.pl-net > span { font-weight: 700; font-size: 15px; }
.pl-net > strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.pl-count { display: inline-block; margin-left: 6px; padding: 0 7px;
  font-size: 12px; font-weight: 700; line-height: 18px; color: var(--pink);
  background: var(--pink-soft); border-radius: 9px; vertical-align: middle; }

/* 年間推移グラフ */
.seg { display: inline-flex; background: var(--pink-soft); border-radius: 12px; padding: 3px; gap: 2px; }
.seg-btn { border: none; background: none; color: var(--pink); font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 9px; cursor: pointer; }
.seg-btn.active { background: #fff; box-shadow: var(--shadow); }
.chart-box { margin-top: 2px; }
.annual-svg { width: 100%; height: auto; display: block; }
.chart-axis { stroke: #ead9e1; stroke-width: 1; }
.chart-xlabel { fill: var(--muted); font-size: 9px; }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart-bar { transform-box: fill-box; transform-origin: bottom;
  animation: barGrow .55s cubic-bezier(.22,1,.36,1) both; }
@keyframes lineDraw { to { stroke-dashoffset: 0; } }
.chart-line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100; animation: lineDraw 1.1s ease forwards; }
.line-wage { stroke: var(--pink); }
.line-inc { stroke: var(--purple); }
@keyframes dotIn { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
.chart-dot { opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: dotIn .3s ease forwards; }
.line-wage-dot { fill: var(--pink); }
.line-inc-dot { fill: var(--purple); }
.chart-legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; font-size: 12px; }
.lg-total { color: var(--pink); }
.lg-wage { color: var(--pink); font-weight: 700; }
.lg-inc { color: var(--purple); font-weight: 700; }

/* 分類タブ（設定・カレンダー日別入力で共用・横スクロール） */
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cat-tabs:empty { display: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab { flex: 0 0 auto; border: 1.5px solid #eadfe4; background: #fff; color: var(--muted);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 14px; cursor: pointer;
  white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.cat-tab.active { border-color: var(--pink); background: var(--pink-soft); color: var(--pink); }

/* 分類の管理（設定・歩合項目カード内） */
.cat-manager { border: 1px solid #f0e6ea; background: #fdfafb; border-radius: 10px;
  padding: 10px 12px; margin: 4px 0 12px; }
.cat-manager-head { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.cat-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }

/* ============ 歩合項目の設定（専用ページ backitems） ============ */
.bk-back { display: inline-flex; align-items: center; gap: 2px; background: none; border: none;
  color: var(--pink); font-weight: 700; font-size: 15px; padding: 0; margin: 0 0 10px; cursor: pointer; }
.bk-back-ic { width: 18px; height: 18px; transform: rotate(180deg); }
.bk-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bk-title { font-size: 22px; margin: 0; }
.bk-lead { font-size: 12px; line-height: 1.7; margin: 6px 0 14px; }

/* 作成アクション（項目の追加・分類の管理をひとまとめに） */
.bk-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.bk-action { flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 14px; padding: 12px 10px; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1.5px solid transparent; white-space: nowrap; }
.bk-action .ic { width: 17px; height: 17px; flex: 0 0 auto; }
.bk-action.primary { background: var(--pink); color: #fff; box-shadow: 0 4px 12px rgba(255,92,138,.28); }
.bk-action.primary:active { background: #f04d7c; }
.bk-action.ghost { background: #fff; color: var(--pink); border-color: var(--pink-soft); box-shadow: var(--shadow); }
.bk-action.ghost:active { background: var(--pink-soft); }

.bk-stats { display: flex; gap: 8px; margin-bottom: 14px; }
.bk-stat { flex: 1; background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 12px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bk-stat-ic { width: 22px; height: 22px; color: var(--pink); }
.bk-stat-v { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.bk-stat-l { font-size: 10.5px; color: var(--muted); }

.bk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.bk-toolbar-list { justify-content: flex-end; }
.bk-select-toggle { display: inline-flex; align-items: center; gap: 5px; background: #fff;
  border: 1.5px solid #eadfe4; color: var(--ink); font-size: 12.5px; font-weight: 700;
  padding: 7px 12px; border-radius: 10px; cursor: pointer; }
.bk-select-toggle .ic { width: 16px; height: 16px; color: var(--pink); }

/* 選択モードのアクションバー */
.bk-selbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  background: var(--pink-soft); border-radius: 14px; padding: 8px 10px; }
.bk-selbar-all { background: #fff; border: 1.5px solid var(--pink-soft); color: var(--pink);
  font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.bk-selbar-count { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--pink); text-align: center; }
.bk-selbar-del { display: inline-flex; align-items: center; gap: 4px; background: #e5484d; color: #fff;
  border: none; font-size: 12.5px; font-weight: 700; padding: 7px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.bk-selbar-del .ic { width: 15px; height: 15px; }
.bk-selbar-del:disabled { background: #e6c3c6; cursor: default; }
.bk-selbar-cancel { background: none; border: none; color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }

/* 選択可能な行のチェック表示 */
.bk-check { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; border: 2px solid #d9c7cf;
  display: flex; align-items: center; justify-content: center; color: #fff; }
.bk-check .ic { width: 14px; height: 14px; }
.bk-lrow-sel { cursor: pointer; }
.bk-lrow-sel.selected { border-color: var(--pink); background: var(--pink-soft); }
.bk-lrow-sel.selected .bk-check { background: var(--pink); border-color: var(--pink); }

.bk-sort { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.bk-sort-ic { width: 16px; height: 16px; }
.bk-sort select { border: 1px solid #eadfe4; border-radius: 10px; padding: 7px 8px; font-size: 12.5px;
  font-weight: 600; color: var(--ink); background: #fff; }

.bk-searchbar { position: relative; margin-bottom: 12px; }
.bk-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); }
.bk-searchbar input { width: 100%; border: 1px solid #eee; border-radius: 14px;
  padding: 11px 12px 11px 38px; font-size: 14px; background: #fff; }

.bk-chips-wrap { position: relative; }
.bk-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none;
  scroll-behavior: smooth; }
.bk-chips::-webkit-scrollbar { display: none; }
/* はみ出して横スクロールできる時だけ、右端にフェード＋「›」を出して気づかせる */
.bk-chips-wrap::after { content: ''; position: absolute; top: 0; right: 0; bottom: 4px; width: 48px;
  background: linear-gradient(to right, rgba(253,243,247,0), var(--bg) 70%);
  pointer-events: none; opacity: 0; transition: opacity .2s; }
.bk-chips-wrap.more::after { opacity: 1; }
.bk-chips-hint { position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(255,92,138,.35);
  display: flex; align-items: center; justify-content: center; color: var(--pink);
  opacity: 0; transition: opacity .2s; pointer-events: none; }
.bk-chips-hint .ic { width: 15px; height: 15px; }
.bk-chips-wrap.more .bk-chips-hint { opacity: 1; }
.bk-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid #eadfe4; background: #fff; color: var(--muted); font-size: 12.5px; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.bk-chip.active { border-color: var(--pink); background: var(--pink-soft); color: var(--pink); }
.bk-chip-n { font-size: 11px; background: #f0e6ea; color: var(--muted); border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center; }
.bk-chip.active .bk-chip-n { background: var(--pink); color: #fff; }

.bk-group { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.bk-group-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 14px 16px;
  background: none; border: none; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.bk-group-ic { width: 20px; height: 20px; color: var(--pink); flex: 0 0 auto; }
.bk-group-name { font-size: 15px; font-weight: 800; }
.bk-group-count { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.bk-group-total { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--pink); }
.bk-group-chev { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; transition: transform .2s; }
.bk-group-chev.open { transform: rotate(180deg); }
.bk-group-body { padding: 0 12px 12px; }

.bk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk-card { position: relative; border: 1px solid #f0e6ea; border-radius: 14px; padding: 12px;
  cursor: pointer; background: #fff; transition: box-shadow .15s; }
.bk-card:active { box-shadow: 0 2px 10px rgba(255,92,138,.14); }
.bk-kebab { position: absolute; top: 8px; right: 6px; width: 20px; height: 20px; color: #c9b8c0; }
.bk-ava { width: 40px; height: 40px; border-radius: 12px; background: var(--pink-soft);
  display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 8px; }
.bk-ava.kind-penalty { background: #ffe1e1; }
.bk-ava.kind-deduction { background: #fde6cf; }
.bk-ava.sm { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; margin: 0; flex: 0 0 auto; }
.bk-card-name { font-size: 13.5px; font-weight: 700; line-height: 1.35; margin-bottom: 4px; }
.bk-card-rate { font-size: 12px; color: var(--pink); font-weight: 700; }
.bk-card-use { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.bk-card-amt { font-size: 15px; font-weight: 800; text-align: right; margin-top: 6px; }
.bk-card-amt.neg { color: #e0466a; }
.bk-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed #f0b9cd; border-radius: 14px; background: #fff8fb; color: var(--pink);
  font-size: 12.5px; font-weight: 700; cursor: pointer; min-height: 120px; }
.bk-add-ic { width: 24px; height: 24px; border-radius: 50%; background: var(--pink-soft);
  display: inline-flex; align-items: center; justify-content: center; }
.bk-add-ic .ic { width: 16px; height: 16px; }
.bk-add-ic.sm { width: 22px; height: 22px; }

.bk-list { display: flex; flex-direction: column; gap: 8px; }
.bk-lrow { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid #f0e6ea;
  border-radius: 12px; padding: 10px 12px; background: #fff; cursor: pointer; text-align: left; }
.bk-lrow-main { flex: 1; min-width: 0; }
.bk-lrow-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-lrow-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.bk-lrow-amt { font-size: 14px; font-weight: 800; flex: 0 0 auto; }
.bk-lrow-amt.neg { color: #e0466a; }
.bk-ladd { justify-content: center; gap: 6px; border-style: dashed; border-color: #f0b9cd;
  background: #fff8fb; color: var(--pink); font-weight: 700; font-size: 13px; }

.bk-empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.bk-empty-ic { width: 44px; height: 44px; margin: 0 auto 10px; color: #d9c7cf; }
.bk-empty-ic .ic { width: 44px; height: 44px; }
.bk-empty-add { width: auto; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; }
.bk-empty-tpl { width: auto; display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0 8px; }

/* 業種テンプレートへの導線 */
.bk-template-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: none;
  color: var(--pink); font-size: 13px; font-weight: 700; cursor: pointer; padding: 2px 2px; margin: 0 0 14px; }
.bk-template-link .ic { width: 16px; height: 16px; }
.bk-occ-list { display: flex; flex-direction: column; gap: 8px; }
.bk-occ-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 14px;
  background: #fff; border: 1.5px solid var(--pink-soft); border-radius: 14px; cursor: pointer;
  font-size: 15px; font-weight: 700; color: var(--ink); text-align: left; }
.bk-occ-btn:active { background: var(--pink-soft); }
.bk-occ-emoji { font-size: 22px; flex: 0 0 auto; }
.bk-occ-label { flex: 1; min-width: 0; }
.bk-occ-chev { width: 18px; height: 18px; color: #c9b8c0; flex: 0 0 auto; }

/* 年収の壁アラート（ホーム上部） */
.wall-card { border: 1.5px solid transparent; }
.wall-card.wall-near { background: #fff7e6; border-color: #ffdca1; }
.wall-card.wall-over { background: #ffecec; border-color: #ffb3b3; }
.wall-head { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px; }
.wall-card.wall-near .wall-head { color: #b8791b; }
.wall-card.wall-over .wall-head { color: #d8434a; }
.wall-head .ic { width: 18px; height: 18px; }
.wall-detail { font-size: 13px; color: var(--ink); margin-top: 6px; line-height: 1.6; }
.wall-bar { height: 8px; border-radius: 999px; background: #fff; overflow: hidden; margin: 10px 0 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.wall-bar-fill { height: 100%; border-radius: 999px; }
.wall-card.wall-near .wall-bar-fill { background: #f2a93b; }
.wall-card.wall-over .wall-bar-fill { background: #e5484d; }
.wall-note { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* オンボーディングの職種選択ボタン */
.onb-occ { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; }
.onb-occ-btn { display: flex; align-items: center; gap: 8px; padding: 12px 12px; border-radius: 12px;
  border: 1.5px solid var(--pink-soft); background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.onb-occ-btn:active { background: var(--pink-soft); }
.onb-occ-emoji { font-size: 20px; }
.bk-nores { text-align: center; padding: 20px 0; }

/* 編集シート・分類管理シート */
.bk-sheet-title { margin: 4px 0 12px; font-size: 17px; }
.bk-field { display: block; margin-bottom: 12px; }
.bk-field2 { display: flex; gap: 10px; }
.bk-field2 .bk-field { flex: 1; }
.bk-flabel { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.bk-field .inline-input, .bk-field select { width: 100%; }
.bk-emojis { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-emoji { width: 40px; height: 40px; border: 1.5px solid #eee; border-radius: 12px; background: #fff;
  font-size: 20px; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; }
.bk-emoji small { font-size: 8px; color: var(--muted); }
.bk-emoji.active { border-color: var(--pink); background: var(--pink-soft); }
.bk-sheet-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.bk-sheet-del { display: inline-flex; align-items: center; gap: 4px; border: none; background: none;
  color: #f55; font-size: 13px; font-weight: 700; cursor: pointer; padding: 8px 4px; }
.bk-sheet-del .ic { width: 16px; height: 16px; }
.bk-sheet-dup { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid #eadfe4;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 8px 12px; border-radius: 10px; }
.bk-sheet-dup .ic { width: 16px; height: 16px; }
.bk-sheet-save { margin-left: auto; flex: 0 0 auto; background: var(--pink); color: #fff; border: none;
  border-radius: 12px; font-weight: 800; font-size: 14px; padding: 11px 24px; cursor: pointer; }
.bk-sheet-save:active { background: #e94b7c; }
.bk-cat-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.bk-cat-name { flex: 1; }
.bk-cat-del { border: none; background: none; color: #f55; cursor: pointer; padding: 4px 6px; flex: 0 0 auto; }
.bk-cat-del .ic { width: 18px; height: 18px; }
.bk-cat-add { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.bk-cat-add textarea { flex: 1; resize: vertical; }
.bk-cat-add .bk-sheet-save { margin: 0; padding: 11px 18px; }

/* 折りたたみカード（設定の操作ログなど・既定で閉じる） */
.set-details { padding: 0; overflow: hidden; }
.set-details-sum { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 16px; }
.set-details-sum::-webkit-details-marker { display: none; }
.set-details-title { font-size: 16px; font-weight: 700; }
.set-details-hint { margin-left: auto; font-size: 12px; color: var(--muted); }
.set-details-chev { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; transition: transform .2s; }
.set-details[open] .set-details-chev { transform: rotate(180deg); }
.set-details[open] .set-details-hint { display: none; }
.set-details-body { padding: 0 16px 16px; }

/* 設定ページの遷移リンク行 */
.set-link { width: 100%; background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
.set-link .set-label { display: flex; flex-direction: column; align-items: flex-start; }
.set-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.set-chev { margin-left: auto; width: 18px; height: 18px; color: #c9b8c0; flex: 0 0 auto; }

/* インセンティブ・チップ（カレンダー日別入力） */
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.chip-inc { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid #eadfe4;
  background: #fff; color: var(--ink); border-radius: 18px; padding: 8px 14px;
  font-size: 14px; font-weight: 600; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform .08s ease; }
.chip-inc:active { transform: scale(.94); }
.chip-inc.active { border-color: var(--pink); background: var(--pink-soft); color: var(--pink); }
.chip-inc.penalty.active { border-color: #f0a; background: #ffe9f2; }
.chip-badge { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--pink); color: #fff; font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; }
/* 調整ポップオーバー */
.chip-pop-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 60; }
.chip-pop { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(320px, 86vw); background: #fff; border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
  padding: 16px; z-index: 61; }
.chip-pop-title { font-weight: 700; font-size: 16px; }
.chip-pop-title .muted { font-weight: 400; font-size: 13px; margin-left: 4px; }

/* 印刷（レポートをPDFで保存） */
/* 画面では隠し、印刷（PDF）だけに出す要素 */
.print-only { display: none; }

@media print {
  /* アプリのUI（固定ヘッダー・下タブ・ドロワー・トグル等）は印刷しない。
     固定ヘッダー #appbar は position:fixed のため隠さないと全ページ上部に重複印刷される。 */
  #appbar, #tabbar, #drawer, #drawerBackdrop, #splash,
  .sheet, .sheet-backdrop, .modal-backdrop, .no-print, .seg, .print-hide { display: none !important; }
  html, body { background: #fff !important; }
  /* 全体を詰めて1枚に収める。基準フォントも少し小さく。 */
  body { color: #1a1a1a !important; font-size: 10.5px; line-height: 1.45;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* @page の余白を 0 にすると、ブラウザが余白に入れる URL/日付/ページ番号のヘッダー・フッターが消える。
     その代わり本文の余白は #screen 側の padding で確保する。 */
  #screen { padding: 12mm 11mm !important; margin: 0 !important; max-width: none !important; }
  .print-only { display: block !important; }

  h2 { margin: 0 0 2px !important; font-size: 15px; color: #111; }
  .report-print-meta { font-size: 9.5px; color: #555; margin: 0 0 6px; padding-bottom: 5px; border-bottom: 1px solid #ddd; }
  .muted { color: #555 !important; }

  /* カードは軽い枠のブロックにして詰める。break-inside:avoid は付けない
     （残りスペースに入らないカードが丸ごと次ページへ飛び、大きな余白＝空白ページになるのを防ぐ）。 */
  .card { box-shadow: none !important; border: 1px solid #ddd; border-radius: 7px;
    padding: 7px 10px !important; margin: 0 0 7px !important; break-inside: auto; page-break-inside: auto; }
  .card h3 { font-size: 12px; margin: 0 0 3px !important; }

  /* 行間・余白を詰める */
  .row { margin: 0 !important; }
  .pl-line { padding: 1px 0 !important; }
  .pl-line > span:first-child, .row > span:first-child { min-width: 0; padding-left: 6px; overflow-wrap: anywhere; }
  .pl-section-head { margin: 2px 0 1px !important; font-size: 10.5px; }
  .pl-subtotal > span:first-child { font-size: 10.5px; }
  .pl-net { padding: 3px 0 !important; margin-top: 3px !important; break-inside: avoid; }
  .pl-net > span { font-size: 11px !important; }
  .pl-net > strong { font-size: 15px !important; white-space: nowrap; }
  .pl-amt { white-space: nowrap; }
  /* 年間グラフは低めに抑えて縦を節約 */
  .chart-box svg, #annualChart svg { max-width: 100% !important; max-height: 135px !important; height: auto !important; }

  @page { margin: 0; }
}

.chart-grid { stroke: #f2e6ec; stroke-width: 1; }
.chart-ylabel { fill: var(--muted); font-size: 8.5px; }

/* アプリ内PDF生成（html2canvas）で画像化するときの見た目。
   ブラウザ印刷を使わないので @media print ではなくこのクラスで整える。 */
.pdf-capturing #screen { background: #fff !important; }
.pdf-capturing .no-print { display: none !important; }
.pdf-capturing .print-only { display: block !important; }
.pdf-capturing .print-hide { display: none !important; }
.pdf-capturing .report-print-meta { font-size: 12px; color: #555; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #ddd; }

/* レポートの月切り替え（‹ 2026年7月 ›） */
.rep-monthnav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 12px; }
.rep-navbtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #f0e2ea;
  background: var(--card); color: var(--pink); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.rep-navbtn:disabled { opacity: .35; box-shadow: none; cursor: default; }
.rep-navlabel { font-weight: 700; font-size: 15px; min-width: 104px; text-align: center; color: var(--ink); }

/* ===== 顧客管理 ===== */
.cust-list { display: flex; flex-direction: column; gap: 10px; }
.cust-card { text-align: left; background: var(--card); border: none; border-radius: 14px;
  box-shadow: var(--shadow); padding: 14px 16px; width: 100%; }
.cust-name { font-weight: 700; font-size: 16px; color: var(--ink); }
.cust-sub { margin-top: 2px; }
.cust-info-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0;
  border-bottom: 1px solid #f2f2f2; }
.cust-info-row:last-child { border-bottom: none; }
/* 顧客詳細を1枚のプロフィールカードに統合し、セクションを区切り線で分ける */
.cust-info-block { margin-top: 10px; }
.cust-sec { margin-top: 16px; padding-top: 16px; border-top: 1px solid #eee; }
.cust-sec-title { margin: 0 0 8px; font-size: 15px; }
.visit-list { list-style: none; padding: 0; margin: 10px 0 0; }
.visit-list.past { opacity: .7; }
.visit-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.visit-item.done .visit-date, .visit-item.done .visit-note { text-decoration: line-through; color: var(--muted); }
.visit-main { flex: 1; display: flex; flex-direction: column; }
.visit-date { font-weight: 600; }
.visit-note { font-size: 12px; }
.visit-del { border: none; background: none; color: var(--muted); font-size: 16px; }
.note-list { list-style: none; padding: 0; margin: 12px 0 0; }
.note-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid #f2f2f2; }
.note-item:first-child { border-top: none; }
.note-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.note-date { font-size: 12px; }
.note-text { white-space: pre-wrap; word-break: break-word; }
.note-del { border: none; background: none; color: var(--muted); font-size: 16px; flex: 0 0 auto; }
.cust-hint .cust-hint-block + .cust-hint-block { margin-top: 12px; }
.cust-hint-head { font-weight: 700; margin-bottom: 4px; }
.cust-hint ul { list-style: none; padding: 0; margin: 0; }
.cust-hint li { padding: 3px 0; font-size: 14px; }

/* ============ イベント（シャンパン予約名簿） ============ */
.cust-seg { display: flex; width: 100%; margin-bottom: 12px; }
.cust-seg .seg-btn { flex: 1; font-size: 14px; padding: 8px 0; }
.ev-date { font-size: 12px; color: var(--purple); font-weight: 600; }
.ev-row { display: flex; align-items: stretch; gap: 8px; }
.ev-row .ev-open { flex: 1; }
.ev-del { flex: 0 0 auto; border: none; background: none; color: var(--muted);
  font-size: 18px; padding: 0 8px; border-radius: 12px; cursor: pointer; }
.ev-del:active { background: var(--pink-soft); }
.res-group + .res-group { margin-top: 14px; }
.res-group-head { font-weight: 700; font-size: 14px; margin-bottom: 6px;
  padding-bottom: 4px; border-bottom: 1px solid var(--pink-soft); }
.res-group-head .muted { font-weight: 400; font-size: 12px; }
.res-list { list-style: none; padding: 0; margin: 0; }
.res-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid #f5f5f5; }
.res-item:last-child { border-bottom: none; }
.res-item.done .res-name, .res-item.done .res-meta { text-decoration: line-through; color: var(--muted); }
.res-check { margin-top: 2px; }
.res-main { flex: 1; min-width: 0; }
.res-name { font-weight: 600; }
.res-tag { display: inline-block; font-size: 10px; color: var(--purple); background: var(--pink-soft);
  border-radius: 6px; padding: 1px 5px; vertical-align: middle; font-weight: 600; margin-left: 6px;
  white-space: nowrap; }
/* 名前＋タグは折り返しても各タグは崩れないように（タグ単位で改行） */
.res-name { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.res-name > .res-tag { margin-left: 0; }
/* 種別（当日/前祝い/後祝い）タグは塗りつぶしで目立たせる */
.res-timing { color: #fff; background: var(--purple); }
/* 予約フォームの商品アイテム行（複数商品） */
.res-item-row { border: 1px solid #f0e6ec; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.res-item-row .ri-del { border: none; background: none; color: #f55; font-size: 18px;
  flex: 0 0 auto; padding: 4px 6px; cursor: pointer; }
.res-meta { font-size: 13px; margin-top: 2px; }
.res-memo { font-size: 12px; margin-top: 2px; }
.res-actions { flex: 0 0 auto; display: flex; gap: 2px; }
.res-actions button { border: none; background: none; color: var(--muted);
  min-width: 40px; padding: 4px 6px; line-height: 1; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.res-actions button:active { background: var(--pink-soft); }
.res-actions .ra-ico { font-size: 19px; }
.res-actions .ra-txt { font-size: 10px; }

/* ホーム最下部の目立つ設定ボタン */
/* ホーム下部：ヘルプ・設定への入口（アイコン＋文字） */
.home-actions { display: flex; gap: 12px; margin-top: 2px; }
.home-action { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, #ffffff 0%, var(--pink-soft) 130%);
  border: none; border-radius: 18px; padding: 15px 12px;
  box-shadow: 0 6px 16px rgba(255, 92, 138, .14); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease; }
.home-action:active { transform: scale(.97); box-shadow: 0 3px 10px rgba(255, 92, 138, .2); }
.home-action .ha-ico { display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 32px; height: 32px; border-radius: 50%; background: var(--pink);
  box-shadow: 0 2px 6px rgba(255, 92, 138, .35); }
.home-action .ha-ico .ic { width: 18px; height: 18px; color: #fff; }
.home-action .ha-label { font-weight: 700; font-size: 16px; color: var(--ink); }

/* 本日の予定カード内の「今月の来店予定」「今月お誕生日」 */
.today-visits, .today-bday { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--pink-soft); }
.today-visits-head, .today-bday-head { font-weight: 700; margin-bottom: 6px; font-size: 14px; }
/* 幅に応じて自動で複数列に並べ、右側の余白を活用する */
.today-visits ul, .today-bday ul { list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 14px; }
.today-visits li, .today-bday li { font-size: 14px;
  display: flex; align-items: baseline; gap: 8px; padding: 3px 8px;
  background: var(--pink-soft); border-radius: 8px; }
.today-visits li .v-date, .today-bday li .v-date { color: var(--purple); font-weight: 600; flex: 0 0 auto; }
.today-visits li .v-name, .today-bday li .v-name { flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* レポートのPDF出力オプション */
.pdf-opt { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 15px; }

/* 保存トースト */
.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 12px);
  background: rgba(40, 30, 40, .92); color: #fff; padding: 12px 22px; border-radius: 18px;
  font-size: 14px; font-weight: 600; line-height: 1.55; text-align: center;
  white-space: pre-line; max-width: min(80vw, 320px); box-shadow: var(--shadow); z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* アプリ内 確認モーダル（PWAでも確実に動く confirm 代替） */
.modal-backdrop { position: fixed; inset: 0; z-index: 1100; display: flex;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(30, 20, 30, .45); opacity: 0; transition: opacity .18s ease; }
.modal-backdrop.show { opacity: 1; }
.modal-card { background: #fff; border-radius: 18px; padding: 22px 20px 16px;
  width: 100%; max-width: 340px; box-shadow: var(--shadow);
  transform: translateY(8px) scale(.98); transition: transform .18s ease; }
.modal-backdrop.show .modal-card { transform: translateY(0) scale(1); }
.modal-msg { font-size: 15px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
/* 縦積みの選択肢（推奨を上・破壊的操作を下に）。 */
.modal-actions-stack { flex-direction: column; }
.lapsed-title { margin: 0 0 10px; font-size: 17px; text-align: center; color: var(--ink); }
.lapsed-del { color: #f55; }
.btn-danger { background: #f55; color: #fff; }
/* アップデート告知ポップアップ */
.update-head { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: var(--ink); }
.update-head .ic { width: 22px; height: 22px; color: var(--pink); }
.update-sub { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 6px 0 12px; }
.update-list { margin: 0; padding: 12px 12px 12px 28px; list-style: disc; background: var(--pink-soft);
  border-radius: 12px; max-height: 46vh; overflow-y: auto; }
.update-list li { font-size: 13.5px; line-height: 1.65; color: var(--ink); margin: 4px 0; }
.update-generic { font-size: 13.5px; color: var(--ink); margin: 0 0 4px; }
/* 設定：アプリ情報 */
.app-info-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.app-info-label { font-weight: 700; font-size: 14px; }
.app-info-ver { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 法的情報カード（マイページ最下部） */
.legal-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.legal-links { display: flex; flex-direction: column; }
.legal-link { display: block; padding: 10px 2px; font-size: 13.5px; color: var(--pink);
  text-decoration: none; border-top: 1px solid var(--pink-soft); }
.legal-link:first-child { border-top: none; }
/* ベルのお知らせパネル（お知らせ＋アプリの更新） */
.notif-card { max-width: 380px; padding: 18px 18px 16px; text-align: left; }
.notif-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--ink); }
.notif-head .ic { width: 20px; height: 20px; color: var(--pink); }
.notif-close { margin-left: auto; width: 32px; height: 32px; border: none; background: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.notif-close .ic { width: 18px; height: 18px; }
.notif-scroll { max-height: 62vh; overflow-y: auto; margin-top: 6px; }
.notif-sec-title { font-size: 12px; color: var(--muted); font-weight: 700; margin: 14px 0 6px; }
.notif-update { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--pink-soft); }
.notif-update.ready { background: linear-gradient(135deg, #ffdfeb, #ffe9f2); border: 1px solid #ffc4da; }
.notif-update-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.notif-update-txt strong { font-size: 13.5px; color: var(--ink); }
.notif-update-txt span { font-size: 11.5px; color: var(--muted); }
.notif-update .btn { width: auto; flex: 0 0 auto; padding: 9px 14px; font-size: 13px; }
.notif-item { padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid #f3eef1; margin-bottom: 8px; }
.notif-item-title { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.notif-item-body { font-size: 12.5px; color: var(--ink); line-height: 1.6; margin-top: 3px; white-space: pre-wrap; }
.notif-item-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.notif-empty { font-size: 13px; color: var(--muted); padding: 8px 2px; }
/* 設定：Lumi Premium 入口カード */
.premium-cta { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid #ffc4da; background: linear-gradient(135deg, #fff2f7, #ffe7f1); }
.premium-cta-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.premium-cta-title { font-weight: 800; font-size: 15px; color: var(--pink); }
.premium-cta-sub { font-size: 11.5px; color: var(--muted); }
.premium-cta-chev { color: var(--pink); display: flex; }
.premium-cta-chev .ic { width: 18px; height: 18px; }
/* マイページのアカウント系ボタン群：均一な余白でまとめる（枠の密着・重なり防止） */
.mp-account { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 14px; }
.mp-account > .card { margin-bottom: 0; }
.pw-spark { color: var(--pink); font-weight: 900; }
/* ペイウォール */
.pw-card { max-width: 400px; padding: 22px 20px 18px; position: relative; text-align: left; }
.pw-head { font-size: 20px; font-weight: 800; color: var(--ink); }
.pw-price { margin: 6px 0 12px; color: var(--ink); }
.pw-price strong { font-size: 30px; font-weight: 800; }
.pw-price span { font-size: 14px; color: var(--muted); margin-left: 2px; }
.pw-scroll { max-height: 48vh; overflow-y: auto; }
.pw-sec-title { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }
.pw-sec-title .ic { width: 16px; height: 16px; }
.pw-sec-title.pw-premium { color: var(--pink); }
.pw-list { margin: 0; padding: 0 0 0 20px; }
.pw-list li { font-size: 13px; line-height: 1.7; color: var(--ink); }
.pw-list.premium li { font-weight: 600; }
.pw-cta { margin-top: 16px; }
.pw-note { margin-top: 14px; padding: 10px; border-radius: 10px; background: var(--pink-soft); color: var(--pink); font-size: 12.5px; text-align: center; font-weight: 700; }
.pw-fine { font-size: 11px; color: var(--muted); text-align: center; margin: 8px 0 0; line-height: 1.6; }
.pw-legal { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--pink-soft);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }
.pw-legal-link { font-size: 11px; color: var(--muted); text-decoration: underline; }
/* 有料機能ロック時のプレースホルダー画面 */
.lock-screen { max-width: 340px; margin: 40px auto; padding: 24px 20px; text-align: center; }
.lock-badge { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--pink-soft); color: var(--pink); }
.lock-title { margin: 0 0 6px; font-size: 17px; }
.lock-sub { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.lock-list { text-align: left; display: inline-block; margin: 0 0 4px; padding: 12px 16px; border-radius: 12px; background: var(--pink-soft); font-size: 12.5px; line-height: 1.9; color: var(--text); }
.lock-cta { display: block; width: 100%; margin-top: 16px; }
.btn-danger:active { background: #e04444; }
.cal-visit { color: var(--purple); font-size: 9px; font-weight: 700; margin-top: 1px; }
.sheet-visits { background: var(--pink-soft); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.sheet-visits ul { list-style: none; padding: 0; margin: 0; }
.visit-line { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.visit-line.done span { text-decoration: line-through; color: var(--muted); }
.visit-line.done .todo-check { background: var(--pink); }
.cal-bday { color: #d17a00; font-size: 10px; font-weight: 700; margin-top: 1px; }
.cal-evheld { color: var(--purple); font-size: 10px; font-weight: 700; margin-top: 1px; }
.cal-ev { font-size: 10px; margin-top: 1px; }
.sheet-bday { background: #fff4e0; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; font-weight: 600; }
.sort-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.sort-chip { flex: 0 0 auto; background: var(--card); color: var(--muted); border: 1px solid #eee;
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sort-chip.active { background: var(--pink); color: #fff; border-color: var(--pink); }

/* ===== 初回ガイド（オンボーディング） ===== */
.onb-overlay { position: fixed; inset: 0; z-index: 1200; display: flex;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(30, 20, 30, .55); opacity: 0; transition: opacity .24s ease; }
.onb-overlay.show { opacity: 1; }
.onb-card { position: relative; background: #fff; border-radius: 22px; padding: 30px 22px 20px;
  width: 100%; max-width: 360px; text-align: center; box-shadow: var(--shadow);
  transform: translateY(12px) scale(.97); transition: transform .24s ease; }
.onb-overlay.show .onb-card { transform: translateY(0) scale(1); }
.onb-skip { position: absolute; top: 12px; right: 14px; background: none; border: none;
  color: var(--muted); font-size: 13px; font-weight: 600; padding: 4px 6px; cursor: pointer; }
.onb-emoji { font-size: 52px; line-height: 1; margin: 4px 0 12px; }
.onb-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 18px; margin: 4px 0 12px; }
.onb-title { font-size: 20px; margin: 0 0 6px; color: var(--ink); }
.onb-hint { display: inline-block; background: var(--pink-soft); color: var(--pink);
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 12px; margin-bottom: 10px; }
.onb-body { font-size: 14px; line-height: 1.75; color: var(--ink); margin: 0 0 18px; text-align: left; }
.onb-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 16px; }
.onb-dot { width: 7px; height: 7px; border-radius: 50%; background: #e6d6dd; transition: background .2s, width .2s; }
.onb-dot.active { width: 18px; border-radius: 999px; background: var(--pink); }
.onb-actions { display: flex; gap: 10px; }
.onb-later { display: block; width: 100%; background: none; border: none; color: var(--muted);
  font-size: 13px; font-weight: 600; margin-top: 12px; padding: 6px; cursor: pointer; }

/* ===== 目印つきツアー（スポットライト＋吹き出し） ===== */
.tour-overlay { position: fixed; inset: 0; z-index: 1200; opacity: 0; transition: opacity .24s ease; }
.tour-overlay.show { opacity: 1; }
/* 対象要素を照らす穴。box-shadow で周囲を暗くする */
.tour-hole { position: fixed; z-index: 1; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(20, 10, 20, .6);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; }
.tour-hole::after { content: ''; position: absolute; inset: -3px; border-radius: 16px;
  border: 2px solid var(--pink); animation: tourPulse 1.4s ease-out infinite; }
@keyframes tourPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 92, 138, .5); }
  100% { box-shadow: 0 0 0 12px rgba(255, 92, 138, 0); } }
/* 吹き出し（.onb-card を再利用しつつ固定配置に上書き） */
.tour-callout { position: fixed; z-index: 2; transform: none; width: calc(100vw - 28px);
  max-height: calc(100vh - 28px); overflow-y: auto; }
.tour-overlay.show .tour-callout { transform: none; }

/* ホーム画面追加ガイド（OS別・該当OSを強調） */
.onb-oslist { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 16px; text-align: left; }
.onb-os { border: 1px solid var(--pink-soft); border-radius: 12px; padding: 10px 12px; background: #fff; }
.onb-os.active { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(255, 92, 138, .15); }
.onb-os-h { font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.onb-os-steps { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; color: var(--ink); }
.onb-os-steps li { margin: 2px 0; }
/* 日本語が変な位置で折り返さないように（句読点・小書き文字の禁則を厳格化） */
.help-a, .onb-body, .onb-os-steps, .onb-os-h { line-break: strict; overflow-wrap: break-word; }

/* ===== 常設ヘルプ ===== */
.help-item { border-bottom: 1px solid #f0e3e9; }
.help-item:last-child { border-bottom: none; }
.help-item summary { list-style: none; cursor: pointer; padding: 12px 24px 12px 2px; position: relative;
  font-size: 14px; font-weight: 600; color: var(--ink); }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: '＋'; position: absolute; right: 4px; top: 11px; color: var(--pink); font-weight: 700; }
.help-item[open] summary::after { content: '−'; }
.help-a { font-size: 13px; line-height: 1.8; color: var(--ink); padding: 0 2px 14px; }

/* ============================================================
   v102 リデザイン: アプリヘッダー / ドロワー / 設定リスト / 目標
   ============================================================ */

/* 固定ヘッダーぶんの余白 */
body { padding-top: calc(54px + env(safe-area-inset-top)); }

/* ===== アプリヘッダー ===== */
#appbar { position: fixed; top: 0; left: 0; right: 0; z-index: 40; box-sizing: border-box;
  height: calc(54px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 16px;
  display: flex; align-items: center; gap: 8px; background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.04); }
#appbar.back { background: linear-gradient(160deg, #ffd7e6 0%, #ffe7f0 55%, #fff 130%); box-shadow: none; }
.ab-brand { flex: 1; min-width: 0; line-height: 1; color: var(--pink); font-weight: 700;
  font-family: 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', cursive; font-style: italic;
  font-size: 30px; }
.ab-spark { font-size: 15px; vertical-align: super; margin-left: 1px; }
.ab-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.ab-icon { border: none; background: none; font-size: 20px; width: 40px; height: 40px; cursor: pointer;
  border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.ab-icon:active { background: var(--pink-soft); }
.ab-icon svg { width: 23px; height: 23px; display: block; }
.ab-icon { position: relative; }
.ab-dot { display: none; position: absolute; top: 7px; right: 7px; width: 9px; height: 9px;
  background: #ff3b5c; border: 2px solid #fff; border-radius: 50%; box-sizing: content-box; }
.ab-icon.has-update .ab-dot { display: block; }
.ab-back { border: none; background: none; color: var(--pink); font-size: 30px; line-height: 1;
  width: 40px; height: 40px; flex: 0 0 auto; cursor: pointer; }
.ab-title { flex: 1; text-align: center; font-weight: 700; font-size: 18px; margin-right: 40px; }

/* ===== ☰ ドロワー ===== */
.drawer-backdrop { position: fixed; inset: 0; z-index: 1140; background: rgba(20,10,20,.4);
  opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; z-index: 1150; height: 100%;
  width: min(78vw, 300px); background: #fff; box-shadow: -8px 0 30px rgba(0,0,0,.18);
  transform: translateX(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
  padding: calc(env(safe-area-inset-top) + 10px) 0 env(safe-area-inset-bottom);
  display: flex; flex-direction: column; }
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between;
  padding: 4px 18px 14px; border-bottom: 1px solid #f0e6ec; }
.drawer-brand { color: var(--pink); font-weight: 700; font-size: 26px;
  font-family: 'Snell Roundhand', 'Apple Chancery', 'Segoe Script', cursive; font-style: italic; }
.drawer-close { border: none; background: none; font-size: 20px; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.drawer-nav { display: flex; flex-direction: column; padding: 8px 0; }
.drawer-item { display: flex; align-items: center; gap: 14px; padding: 15px 20px; border: none;
  background: none; font-size: 15px; color: var(--ink); text-align: left; cursor: pointer; width: 100%;
  box-sizing: border-box; text-decoration: none; }
.drawer-item:active { background: var(--pink-soft); }
.di-ico { font-size: 19px; width: 24px; text-align: center; flex: 0 0 auto; }

/* ===== ホーム: カード見出し / リンクボタン ===== */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.card-head h3 { margin: 0; }
.link-btn { border: none; background: none; color: var(--pink); font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 4px 0; flex: 0 0 auto; }

/* ===== ホーム: 収入サマリー凡例 ===== */
.summary-body { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.summary-body canvas { flex: 0 0 auto; }
.sum-legend { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sum-leg-row { display: flex; align-items: flex-start; gap: 9px; }
.leg-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; }
.leg-main { min-width: 0; }
.leg-name { font-size: 13px; color: var(--muted); }
.leg-amt { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.leg-pct { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 2px; }

/* ===== ホーム: 本日の予定 ===== */
.today-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 4px; }
.tr-label { font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.tr-value { color: var(--pink); font-weight: 700; font-size: 15px; text-align: right; min-width: 0; }
.tr-value.muted-v { color: var(--muted); font-weight: 400; }
.today-sec { margin-top: 8px; padding-top: 12px; border-top: 1px solid #f3eef1; }
.today-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.today-sec-head span { font-weight: 700; font-size: 14px; }
.mini-btn { border: 1px solid var(--pink); background: var(--pink-soft); color: var(--pink);
  font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 999px; cursor: pointer; flex: 0 0 auto; }
.mini-btn:active { background: #ffd3e1; }
.today-empty { font-size: 13px; padding: 4px 0; }

/* ===== ホーム: 直近チップ ===== */
.chip-date { font-size: 12px; font-weight: 600; }
.chip-state { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.chip strong { display: block; margin: 2px 0; }

/* ===== ホーム: 使い方/ヘルプ ボタン ===== */
.home-action .ha-label { font-size: 14px; }

/* ===== ホーム: 今月の目標 ===== */
.goal-cta { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid #ffdfec; background: linear-gradient(135deg, #fff 0%, #fff2f7 100%); }
.goal-cta:active { background: #ffe9f2; }
.goal-cta-ico { font-size: 26px; flex: 0 0 auto; }
.goal-cta-body { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.goal-cta-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.goal-cta-sub { font-size: 12px; color: var(--muted); }
.goal-cta-chev { color: var(--pink); font-size: 24px; flex: 0 0 auto; }
.goal-card { cursor: pointer; }
.goal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.goal-title { font-weight: 700; font-size: 15px; }
.goal-target { color: var(--pink); font-weight: 800; font-size: 19px; letter-spacing: -.4px; }
.goal-bar { height: 12px; background: var(--pink-soft); border-radius: 999px; margin: 12px 0 8px; overflow: hidden; }
.goal-bar-fill { height: 100%; border-radius: 999px; min-width: 6px;
  background: linear-gradient(90deg, var(--pink), #ff9bbb); transition: width .5s ease; }
.goal-meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.goal-meta strong { color: var(--pink); }
.goal-input { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid #eee;
  border-radius: 12px; font-size: 18px; text-align: center; margin-top: 14px; }

/* ============================================================
   設定画面: iOS 風グループリスト
   ============================================================ */
.set-group { margin-bottom: 18px; }
.set-group-title { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 4px 8px; }
.set-rows { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.set-rows.is-off { opacity: .45; }
.set-rows.is-off input, .set-rows.is-off .set-val { pointer-events: none; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 54px;
  border-top: 1px solid #f3eef1; box-sizing: border-box; }
.set-rows > .set-row:first-child { border-top: none; }
.set-ico { width: 22px; text-align: center; font-size: 16px; flex: 0 0 auto; }
.set-label { flex: 1; font-size: 15px; min-width: 0; }
.set-val { flex: 0 1 auto; max-width: 58%; text-align: right; border: none; background: none;
  color: var(--muted); font-size: 15px; padding: 6px 0; min-width: 60px; }
.set-val::placeholder { color: #c9c4c9; }
.set-val:focus { outline: none; color: var(--ink); }
input.set-val[type="time"] { -webkit-appearance: none; appearance: none; width: auto; }
.set-val-wrap { flex: 0 0 auto; }
.set-val-wrap select { border: none; background: none; color: var(--pink); font-weight: 600;
  font-size: 15px; text-align: right; text-align-last: right; }
.set-hint { font-size: 12px; color: var(--muted); margin: 6px 4px 0; }
.set-desc { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 0 4px 10px; }
.btn-save { background: linear-gradient(135deg, var(--pink), #ff86ab); border-radius: 16px;
  padding: 15px; font-size: 16px; margin: 8px 0 24px; box-shadow: 0 6px 16px rgba(255,92,138,.32); }

/* ===== トグルスイッチ ===== */
.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider { position: absolute; inset: 0; background: #e2e2e8; border-radius: 999px;
  transition: background .2s ease; cursor: pointer; }
.switch-slider::before { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.switch input:checked + .switch-slider { background: var(--pink); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ===== 共通ラインアイコン（icons.js） ===== */
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.18em; flex: 0 0 auto; }

/* ===== ボトムナビ: ラインSVGアイコン ===== */
.tab-ico { width: 25px; height: 25px; display: block; }
#tabbar button svg { flex: 0 0 auto; }
#tabbar .fab { padding: 0; }
#tabbar .fab svg { width: 26px; height: 26px; }

/* ===== デスクトップ: サイドバーをヘッダーの下げる ===== */
@media (min-width: 900px) {
  #appbar { z-index: 60; }
  #tabbar { top: calc(54px + env(safe-area-inset-top)); }
  .tab-ico { width: 27px; height: 27px; }
}

/* ===== レポート: 歩合TOP3 ランクバッジ ===== */
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 50%; font-size: 12px; font-weight: 800; color: #fff; margin-right: 4px; vertical-align: -0.15em; }
.rank-1 { background: #f5b301; }
.rank-2 { background: #b9c2cc; }
.rank-3 { background: #cd8b52; }

/* サマリー凡例・設定行などインライン用のアイコン色調整 */
.set-ico .ic { color: var(--muted); }

/* ============================================================
   顧客リスト カード（リッチ表示）
   ============================================================ */
.cust-count { color: var(--pink); font-weight: 700; font-size: 14px; }
.cust-seg .seg-btn .ic { width: 16px; height: 16px; vertical-align: -0.18em; margin-right: 2px; }

/* 検索ボックス（左にアイコン） */
.cust-search-wrap { position: relative; margin: 12px 0 10px; }
.cust-search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); display: flex; }
.cust-search-ico .ic { width: 18px; height: 18px; }
.cust-search-wrap input { width: 100%; box-sizing: border-box; padding: 12px 14px 12px 40px;
  border: 1px solid #eee; border-radius: 14px; background: #fff; }
.cust-search-wrap input:focus { outline: none; border-color: var(--pink); }

/* カード */
.cust-card2 { background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  margin-bottom: 14px; cursor: pointer; overflow: hidden; }
.cust-card2:active { background: #fff8fb; }
.cc-top { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 14px; position: relative; }
.cc-avatar { width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(160deg, #ffe3ee, #ffd0e0); color: #f4a0bd;
  display: flex; align-items: center; justify-content: center; }
.cc-avatar .ic { width: 30px; height: 30px; }
.cc-body { flex: 1; min-width: 0; padding-right: 8px; }
.cc-name { font-weight: 700; font-size: 18px; line-height: 1.2; }
.cc-furi { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cc-visits { font-size: 13px; margin-top: 5px; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.cc-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.cc-chip .ic { width: 13px; height: 13px; }
.cc-chip-none { background: #e9f0fb; color: #5b7fb0; }
.cc-chip-visit { background: #e6f4ea; color: #3f9d5b; }
.cc-chip-new { background: var(--pink-soft); color: var(--pink); }
.cc-chip-reg { background: #efe9ff; color: var(--purple); }
.cc-memo { position: absolute; top: 14px; right: 34px; display: inline-flex; align-items: center; gap: 4px;
  border: 1.4px solid var(--pink); background: #fff; color: var(--pink); font-size: 12px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.cc-memo .ic { width: 14px; height: 14px; }
.cc-memo:active { background: var(--pink-soft); }
.cc-chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: #d3ccd0; font-size: 22px; line-height: 1; }
.cc-foot { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #f2eef1; }
.cc-foot-item { display: flex; align-items: center; gap: 8px; padding: 12px 8px 12px 12px; min-width: 0; }
.cc-foot-item + .cc-foot-item { border-left: 1px solid #f2eef1; }
.cc-foot-item .ic { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.cc-foot-item > div { min-width: 0; }
.cc-foot-item span { display: block; color: var(--muted); font-size: 11px; }
.cc-foot-item strong { font-size: 13px; white-space: nowrap; }

/* 白地・ピンク枠の追加ボタン */
.btn-outline { background: #fff; color: var(--pink); border: 1.5px solid var(--pink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-outline:active { background: var(--pink-soft); }
.btn-outline .ic { width: 18px; height: 18px; }

/* ===== 顧客: フリガナ索引 ===== */
.kana-index { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.kana-jump { flex: 0 0 auto; min-width: 30px; height: 30px; padding: 0 6px;
  border: 1px solid #f0dde6; background: #fff; color: var(--pink); font-size: 13px; font-weight: 700;
  border-radius: 9px; cursor: pointer; }
.kana-jump:active { background: var(--pink-soft); }
.kana-head { font-size: 13px; font-weight: 800; color: var(--pink); margin: 6px 2px 8px;
  padding-bottom: 4px; border-bottom: 2px solid var(--pink-soft);
  scroll-margin-top: calc(66px + env(safe-area-inset-top)); }

/* ============================================================
   イベント画面（一覧・詳細）
   ============================================================ */
/* イベント作成 CTA（点線カード） */
.ev-cta { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1.6px dashed #f3b6cd; border-radius: 18px; padding: 18px 16px; margin-bottom: 16px; }
.ev-cta:active { background: #fff5f9; }
.ev-cta-ico { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; background: var(--pink-soft);
  color: var(--pink); display: flex; align-items: center; justify-content: center; }
.ev-cta-ico .ic { width: 26px; height: 26px; }
.ev-cta-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ev-cta-title { font-weight: 700; font-size: 16px; }
.ev-cta-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* イベントカード（一覧） */
.ev-list { display: flex; flex-direction: column; }
.ev-card2 { display: flex; align-items: center; gap: 14px; position: relative;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px; cursor: pointer; }
.ev-card2:active { background: #fff8fb; }
.ev-avatar { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(160deg, #ffd7e6, #ffbcd3); color: #fff;
  display: flex; align-items: center; justify-content: center; }
.ev-avatar .ic { width: 28px; height: 28px; }
.ev-avatar.lg { width: 70px; height: 70px; }
.ev-avatar.lg .ic { width: 34px; height: 34px; }
.ev-card-body { flex: 1; min-width: 0; padding-right: 14px; }
.ev-card-name { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-card-date { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 5px; }
.ev-card-date .ic { width: 15px; height: 15px; }
.ev-card-stats { font-size: 13px; margin-top: 5px; }
.ev-card-stats .ev-sep { color: #e3d5db; margin: 0 6px; }

/* 開催状況バッジ */
.ev-badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.ev-badge-live { background: var(--pink-soft); color: var(--pink); }
.ev-badge-end { background: #ececf0; color: #9a9aa4; }

/* 戻る */
.ev-back { display: inline-flex; align-items: center; gap: 6px; border: none; background: none;
  color: var(--pink); font-weight: 700; font-size: 15px; cursor: pointer; padding: 4px 2px; margin-bottom: 8px; }
.ev-back .ic { width: 20px; height: 20px; }

/* 詳細ヘッダー */
.ev-detail-head { display: flex; align-items: flex-start; gap: 14px; }
.ev-detail-title { flex: 1; min-width: 0; }
.ev-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-name-row h2 { margin: 0; font-size: 22px; }
.ev-id { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ev-detail-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.ev-memo { margin-top: 10px; font-size: 13px; color: var(--ink); background: var(--bg);
  border-radius: 10px; padding: 8px 12px; }
.btn.sm { width: auto; padding: 7px 12px; font-size: 13px; }
.btn-outline.sm .ic { width: 15px; height: 15px; }

/* 歩合合計の帯 */
.ev-back-row { display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding: 12px 14px; background: var(--pink-soft); border-radius: 14px; }
.ev-back-row strong { color: var(--pink); font-size: 18px; }

/* 予約名簿 空状態 */
.res-empty { text-align: center; padding: 26px 10px 20px; color: var(--muted); }
.res-empty-ico { color: #e6b9cb; display: block; }
.res-empty-ico .ic { width: 40px; height: 40px; }
.res-empty-title { font-weight: 700; font-size: 15px; color: var(--ink); margin-top: 10px; }
.res-empty-sub { font-size: 12px; line-height: 1.6; margin-top: 4px; }

/* 予約サマリー タイル */
.ev-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ev-sum-tile { background: var(--pink-soft); border-radius: 14px; padding: 12px 4px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ev-sum-ico { color: var(--pink); }
.ev-sum-ico .ic { width: 20px; height: 20px; }
.ev-sum-label { font-size: 11px; color: var(--muted); }
.ev-sum-tile strong { font-size: 14px; }

/* 削除ボタン（塗り） */
.btn-delete { background: var(--pink); color: #fff; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; margin-top: 4px; }
.btn-delete .ic { width: 18px; height: 18px; }
.btn-delete:active { background: #e94e81; }

/* ===== 数量ステッパー（予約フォーム） ===== */
.qty-stepper { display: flex; align-items: center; gap: 8px; }
.qty-btn { flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid #eee; background: #fff;
  border-radius: 12px; color: var(--pink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.qty-btn:active { background: var(--pink-soft); }
.qty-btn .ic { width: 18px; height: 18px; }
.qty-input { flex: 1; min-width: 0; text-align: center; padding: 10px 6px;
  border: 1px solid #eee; border-radius: 12px; -moz-appearance: textfield; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== 日次詳細シート「入った歩合を記録」（画面1リデザイン） ===== */
.inc-head { margin: 14px 0 10px; }
.inc-head-title { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; }
.inc-head-title .ic { width: 18px; height: 18px; color: var(--pink); }
.inc-head-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.inc-searchrow { display: flex; gap: 8px; margin-bottom: 10px; }
.inc-search { position: relative; flex: 1; min-width: 0; }
.inc-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.inc-search-ic .ic { width: 16px; height: 16px; }
.inc-search input { width: 100%; border: 1px solid #eee; border-radius: 12px;
  padding: 10px 12px 10px 34px; font-size: 14px; background: #fff; }
.inc-filter { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  border: 1.5px solid #eadfe4; background: #fff; color: var(--ink); border-radius: 12px;
  padding: 0 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.inc-filter .ic { width: 15px; height: 15px; color: var(--pink); }
.inc-catchips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.inc-catchips::-webkit-scrollbar { display: none; }
.inc-catchip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid #eadfe4; background: #fff; color: var(--muted); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; }
.inc-catchip.active { border-color: var(--pink); background: var(--pink); color: #fff; }
.inc-catchip-n { font-size: 11px; background: #f0e6ea; color: var(--muted);
  border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center; }
.inc-catchip.active .inc-catchip-n { background: rgba(255,255,255,.3); color: #fff; }
.inc-group { border: 1px solid #f0e6ea; border-radius: 16px; margin-bottom: 12px; overflow: hidden; background: #fff; }
.inc-group-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px;
  background: none; border: none; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.inc-group-emoji { font-size: 18px; flex: 0 0 auto; line-height: 1; }
.inc-group-emoji .ic { width: 18px; height: 18px; color: var(--pink); }
.inc-group-name { font-size: 15px; font-weight: 800; }
.inc-group-total { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--pink); }
.inc-group-chev { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; transition: transform .2s; }
.inc-group-chev.open { transform: rotate(180deg); }
.inc-group-body { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px; }
.inc-group-body[hidden] { display: none; }

/* ===== 「歩合項目を選択」フルスクリーンモーダル（画面2） ===== */
.picker-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.35);
  opacity: 0; transition: opacity .25s; }
.picker-backdrop.show { opacity: 1; }
.picker-modal { position: fixed; inset: 0; z-index: 71; background: var(--bg);
  display: flex; flex-direction: column; transform: translateY(100%); transition: transform .28s cubic-bezier(.4,0,.2,1); }
.picker-modal.show { transform: translateY(0); }
.picker-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px;
  background: #fff; border-bottom: 1px solid #f0e6ea; flex: 0 0 auto; }
.picker-icobtn { width: 36px; height: 36px; border: none; background: none; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.picker-icobtn .ic { width: 22px; height: 22px; }
.picker-title { flex: 1; text-align: center; margin: 0; font-size: 16px; font-weight: 800; }
.picker-search { position: relative; margin: 12px 14px 0; flex: 0 0 auto; }
.picker-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.picker-search-ic .ic { width: 16px; height: 16px; }
.picker-search input { width: 100%; border: 1px solid #eee; border-radius: 12px;
  padding: 11px 12px 11px 34px; font-size: 14px; background: #fff; }
.picker-body { flex: 1; overflow-y: auto; padding: 14px; -webkit-overflow-scrolling: touch; }
.picker-body .bk-group { background: #fff; border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.picker-body .bk-group-total { font-size: 12.5px; color: var(--pink); }
.pick-row.selected { border-color: var(--pink); background: var(--pink-soft); }
/* 件数ステッパー（− 0 ＋） */
.pick-stepper { display: flex; align-items: center; justify-content: center; gap: 6px; }
.pick-step { width: 32px; height: 32px; border-radius: 10px; border: 1.5px solid #eadfe4;
  background: #fff; color: var(--pink); font-size: 20px; font-weight: 700; line-height: 1;
  cursor: pointer; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.pick-step:active { background: var(--pink-soft); }
.selected .pick-step { border-color: var(--pink); }
.pick-qty { min-width: 30px; text-align: center; font-size: 16px; font-weight: 800;
  font-variant-numeric: tabular-nums; }
.selected .pick-qty { color: var(--pink); }
.pick-sales { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.pick-sales-in { flex: 1; min-width: 0; border: 1.5px solid #eadfe4; border-radius: 10px;
  padding: 7px 8px; font-size: 14px; text-align: right; -moz-appearance: textfield; }
.pick-sales-in::-webkit-outer-spin-button, .pick-sales-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* リスト表示ではステッパー/売上欄を右端に固定 */
.pick-row { gap: 8px; }
.pick-row .pick-stepper, .pick-row .pick-sales { flex: 0 0 auto; margin-left: auto; }
.pick-row .pick-sales-in { width: 90px; flex: 0 0 auto; }
.picker-foot { flex: 0 0 auto; background: #fff; border-top: 1px solid #f0e6ea;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.picker-foot-info { display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.picker-foot-info strong { color: var(--ink); font-size: 15px; }
.picker-foot-sum strong { color: var(--pink); }
.picker-apply { width: 100%; }
.picker-empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.picker-empty-ic { width: 44px; height: 44px; margin: 0 auto 10px; color: #d9c7cf; }
.picker-empty-ic .ic { width: 44px; height: 44px; }
.picker-empty-add { width: auto; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; }
.picker-nores { text-align: center; padding: 30px 0; }

/* ===== 選択画面の説明バナー ===== */
.picker-note { display: flex; align-items: flex-start; gap: 8px; margin: 12px 14px 0;
  background: #fff6fa; border: 1px solid #ffd9e6; border-radius: 12px; padding: 10px 12px;
  font-size: 12px; line-height: 1.6; color: #6b5560; flex: 0 0 auto; }
.picker-note .ic { width: 17px; height: 17px; color: var(--pink); flex: 0 0 auto; margin-top: 1px; }
.picker-note strong { color: var(--pink); font-weight: 800; }

/* ===== 日別シート「入った歩合」の要約リスト＋入力ボタン ===== */
.inc-empty { font-size: 13px; color: var(--muted); line-height: 1.6; text-align: center;
  background: var(--bg); border-radius: 12px; padding: 14px 12px; margin: 0 0 10px; }
.inc-sum-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.inc-sum-row { display: flex; align-items: center; gap: 8px; background: var(--bg);
  border-radius: 12px; padding: 9px 12px; }
.inc-sum-emoji { font-size: 17px; flex: 0 0 auto; line-height: 1; }
.inc-sum-name { font-size: 14px; font-weight: 700; min-width: 0; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; }
.inc-sum-qty { font-size: 12px; font-weight: 700; color: var(--pink); flex: 0 0 auto; }
.inc-sum-amt { margin-left: auto; font-size: 14px; font-weight: 800; flex: 0 0 auto; }
.inc-sum-amt.neg { color: #e0466a; }
.inc-open { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 4px; }
.inc-open .ic { width: 17px; height: 17px; }
