:root {
  --bg: #f2f6f2;
  --panel: #ffffff;
  /* ブロック（おもちゃのブロック）調テーマ：メインカラーはやさしい緑 */
  --primary: #4cae57;
  --primary-dark: #3a9247;
  --text: #2b3440;
  --muted: #8a93a8;
  --border: #e4e8ee;
  --shadow: 0 6px 24px rgba(60, 110, 70, 0.10);
  --danger: #e5484d;
  --ok: #2fb170;
  --accent: #ff7a59;
  --check-border: #aab4c9; /* チェック四角の枠線。--border だと薄すぎ、濃すぎても浮くので中間色 */
  /* カテゴリ色（アラート帯・アイコンブロック） */
  --band-red: #f26d6d;
  --band-yellow: #f2b53c;
  --band-blue: #5a8fdc;
  --band-purple: #9b7ede;
  --band-green: #4cae57;
  --band-teal: #3aa8a0; /* 勤怠（タイムカード）。既存5色と判別できる青緑（華子さん案・所長採用） */
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app-header {
  /* 薄めのグリーン＋透ける質感（癒しテーマ）。
     ただし文字が乗る左側は一段濃くして、白文字の読みやすさを確保する
     （右側は白ピルボタンが自前の背景を持つので薄くてよい） */
  background: linear-gradient(110deg, rgba(70, 150, 80, .95) 0%, rgba(96, 186, 108, .88) 45%, rgba(139, 209, 149, .78) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  padding: 24px 28px 28px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* 下側の角に大きめの丸みをつけて、やわらかくかわいい印象に */
  border-radius: 0 0 28px 28px;
  position: relative;
  /* backdrop-filter がヘッダーをスタッキングコンテキストにするため、
     z-index が無いと中のアカウントメニュー（z-index:60）が本文のタイルの下に潜る */
  z-index: 50;
}
/* ブロックのポッチ（スタッド）：上下に白い点列 */
.app-header::before,
.app-header::after {
  content: "";
  position: absolute; left: 18px; right: 18px; height: 9px;
  background-image: radial-gradient(circle at 11px 4.5px, rgba(255,255,255,.40) 4.5px, transparent 5.5px);
  background-size: 30px 9px;
  background-repeat: repeat-x;
  pointer-events: none;
}
.app-header::before { top: 6px; }
.app-header::after { bottom: 9px; }
.exit-btn {
  font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 10px 18px; border: 1px solid rgba(255,255,255,.5);
  border-radius: 10px; background: rgba(255,255,255,.15); color: #fff;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.exit-btn:hover { background: rgba(255,255,255,.28); }
.exit-btn:active { transform: translateY(1px); }

/* 終了オーバーレイ */
.shutdown-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(244, 246, 251, .96);
  display: grid; place-items: center; padding: 24px;
}
.shutdown-box {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; padding: 40px 44px; text-align: center;
  box-shadow: var(--shadow); max-width: 420px;
}
.shutdown-box .shutdown-ico { width: 118px; height: auto; display: block; margin: 0 auto 14px; }
.shutdown-box h2 { margin: 0 0 12px; font-size: 22px; color: var(--text); }
.shutdown-box p { margin: 6px 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.shutdown-box .shutdown-note { margin-top: 18px; font-size: 13px; color: var(--muted); }
.shutdown-box .shutdown-note b { color: var(--primary); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo {
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(255,255,255,.92);
  display: grid; place-items: center; font-size: 24px;
}
.brand .logo img { width: 36px; height: 36px; display: block; }
.brand h1 { margin: 0; font-size: 21px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 40, 10, .28); }
/* ひとことは白い吹き出しチップ（.daikichi-says）なので影は不要（チップ内の濃色文字に影が掛かると汚れて見える） */
.brand p { margin: 2px 0 0; font-size: 13px; opacity: 1; }
/* 大吉くんの紹介ページへの控えめな隠しリンク（肉球） */
.daikichi-about { margin-left: 5px; text-decoration: none; font-size: 15px; opacity: .55; transition: opacity .15s; }
.daikichi-about:hover { opacity: 1; }

.container { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; }

/* 期限アラート */
.alert-banner {
  background: linear-gradient(135deg, #fff4e5, #ffe9e0);
  border: 1px solid #ffd0b8;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.alert-banner .alert-head { font-weight: 700; color: #d9603b; margin-bottom: 6px; font-size: 14px; }
.alert-banner ul { margin: 0; padding-left: 20px; }
.alert-banner li { font-size: 13px; color: #7a4a34; margin: 3px 0; }
.alert-banner li.urgent { color: var(--danger); font-weight: 700; }  /* 超過・今日・明日 = 赤 */
.alert-banner li.soon { color: #8a5a00; font-weight: 600; }          /* あと2〜3日 = オレンジ */
.alert-banner li.overdue { color: var(--danger); font-weight: 600; } /* 旧クラス（後方互換） */

/* ダッシュボード */
.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-card.highlight { background: linear-gradient(135deg, #fff, #eef2ff); border-color: #d5ddff; }
.stat-card.warn { background: linear-gradient(135deg, #fff, #fff2e8); border-color: #ffd9c2; }
.stat-card.warn .stat-num { color: var(--accent); }
.stat-num { font-size: 36px; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* 最新の振り返り（ダッシュボード） */
.latest-review {
  background: linear-gradient(135deg, #eef2ff, #f3f0ff);
  border: 1px solid #d9ddff;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.latest-review .latest-head { font-size: 12px; font-weight: 700; color: #3c6fc0; letter-spacing: .02em; } /* 水色カードには青系見出し */
.latest-review .latest-week { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 4px; }
.latest-review .latest-comment {
  font-size: 14px; color: #45507a; white-space: pre-wrap; word-break: break-word;
  margin-top: 6px; line-height: 1.6;
}
.latest-review .latest-date { font-size: 11px; color: var(--muted); margin-top: 8px; }
.latest-review .latest-empty { font-size: 13px; color: var(--muted); }

/* 週次振り返りセクション */
.review-section { margin-top: 28px; }
.review-section h2 { font-size: 18px; margin: 0 0 14px; }
.review-section .card textarea { min-height: 70px; }
.review-item {
  background: #f7f5ff;
  border: 1px solid #e2ddf5;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
}
.review-item .review-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 2px; }
.review-item .review-tools .icon-btn.edit:hover { color: var(--primary); }
.review-item .review-week { font-weight: 700; font-size: 14px; color: #6d4fb8; padding-right: 48px; } /* ラベンダーのカードには紫系見出し */
.review-item .review-comment {
  font-size: 14px; color: #55617d; white-space: pre-wrap; word-break: break-word; margin-top: 6px;
}
.review-item .review-date { font-size: 11px; color: var(--muted); margin-top: 10px; }
.review-edit textarea {
  width: 100%; font-family: inherit; font-size: 14px; margin-top: 8px;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--text); outline: none; resize: vertical; min-height: 60px;
}
.review-edit textarea:focus { border-color: var(--primary); }
.review-edit .edit-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* 検索 */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 14px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.search-bar .search-ico { font-size: 15px; opacity: .6; }
.search-bar input {
  flex: 1; border: none; outline: none; background: none;
  font-family: inherit; font-size: 15px; color: var(--text);
  padding: 10px 0;
}
.search-clear {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 14px; padding: 4px 8px; border-radius: 50%;
}
.search-clear:hover { background: var(--bg); color: var(--text); }

/* 2カラム */
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.column h2 { font-size: 18px; margin: 0 0 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card input[type=text], .card textarea {
  width: 100%;
  font-family: inherit; font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--text);
  outline: none;
  margin-bottom: 10px;
}
.card input:focus, .card textarea:focus { border-color: var(--primary); background: #fff; }
.card textarea { resize: vertical; min-height: 74px; }
.inline { display: flex; gap: 10px; }
.inline input { margin-bottom: 0; }

.btn {
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 18px; border: none; border-radius: 10px;
  background: var(--primary); color: #fff; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--bg); color: var(--text); }
.btn.ghost:hover { background: #e8ecf6; }
.btn.small { padding: 7px 12px; font-size: 13px; }

.task-detail-input { min-height: 56px; margin-bottom: 10px; }
.due-label { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.card input[type=date], .card input[type=week] {
  font-family: inherit; font-size: 14px;
  padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: #fbfcfe; color: var(--text); outline: none;
}
.card input[type=date]:focus, .card input[type=week]:focus { border-color: var(--primary); background: #fff; }

/* よく使うタスク */
.presets { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.presets-title { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef2ff; border: 1px solid #d5ddff; color: #3b56d4; /* 青い下地には青系の文字（緑テーマ化の影響を受けない固定色） */
  border-radius: 20px; padding: 6px 6px 6px 13px; font-size: 13px; font-weight: 600;
}
.preset-chip .use { cursor: pointer; }
.preset-chip .use:hover { text-decoration: underline; }
.preset-chip .rm {
  cursor: pointer; background: rgba(59,86,212,.12); border-radius: 50%;
  width: 18px; height: 18px; display: grid; place-items: center; font-size: 11px;
}
.preset-chip .rm:hover { background: var(--danger); color: #fff; }
.preset-empty { font-size: 12px; color: var(--muted); }

.icon-btn {
  background: none; border: none; cursor: pointer; font-size: 15px;
  color: var(--muted); padding: 4px 6px; border-radius: 6px; transition: .15s;
}
.icon-btn:hover { background: var(--bg); color: var(--danger); }

/* 一覧 */
.list { display: flex; flex-direction: column; gap: 12px; }

.memo-item {
  background: #fffdf5;
  border: 1px solid #f0ead0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
}
.memo-item .memo-title { font-weight: 700; font-size: 15px; padding-right: 24px; }
.memo-item .memo-content { font-size: 14px; color: #55617d; white-space: pre-wrap; word-break: break-word; margin-top: 6px; }
.memo-item .memo-date { font-size: 11px; color: var(--muted); margin-top: 10px; }

.task-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}
/* アラート対象タスクはタイル背景を薄く色づけ（超過・今日・明日=赤／あと2〜3日=オレンジ） */
.task-item.row-urgent { background: #fdeceb; border-color: #f3c4c1; border-left: 4px solid var(--danger); }
.task-item.row-soon { background: #fff6e6; border-color: #f2dcae; border-left: 4px solid #e0a021; }
.task-item .check {
  width: 24px; height: 24px; border-radius: 7px;
  border: 2px solid var(--check-border); background: #fff; cursor: pointer; flex-shrink: 0;
  display: grid; place-items: center; transition: .15s; font-size: 15px;
}
.task-item .check:hover { border-color: var(--primary); }
.task-item.done .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.task-item .task-body { flex: 1; min-width: 0; }
.task-item .task-title { font-size: 15px; word-break: break-word; }
.task-item.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-item .task-detail {
  font-size: 13px; color: #55617d; white-space: pre-wrap; word-break: break-word;
  margin-top: 5px; padding-left: 10px; border-left: 2px solid var(--border);
}
.task-item.done .task-detail { color: var(--muted); }
.task-item .check { align-self: flex-start; margin-top: 1px; }
.task-item { align-items: flex-start; }
.task-edit-box input, .task-edit-box textarea {
  width: 100%; font-family: inherit; font-size: 14px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--text); outline: none; margin-bottom: 8px;
}
.task-edit-box input:focus, .task-edit-box textarea:focus { border-color: var(--primary); }
.task-edit-box textarea { resize: vertical; min-height: 54px; }
.task-edit-box .edit-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.task-edit-box .edit-due { margin-right: auto; }
.task-item .task-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.status-tag { font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.status-open { background: #fff2e0; color: #d98324; }
.status-done { background: #e3f6ec; color: var(--ok); }
.due-tag { font-size: 11px; font-weight: 600; }
.due-tag.due-normal { color: var(--muted); }
.due-tag.due-soon { color: var(--accent); font-weight: 700; }
.due-tag.due-over { color: var(--danger); font-weight: 700; }
.task-actions { display: flex; gap: 2px; flex-shrink: 0; }

/* メモ編集モード */
.memo-edit input, .memo-edit textarea {
  width: 100%; font-family: inherit; font-size: 14px;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--text); outline: none; margin-bottom: 8px;
}
.memo-edit input:focus, .memo-edit textarea:focus { border-color: var(--primary); }
.memo-edit textarea { resize: vertical; min-height: 60px; }
.memo-edit .edit-actions { display: flex; gap: 8px; justify-content: flex-end; }
.memo-item .memo-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 2px; }
.memo-item .icon-btn.edit:hover { color: var(--primary); }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }
.empty .big { font-size: 36px; display: block; margin-bottom: 8px; opacity: .5; }
.empty .daikichi { width: 72px; height: auto; display: block; margin: 0 auto 10px; opacity: .85; }

/* トースト */
.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text); color: #fff;
  padding: 12px 24px; border-radius: 30px;
  font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.3);
  z-index: 100; opacity: 0; transition: .3s; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }

/* トースト内の「元に戻す」ボタン */
.toast-undo {
  font-family: inherit; font-size: 13px; font-weight: 700;
  margin-left: 10px; padding: 5px 14px;
  border: 1px solid rgba(255,255,255,.5); border-radius: 20px;
  background: rgba(255,255,255,.15); color: #fff;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.toast-undo:hover { background: rgba(255,255,255,.3); }
.toast-undo:active { transform: translateY(1px); }

@media (max-width: 720px) {
  .dashboard { grid-template-columns: repeat(2, 1fr); } /* 2×2で見やすく */
  .columns { grid-template-columns: 1fr; }
}

/* ヘッダー右側（ユーザー名・パスワード変更・ログアウト・終了） */
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; position: relative; }
.user-badge { font-size: 13px; font-weight: 700; opacity: .95; white-space: nowrap; }
/* ユーザー名バッジ＝アカウントメニューのボタン（👑🔑ログアウト⏻を収納） */
button.user-badge {
  font-family: inherit; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px; padding: 7px 12px; transition: .15s;
}
button.user-badge:hover { background: rgba(255,255,255,.26); }
button.user-badge::after { content: ' ▾'; font-size: 10px; opacity: .8; }
/* メニューの中身が無いユーザー（デモ等）：ただの名前表示にする（▾も出さない・押しても反応しない） */
button.user-badge.no-menu { cursor: default; }
button.user-badge.no-menu:hover { background: rgba(255,255,255,.14); }
button.user-badge.no-menu::after { content: none; }
/* ログアウト・終了はヘッダーに常時表示。緑ヘッダー上でも見やすいよう色を分ける */
.link-btn.logout-btn { color: #7a4a34; }
.link-btn.exit-header-btn { background: #fff2ec; color: #c25a2b; border-color: #f3d3c2; }
.link-btn.exit-header-btn:hover { background: #ffe8dc; }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  flex-direction: column; gap: 2px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(30, 40, 80, .18);
  padding: 6px; min-width: 190px;
}
.user-menu-item {
  font-family: inherit; border: none; background: none; text-align: left; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text);
  padding: 9px 12px; border-radius: 8px; white-space: nowrap;
}
.user-menu-item:hover { background: #f2f5fc; }

/* スマホ用の下部タブバー（640px以下でだけ表示） */
.mobile-tabs { display: none; }
.link-btn {
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 9px 14px; border: 1px solid rgba(0, 60, 20, .08);
  border-radius: 12px; background: #fff; color: #276b31;
  cursor: pointer; transition: .15s; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .14);
}
.link-btn:hover { background: #eefaf0; transform: translateY(-1px); }
.link-btn:active { transform: translateY(1px); }

/* バージョン表示（ボタンの下に控えめに・クリックで変更履歴） */
.version-tag {
  flex-basis: 100%; text-align: right; margin-top: 2px;
  font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: rgba(255,255,255,.72); background: none; border: none; cursor: pointer;
  padding: 0 2px; transition: .15s;
}
.version-tag:hover { color: #fff; text-decoration: underline; }

/* 変更履歴モーダル */
.changelog-box { max-width: 480px; text-align: left; }
.changelog-list { margin: 4px 0 4px; max-height: 55vh; overflow-y: auto; }
.changelog-item { padding: 12px 2px; border-bottom: 1px solid var(--border); }
.changelog-item:last-child { border-bottom: none; }
.changelog-head { display: flex; align-items: baseline; gap: 10px; }
.changelog-v { font-weight: 800; font-size: 14px; color: var(--primary); letter-spacing: .03em; }
.changelog-date { font-size: 11px; color: var(--muted); }
.changelog-note { font-size: 13px; line-height: 1.7; color: var(--text); margin-top: 5px; }

/* メンバー管理（マスター用） */
.admin-box { max-width: 440px; text-align: left; }
/* 一覧は中だけスクロールさせ、下の「デモ招待」と「閉じる」が画面内に収まるようにする */
.admin-list { margin: 6px 0 4px; max-height: 34vh; overflow-y: auto; }
.admin-loading { color: var(--muted); font-size: 14px; padding: 10px 0; text-align: center; }
.admin-user {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.admin-user-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.admin-user-name { font-weight: 700; font-size: 15px; }
.admin-user-status { font-size: 12px; }
.admin-user-status.set { color: var(--ok); }
.admin-user-status.temp { color: var(--accent); }

/* デモ招待（期限付きデモパスワードの発行） */
.demo-pass-box {
  margin-top: 12px; padding: 12px 14px;
  background: #fdf7ec; border: 1px dashed #e3c98f; border-radius: 12px;
  font-size: 13px; text-align: left;
}
.demo-pass-title { font-weight: 700; color: #7a5a22; margin-bottom: 6px; }
.demo-pass-status-row { margin-bottom: 8px; }
.demo-pass-status.on { color: var(--ok); font-weight: 700; }
.demo-pass-status.off { color: var(--muted); }
.demo-pass-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-pass-actions label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #7a5a22; }
.demo-pass-actions select {
  font-family: inherit; font-size: 13px; padding: 6px 8px;
  border: 1px solid #e3c98f; border-radius: 8px; background: #fff; color: var(--text);
}
.demo-pass-hint { color: #a08150; font-size: 11.5px; margin-top: 8px; }

/* 発行結果（コピーできる形で表示） */
.demo-pass-result {
  margin-top: 10px; padding: 10px 12px;
  background: #fffdf6; border: 1px solid #e3c98f; border-radius: 10px;
}
.demo-pass-result-title { font-weight: 700; color: var(--ok); margin-bottom: 8px; }
.demo-pass-cred-grid {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 6px 8px; align-items: center;
}
.demo-pass-cred-label { color: #7a5a22; font-size: 12.5px; white-space: nowrap; }
.demo-pass-cred-input {
  font-family: inherit; font-size: 14px; padding: 6px 8px;
  border: 1px solid #e3c98f; border-radius: 8px; background: #fff; color: var(--text);
  width: 100%; min-width: 0;
}
.demo-pass-cred-input.pw {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Courier New", monospace;
  letter-spacing: 0.5px; font-weight: 700;
}
.demo-copy-btn { white-space: nowrap; }
.demo-copy-btn.copied { background: var(--ok); color: #fff; border-color: var(--ok); }
.demo-pass-result-exp { color: #7a5a22; font-size: 12px; margin-top: 8px; }
.demo-pass-result-actions { margin-top: 8px; }

/* データの控え（管理者バックアップ）：デモ招待（黄）と区別しやすい青系 */
.admin-backup-box {
  margin-top: 12px; padding: 12px 14px;
  background: #f0f5fd; border: 1px dashed #a9c4ea; border-radius: 12px;
  font-size: 13px; text-align: left;
}
.admin-backup-title { font-weight: 700; color: #33568a; margin-bottom: 8px; }
.admin-backup-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-backup-hint { color: #6e86a8; font-size: 11.5px; margin-top: 8px; }

/* デモモードの案内バナー */
.demo-banner {
  background: #fff6e5; color: #8a5a00;
  border: 1px solid #ffd591; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 18px;
  font-size: 14px; line-height: 1.6;
}

/* ログイン画面・パスワード変更（全面オーバーレイ） */
.auth-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: rgba(38, 49, 77, .55); backdrop-filter: blur(3px);
  padding: 20px;
}
.auth-box {
  width: 100%; max-width: 360px;
  background: var(--panel); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(30,40,90,.35);
  padding: 30px 26px; text-align: center;
  /* 中身が画面より縦に長くなっても、必ずスクロールして下のボタンに届くようにする */
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.auth-logo img { width: 56px; height: 56px; }
.auth-box h2 { margin: 12px 0 4px; font-size: 20px; color: var(--text); }
.auth-sub { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.auth-box input {
  width: 100%; margin: 7px 0; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 15px; color: var(--text); background: #fff;
}
.auth-box input:focus { outline: none; border-color: var(--primary); }
.auth-btn { width: 100%; margin-top: 14px; }
.auth-actions { display: flex; gap: 10px; margin-top: 14px; }
.auth-actions .btn { flex: 1; }
.auth-error {
  background: #fdecec; color: var(--danger);
  border: 1px solid #f6c6c8; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 12px; text-align: left;
}

/* ---- 出産手当金支給申請書の作成モーダル ---- */
.teate-box { max-width: 640px; text-align: left; }
.teate-box h2 { text-align: center; }
.teate-sec {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px 8px; margin: 12px 0; background: #fafcff;
}
.teate-sec-calc { background: #f0f7fd; border-color: #cfe4f5; } /* 申請内容＝アプリ計算値の水色 */
.teate-sec-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.teate-clear-btn { margin-left: auto; font-size: 11.5px; padding: 4px 10px; }
.teate-save-note, .teate-nosave-note, .teate-calc-note {
  font-size: 11px; font-weight: 600; border-radius: 8px; padding: 2px 8px; margin-left: 6px; white-space: nowrap;
}
.teate-save-note { background: #e7f3ea; color: #2c7a45; }
.teate-nosave-note { background: #fdf0e7; color: #b05c1e; }
.teate-calc-note { background: #e2eff9; color: #22699c; }
.teate-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; }
.teate-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.teate-grid .teate-wide { grid-column: 1 / -1; }
.teate-grid input, .teate-grid select {
  font-family: inherit; font-size: 14.5px; padding: 9px 11px; margin: 0;
  border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: #fff;
}
.teate-grid input:focus, .teate-grid select:focus { outline: none; border-color: var(--primary); }
/* 生年月日の下に和暦（元号）を小さく表示。空のときは高さを取らない。 */
.teate-wareki { font-size: 12px; font-weight: 600; color: var(--primary); min-height: 1em; }
.teate-wareki:empty { display: none; }
/* 生年月日の「年（和暦併記）／月／日」プルダウン。選ぶ段階で和暦が見えるようにするための構成。 */
.birth-selects { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.birth-selects select { padding: 9px 6px; }
.birth-selects .birth-y { min-width: 128px; }
.birth-u { font-size: 12px; color: var(--muted); margin: 0 4px 0 1px; }
.teate-hint { font-size: 11.5px; color: var(--muted); margin: 8px 0 4px; line-height: 1.6; }
.teate-mail-text {
  width: 100%; font-family: inherit; font-size: 13px; line-height: 1.7;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); background: #fff; resize: vertical; white-space: pre-wrap;
}
.teate-mail-text:focus { outline: none; border-color: var(--primary); }
@media (max-width: 640px) {
  .teate-grid { grid-template-columns: 1fr; }
}

/* 企業リストの「会社情報（事業主証明欄用）」チップと編集フォーム */
.company-box { max-width: 560px; text-align: left; }
.company-box h2, .company-box .auth-sub { text-align: center; }
.company-box .admin-list { max-height: 52vh; }
.company-cert-chip {
  font-size: 11px; font-weight: 600; border-radius: 8px; padding: 2px 8px;
  background: #f0f0f3; color: var(--muted); white-space: nowrap; align-self: flex-start;
}
.company-cert-chip.ok { background: #e7f3ea; color: #2c7a45; }
.company-row-btns { display: flex; gap: 6px; flex-shrink: 0; }
.company-cert-form {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin: 4px 0 10px; background: #fafcff;
}
.company-unreg-head {
  margin-top: 14px; padding: 6px 4px; font-size: 12px; font-weight: 700;
  color: var(--muted); border-bottom: 1px solid var(--border);
}

/* ========== 出産・育児 手続き管理 ========== */

/* ヘッダーの切替ボタン（アクティブ時は白抜き） */
.link-btn.nav-btn.active { background: #3d9950; color: #fff; box-shadow: inset 0 2px 4px rgba(0,0,0,.18); }

.alert-banner .alert-tag {
  display: inline-block; background: #ffe0cc; color: #b0521f;
  border-radius: 6px; padding: 0 6px; font-size: 11px; font-weight: 700; margin-right: 2px;
}

.mat-head {
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 5;
  background: var(--bg); padding: 10px 0; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.mat-title { margin: 0; font-size: 20px; color: var(--text); }
.nav-back { background: #fff; border: 1px solid var(--primary); color: var(--primary-dark); font-weight: 700; white-space: nowrap; }
.nav-back:hover { background: #eef2ff; }
.mat-lead { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0 0 18px; }

/* 出産・育児ページのマスコット（茶柴のお母さん＋赤ちゃん大吉くん） */
.mat-intro { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; }
.mat-intro .mat-lead { flex: 1; margin: 0; }
.mat-mascot { width: 200px; flex-shrink: 0; }
@media (max-width: 640px) {
  .mat-intro { flex-direction: column; }
  .mat-mascot { width: 170px; }
}

/* 登録フォーム */
.mat-form-title { font-weight: 700; font-size: 15px; margin-bottom: 12px; color: var(--text); }
.mat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; margin-bottom: 12px;
}
.mat-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); position: relative; }
/* ラベル行の右端に置く小さなリンク風ボタン（例：会社名の横の「会社の登録・詳細登録」） */
.label-side-btn { position: absolute; top: -1px; right: 0; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 600;
  color: #2c7a45; text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: #1d5731; }
.mat-grid input, .mat-grid select {
  font-family: inherit; font-size: 15px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: #fff;
}
.mat-grid input:focus, .mat-grid select:focus { outline: none; border-color: var(--primary); }
.mat-form-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* チェックボックスと説明文を横1行に並べるラベル。
   下の .mat-check（24px角のチェック枠・一覧の完了マーク用）と同じ名前を使うと、
   枠の中に文字とチェックボックスが重なって読めなくなるため、別の名前にしている */
.mat-check-line { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text); }
.mat-check-line input[type="checkbox"] {
  width: 16px; height: 16px; flex: none; margin: 0; padding: 0; border: none; border-radius: 0;
}
.mat-note-input {
  flex: 1; min-width: 160px; font-family: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: #fff;
}
.mat-note-input:focus { outline: none; border-color: var(--primary); }

/* ケース一覧 */
.mat-list { margin-top: 22px; display: flex; flex-direction: column; gap: 18px; }
.mat-case {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 22px; box-shadow: var(--shadow); border-left: 5px solid var(--primary);
}
.mat-case.case-done { opacity: .72; border-left-color: var(--ok); }
/* アラート：1週間前から黄（少し太く）、期限到来・超過で赤（さらに太く）、完了で青に戻る */
.mat-case.alert-warn { border-left-color: #f5b301; border-left-width: 9px; }
.mat-case.alert-urgent { border-left-color: var(--danger); border-left-width: 13px; }

/* メイン画面の出産・育児お知らせバナー */
.mat-alert-banner {
  background: linear-gradient(135deg, #fff8e6, #fff0f0);
  border: 1px solid #ffd9a8; border-radius: 14px;
  padding: 14px 18px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.mat-alert-banner .mba-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-weight: 700; color: #b0521f; font-size: 14px; margin-bottom: 8px;
}
.mat-alert-banner ul { margin: 0; padding-left: 20px; }
.mat-alert-banner li { font-size: 13px; margin: 4px 0; color: #7a4a34; }
.mat-alert-banner li.warn { color: #8a5a00; }
.mat-alert-banner li.urgent { color: var(--danger); font-weight: 700; }
.mat-alert-banner .mba-who {
  display: inline-block; background: #ffe0cc; color: #b0521f;
  border-radius: 6px; padding: 0 6px; font-size: 11.5px; font-weight: 700; margin-right: 4px;
}

.mat-case-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mat-case-id {
  display: flex; gap: 10px; align-items: flex-start; flex: 1; min-width: 0;
  cursor: pointer; border-radius: 8px; padding: 4px 6px; margin: -4px -6px;
}
.mat-case-id:hover { background: rgba(79, 110, 247, .06); }
.mat-caret { color: var(--muted); font-size: 12px; margin-top: 4px; flex: 0 0 auto; user-select: none; }
.mat-case-idtext { min-width: 0; }
.mat-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mat-summary-chip { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eef1f8; color: var(--muted); }
.mat-summary-chip.plain { background: #eef1f8; color: var(--text); }
.mat-summary-chip.ok { background: #e4f7ee; color: #1f8a5b; }
.mat-summary-chip.soon { background: #fff0e0; color: #b0521f; }
.mat-summary-chip.over { background: #fdecec; color: var(--danger); }
.mat-summary-chip.none { background: #eef1f8; color: var(--muted); }
.mat-summary-chip.done { background: #e9edf5; color: var(--muted); }
.mat-foot { margin-top: 22px; text-align: center; }

/* 折りたたみ時の「次の期限」帯（大きめで見やすく） */
.mat-nextdue {
  margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 10px 14px; border-radius: 12px;
  background: #eef2fb; color: var(--text); font-size: 15px;
}
.mat-nextdue .nd-label {
  font-size: 12px; font-weight: 800; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; background: rgba(79, 110, 247, .14); color: var(--primary-dark);
}
.mat-nextdue .nd-title { font-size: 16px; font-weight: 800; }
.mat-nextdue .nd-date { font-size: 15px; font-weight: 800; }
.mat-nextdue.soon { background: #fff2dc; color: #8a5a00; }
.mat-nextdue.soon .nd-label { background: #ffd591; color: #8a5a00; }
.mat-nextdue.over { background: #fdecec; color: var(--danger); }
.mat-nextdue.over .nd-label { background: #f6c6c8; color: var(--danger); }
.mat-nextdue.done { background: #e9edf5; color: var(--muted); font-weight: 700; font-size: 14px; }
.mat-nextdue.none { background: #eef1f8; color: var(--muted); font-weight: 600; font-size: 14px; }
.mat-case-company { font-size: 15px; font-weight: 700; color: var(--text); }
.mat-case-person { font-size: 14px; color: var(--text); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mat-case-tools { display: flex; gap: 2px; flex-shrink: 0; align-items: center; }
/* ご本人へお渡しする案内だけ「さくら色の母子手帳」アイコン＋桜色の座布団を敷き、
   細い仕切りで事務所用ボタン（🖨️✏️✔🗑️）と区別する（デザイナー案1・所長採用）。
   緑基調の画面で唯一の桜色＝お母さんになる方へのお渡しもの、の特別感 */
.mat-case-tools .guide-btn {
  background: #fdeef2; border-radius: 8px;
  display: inline-flex; align-items: center;
  padding: 5px 7px; /* 高さ28px＝隣の絵文字ボタンと揃える */
}
.mat-case-tools .guide-btn svg { display: block; }
.mat-case-tools .guide-btn:hover { background: #f9dce5; }

/* 出産手当金申請書ボタン：青い座布団（桜色＝ご本人へのお渡しもの／青＝役所へ出す申請書）。
   仕切り線はこのボタンの後ろ＝「お渡し・提出もの」と事務所用ボタン（🖨️✏️✔🗑️）の境目 */
.mat-case-tools .teate-btn {
  background: #e8f1fb; border-radius: 8px;
  margin-right: 8px; position: relative;
  display: inline-flex; align-items: center;
  padding: 5px 7px;
}
.mat-case-tools .teate-btn svg { display: block; }
.mat-case-tools .teate-btn::after {
  content: ""; position: absolute; right: -5px; top: 3px; bottom: 3px;
  border-right: 1px solid var(--border);
}
.mat-case-tools .teate-btn:hover { background: #d8e7f7; }

.kind-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.kind-badge.kind-self { background: #e7ecff; color: #3b56d4; } /* 青下地は青文字（固定色） */
.kind-badge.kind-spouse { background: #e4f7ee; color: #1f8a5b; }
.kind-badge.multiple { background: #fff0e0; color: #b0521f; }
.kind-badge.cycle { background: #e7ecff; color: #3b56d4; }
.kind-badge.done { background: #e9edf5; color: var(--muted); }

.mat-dates { margin: 12px 0 4px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.mat-expected { font-weight: 700; color: var(--text); }
.mat-actual.set { color: #1f8a5b; font-weight: 700; }
.mat-actual.none { color: var(--muted); }

.mat-note { font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }

.mat-actual-input {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f7f9ff; border: 1px dashed #c9d4f5; border-radius: 12px;
  padding: 12px 14px; margin: 12px 0; font-size: 13px;
}
.mat-actual-input label { font-weight: 700; color: var(--text); }
.mat-actual-input input[type=date] {
  font-family: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
.mat-actual-hint { color: var(--muted); font-size: 12px; }

/* 進捗バー */
.mat-progress { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; }
.mat-progress-bar { flex: 1; height: 8px; background: #eef1f8; border-radius: 999px; overflow: hidden; }
.mat-progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #57c98a); transition: width .3s; }
.mat-progress-label { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* 手続きタスク */
.mat-tasks { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.mat-task { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
/* 完了した手続きは小さく・控えめに（縦の長さを抑える） */
.mat-task.done { background: #f6f8fa; padding: 7px 12px; gap: 8px; }
.mat-task.done .mat-check { width: 20px; height: 20px; font-size: 12px; }
.mat-task.done .mat-task-title { text-decoration: line-through; color: var(--muted); font-size: 13px; font-weight: 600; }
.mat-done-date { font-size: 12px; font-weight: 700; color: #1f8a5b; white-space: nowrap; }
.mat-check {
  width: 24px; height: 24px; flex-shrink: 0; border: 2px solid var(--check-border); border-radius: 7px;
  background: #fff;
  display: grid; place-items: center; cursor: pointer; color: #fff; font-weight: 800; font-size: 14px; transition: .15s;
}
.mat-task.done .mat-check { background: var(--ok); border-color: var(--ok); }
.mat-check:hover { border-color: var(--ok); }
.mat-task-body { flex: 1; min-width: 0; }
.mat-task-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 給付の申請ラウンド：支給対象期間・申請期間の表示 */
.mat-kyufu-period {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  margin-top: 6px; padding: 7px 10px;
  background: #f2f6ff; border: 1px solid #d9e3fb; border-radius: 8px;
  font-size: 12.5px; color: #3d4a6b;
}
.mat-kyufu-period b { color: var(--primary-dark); font-weight: 700; }
.mat-kyufu-period .kp-limit { color: var(--muted); font-size: 11.5px; }

/* 復帰の確認ボックス */
.fukki-box {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fdf4ec; border: 1px dashed #ecc9a3; border-radius: 12px;
  padding: 10px 14px; margin: 10px 0; font-size: 13px;
}
.fukki-box .fukki-label { font-weight: 700; color: #7a5322; }
.fukki-box input[type=date] {
  font-family: inherit; font-size: 13.5px; padding: 7px 9px;
  border: 1px solid #e3cf8a; border-radius: 8px; background: #fff; color: var(--text);
}
.fukki-box .fukki-hint { color: #a08150; font-size: 12px; flex-basis: 100%; }
/* 給付申請を完了にした直後の目線誘導（ダイアログの代わりに数秒だけ点灯） */
.fukki-box.fukki-attn { animation: fukkiAttn 1.2s ease-in-out 3; }
@keyframes fukkiAttn {
  0%, 100% { background: #fdf4ec; box-shadow: none; }
  50% { background: #fbe4c8; box-shadow: 0 0 0 3px rgba(236, 160, 80, .35); }
}

/* 手続き行の区分ボタン（出産育児一時金の精算方法／子の扶養先） */
.mat-seg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; }
.mat-seg-label { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.seg-btn {
  font-family: inherit; font-size: 12px; padding: 4px 11px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--muted);
}
.seg-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.seg-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
/* 「未確認」が選ばれたままの状態は警告色で目立たせる（確認漏れの視覚化） */
.seg-btn.on.warn { background: #f0a32f; border-color: #f0a32f; }

/* 申請スケジュール表（折りたたみ） */
.sched-box {
  border: 1px solid var(--border); border-radius: 10px;
  background: #fafbfe; margin: 8px 0; overflow: hidden;
}
.sched-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 700; color: var(--primary-dark);
}
.sched-head:hover { background: #f0f3fb; }
.sched-title { font-weight: 700; }
.sched-meta { font-weight: 600; font-size: 12px; color: var(--muted); }
.sched-ended {
  font-size: 11.5px; font-weight: 700; color: #1f8a5b;
  background: #e3f6ec; border-radius: 999px; padding: 2px 9px;
}
.sched-scroll { overflow-x: auto; }
.sched-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff;
}
.sched-table th {
  text-align: left; font-size: 11.5px; color: var(--muted);
  padding: 6px 10px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  white-space: nowrap; background: #f6f8fd;
}
.sched-table td { padding: 6px 10px; border-bottom: 1px solid #eef1f8; white-space: nowrap; color: var(--text); }
.sched-table .sr-num { color: var(--muted); font-weight: 700; }
.sched-table tr.sr-done td { color: var(--muted); background: #f8faf9; }
.sched-table .st-done { color: #1f8a5b; font-weight: 700; }
.sched-table .st-over { color: var(--danger); font-weight: 700; }
.sched-table .st-now { color: #b06a00; font-weight: 700; }
.sched-table .st-wait { color: var(--muted); }

/* 準備チェック（各手続きの注意点・必要情報・添付書類の吹き出し） */
.prep-box {
  border: 1px dashed #cfd9f2; border-radius: 10px;
  background: #fbfcff; margin-top: 8px; overflow: hidden;
  position: relative;
}
.prep-box::before { /* 吹き出しのしっぽ */
  content: ''; position: absolute; top: -6px; left: 22px;
  width: 10px; height: 10px; background: #fbfcff;
  border-left: 1px dashed #cfd9f2; border-top: 1px dashed #cfd9f2;
  transform: rotate(45deg);
}
.prep-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 12px; cursor: pointer; user-select: none;
  font-size: 12.5px; font-weight: 700; color: var(--primary-dark);
}
.prep-head:hover { background: #f0f3fb; }
.prep-title { font-weight: 800; }
.prep-meta { font-weight: 600; font-size: 11.5px; color: var(--muted); }
.prep-body { padding: 4px 14px 12px; }
.prep-dest {
  font-size: 12px; font-weight: 700; color: var(--text);
  background: #f1f4fc; border-radius: 8px; padding: 6px 10px; margin: 4px 0 8px;
}
.prep-sec { margin: 8px 0; }
.prep-sec-title { font-size: 12px; font-weight: 800; color: var(--primary-dark); margin-bottom: 4px; }
.prep-note { font-size: 12px; color: #8a5b00; line-height: 1.6; }
.prep-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 4px 6px; border-radius: 8px; cursor: pointer;
}
.prep-item:hover { background: #f0f3fb; }
.prep-check {
  flex: none; width: 16px; height: 16px; margin-top: 1px;
  border: 2px solid var(--check-border, #aab4c9); border-radius: 5px;
  background: #fff; font-size: 11px; font-weight: 800; color: #1f8a5b;
  display: grid; place-items: center;
}
.prep-item.on .prep-check { background: #e3f6ec; border-color: #7fc9a4; }
.prep-item-text { font-size: 12.5px; color: var(--text); line-height: 1.55; }
.prep-item.on .prep-item-text { color: var(--muted); }
.prep-src { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.prep-src a { color: var(--primary-dark); }

/* バッジ：復帰済み・時短給付管理中 */
.kind-badge.fukki { background: #e3f6ec; color: #1f8a5b; }
.kind-badge.jitan { background: #eef2ff; color: var(--primary-dark); }
.mat-task-title { font-weight: 700; font-size: 14px; color: var(--text); }
.mat-task-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-top: 4px; }

.cat-tag { font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.cat-tag.cat-menjo { background: #ffe9e9; color: #c33; }
.cat-tag.cat-kyufu { background: #e3f1ff; color: #1667c9; }
.cat-tag.cat-todoke { background: #efe7ff; color: #6b3fd0; }
.cat-tag.cat-kanri { background: #eef1f6; color: var(--muted); }
.cat-tag.cat-kakunin { background: #fff4d6; color: #9a6b00; }

.mat-due { font-size: 11.5px; font-weight: 700; }
.mat-due.due-normal { color: var(--muted); }
.mat-due.due-soon { color: var(--accent); }
.mat-due.due-over { color: var(--danger); }
.mat-due.none { color: #c0c6d4; font-weight: 600; }

/* 産休・育休の期間ボックス */
.mat-periods {
  background: #f7f9ff; border: 1px solid #dce4fb; border-radius: 12px;
  padding: 14px 16px; margin: 12px 0;
}
.mat-periods.empty { color: var(--muted); font-size: 13px; }
.mat-periods-head { font-weight: 800; font-size: 14px; color: var(--primary-dark); margin-bottom: 10px; }
.mat-periods-hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

.period-block { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.period-block:last-child { margin-bottom: 0; }
.period-block.primary { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,110,247,.12); }
.period-block-title { font-weight: 700; font-size: 12.5px; color: var(--text); margin-bottom: 6px; }
.period-block.primary .period-block-title { color: var(--primary-dark); }

.period-rows { display: flex; flex-direction: column; gap: 3px; }
.period-row { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.period-row .pr-label { flex: 0 0 130px; color: var(--muted); font-weight: 600; }
.period-row .pr-range { flex: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.period-row .pr-days { flex: 0 0 auto; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.period-row.total { border-top: 1px dashed var(--border); margin-top: 3px; padding-top: 5px; }
.period-row.total .pr-label, .period-row.total .pr-days { color: var(--primary-dark); }
.period-row.iku .pr-label { color: #1f8a5b; }

@media (max-width: 640px) {
  .period-row { flex-wrap: wrap; }
  .period-row .pr-label { flex-basis: 100%; }
}

/* ケース編集 */
.mat-case-edit { border-left-color: var(--accent); }
.mat-edit-hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

@media (max-width: 640px) {
  .mat-grid { grid-template-columns: 1fr; }
}

/* ---- 印刷用スケジュール表 -------------------------------------------------
   ふだんは非表示。🖨️ボタンで body に .printing が付き、印刷時だけ
   この表「だけ」が印刷される（アプリ画面は印刷に含めない）。 */
.print-sheet { display: none; }

@media print {
  body.printing { background: #fff !important; }
  body.printing .app-header,
  body.printing .container,
  body.printing .toast { display: none !important; }
  body.printing .print-sheet { display: block; }
}

.print-sheet {
  color: #000; background: #fff;
  font-size: 12px; line-height: 1.6;
  padding: 4mm 2mm;
}
.print-sheet .p-head { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 12px; }
.print-sheet h1 { font-size: 19px; margin: 0; }
.print-sheet .p-made { font-size: 11px; }
.print-sheet h2 { font-size: 14px; margin: 16px 0 6px; border-left: 4px solid #444; padding-left: 8px; }
.print-sheet .p-small { font-size: 11px; font-weight: 400; }
.print-sheet .p-table { width: 100%; border-collapse: collapse; }
.print-sheet .p-table th, .print-sheet .p-table td { border: 1px solid #666; padding: 5px 8px; text-align: left; vertical-align: top; }
.print-sheet .p-table th { background: #efefef; font-weight: 700; white-space: nowrap; }
.print-sheet .p-info th { width: 90px; }
.print-sheet .p-tasks .p-num { text-align: center; width: 26px; }
.print-sheet .p-tasks td:nth-child(2) { white-space: nowrap; }
.print-sheet .p-tasks td:nth-child(4), .print-sheet .p-tasks td:nth-child(5) { white-space: nowrap; }
.print-sheet .p-desc { font-size: 10px; color: #444; margin-top: 2px; }
.print-sheet .p-done td { color: #666; background: #f7f7f7; }
.print-sheet .p-note { margin-top: 10px; font-size: 12px; }
.print-sheet .p-foot { margin-top: 14px; font-size: 10px; color: #444; border-top: 1px solid #999; padding-top: 6px; }

/* ご本人（被保険者）用の案内：スタッフ用の管理表よりやわらかい体裁。
   モノクロ印刷でも読めるよう、色に頼らず線の細さ・角丸・余白で差をつける */
.print-sheet .g-for { font-size: 16px; font-weight: 700; margin: 2px 0 6px; }
.print-sheet .g-company { font-size: 12px; font-weight: 400; color: #444; }
.print-sheet .g-lead { font-size: 12.5px; margin: 0 0 6px; }
.print-sheet .g-period th { width: 170px; }
.print-sheet .g-days { white-space: nowrap; text-align: right; width: 52px; }
.print-sheet .g-note { font-size: 10.5px; color: #444; margin: 6px 0 2px; }
/* ②の冒頭に置く「お金が入るまでの流れ」。日付は出さず、順番と待ち時間だけ示す。
   案内は表面＝①②／裏面＝③④の2ページに収める設計のため、余白は詰めておく */
.print-sheet .g-flow { font-size: 10.5px; line-height: 1.5; background: #f4f7f6; border-radius: 8px; padding: 5px 9px; margin: 4px 0 2px; }
.print-sheet .g-money th { width: 128px; }
.print-sheet .g-th-sub { font-size: 9.5px; font-weight: 400; color: #555; }
.print-sheet .g-sub { font-size: 10px; color: #444; }
.print-sheet .g-money td, .print-sheet .g-period td, .print-sheet .g-docs td { border-color: #999; }
.print-sheet .g-money th, .print-sheet .g-period th, .print-sheet .g-docs th { border-color: #999; background: #f3f3f3; }
/* ③ご用意いただくもの：行数が多いので少し詰める。書類名は折り返し可（white-space解除） */
.print-sheet .g-docs th { width: 150px; white-space: normal; }
.print-sheet .g-docs td { font-size: 11px; }
/* ②の下に置く「上乗せの給付」の囲み。モノクロ印刷でも目立つよう太めの枠＋淡い地。
   金額・割合は載せない（本人向け文書の方針）。要件・期間の目安と「個別にご案内」まで。 */
.print-sheet .g-uwanose { border: 1.5px solid #555; border-radius: 8px; padding: 6px 10px; margin: 6px 0 2px; background: #fafafa; }
.print-sheet .g-uwanose-title { font-size: 11.5px; font-weight: 700; margin-bottom: 4px; }
.print-sheet .g-uwanose-intro { font-size: 10px; color: #444; margin-bottom: 6px; line-height: 1.5; }
.print-sheet .g-uwanose-list { margin: 0; padding-left: 16px; font-size: 10px; color: #333; }
.print-sheet .g-uwanose-list li { margin: 4px 0; line-height: 1.45; }
.print-sheet .g-uwanose-tag { display: inline-block; font-size: 9.5px; font-weight: 700; color: #222; background: #ececec; padding: 1px 7px; border-radius: 4px; margin-bottom: 2px; }
.print-sheet .g-uwanose-sub { margin: 3px 0 0; padding-left: 16px; }
.print-sheet .g-uwanose-sub li { margin: 2px 0; }
.print-sheet .g-uwanose-foot { font-size: 10px; color: #444; margin-top: 6px; line-height: 1.5; }
/* ③の追加でご本人用の案内は2ページ（両面で1枚）になるため、
   途中で切れると読みにくい部品（表の行・お願いの箱・見出し直後）では改ページしない。
   さらに ①②＝表面／③④＝裏面 で必ず切り替え（若手社労士レビュー：表の行間で
   中途半端に割れるより、紙をめくる場所を固定した方が読みやすい） */
.print-sheet .p-table tr, .print-sheet .g-todo-item, .print-sheet .g-uwanose { page-break-inside: avoid; }
.print-sheet h2 { page-break-after: avoid; }
/* 案内は3ページ（両面印刷で2枚）。①②／上乗せ枠＋③／④ で必ず切り替える。
   実測（A4・余白12mm＝1ページ1032px相当）で P1=809 / P2=933 / P3=470（最も長くなる
   受取代理＋多胎＋扶養selfのケース）。表の行の途中で割れるより、めくる場所を固定する。 */
.print-sheet .g-uwanose, .print-sheet .g-page3 { page-break-before: always; }
/* 裏面への誘導。画面確認時は意味がないので印刷時のみ表示 */
.print-sheet .g-turn { display: none; }
@media print {
  .print-sheet .g-turn { display: block; text-align: right; font-size: 10px; color: #444; margin-top: 10px; }
}

/* 産休・育休の申出書（ご本人→会社）：📗案内のあとに1枚ずつ。
   本人が書くのは申出日と署名だけなので、記入欄は大きめ・線ははっきりと */
.print-sheet .m-form { page-break-before: always; padding-top: 10mm; }
.print-sheet .m-form h1 { text-align: center; font-size: 18px; margin: 0 0 16px; letter-spacing: .2em; }
.print-sheet .m-to { font-size: 14px; margin: 0 0 14px; }
.print-sheet .m-date { text-align: right; font-size: 13px; margin: 0 0 6px; }
.print-sheet .m-sign { text-align: right; font-size: 13px; margin: 0 0 16px; }
.print-sheet .m-line { display: inline-block; border-bottom: 1px solid #000; min-width: 180px; text-align: center; }
.print-sheet .m-blank { display: inline-block; min-width: 34px; border-bottom: 1px solid #000; }
.print-sheet .m-lead { font-size: 13px; margin: 0 0 10px; }
.print-sheet .m-table th { width: 190px; border-color: #999; background: #f3f3f3; white-space: normal; }
.print-sheet .m-table td { border-color: #999; font-size: 13px; }
.print-sheet .m-small { font-size: 11px; }
/* 実際の日をあとから手書きする行。予定日の行と見分けがつくよう、見出しの地色を落として
   「まだ埋まっていない欄」であることを見た目で示す（モノクロ印刷でも差が出る濃さ） */
/* 案内と切り離されたときに誰の用紙か分かるようにする控えめな1行（署名の代わりではない） */
.print-sheet .m-owner { text-align: right; font-size: 10px; color: #555; margin: -10px 0 10px; }
/* 受付欄の中の、育介法21条（個別周知・意向確認）の実施記録 */
.print-sheet .m-office-check { margin-top: 5px; padding-top: 5px; border-top: 1px dotted #bbb; }
.print-sheet .m-fill th { background: #fff; font-weight: 400; }
.print-sheet .m-fill th .m-small { color: #555; }
.print-sheet .m-note { font-size: 10.5px; color: #444; margin-top: 8px; }
.print-sheet .m-office { margin-top: 22px; border: 1px dashed #999; border-radius: 6px; padding: 8px 12px; font-size: 11.5px; }
.print-sheet .g-todo { margin-top: 4px; }
.print-sheet .g-todo-item {
  border: 1px solid #999; border-radius: 8px;
  padding: 6px 10px; margin-bottom: 6px; font-size: 12px;
}

/* ---- タスクの企業名 --------------------------------------------------------
   タスクに付ける企業名（登録リストから選択）。タグ表示とセレクトの見た目。 */
.company-tag {
  display: inline-block;
  background: #eef4ff; color: #3b56d4;
  border: 1px solid #d5e0ff; border-radius: 20px;
  padding: 2px 10px; font-size: 11.5px; font-weight: 700;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}
.company-select {
  font-family: inherit; font-size: 13.5px;
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: #fbfcfe; color: var(--text); outline: none;
  flex: 1; min-width: 0; max-width: 100%;
}
.company-select:focus { border-color: var(--primary); background: #fff; }
.edit-actions .company-select { flex: 1; }

/* ---- 給与計算（月次）管理 ---------------------------------------------------
   出産・育児管理（.mat-*）の見た目を土台に、給与計算特有の部分だけ追加。 */

/* 給与計算ページのマスコット（PCで給与計算をする大吉くん） */
.pay-mascot { width: 220px; }
@media (max-width: 640px) {
  .pay-mascot { width: 185px; }
}
.pay-form-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pay-form-grid label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.pay-form-grid input, .pay-form-grid textarea {
  display: block; width: 100%; margin-top: 5px;
  font-family: inherit; font-size: 14px; font-weight: 400; color: var(--text);
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  background: #fbfcfe; outline: none;
}
.pay-form-grid input:focus, .pay-form-grid textarea:focus { border-color: var(--primary); background: #fff; }
.pay-form-grid textarea { resize: vertical; min-height: 54px; }

.pay-memo {
  background: #fff9e8; border: 1px solid #f3e2ad; border-radius: 10px;
  padding: 10px 14px; font-size: 13.5px; color: #6b5b1e;
  margin: 10px 0 4px; white-space: pre-wrap; word-break: break-word;
}
/* 「毎月必ずチェックすること」（全社共通の覚え）— 給与計算画面の上部に常時表示 */
.pay-note {
  background: #fff9e8; border: 1px solid #f3e2ad; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 16px;
}
.pay-note-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: #6b5b1e;
}
.pay-note-head .icon-btn { margin-left: auto; }
.pay-note-body {
  margin-top: 8px; font-size: 13.5px; color: #6b5b1e;
  white-space: pre-wrap; word-break: break-word;
}
.pay-note-empty { margin-top: 8px; font-size: 13px; color: #a99a56; }
.pay-note-edit textarea {
  width: 100%; min-height: 84px; margin-top: 10px;
  font-family: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid #e3cf8a; border-radius: 10px;
  background: #fffdf5; color: #5b4d16; outline: none; resize: vertical;
  box-sizing: border-box;
}
.pay-note-edit textarea:focus { border-color: #d3b95e; background: #fff; }
.pay-note-edit .edit-actions { margin-top: 10px; }

.pay-month-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 6px; }
.pay-ym { font-size: 15px; font-weight: 700; color: var(--primary-dark); }
.pay-nav { padding: 6px 10px; }
.pay-progress { flex: 1; min-width: 160px; margin: 0; }

/* 項目のタグ（毎回／この月のみ）と削除ボタン */
.cat-tag.cat-every { background: #e8f4ff; color: #1668b8; border: 1px solid #c4e0f8; }
.cat-tag.cat-once { background: #fdeef7; color: #b0387f; border: 1px solid #f5cbe4; }
.pay-item-del { margin-left: auto; flex: 0 0 auto; }
.pay-empty-month { font-size: 13px; color: var(--muted); padding: 14px 6px; text-align: center; }

/* 項目の登録フォーム（カード内） */
.pay-add { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.pay-add-title { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.pay-add input[type=text] {
  width: 100%; font-family: inherit; font-size: 14px;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  background: #fbfcfe; color: var(--text); outline: none; margin-bottom: 8px;
}
.pay-add input[type=text]:focus { border-color: var(--primary); background: #fff; }
.pay-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pay-repeat-sel { flex: 0 1 auto; width: auto; min-width: 170px; }
.pay-ym-input {
  font-family: inherit; font-size: 13.5px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: #fbfcfe; color: var(--text); outline: none;
}
.pay-ym-input:focus { border-color: var(--primary); background: #fff; }

/* デモバナー（案内文＋リセットボタン） */
.demo-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.demo-banner span { flex: 1; min-width: 220px; }
.demo-reset-btn { flex: 0 0 auto; }

/* ---- 大吉くん わくわく演出 --------------------------------------------------
   社員さんが触っていて楽しくなる、親しみのある動きたち。
   ※「視差効果を減らす」設定のパソコンでは自動でオフになります（最下部）。 */

/* 大吉くんのひとこと吹き出し（ヘッダー） */
.daikichi-says {
  display: inline-block; position: relative;
  background: rgba(255,255,255,.94); color: var(--text);
  border-radius: 999px; padding: 3px 12px;
  font-size: 12.5px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.daikichi-says::before { /* ロゴの大吉くんに向く、吹き出しのしっぽ */
  content: ''; position: absolute; left: -6px; top: 50%; margin-top: -5px;
  border: 5px solid transparent; border-right-color: rgba(255,255,255,.94); border-left: 0;
}
.daikichi-says.pop { animation: dk-pop .35s ease; }
@keyframes dk-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ロゴの大吉くん：ふんわり上下＋なでる（クリック/ホバー）と跳ねる */
.brand .logo { cursor: pointer; }
.brand .logo img { animation: dk-bob 3s ease-in-out infinite; }
@keyframes dk-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.brand .logo img.jump, .brand .logo:hover img { animation: dk-jump .55s ease; }
@keyframes dk-jump {
  0% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-9px) rotate(-8deg); }
  70% { transform: translateY(0) rotate(4deg); }
  100% { transform: translateY(0) rotate(0); }
}

/* 空っぽ画面の大吉くん・おやすみ大吉くんも、そっと呼吸 */
.empty .daikichi { animation: dk-bob 3.4s ease-in-out infinite; }
.shutdown-box .shutdown-ico { animation: dk-breath 3.6s ease-in-out infinite; }
@keyframes dk-breath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }

/* タスク完了のごほうび肉球（クリック位置からポンと飛ぶ） */
.paw-pop {
  position: fixed; z-index: 300; pointer-events: none;
  font-size: 20px; animation: paw-fly .85s ease-out forwards;
}
@keyframes paw-fly {
  0% { opacity: 0; transform: translateY(0) scale(.5); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-36px) scale(1.5); }
}

/* ときどき登場：画面の下をお散歩する大吉くん（クリックでなでられる） */
.dk-walker {
  position: fixed; bottom: 4px; left: 0; z-index: 250; cursor: pointer;
  animation: dk-stroll 25s linear forwards;
}
.dk-walker img {
  display: block; width: 46px; height: auto;
  animation: dk-trot .55s ease-in-out infinite;
}
.dk-walker:hover img { animation: dk-jump .55s ease; }
@keyframes dk-stroll {
  0%   { transform: translateX(-60px); }
  42%  { transform: translateX(46vw); }   /* まんなかあたりで… */
  50%  { transform: translateX(46vw); }   /* ちょっとひと休み */
  100% { transform: translateX(105vw); }
}
@keyframes dk-trot {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

/* お散歩のあとに残る、ちいさな肉球の足あと（ふわっと消える） */
.dk-pawprint {
  position: fixed; z-index: 240; pointer-events: none;
  font-size: 12px; opacity: 0; animation: dk-pawfade 2.4s ease-out forwards;
}
@keyframes dk-pawfade {
  0% { opacity: 0; }
  15% { opacity: .55; }
  100% { opacity: 0; }
}

/* 隠れ大吉くん：画面の下・左・右のふちからひょっこり顔を出してすぐ隠れる */
.dk-peek {
  position: fixed; z-index: 249; cursor: pointer;
}
.dk-peek img { display: block; width: 64px; height: auto; }
/* 下から（既定）：bottom を動かしてひょっこり */
.dk-peek.side-bottom {
  bottom: -76px; transition: bottom .7s cubic-bezier(.34, 1.4, .5, 1);
}
.dk-peek.side-bottom.up { bottom: -8px; }
/* 左のふちから：left を動かし、顔を右（画面の内側）へ向ける */
.dk-peek.side-left {
  left: -76px; transition: left .7s cubic-bezier(.34, 1.4, .5, 1);
}
.dk-peek.side-left.up { left: -8px; }
.dk-peek.side-left img { transform: rotate(90deg); }
/* 右のふちから：right を動かし、顔を左（画面の内側）へ向ける */
.dk-peek.side-right {
  right: -76px; transition: right .7s cubic-bezier(.34, 1.4, .5, 1);
}
.dk-peek.side-right.up { right: -8px; }
.dk-peek.side-right img { transform: rotate(-90deg); }

/* お散歩のレアキャラ演出 */
.dk-walker.dk-family img { width: 62px; }               /* 家族（お母さん＋赤ちゃん）は少し大きめに */
.dk-walker.dk-rare-sparkle img {                        /* 激レア：キラキラ縁取り */
  animation: dk-trot .55s ease-in-out infinite, dk-sparkle 1.2s ease-in-out infinite;
}
.dk-walker .dk-crown {                                  /* 王冠は頭の上でふわり */
  position: absolute; left: 50%; top: -12px; transform: translateX(-50%);
  font-size: 15px; pointer-events: none; animation: dk-bob 1.4s ease-in-out infinite;
}
@keyframes dk-sparkle {
  0%, 100% { filter: drop-shadow(0 0 3px #ffd54a) drop-shadow(0 0 6px #ff9900); }
  50%      { filter: drop-shadow(0 0 6px #fff3b0) drop-shadow(0 0 12px #ffb84d); }
}

/* 未完了のチェック欄にホバーすると、肉球がうっすら現れる */
.task-item:not(.done) .check:hover::after,
.mat-task:not(.done) .mat-check:hover::after { content: '🐾'; font-size: 11px; opacity: .75; }

/* 触って楽しいホバー（カードがふわっと浮く・ボタンが弾む） */
.stat-card, .memo-item, .task-item, .review-item, .mat-case, .preset-chip {
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-3px); }
.memo-item:hover, .task-item:hover, .review-item:hover, .mat-case:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(60, 80, 160, .16);
}
.preset-chip:hover { transform: translateY(-1px); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

/* 「視差効果を減らす」設定の人には、動きをすべてオフ（酔い・チカチカ対策） */
@media (prefers-reduced-motion: reduce) {
  .brand .logo img, .brand .logo:hover img, .brand .logo img.jump,
  .empty .daikichi, .shutdown-box .shutdown-ico,
  .paw-pop, .daikichi-says.pop { animation: none !important; }
  .stat-card, .memo-item, .task-item, .review-item, .mat-case, .preset-chip, .btn { transition: none; }
  .dk-walker, .dk-peek, .dk-pawprint { display: none !important; } /* お散歩・ひょっこり大吉くんも出さない */
}

/* ---- 携帯（スマホ）での見やすさ最適化 --------------------------------------
   幅640px以下：ヘッダーを縦積みコンパクトに、余白・文字を画面幅に合わせる。 */
@media (max-width: 640px) {
  /* ヘッダー：縦積み・中央寄せ・コンパクト */
  .app-header {
    flex-direction: column; align-items: stretch;
    padding: 14px 14px 12px; gap: 10px;
    border-radius: 0 0 20px 20px;
  }
  .brand { justify-content: center; }
  .brand h1 { font-size: 19px; }
  .daikichi-says { max-width: 210px; font-size: 11.5px; }
  .header-actions { justify-content: center; gap: 6px; }
  .user-badge { text-align: center; }
  .link-btn { font-size: 12px; padding: 7px 10px; }
  .exit-btn { font-size: 12px; padding: 7px 12px; }

  /* ビュー切替は下部タブバーが担うので、ヘッダーのナビボタンは隠す */
  .header-actions .nav-btn { display: none; }
  .mobile-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: #fff; border-top: 1px solid var(--border);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(30, 40, 80, .10);
  }
  .mobile-tabs button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
    border: none; background: none; font-family: inherit; cursor: pointer;
    font-size: 10.5px; font-weight: 700; color: var(--muted);
    padding: 5px 2px; border-radius: 10px;
  }
  .mobile-tabs button span { font-size: 18px; }
  .mobile-tabs button.active { color: var(--primary-dark); background: #eef2ff; }
  body { padding-bottom: 66px; } /* 下部タブバーに本文が隠れないように */

  /* 本文まわり：余白を詰めて画面を広く使う */
  .container { padding: 14px 12px 50px; }
  .dashboard { gap: 10px; }
  .stat-card { padding: 14px 8px; }
  .stat-num { font-size: 26px; }
  .stat-label { font-size: 11.5px; }
  .card { padding: 13px; }

  /* 入力の横並びは折り返しOKに（企業セレクト＋管理ボタン等がはみ出さない） */
  .inline { flex-wrap: wrap; }

  /* タスクのタグ・企業名は幅を抑える */
  .company-tag { max-width: 150px; }

  /* 出産・育児／給与計算の見出しやカード */
  .mat-head { flex-wrap: wrap; gap: 8px; padding: 8px 0; }
  .mat-title { font-size: 17px; }
  .mat-form-row { flex-wrap: wrap; }
  .mat-case { padding: 14px 12px; }
  .pay-month-head { gap: 6px; }
  .pay-ym { font-size: 13.5px; }

  /* デモバナー：縦積みでボタンを押しやすく */
  .demo-banner { flex-direction: column; align-items: stretch; }
  .demo-reset-btn { align-self: flex-end; }

  /* トースト：画面幅に収める */
  .toast { max-width: calc(100vw - 28px); text-align: center; }
}

/* さらに小さい画面（〜400px）：ダッシュボードの数字をひと回り小さく */
@media (max-width: 400px) {
  .stat-num { font-size: 22px; }
  .brand .logo { width: 40px; height: 40px; }
  .brand .logo img { width: 31px; height: 31px; }
}

/* ---- 折りたたみセクション（大項目タップで開閉） -----------------------------
   携帯では最初は閉じた状態（app.js の collapseSectionsForMobile）。
   パソコンでも見出しをクリックすれば畳める。 */
.sec-head { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; }
.sec-head:hover { opacity: .85; }
.sec-caret {
  margin-left: auto; font-size: 14px; color: var(--muted);
  transition: transform .2s ease;
}
.collapsible-sec.collapsed .sec-caret { transform: rotate(-90deg); }
.collapsible-sec.collapsed > :not(.sec-head) { display: none !important; }
/* 閉じているときは見出しの下余白を詰める */
.collapsible-sec.collapsed .sec-head { margin-bottom: 0; }

/* ==== 社会保険の月額変更（随時改定）管理 ====================================
   カード・タスク・進捗・アラートは出産・育児（.mat-）のスタイルを共用し、
   月額変更に固有のバッジと判定ボックスだけをここで定義する。 */

/* ケースのバッジ（昇給・降給・判定結果・短時間） */
.kind-badge.gep-up { background: #e4f7ee; color: #1f8a5b; }
.kind-badge.gep-down { background: #fdeaea; color: #b3392f; }
.kind-badge.gep-wait { background: #f0f2f7; color: var(--muted); }
.kind-badge.gep-hit { background: #ffe9d6; color: #b0521f; }
.kind-badge.gep-miss { background: #e9edf5; color: var(--muted); }
.kind-badge.gep-short { background: #eef4ff; color: var(--primary-dark); }

/* 2等級差の自動判定ボックス */
.gep-judge {
  background: #f7f9ff; border: 1px dashed #c9d4f5; border-radius: 12px;
  padding: 12px 14px; margin: 12px 0; font-size: 13px;
}
.gep-judge-title { font-weight: 700; color: var(--text); margin-bottom: 8px; }
.gep-pay-row {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  padding: 5px 0;
}
.gep-pay-month { font-weight: 700; color: var(--primary-dark); min-width: 12em; }
.gep-pay-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.gep-pay-field input[type=number] {
  font-family: inherit; font-size: 14px; padding: 7px 9px; width: 8.5em;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
.gep-pay-field input[type=number]:focus { outline: none; border-color: var(--primary); }
.gep-judge-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.gep-judge-hint { color: var(--muted); font-size: 12px; }
/* まだ保存していない入力があるときの目印（保存すると消える） */
.gep-unsaved {
  background: #fff3e6; border: 1px solid #f2cfa6; color: #9a5a1c;
  border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700;
}
.gep-unsaved[hidden] { display: none; }
.gep-judge-actions .btn.unsaved { box-shadow: 0 0 0 3px #ffe4c2; }

/* 判定結果（入力待ち・該当・非該当） */
.gep-result { border-radius: 10px; padding: 10px 12px; margin-top: 8px; line-height: 1.7; }
.gep-result.pending { background: #f0f2f7; color: var(--muted); }
.gep-result.hit { background: #fff3e6; border: 1px solid #f2cfa6; color: #7a4a17; }
.gep-result.hit b { color: #b0521f; }
.gep-result.miss { background: #eef1f6; border: 1px solid #d6dcE8; color: #4a566e; }

/* スマホでは判定欄の月ラベルを1行占有にして入力欄を並べやすく */
@media (max-width: 640px) {
  .gep-pay-month { min-width: 0; flex-basis: 100%; }
}

/* ==== 出産育児カードの「分かりやすさ」改善 =================================== */

/* 展開時にも最上部に出す「👉つぎにやること」帯（クリックで該当手続きへ移動） */
.mat-nextdue-hero { cursor: pointer; }
.mat-nextdue-hero .mat-nextdue { margin-top: 10px; }
.mat-nextdue-hero:hover .mat-nextdue { filter: brightness(0.97); }

/* 「つぎにやること」の手続き行を強調 */
.mat-task.next { border-left: 4px solid var(--primary); background: #f7f9ff; }
.next-tag {
  font-size: 11px; font-weight: 800; color: #fff;
  background: var(--primary); border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}

/* 期間の計算内訳（折りたたみの中の期間ブロック） */
.sched-box .period-block { margin: 8px 10px; }

/* フェーズ・ステップバー（産前→産後→育休中→復帰後の現在地） */
.mat-stepbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  margin: 12px 0 2px;
}
.mat-step {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: #f0f2f7; color: var(--muted);
}
.mat-step.past { background: #e4f7ee; color: #1f8a5b; }
.mat-step.now { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(79,110,247,.35); }
.mat-step-arrow { color: var(--muted); font-size: 11px; }

/* フェーズごとの手続きグループ */
.mat-phase { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fafbfe; }
.mat-phase-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  cursor: pointer; user-select: none; font-size: 13px; font-weight: 700; color: var(--text);
}
.mat-phase-head:hover { background: #f2f5fc; }
.mat-phase-head.all-done { color: var(--muted); }
.mat-phase-title { flex: 0 0 auto; }
.mat-phase-meta { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.mat-phase .mat-task { border-left: none; border-right: none; border-radius: 0; }
.mat-phase .mat-task + .mat-task { border-top: none; }
.mat-phase .mat-task.next { border-left: 4px solid var(--primary); } /* 「つぎにやること」の青ラインは残す */
.mat-phase .fukki-box { margin: 8px 10px; }

/* カテゴリタグの凡例（1行） */
.mat-legend {
  font-size: 11.5px; color: var(--muted); margin: 10px 0 6px;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.mat-legend .cat-tag { font-size: 10px; }

/* ==== 「🔔 今日やること」統合バナー ======================================== */
#todayAlert .today-row { cursor: pointer; }
#todayAlert .today-row:hover { text-decoration: underline; }
#todayAlert .mba-src { margin-right: 4px; }
#todayAlert .today-more { margin-top: 8px; }

/* ==== ブロック調UIリニューアル ==============================================
   おもちゃのブロックをモチーフにしたテーマ。
   ・アラートはカテゴリ別の帯（左に色付きブロックのアイコン、右に「確認する」ボタン）
   ・ダッシュボードはポッチ（スタッド）付きのブロック型タイル
   ・検索は丸型＋対象フィルタ                                                     */

/* カテゴリ別アラート帯 */
.alert-stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.alert-band {
  display: flex; align-items: center; gap: 14px;
  border-radius: 16px; padding: 12px 16px; margin-bottom: 0;
  border: 1px solid var(--border); background: #fff;
  box-shadow: var(--shadow);
}
.alert-band.demo-banner { margin-bottom: 18px; } /* デモ帯だけ単独配置なので下余白を持つ */
.band-ico {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 21px; color: #fff;
  position: relative; box-shadow: 0 3px 6px rgba(0, 0, 0, .14);
}
/* アイコンブロックのポッチ */
.band-ico::before {
  content: ""; position: absolute; top: 4px; left: 7px; right: 7px; height: 5px;
  background-image: radial-gradient(circle at 5px 2.5px, rgba(255,255,255,.45) 2.5px, transparent 3.2px);
  background-size: 13px 5px; background-repeat: repeat-x;
}
.band-body { flex: 1; min-width: 0; }
.band-title { font-size: 13.5px; font-weight: 800; line-height: 1.5; }
.band-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.band-body ul { margin: 4px 0 0; padding-left: 18px; }
.band-body li { font-size: 12.5px; margin: 2px 0; color: #4a566e; }
.band-body li.urgent { color: var(--danger); font-weight: 700; }
.band-body li.warn { font-weight: 600; }
.band-body li.more { color: var(--muted); list-style: none; margin-left: -18px; }
.band-btn {
  flex-shrink: 0; align-self: center;
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 9px 14px; border-radius: 12px; background: #fff;
  border: 1.5px solid var(--border); cursor: pointer; white-space: nowrap; transition: .15s;
}
.band-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.10); }
/* 帯の右にボタンを2つ並べるとき（例：勤怠の打刻もれ＝「打刻を追加」と「出勤簿を開く」） */
.band-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex-shrink: 0; align-self: center; }
/* いちばんしてほしい操作（その場で直す）を塗りつぶしで前に出す。
   帯の色ごとの .band-XXX .band-btn（文字色を薄い色に上書きする）より強い指定にしておく。
   地色は --band-teal のままだと13pxの白文字で 2.9:1 しか出ないため、濃いほうの teal（5.2:1）で塗る */
.alert-band .band-btn.primary { background: #1d7a72; border-color: #196a63; color: #fff; }
/* 本日・超過を含む帯は、左のアクセントバーで緊急度をはっきり示す
   （パステル化で警告の強さが失われないように） */
.alert-band.has-urgent { box-shadow: inset 4px 0 0 var(--accent, transparent), var(--shadow); }

/* 帯の色（タスク＝赤／出産育児＝黄／給与計算＝青／月額変更＝紫／デモ＝緑） */
.band-red { background: #fdf3f3; border-color: #f5d5d5; --accent: var(--band-red); }
.band-red .band-ico { background: var(--band-red); }
.band-red .band-title { color: #c23b3b; }
.band-red .band-btn { color: #c23b3b; border-color: #eab9b9; }
.band-yellow { background: #fdf9ec; border-color: #efe0b6; --accent: var(--band-yellow); }
.band-yellow .band-ico { background: var(--band-yellow); }
.band-yellow .band-title { color: #9c6f14; }
.band-yellow .band-btn { color: #9c6f14; border-color: #e5d3a0; }
.band-blue { background: #f0f5fd; border-color: #d4e2f6; --accent: var(--band-blue); }
.band-blue .band-ico { background: var(--band-blue); }
.band-blue .band-title { color: #35619e; }
.band-blue .band-btn { color: #35619e; border-color: #bcd2ef; }
.band-purple { background: #f6f2fd; border-color: #e2d7f6; --accent: var(--band-purple); }
.band-purple .band-ico { background: var(--band-purple); }
.band-purple .band-title { color: #6d4fb8; }
.band-purple .band-btn { color: #6d4fb8; border-color: #d2c3ee; }
.band-green { background: #f0f9f1; border-color: #cfe9d4; }
.band-green .band-ico { background: var(--band-green); }
.band-green .band-title { color: #2e7d3c; }
.band-green .band-btn { color: #2e7d3c; border-color: #b9dfc1; }

/* ブロック型のダッシュボードタイル */
.stat-card {
  display: flex; align-items: center; gap: 10px;
  text-align: left; padding: 20px 16px 16px; border-radius: 16px;
  position: relative;
}
/* タイル上部のポッチ */
.stat-card::before {
  content: ""; position: absolute; top: 5px; left: 16px; right: 16px; height: 7px;
  background-image: radial-gradient(circle at 9px 3.5px, var(--stud, rgba(0,0,0,.06)) 3.5px, transparent 4.5px);
  background-size: 24px 7px; background-repeat: repeat-x;
  pointer-events: none;
}
.stat-ico {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: #fff; display: grid; place-items: center; font-size: 19px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05), 0 2px 5px rgba(0, 0, 0, .08);
}
.stat-num { font-size: 32px; }
.stat-label { margin-top: 0; font-weight: 700; }
.stat-card.tile-memo { background: #f3edff; border-color: #e0d3f7; --stud: #ddccf3; }
.stat-card.tile-memo .stat-num { color: #7a5fd0; }
.stat-card.tile-task { background: #eaf7ec; border-color: #cfe9d4; --stud: #cfe6d4; }
.stat-card.tile-task .stat-num { color: #2e8b40; }
.stat-card.tile-open { background: #e9f1fd; border-color: #cfdff7; --stud: #d0e0f5; }
.stat-card.tile-open .stat-num { color: #3c6fc0; }
.stat-card.tile-due { background: #fdeee3; border-color: #f6d8c2; --stud: #f3d8c1; }
.stat-card.tile-due .stat-num { color: #e07a2a; }

/* 検索：丸型＋対象フィルタ */
.home-search { border-radius: 999px; padding: 6px 8px 6px 18px; }
.search-scope {
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text);
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg);
  padding: 8px 12px; outline: none; cursor: pointer; flex-shrink: 0;
}
.search-scope:focus { border-color: var(--primary); }

/* 最新の振り返り：カレンダーアイコン */
.latest-review .latest-head::before { content: "📅 "; }

/* ブロックの植木鉢の飾り（広い画面のみ・操作の邪魔をしない） */
.deco-blocks {
  position: fixed; left: 14px; bottom: 12px; width: 112px;
  opacity: .95; pointer-events: none; z-index: 1;
}
@media (max-width: 1280px) { .deco-blocks { display: none; } }

/* 帯のスマホ対応：ボタンを下段へ */
@media (max-width: 640px) {
  .alert-band { flex-wrap: wrap; }
  .band-body { flex-basis: calc(100% - 60px); }
  .band-btn, .band-btns { margin-left: auto; }
  .band-btns .band-btn { margin-left: 0; } /* まとまりの中では左寄せのまま並べる */
}

/* ---- ブロック調をすべてのページへ（癒しと遊び心） -------------------------
   見出しの絵は案件に合わせる：📁メモ=黄 ✅タスク=緑 🗓️振り返り=青
   👶出産育児=黄 💰給与計算=青 📈月額変更=紫（アラート帯と同じ色対応） */

/* 見出し用のブロックアイコン（ポッチつき・なでると少し傾く遊び心） */
.page-ico {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 11px; font-size: 20px;
  color: #fff; position: relative; margin-right: 10px; vertical-align: -12px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .14);
  transition: transform .18s ease;
}
.page-ico::before {
  content: ""; position: absolute; top: 4px; left: 6px; right: 6px; height: 5px;
  background-image: radial-gradient(circle at 5px 2.5px, rgba(255,255,255,.45) 2.5px, transparent 3.2px);
  background-size: 13px 5px; background-repeat: repeat-x;
}
.page-ico.sm {
  width: 30px; height: 30px; border-radius: 9px; font-size: 15px;
  margin-right: 8px; vertical-align: -8px;
}
.page-ico.sm::before {
  top: 3px; left: 5px; right: 5px; height: 4px;
  background-image: radial-gradient(circle at 4px 2px, rgba(255,255,255,.45) 2px, transparent 2.6px);
  background-size: 10px 4px;
}
h2:hover .page-ico, .sec-head:hover .page-ico { transform: rotate(-8deg) scale(1.06); }
.ico-yellow { background: var(--band-yellow); }
.ico-blue { background: var(--band-blue); }
.ico-purple { background: var(--band-purple); }
.ico-green { background: var(--band-green); }
.ico-red { background: var(--band-red); }

/* ページの導入カード：各ページのテーマ色のパステル＋ポッチ */
.mat-intro {
  position: relative; border-radius: 16px;
  padding: 20px 18px 14px; margin-bottom: 16px;
  border: 1px solid var(--border); background: #fff;
  box-shadow: var(--shadow);
}
.mat-intro::before {
  content: ""; position: absolute; top: 6px; left: 16px; right: 16px; height: 6px;
  background-image: radial-gradient(circle at 8px 3px, var(--stud, rgba(0,0,0,.06)) 3px, transparent 4px);
  background-size: 22px 6px; background-repeat: repeat-x; pointer-events: none;
}
.mat-intro .mat-lead { color: #5a6478; }
#maternityView .mat-intro { background: #fdf9ec; border-color: #efe0b6; --stud: #ecdcae; }
#payrollView .mat-intro { background: #f0f5fd; border-color: #d4e2f6; --stud: #d3e0f3; }
#geppenView .mat-intro { background: #f6f2fd; border-color: #e2d7f6; --stud: #ddd0f2; }

/* 戻るボタン・検索も全ページ丸く統一 */
.search-bar { border-radius: 999px; }
.nav-back { border-radius: 999px; border-color: #cfe9d4; }
.nav-back:hover { background: #eefaf0; }

/* ==== 🐶 大吉くんの朝礼カード ============================================== */
.chorei-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(135deg, #fff8ec, #fff);
  border: 1px solid #f0dcb8; border-radius: 16px;
  padding: 18px 16px 14px; margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(176, 130, 30, .08);
  position: relative;
}
/* 朝礼カードにもブロックのポッチ（世界観の統一） */
.chorei-card::before {
  content: ""; position: absolute; top: 5px; left: 16px; right: 16px; height: 6px;
  background-image: radial-gradient(circle at 8px 3px, #f2e3c2 3px, transparent 4px);
  background-size: 22px 6px; background-repeat: repeat-x; pointer-events: none;
}
.chorei-dog { width: 52px; height: 52px; flex-shrink: 0; }
.chorei-body { flex: 1; min-width: 0; }
.chorei-head { font-size: 14px; color: var(--text); margin-bottom: 8px; position: relative; padding-right: 26px; }
.chorei-close {
  position: absolute; right: 0; top: -2px;
  border: none; background: none; cursor: pointer;
  color: var(--muted); font-size: 14px; padding: 2px 6px; border-radius: 6px;
}
.chorei-close:hover { background: #f0e6d2; }
.chorei-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text);
  padding: 5px 8px; border-radius: 8px;
}
.chorei-row.done { color: var(--muted); }
.chorei-row.done .chorei-text { text-decoration: line-through; }
.chorei-ico { flex-shrink: 0; }
.chorei-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chorei-ok { color: #1f8a5b; font-weight: 800; font-size: 12px; white-space: nowrap; }
.chorei-donemsg { font-size: 13px; font-weight: 800; color: #b0521f; margin: 6px 0 0 8px; }
.chorei-week { display: flex; gap: 6px; margin-top: 10px; }
.chorei-day {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 10.5px; color: var(--muted); font-weight: 700;
  background: #fff; border: 1px solid #eee1c8; border-radius: 8px;
  min-width: 34px; padding: 3px 4px 1px;
}
.chorei-day b { font-size: 13px; min-height: 18px; }
.chorei-day.today { border-color: var(--primary); color: var(--primary-dark); }
@media (max-width: 640px) {
  .chorei-dog { width: 40px; height: 40px; }
  .chorei-text { white-space: normal; }
}

/* ==== 勤怠（タイムカード） ================================================ */

/* 帯の色（ティール）。既存の band-* と同じ文法 */
.band-teal { background: #ecf7f5; border-color: #cfe8e5; --accent: var(--band-teal); }
.band-teal .band-ico { background: var(--band-teal); }
.band-teal .band-title { color: #1d7a72; }
.band-teal .band-btn { color: #1d7a72; border-color: #b5ddd8; }
.ico-teal { background: var(--band-teal); }

/* ヘッダーの状態チップ（出勤中 9:02〜） */
.tc-chip {
  font-family: inherit; font-size: 12.5px; font-weight: 800;
  padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: .15s;
  background: #fff; color: #1d7a72; border: 1.5px solid #b5ddd8; white-space: nowrap;
}
.tc-chip:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.tc-chip .tc-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #2fb170; margin-right: 5px; animation: tcPulse 2.4s ease-in-out infinite;
}
.tc-chip .tc-dot.brk { background: var(--band-yellow); animation: none; }
@keyframes tcPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .tc-chip .tc-dot { animation: none; } }

/* ホームの打刻カード（ティールの座布団・ブロック調） */
.tc-card {
  display: flex; align-items: center; gap: 14px;
  background: #ecf7f5; border: 1px solid #cfe8e5; border-radius: 16px;
  padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.tc-card .tc-dog { width: 54px; height: 54px; flex-shrink: 0; }
.tc-card-mid { flex: 1; min-width: 0; }
.tc-state { font-size: 14px; font-weight: 800; color: #1d7a72; }
.tc-now { font-size: 24px; font-weight: 800; color: #14554f; letter-spacing: 1px; line-height: 1.2; }
.tc-times { font-size: 12px; color: #4a566e; margin-top: 2px; }
.tc-note { font-size: 12px; color: #b0521f; font-weight: 700; margin-top: 2px; }
.tc-card-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; flex-shrink: 0; }
.tc-card-actions .row { display: flex; gap: 8px; }
.tc-btn {
  font-family: inherit; font-weight: 800; cursor: pointer; transition: .15s;
  border-radius: 14px; border: 1.5px solid #2e968f; background: var(--band-teal); color: #fff;
  padding: 12px 22px; font-size: 15px; white-space: nowrap;
}
.tc-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(58,168,160,.35); }
.tc-btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.tc-btn.sub { background: #fff; color: #1d7a72; border-color: #b5ddd8; font-size: 13.5px; padding: 10px 16px; }
.tc-btn.ghost { background: transparent; color: #1d7a72; border-color: transparent; font-size: 12.5px; padding: 6px 10px; }
.tc-card-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.tc-link { font-size: 12.5px; color: #1d7a72; font-weight: 700; background: none; border: none; cursor: pointer; padding: 4px 0; font-family: inherit; }
.tc-link:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .tc-card { flex-wrap: wrap; }
  .tc-card .tc-dog { width: 44px; height: 44px; }
  .tc-card-actions { width: 100%; }
  .tc-btn { width: 100%; }
}

/* 勤怠ビュー：月ナビ・サマリー・一覧 */
.tc-month-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tc-month-label { font-size: 16px; font-weight: 800; color: var(--text); }
.tc-user-select { font-family: inherit; font-size: 13px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--border); background: #fff; }
.tc-tiles { margin-bottom: 14px; }
.stat-card.tile-teal { background: #ecf7f5; border-color: #cfe8e5; --stud: #cfe8e5; }
.stat-card.tile-teal .stat-num { color: #1d7a72; }

.tc-day {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 14px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.tc-day.today { border-color: #b5ddd8; background: #f7fcfb; }
.tc-day.weekend { background: #fafbfc; }
.tc-day-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tc-day-date { font-weight: 800; font-size: 13.5px; min-width: 90px; }
.tc-day-date .dow-sat { color: #3c6fc0; }
.tc-day-date .dow-sun { color: #c23b3b; }
.tc-day-sum { font-size: 12.5px; color: #4a566e; display: flex; gap: 12px; flex-wrap: wrap; }
.tc-day-sum b { color: var(--text); }
.tc-day-issues { margin-top: 4px; }
.tc-issue {
  display: inline-block; font-size: 11.5px; font-weight: 700; color: #9c6f14;
  background: #fdf9ec; border: 1px solid #efe0b6; border-radius: 999px; padding: 2px 9px; margin: 2px 4px 0 0;
}
.tc-issue.open { color: #c23b3b; background: #fdf3f3; border-color: #f5d5d5; }
.tc-punches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tc-punch {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: #2b3440;
  background: #f4f7f6; border: 1px solid #dde6e4; border-radius: 999px; padding: 3px 6px 3px 10px;
}
.tc-punch.voided { text-decoration: line-through; color: var(--muted); background: #f6f6f6; }
.tc-punch .tc-badge {
  font-size: 10.5px; font-weight: 800; color: #1d7a72; background: #ecf7f5;
  border: 1px solid #b5ddd8; border-radius: 999px; padding: 1px 6px; cursor: help;
}
.tc-punch button {
  font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
  border: none; background: none; color: var(--muted); padding: 2px 4px; border-radius: 6px;
}
.tc-punch button:hover { color: #1d7a72; background: #e2f1ef; }
.tc-day-add { margin-top: 6px; }
.tc-hist { font-size: 11.5px; color: var(--muted); margin: 4px 0 0; padding-left: 16px; }
.tc-hist li { margin: 2px 0; }

/* 修正モーダル */
.tc-amend-grid { display: grid; gap: 10px; text-align: left; margin: 10px 0; }
.tc-amend-grid label { font-size: 12.5px; font-weight: 700; color: #4a566e; display: grid; gap: 4px; }
/* チェック行だけは、上下2段（ラベル＋入力欄）ではなく横1行に並べる */
.tc-amend-grid label.mat-check-line { display: flex; align-items: center; gap: 7px; }
.tc-amend-grid input, .tc-amend-grid select, .tc-amend-grid textarea {
  font-family: inherit; font-size: 14px; padding: 9px 10px; border-radius: 10px; border: 1.5px solid var(--border);
}
.tc-reason-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-reason-chips button {
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  background: #ecf7f5; color: #1d7a72; border: 1px solid #b5ddd8; border-radius: 999px; padding: 4px 10px;
}
.tc-reason-chips button:hover { background: #dcefec; }
.tc-orig-info { font-size: 12.5px; color: #4a566e; background: #f4f7f6; border-radius: 10px; padding: 8px 10px; }

/* 勤怠：月次締めバッジ・管理者の全員集計（Ver.5.01.00） */
.tc-closed-badge {
  font-size: 12px; font-weight: 800; color: #9c6f14;
  background: #fdf9ec; border: 1px solid #efe0b6; border-radius: 999px; padding: 3px 10px;
}
.tc-admin-summary {
  background: #fff; border: 1px solid #cfe8e5; border-radius: 14px;
  padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.tc-admin-summary-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tc-admin-summary-title { font-size: 13.5px; font-weight: 800; color: #1d7a72; flex: 1; }
.tc-table-wrap { overflow-x: auto; }
.tc-sum-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tc-sum-table th, .tc-sum-table td {
  text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tc-sum-table th { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.tc-sum-table tbody tr:last-child td { border-bottom: none; }

/* 勤怠：退勤の確認ステップ・修正のお願い（Ver.5.02.00） */
/* 主ボタンのコントラスト改善（白文字 on #3aa8a0 は約2.9:1でAA未達 → #1d7a72 で約5.2:1に。華子さん指摘） */
.tc-btn { background: #1d7a72; border-color: #14554f; }
.tc-btn:hover { box-shadow: 0 4px 10px rgba(29, 122, 114, .35); }
.tc-btn.sub { background: #fff; color: #1d7a72; border-color: #b5ddd8; }
.tc-btn.ghost { background: transparent; color: #1d7a72; border-color: transparent; }
.tc-out-warn {
  font-size: 12px; font-weight: 700; color: #9c6f14; line-height: 1.6;
  background: #fdf9ec; border: 1px solid #efe0b6; border-radius: 10px; padding: 8px 10px;
  max-width: 320px;
}

/* 確認状態のバッジ（管理者テーブル） */
.tc-rev-badge {
  display: inline-block; font-size: 11.5px; font-weight: 800;
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.tc-rev-badge.req { color: #9c6f14; background: #fdf9ec; border: 1px solid #efe0b6; cursor: help; }
.tc-rev-badge.resp { color: #1d7a72; background: #ecf7f5; border: 1px solid #b5ddd8; }
.tc-rev-badge.okd { color: #2e7d3c; background: #f0f9f1; border: 1px solid #cfe9d4; }
.tc-rev-badge.none { color: var(--muted); }

/* 本人向け「修正のお願い」カード */
.tc-review-card {
  border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.tc-review-card.req { background: #fdf9ec; border: 1px solid #efe0b6; }
.tc-review-card.resp { background: #ecf7f5; border: 1px solid #cfe8e5; color: #1d7a72; font-weight: 700; font-size: 13px; }
.tc-review-title { font-size: 13.5px; font-weight: 800; color: #9c6f14; }
.tc-review-note { font-size: 13px; color: #2b3440; margin: 6px 0 2px; line-height: 1.6; }
.tc-review-hint { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.tc-resp-note {
  display: block; width: 100%; font-family: inherit; font-size: 13px;
  padding: 8px 10px; border-radius: 10px; border: 1.5px solid #efe0b6; margin-bottom: 8px;
}

/* 勤怠：日ごとの時間外・深夜の集計表示（Ver.5.03.00） */
.tc-day-sum .tc-ot b { color: #b0521f; }  /* 時間外＝オレンジ寄り */
.tc-day-sum .tc-nt b { color: #4a4fb8; }  /* 深夜＝藍寄り */

/* 勤怠：PDF/印刷用の帳票（Ver.5.03.00・既存 .print-sheet 基盤を利用） */
.print-sheet .p-tc td, .print-sheet .p-tc th { padding: 4px 7px; font-size: 12px; white-space: nowrap; }
.print-sheet .p-tc .p-r { text-align: right; }
.print-sheet .p-tc .p-sun { color: #b00; }
.print-sheet .p-tc .p-sat { color: #06c; }
.print-sheet .p-tc .p-small { font-size: 10px; color: #444; white-space: normal; }
.print-sheet .p-tc tfoot .p-total th, .print-sheet .p-tc tfoot .p-total td { background: #eee; font-weight: 700; }
.print-sheet .p-tc-sum { width: auto; margin-top: 12px; }
.print-sheet .p-tc-sum th { text-align: left; background: #f3f3f3; }
.print-sheet .p-tc-sum td { min-width: 90px; font-weight: 700; }

/* 勤怠：祝日の表示（画面・印刷。表示のみ＝計算には影響しない） */
.tc-day-date .tc-hol {
  font-size: 11px; font-weight: 700; color: #c23b3b;
  background: #fdf3f3; border: 1px solid #f5d5d5; border-radius: 999px;
  padding: 1px 7px; margin-left: 6px; white-space: nowrap;
}
.print-sheet .p-tc .p-hol { color: #b00; font-size: 10px; margin-left: 4px; }

/* 勤怠：打刻カード中央の今日のタイムライン（Ver.5.05.00） */
.tc-timeline {
  margin: 6px 0 2px; padding: 8px 10px; background: #f4faf9;
  border: 1px solid #d8ece9; border-radius: 10px; font-size: 12.5px; color: #2b3440;
}
.tc-tl-row { line-height: 1.9; }
.tc-tl-row b { color: #14554f; font-weight: 800; }
.tc-tl-k { display: inline-block; min-width: 68px; color: #4a566e; font-weight: 700; }
.tc-tl-live { color: #9c6f14; font-weight: 700; }
.tc-tl-total { border-top: 1px dashed #cfe3e0; margin-top: 4px; padding-top: 4px; }
.tc-tl-total b { color: #1d7a72; }
@media (max-width: 640px) { .tc-tl-k { min-width: 60px; } }

/* 勤怠：打刻カードの畳む操作・ヘッダーバッジの開閉ヒント（Ver.5.06.00） */
.tc-card { position: relative; }
.tc-card-fold {
  position: absolute; top: 8px; right: 10px;
  font-family: inherit; font-size: 11.5px; font-weight: 700; color: #1d7a72;
  background: #fff; border: 1px solid #b5ddd8; border-radius: 999px;
  padding: 3px 10px; cursor: pointer; transition: .15s; z-index: 1;
}
.tc-card-fold:hover { background: #ecf7f5; }
.tc-chip-caret { margin-left: 5px; font-size: 10px; opacity: .8; }
@media (max-width: 640px) { .tc-card-fold { top: 6px; right: 8px; } }

/* 勤怠：出勤簿/勤務一覧の分離・日ごとの修正のお願い（Ver.5.07.00） */
.tc-view-title { font-size: 16.5px; font-weight: 800; color: var(--text); margin: 2px 0 8px; }
.tc-crumb { margin-bottom: 6px; }
.tc-sum-table tr.tc-row-click { cursor: pointer; }
.tc-sum-table tr.tc-row-click:hover td { background: #f2faf9; }
.tc-row-open { font-size: 12px; opacity: .7; }
.tc-lhol {
  font-size: 11px; font-weight: 700; color: #a04a1f;
  background: #fdeee3; border: 1px solid #f6d8c2; border-radius: 999px;
  padding: 1px 7px; margin-left: 6px; white-space: nowrap;
}
.tc-day.asked { border-color: #efe0b6; background: #fffdf4; box-shadow: inset 4px 0 0 var(--band-yellow), var(--shadow); }
.tc-day-ask {
  margin-top: 6px; font-size: 12.5px; font-weight: 700; color: #9c6f14;
  background: #fdf9ec; border: 1px solid #efe0b6; border-radius: 10px; padding: 6px 10px;
}
.tc-review-item { font-size: 13px; color: #2b3440; margin: 4px 0; line-height: 1.7; }
.tc-review-item b { color: #9c6f14; }

/* 勤怠：日カードの「✉️ この日の修正をお願いする」を本人操作と見分けやすく（Ver.5.07.01・古代さん低2） */
.tc-ask-link {
  background: #fdf9ec; border: 1px solid #efe0b6; border-radius: 999px;
  padding: 2px 10px; color: #9c6f14;
}
.tc-ask-link:hover { background: #faf3d9; text-decoration: none; }

/* 給与計算：固定残業代の逆算ツール（Ver.5.08.00・画面内計算） */
.kz-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.kz-tab {
  font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--border);
  background: #fff; color: var(--muted); transition: .15s;
}
.kz-tab.active { background: #e9f1fd; color: #35619e; border-color: #bcd2ef; }
.kz-grid label .kz-sub, .kz-sub { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin: 1px 0 2px; }
.kz-result-table { width: 100%; margin-top: 10px; }
.kz-result-table th { width: 60%; background: #f3f6fb; font-weight: 700; }
.kz-result-table .p-r { text-align: right; }
.kz-result-table b { color: #35619e; font-size: 15px; }
.kz-warn {
  margin-top: 10px; font-size: 12.5px; font-weight: 700; color: #9c6f14; line-height: 1.7;
  background: #fdf9ec; border: 1px solid #efe0b6; border-radius: 10px; padding: 8px 12px;
}
.kz-warn.strong { color: #c23b3b; background: #fdf3f3; border-color: #f5d5d5; }
.kz-basis { margin-top: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.kz-note { margin-top: 8px; font-size: 12px; color: #4a566e; }
.kz-note summary { cursor: pointer; font-weight: 700; color: #35619e; }
.kz-note ul { margin: 6px 0 0; padding-left: 18px; }
.kz-note li { margin: 3px 0; line-height: 1.7; }

/* 固定残業：独立ページ化・手当のお知らせ・電卓警告（Ver.5.09.00・所長要望4点） */
.kz-entry-row { margin: 0 0 14px; }
.kz-alert {
  font-size: 12.5px; line-height: 1.8; color: #35619e;
  background: #f0f5fd; border: 1px solid #d4e2f6; border-radius: 12px;
  padding: 10px 14px; margin: 10px 0;
}
.kz-allow { margin-top: 4px; }
.kz-result-table .kz-th-sub { font-weight: 400; color: var(--muted); padding-left: 22px; }
.kz-warn.calc { color: #2e7d3c; background: #f0f9f1; border-color: #cfe9d4; }
