:root {
  --primary: #2f6f4f;
  --primary-dark: #255a40;
  --bg: #f4f6f5;
  --text: #2b2b2b;
  --muted: #6b7280;
  --border: #d5dbd7;
  --error: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* === ログイン画面 === */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 36px 32px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-org {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.auth-sys {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
  letter-spacing: 0.04em;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label { font-size: 13px; color: var(--muted); }

.field input {
  width: 100%;
  padding: 11px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 79, 0.12);
}

.field-error { font-size: 12px; color: var(--error); }

.auth-error {
  background: #fdecea;
  border: 1px solid #f5c6c2;
  color: var(--error);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 18px;
  font-size: 13px;
}

.auth-error p { margin: 0; }

.btn-primary {
  margin-top: 6px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-primary:hover { background: var(--primary-dark); }

/* === ログイン後トップ === */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  background: var(--primary);
  color: #fff;
}

.topbar-title { font-size: 15px; font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.topbar-user { font-size: 13px; }

.logout-form { margin: 0; }

.btn-link {
  background: none;
  border: none;
  color: #fff;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.content { padding: 28px 20px; max-width: 880px; margin: 0 auto; }

/* === メニューグリッド === */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 26px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}

.menu-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.menu-icon {
  width: 40px;
  height: 40px;
  color: var(--primary);
}

.menu-icon svg { width: 100%; height: 100%; }

.menu-label { font-size: 14px; font-weight: 600; }

/* 未実装メニュー（押せない・グレーアウト） */
.menu-card.is-disabled {
  opacity: .5;
  background: #f3f5f4;
  pointer-events: none;
  cursor: not-allowed;
  box-shadow: none;
}
.menu-card.is-disabled:hover { border-color: var(--border); box-shadow: none; transform: none; }
.menu-card.is-disabled .menu-label::after { content: '（準備中）'; font-weight: 400; color: var(--muted); }

/* === ホーム：法人会議・行事 === */
.events-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.events-title { font-size: 15px; margin: 0 0 12px; color: var(--primary-dark); }

.events-list { list-style: none; margin: 0; padding: 0; }

.events-item {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed #eee;
  font-size: 14px;
}

.events-item:last-child { border-bottom: none; }

.events-date { flex: 0 0 76px; font-weight: 600; color: var(--text); }
.events-wd { font-weight: 400; color: var(--muted); font-size: 12px; }
.events-name { color: var(--text); }
.events-note { color: var(--muted); font-size: 12px; margin-left: 8px; }

.events-item.is-past { opacity: .45; }
.events-item.is-today { background: #eef7f1; border-radius: 4px; }
.events-item.is-today .events-date { color: var(--primary-dark); }

.events-empty { color: var(--muted); font-size: 14px; margin: 0; }

/* === 勤務表 共通 === */
.topbar-home { color: #fff; text-decoration: none; }
.topbar-home:hover { text-decoration: underline; }
.topbar-sep { opacity: .7; margin: 0 4px; }

.tabbar {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  background: #e9efeb;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 11px 18px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary-dark); font-weight: 700; border-bottom-color: var(--primary); }

.content-wide { max-width: 100%; }

/* === 週ナビ === */
.week-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.week-label { font-size: 16px; font-weight: 700; }

.btn-week {
  padding: 7px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.btn-week:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn-week-today { margin-left: auto; }

/* === 勤務表テーブル === */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }

.roster-table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
  font-size: 13px;
}

.roster-table th, .roster-table td {
  border: 1px solid var(--border);
  vertical-align: top;
}

.roster-table thead th {
  background: #eef3f0;
  text-align: center;
  padding: 6px 4px;
  position: sticky;
  top: 0;
}

.roster-table .wd { font-size: 11px; color: var(--muted); }

.col-name {
  background: #f7faf8;
  text-align: left;
  padding: 6px 10px;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 96px;
}

.col-day { width: 92px; padding: 4px; }
.col-day.is-weekend { background: #fbf3f3; }
thead .col-day.is-weekend { background: #f6e8e8; }

.cell-item { padding: 1px 0; line-height: 1.3; }
.cell-item.is-leave { color: var(--muted); }
.cell-time { display: block; font-size: 10px; color: var(--muted); }

.empty-row { text-align: center; color: var(--muted); padding: 24px; }

/* === 施設ごとテーブル === */
.office-table .col-office {
  background: #eef3f0;
  text-align: left;
  padding: 6px 10px;
  white-space: nowrap;
  vertical-align: top;
  font-weight: 700;
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 84px;
}

.office-table .col-duty {
  background: #f7faf8;
  text-align: left;
  padding: 5px 8px;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
  min-width: 72px;
}

/* === 空き状況検索 === */
.avail-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 16px;
}

.avail-form label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }

.avail-form input {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.btn-inline { padding: 9px 20px; }

.avail-head { font-size: 15px; margin: 4px 0 16px; }

.avail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.avail-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
}

.avail-box h2 { font-size: 14px; margin: 0 0 10px; }
.avail-ok h2 { color: var(--primary-dark); }
.avail-ng h2 { color: var(--muted); }

.avail-row { font-size: 14px; padding: 4px 0; border-bottom: 1px dashed #eee; }
.avail-reason { color: var(--muted); font-size: 12px; margin-left: 6px; }
.mark-ok { color: var(--primary); font-weight: 700; margin-right: 6px; }
.mark-ng { color: #b9433a; font-weight: 700; margin-right: 6px; }

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

/* === 日表示（ガント） === */
.day-pick { margin: 0; }
.day-pick input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.gantt-hint { font-size: 12px; color: var(--muted); margin: 0 0 10px; }

.gantt-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.gantt-inner { min-width: 1120px; }

.gantt-row { display: flex; align-items: stretch; border-bottom: 1px solid #f0f0f0; }
.gantt-row:last-child { border-bottom: none; }

.gantt-name {
  flex: 0 0 110px;
  padding: 6px 10px;
  font-size: 13px;
  background: #f7faf8;
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
}

.gantt-track { position: relative; flex: 1; height: 30px; }

.gantt-head { background: #eef3f0; }
.gantt-head .gantt-track { height: 24px; }
.gantt-head .gantt-name { background: #eef3f0; }

.gantt-tick {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted);
}

.gantt-grid {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: #f0f0f0;
  pointer-events: none;
}

.gantt-body .gantt-track { cursor: copy; }

/* ゼブラ（交互の行背景。グループ単位で交互） */
.gantt-group .gantt-row:nth-child(even) { background: #f5f8f6; }
.gantt-group .gantt-row:nth-child(even) .gantt-name { background: #eef3f0; }

/* 施設グループ見出し */
.gantt-grouphead {
  padding: 9px 14px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  background: var(--primary);
  border-top: 2px solid #fff;
  position: sticky;
  left: 0;
}
.gantt-grouphead.is-other { color: #fff; background: #8a8f8c; }

.bar-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 12px;
  cursor: ew-resize;
  background:
    linear-gradient(135deg, transparent 50%, rgba(255,255,255,.85) 50%);
  border-bottom-right-radius: 4px;
}

/* ドラッグ中のリアルタイム時刻表示 */
.drag-readout {
  position: fixed;
  z-index: 1000;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #2b2b2b;
  border-radius: 5px;
  pointer-events: none;
  white-space: nowrap;
}

.gantt-bar {
  position: absolute;
  top: 4px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 11px;
  color: #fff;
  text-decoration: none;
  overflow: visible;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
}

.gantt-bar .bar-label { overflow: hidden; text-overflow: ellipsis; }

.bar-work { background: #6f9bd6; }
.bar-night { background: #a08fc8; }
.bar-leave { background: #cdd2ce; color: #555; }
.bar-unknown { background: #dcad6a; }

.gantt-bar:hover { filter: brightness(1.08); box-shadow: 0 0 0 2px rgba(47,111,79,.3); z-index: 3; }
.gantt-bar.is-cont { border-right: 3px dashed #fff; }

/* ツールチップ */
.bar-tip {
  display: none;
  position: absolute;
  bottom: 26px;
  left: 0;
  z-index: 10;
  min-width: 160px;
  padding: 8px 10px;
  background: #2b2b2b;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.bar-tip em { color: #ffd27d; font-style: normal; }
.gantt-bar:hover .bar-tip { display: block; }

/* === 割当編集フォーム === */
.form-wrap { max-width: 520px; }
.form-heading { font-size: 16px; margin: 0 0 18px; }
.assign-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 12px; align-items: flex-start; }
.form-label { flex: 0 0 110px; font-size: 13px; color: var(--muted); padding-top: 8px; }
.form-field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.form-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.btn-danger {
  margin-left: auto;
  padding: 9px 16px;
  font-size: 14px;
  color: #fff;
  background: #b9433a;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.btn-danger:hover { background: #9e362e; }

/* === モーダル（新規割当ダイアログ） === */
.modal {
  border: none;
  border-radius: 10px;
  padding: 0;
  width: 460px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.modal::backdrop { background: rgba(0,0,0,.35); }
.modal-form { padding: 22px 24px; }
.modal-form .form-heading { margin-bottom: 16px; }
.modal-staff { color: var(--primary-dark); }

/* 終日チェック時の時刻フィールド無効化 */
.form-row.is-disabled { opacity: .45; }
.form-input:disabled { background: #f0f0f0; cursor: not-allowed; }

/* === 支援記録 === */
.rec-messages { list-style: none; padding: 0; margin: 0 0 16px; }
.rec-msg { padding: 10px 12px; border-radius: 6px; font-size: 14px; margin-bottom: 8px; }
.rec-msg-success { background: #eef7f1; border: 1px solid #bfe0cc; color: var(--primary-dark); }
.rec-msg-error { background: #fdecea; border: 1px solid #f5c6c2; color: var(--error); }

.rec-btn {
  display: inline-block;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
.rec-btn:hover { background: var(--primary-dark); }
.rec-btn-sm { padding: 6px 12px; font-size: 13px; }
.rec-btn-light { background: #fff; color: var(--primary-dark); border: 1px solid var(--border); }
.rec-btn-light:hover { background: #f0f5f2; border-color: var(--primary); }

.rec-list { list-style: none; padding: 0; margin: 12px 0; }
.rec-list li { padding: 10px 0; border-bottom: 1px solid #eee; font-size: 15px; }
.rec-list a { color: var(--primary-dark); text-decoration: none; font-weight: 600; }
.rec-list a:hover { text-decoration: underline; }
.rec-muted { color: var(--muted); }
.rec-small { font-size: 13px; }
.rec-h2 { font-size: 15px; color: var(--primary-dark); margin: 24px 0 8px; }

.rec-form { max-width: 640px; }
.rec-form p { margin: 0 0 14px; }
.rec-form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.rec-form input, .rec-form select, .rec-form textarea {
  width: 100%;
  padding: 9px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
}
.rec-form input[type="checkbox"] { width: auto; }

.rec-obs {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 8px;
}
.rec-obs-text { font-size: 14px; line-height: 1.7; }

.rec-reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.rec-report-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rec-report-head { display: flex; align-items: center; justify-content: space-between; }
.rec-report-text { font-size: 13px; line-height: 1.7; white-space: normal; }
.rec-report-actions { margin-top: auto; display: flex; gap: 8px; padding-top: 6px; }
.rec-error { color: var(--error); font-size: 13px; }

.rec-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.rec-badge-draft { background: #fdf0d8; color: #8a6d3b; }
.rec-badge-edited { background: #e3eefb; color: #2c5d99; }
.rec-badge-confirmed { background: #e6f4ea; color: var(--primary-dark); }

/* 利用者カード（クリックできるボタン） */
.rec-client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.rec-client-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.rec-client-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .07);
  transform: translateY(-2px);
}
.rec-client-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rec-client-arrow { color: var(--primary); font-size: 20px; line-height: 1; }
.rec-client-kana { font-size: 12px; color: var(--muted); }
.rec-client-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 記録一覧テーブル */
.rec-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; margin: 12px 0; }
.rec-table { border-collapse: collapse; width: 100%; background: #fff; font-size: 14px; }
.rec-table th, .rec-table td { border-bottom: 1px solid #eee; padding: 10px 12px; text-align: left; vertical-align: middle; }
.rec-table thead th { background: #eef3f0; color: var(--primary-dark); font-size: 13px; white-space: nowrap; }
.rec-table tbody tr:hover { background: #f5f8f6; }
.rec-table tbody tr:last-child td { border-bottom: none; }
.rec-nowrap { white-space: nowrap; }
.rec-center { text-align: center; }
.rec-excerpt { color: var(--text); }

/* 記録一覧アルバム（めくる表示） */
.rec-album-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 8px 0 12px;
}
.rec-album-current { font-size: 15px; font-weight: 700; color: var(--primary-dark); min-width: 150px; text-align: center; }
.rec-btn[disabled] { opacity: .4; cursor: default; pointer-events: none; }

.rec-month-index {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 16px;
}
.rec-month-index-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.rec-month-chip {
  display: inline-block;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  background: #eef3f0;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  cursor: pointer;
}
.rec-month-chip:hover { background: #dceae2; }
.rec-month-chip.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.rec-month-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  color: var(--primary-dark);
  margin: 6px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #e3ebe6;
}

/* アルバム本体：ページ＋サイド索引タブ */
.rec-album-body { display: flex; align-items: flex-start; gap: 6px; }
.rec-album-tabs { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; padding-top: 30px; }
.rec-tabs-label { font-size: 11px; color: var(--muted); text-align: center; margin-bottom: 2px; }
.rec-month-tab {
  display: block;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #4a4a4a;
  text-decoration: none;
  border-radius: 0 14px 14px 0;          /* 右側がはみ出す“タブ”形状 */
  box-shadow: 2px 2px 5px rgba(0, 0, 0, .12);
  margin-left: -6px;                       /* ページの陰に少し差し込む */
  white-space: nowrap;
  transition: transform .12s, box-shadow .12s;
}
.rec-month-tab:hover { transform: translateX(5px); }
.rec-month-tab.is-active { transform: translateX(10px); box-shadow: 4px 3px 9px rgba(0, 0, 0, .2); color: #1f1f1f; }
.rec-month-tab[data-color="0"] { background: #f6c0c6; }
.rec-month-tab[data-color="1"] { background: #bfe0ef; }
.rec-month-tab[data-color="2"] { background: #f7e29a; }
.rec-month-tab[data-color="3"] { background: #c9e7c0; }
.rec-month-tab[data-color="4"] { background: #d9c8ec; }
.rec-month-tab[data-color="5"] { background: #f7cfa0; }
@media (max-width: 560px) {
  .rec-album-tabs { padding-top: 0; }
  .rec-month-tab { padding: 7px 9px; font-size: 12px; }
}

/* アルバム：横スライド方式（Kindle風・指に追従） */
.rec-album-viewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  touch-action: pan-y;        /* 縦スクロールは生かし、横ドラッグを取得 */
  cursor: grab;
  border-radius: 8px;
}
.rec-album-viewport.rec-dragging { cursor: grabbing; user-select: none; }

/* 左右の三角めくりボタン（ページの外側・本文に被らない） */
.rec-arrow {
  flex: 0 0 auto;
  align-self: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.rec-arrow:hover { background: var(--primary-dark); }
.rec-arrow.is-hidden { visibility: hidden; }   /* 端では非表示。場所は保持してガタつき防止 */
@media (max-width: 560px) {
  .rec-arrow { width: 30px; height: 30px; font-size: 13px; }
}
.rec-album-track { display: flex; align-items: stretch; will-change: transform; }
.rec-album-track.is-animating { transition: transform .3s cubic-bezier(.22, .61, .36, 1); }

.rec-album-page {
  flex: 0 0 100%;
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.rec-day-page { min-height: 150px; }
.rec-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid #e3ebe6; }
.rec-day-date { font-size: 18px; font-weight: 800; color: var(--primary-dark); }
.rec-day-text { font-size: 15px; line-height: 1.9; min-height: 48px; }
.rec-day-actions { margin-top: 12px; }
.rec-album-hint { margin: 8px 2px 0; }

/* 総合所見（特徴・変遷） */
.rec-overview {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px 0 4px;
}
.rec-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rec-overview-head form { margin: 0; }
.rec-overview-title { margin: 0; }
.rec-overview-text { font-size: 14px; line-height: 1.8; margin: 10px 0 6px; }

/* 起きた問題・留意事項（特出し） */
.rec-concerns {
  background: #fdf6e9;
  border: 1px solid #f0d9a8;
  border-left: 4px solid #d99a2b;
  border-radius: 6px;
  padding: 12px 14px;
  margin: 12px 0;
}
.rec-concerns-title { font-weight: 700; color: #8a5a12; font-size: 14px; margin-bottom: 6px; }
.rec-concerns-list { margin: 0; padding-left: 20px; }
.rec-concerns-list li { font-size: 14px; line-height: 1.7; color: #5e4a22; }

/* 請求データ（実績記録票・月次集計） */
.rec-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rec-billing-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 8px 0 10px; }
.rec-month-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.rec-month-form select { padding: 7px 10px; font-size: 14px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.rec-billing-note { background: #fdf6e9; border: 1px solid #f0d9a8; border-radius: 6px; padding: 8px 12px; }
.rec-agg-wrap { max-width: 460px; }
.rec-agg-wrap th { background: #f7faf8; text-align: left; }

/* 一問一答チャット（観察記録の入力） */
.rec-chat {
  background: #eef3f0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  min-height: 120px;
  max-height: 60vh;
  overflow-y: auto;
  margin: 8px 0 14px;
}
.rec-bubble {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.rec-bubble-bot { background: #fff; border: 1px solid var(--border); border-top-left-radius: 4px; }
.rec-bubble-user { background: var(--primary); color: #fff; margin-left: auto; border-top-right-radius: 4px; }
.rec-chat-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.rec-chat-opt {
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
  background: #fff;
  border: 1.5px solid var(--primary);
  border-radius: 18px;
  cursor: pointer;
}
.rec-chat-opt:hover { background: var(--primary); color: #fff; }
.rec-chat-detail {
  flex: 1 1 260px;
  max-width: 460px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}
.rec-chat-detail.rec-invalid { border-color: var(--error); box-shadow: 0 0 0 3px rgba(192, 57, 43, .12); }
.rec-chat-final-label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.rec-chat-final textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 14px; }

/* AI生成中ローダー */
.rec-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 43, 43, .45);
}
/* hidden 属性のときは確実に隠す（display 指定が hidden を上書きするのを防ぐ） */
.rec-loader-overlay[hidden] { display: none; }
.rec-loader-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px 36px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.rec-loader-text { margin: 14px 0 0; font-size: 15px; font-weight: 600; color: var(--text); }
.rec-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border: 4px solid #e3ebe6;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: rec-spin .8s linear infinite;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }
