/*
 * 管理画面と、隊員向けの共有ページ(shared レイアウト)の見た目。
 * Propshaft なので、このフォルダの CSS は全部読まれる(紹介ページの landing.css は .lp の下だけに効く)。
 *
 * 方針: きちんと・信頼。濃い紺が主役で、オレンジは「一番押してほしいボタン」1つだけ。
 * 共有ページは古いスマホでも見るので、grid / flex / CSS 変数の基本だけで組む。
 */

/* ==================================================================
   色・文字・形
================================================================== */
:root {
  /* 主役 */
  --navy: #14213D;          /* 見出し・上の帯 */
  --navy-2: #2D4A80;        /* リンク・選択中 */
  --navy-soft: #3B4F78;
  --switch-on: #2F6FDB;      /* 出勤・必要のスイッチの ON(明るめの青) */
  --switch-on-text: #1F56B8;
  --switch-mixed: #9DBDF0;
  --on-navy: #C7D2E6;       /* 紺地の上の文字 */
  --accent: #F28C28;        /* 一番押してほしいボタンだけ。文字は紺 */
  --accent-hover: #E07A16;

  /* 地と面 */
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --line: #E3E7EE;
  --line-strong: #C9D3E6;
  --text: #1C2433;
  --muted: #5B6577;

  /* 状態 */
  --ok: #1F8A5B;
  --ok-bg: #E3F2EA;
  --ok-text: #1F6E49;
  --warn: #B4530B;
  --warn-bg: #FDEBDC;
  --warn-text: #8F420A;
  --danger: #B42318;        /* 削除・NG だけに使う */
  --danger-bg: #FDECEA;
  --danger-text: #8E1B12;

  /* 札 */
  --group-bg: #E6ECF7;
  --group-text: #24365F;
  --solo-bg: #EEF0F3;
  --solo-text: #4A5468;

  /* 時間割のセル。配置場所ごとの色分けはしない: 持ち場は白地に紺の文字、休憩だけ薄い灰色 */
  --cell-rest: #EEF0F3;
  /* 時間割の今のコマ(行)は紺の帯。休憩・待機のマスは少し明るい紺にして、帯の中でも見分ける */
  --now-bg: var(--navy);
  --now-off-bg: var(--navy-soft);

  /* 以前の名前(ほかのルールが使っている)。新しい色に寄せる */
  --color-primary: var(--navy-2);
  --color-primary-dark: var(--navy);
  --color-primary-light: var(--group-bg);
  --color-success: var(--ok);
  --color-success-dark: var(--ok-text);
  --color-success-light: var(--ok-bg);
  --color-danger: var(--danger);
  --color-danger-dark: var(--danger-text);
  --color-danger-light: var(--danger-bg);
  --color-warning: var(--warn);
  --color-warning-dark: var(--warn-text);
  --color-warning-light: var(--warn-bg);
  --color-info: var(--group-text);
  --color-info-light: var(--group-bg);

  --gray-25: #FBFCFD;
  --gray-50: #F6F7F9;
  --gray-100: #EEF0F3;
  --gray-200: #E3E7EE;
  --gray-300: #C9D0DB;
  --gray-400: #9AA3B2;
  --gray-500: #5B6577;
  --gray-600: #4A5468;
  --gray-700: #343D4F;
  --gray-800: #1C2433;
  --gray-900: #14213D;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  /* カードは影なし。持ち上げて見せたいもの(ドラッグ中・ダイアログ)だけ影を付ける */
  --shadow-sm: none;
  --shadow-md: 0 4px 14px rgba(20, 33, 61, 0.12);
  --shadow-lg: 0 10px 30px rgba(20, 33, 61, 0.18);

  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --tap: 44px; /* 指で押すものの最低の高さ */
}

/* ==================================================================
   ベース
================================================================== */
* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
  color: var(--navy);
  font-weight: 700;
  line-height: 1.4;
}

a { color: var(--navy-2); }
a:hover { color: var(--navy); }

table { font-family: inherit; }

/* 細い線の印(ApplicationHelper#icon) */
.icon {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  vertical-align: -3px;
}
.icon-sm { width: 15px; height: 15px; vertical-align: -2px; }

.container,
.page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 28px 0 20px;
}
.page-header > * { min-width: 0; }

.page-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  color: var(--navy);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.page-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 0;
  max-width: 46em;
}

.page-meta { color: var(--muted); font-size: 14px; }

/* 一覧へ戻る など、ページの上に置く小さなリンク */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--tap);
  margin-top: 12px;
  color: var(--navy-2);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }
.back-link + .page-header { margin-top: 4px; }

.section-block { margin-bottom: 28px; }

.section-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin: 32px 0 10px;
}

.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }

/* ==================================================================
   上の帯(紺)
================================================================== */
.navbar {
  background-color: var(--navy);
  color: #FFFFFF;
  position: sticky;
  top: 0;
  z-index: 20;
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px 28px;
  min-height: 60px;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  color: #FFFFFF;
  font-weight: 900;
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
}
.navbar-brand:hover { color: #FFFFFF; }

/* 毎日の画面(.navbar-links)と設定▾(.nav-settings)。使い方・ログアウト(.nav-account)は右端 */
.navbar-menu {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.navbar-links {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--on-navy);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.nav-link:hover { color: #FFFFFF; background-color: rgba(255, 255, 255, 0.08); }
.nav-link.nav-link-active {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.14);
  font-weight: 700;
}
.nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 使い方・ログアウトは button_to(フォーム)なので、リンクと同じ見た目に揃える */
.nav-logout-form { margin: 0; display: inline-flex; }

/* 狭い画面: ロゴの段の右に使い方・ログアウト、その下の段に毎日の画面と設定▾ */
@media (max-width: 960px) {
  .navbar { position: static; }
  .navbar-inner { flex-wrap: wrap; padding: 6px 12px 8px; }
  .nav-link { min-height: var(--tap); padding: 0 10px; }
}

/* ==================================================================
   現場と日付の帯(白)
================================================================== */
.work-date-bar {
  background-color: var(--surface);
  border-bottom: 1px solid var(--line);
}

/* 今日以外を編集しているときは、取り違えないよう色を変える */
.work-date-bar.work-date-bar-other {
  background-color: var(--warn-bg);
  border-bottom-color: #F3C9A4;
}

.work-date-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  font-size: 14px;
}

.work-site {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.work-label { color: var(--muted); white-space: nowrap; }
.work-site-name { font-weight: 700; overflow-wrap: anywhere; }

.work-date-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.work-date-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}

.inline-form { display: inline; margin: 0; }

.work-date-input { width: auto; min-height: 40px; padding: 4px 8px; }

/* 現場の切り替え */
.site-switcher { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.site-switcher select { max-width: 240px; min-height: 40px; font-weight: 700; }

@media (max-width: 640px) {
  .work-date-bar-inner { padding: 8px 16px; }
  .work-date-controls { gap: 6px; }
}

/* ==================================================================
   お知らせの帯(お試しの残り日数・無料プラン・メールの確認)
================================================================== */
.account-notice {
  padding: 10px 20px;
  font-size: 14px;
  text-align: center;
  background-color: var(--group-bg);
  color: var(--group-text);
  border-bottom: 1px solid var(--line-strong);
}

.account-notice-warning {
  background-color: var(--warn-bg);
  color: var(--warn-text);
  border-bottom-color: #F3C9A4;
}

.account-notice .inline-form button,
.account-notice a { margin-left: 8px; }
.account-notice a { font-weight: 700; color: inherit; }

/* ==================================================================
   画面上部のお知らせ(保存しました など)
================================================================== */
.flash-wrapper {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 20px 0;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid transparent;
  margin: 0 0 4px;
}
.flash .icon { margin-top: 2px; }

.flash-notice { background-color: var(--ok-bg); color: var(--ok-text); border-color: #BFE0CD; }
.flash-alert { background-color: var(--warn-bg); color: var(--warn-text); border-color: #F3C9A4; }

/* 押すとすぐ保存されるスイッチの「保存しました」(layouts/application・save_toast_controller.js)。
   画面の上のお知らせが見えない位置でも分かるように、画面の下に数秒だけ出す */
.save-toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 1000;
  transform: translate(-50%, 8px);
  max-width: calc(100% - 32px);
  width: max-content;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(20, 33, 61, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.save-toast.is-shown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.save-toast.save-toast-failed { background: var(--warn-bg); color: var(--warn-text); border: 1px solid #F3C9A4; }
.save-toast-text:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .save-toast { transition: none; } }

/* 個人プランで上限に当たったときのプランの案内(shared/_plan_guide。PlanGuide の先頭)。
   オレンジは使わず、白地・細い線で控えめに。フラッシュの下に出すときは少しあける */
.plan-guide { margin-top: 10px; font-size: 14px; line-height: 1.7; color: var(--text); }
.plan-guide-flash {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.plan-guide-text { margin: 0 0 4px; }
.plan-guide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; }
.plan-guide-doc { font-weight: 700; overflow-wrap: anywhere; }

/* ==================================================================
   ボタン
   主(.btn-primary)= オレンジ・文字は紺。1画面に1つだけ。
   副(.btn-outline)= 白地に紺の枠。
================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 18px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(45, 74, 128, 0.35); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background-color: var(--accent); color: var(--navy); }
.btn-primary:hover { background-color: var(--accent-hover); color: var(--navy); }

.btn-outline { background-color: var(--surface); color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background-color: var(--group-bg); color: var(--navy); }

/* キャンセル など、目立たせない戻る操作 */
.btn-secondary { background-color: var(--surface); color: var(--muted); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--gray-400); color: var(--text); }

.btn-success { background-color: var(--ok); color: #FFFFFF; }
.btn-success:hover { background-color: var(--ok-text); color: #FFFFFF; }

/* 消す操作。取り消せないものは確認を出す(data-turbo-confirm) */
.btn-danger { background-color: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background-color: var(--danger-bg); color: var(--danger-text); }

/* 取り消しが効く「削除」などの操作。枠を薄く、文字だけ赤にする */
.btn-outline-danger { background-color: var(--surface); color: var(--danger); border-color: #EBC3BE; }
.btn-outline-danger:hover { background-color: var(--danger-bg); border-color: var(--danger); color: var(--danger-text); }

.btn-large { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { display: flex; width: 100%; }

/* 指で押す画面では、小さいボタンも 44px にする */
@media (pointer: coarse) {
  .btn-sm { min-height: var(--tap); }
}

/* 時間割を作るボタン(配置画面の一番押してほしいボタン) */
.btn-flash,
.btn-submit-schedule {
  background-color: var(--accent);
  color: var(--navy);
  font-weight: 900;
}
.btn-flash:hover,
.btn-submit-schedule:hover { background-color: var(--accent-hover); color: var(--navy); }

.link-danger {
  color: var(--danger);
  background: none;
  border: 0;
  padding: 0 4px;
  min-height: 36px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-danger:hover { color: var(--danger-text); }

/* ==================================================================
   札(ピル)
================================================================== */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
  background: var(--solo-bg);
  color: var(--solo-text);
}
.badge-info, .pill-group { background: var(--group-bg); color: var(--group-text); }
.badge-secondary, .pill-solo { background: var(--solo-bg); color: var(--solo-text); }
.badge-warning, .pill-warn { background: var(--warn-bg); color: var(--warn-text); }
.badge-success, .pill-ok { background: var(--ok-bg); color: var(--ok-text); }
.badge-danger, .pill-danger { background: var(--danger-bg); color: var(--danger-text); }
/* 基本の配置場所(Post#base_post)の印。契約で決まった持ち場なので、紺の地で落ち着いて目立たせる(オレンジは使わない) */
.badge-base { background: var(--navy); color: #FFFFFF; padding: 1px 8px; font-size: 11px; vertical-align: 2px; }

/* ==================================================================
   カード / 空のとき
================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.form-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--navy);
}

.card-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}
.empty-state h3 { color: var(--navy); margin: 0 0 6px; font-size: 17px; }
.empty-state p { margin: 0; font-size: 14px; }

/* ==================================================================
   フォーム部品
================================================================== */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.7;
}
.alert-danger { background-color: var(--danger-bg); border: 1px solid #EBC3BE; color: var(--danger-text); }
.alert-danger h4 { margin: 0 0 8px; font-size: 15px; color: inherit; }
.alert-danger ul { margin: 0; padding-left: 20px; }
.alert-warning { background-color: var(--warn-bg); border: 1px solid #F3C9A4; color: var(--warn-text); }

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.form-row-end { align-items: flex-end; }

.form-group { margin-bottom: 16px; }
.form-group.col { flex: 1; min-width: 200px; }
.form-row > .form-group { margin-bottom: 0; }

.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14px;
}
.form-label.required::after { content: " *"; color: var(--danger); }
/* 欄の中の小見出し(スタッフの「ほかの資格を足す」など) */
.form-label.form-label-sub { font-weight: 600; font-size: 13px; margin-top: 10px; }

.form-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 12px;
}

.form-control {
  width: 100%;
  min-height: var(--tap);
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background-color: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(45, 74, 128, 0.18);
}
textarea.form-control { min-height: 0; }
/* 日数・人数など、数字だけを入れる欄 */
.form-control-narrow { max-width: 140px; }

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* 数値入力 ＋ 単位 */
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background-color: var(--gray-100);
  border: 1px solid var(--line-strong);
  border-left: none;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

/* チェックボックスを並べた選択肢 */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  cursor: pointer;
  font-size: 14px;
}
.checkbox-card:hover { border-color: var(--navy-2); }
.checkbox-card:has(input:checked) { border-color: var(--navy-2); background-color: var(--group-bg); }
.checkbox-card input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; flex: none; }
.checkbox-name { color: var(--text); }
.checkbox-card.is-disabled { opacity: 0.55; cursor: not-allowed; }
.checkbox-card.is-disabled:hover { border-color: var(--line); }

.checkbox-desc { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 400; }

/* 種類を選ぶラジオのカード */
.type-radio-group { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

.type-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  cursor: pointer;
}
.type-radio-card:hover { border-color: var(--gray-400); }
.type-radio-input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.type-radio-card:has(.type-radio-input:checked) {
  border-color: var(--navy-2);
  background-color: var(--group-bg);
  box-shadow: 0 0 0 1px var(--navy-2);
}

.type-title { display: block; font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 2px; }
.type-desc { display: block; font-size: 13px; color: var(--muted); line-height: 1.6; }

/* 小さな図(班をまたぐ休憩回しを選ぶカード)。クラス名は前の「回り方」の図の名残 */
.rotation-style-diagram {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto;
}
.rotation-style-diagram .rs-box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.rotation-style-diagram .rs-label { fill: var(--muted); font-size: 11px; font-weight: 700; }
.rotation-style-diagram .rs-note { fill: var(--muted); font-size: 10.5px; }
.rotation-style-diagram .rs-caption { fill: var(--navy); font-size: 11px; font-weight: 700; }
.rotation-style-diagram .rs-person { fill: var(--navy); }
.rotation-style-diagram .rs-person-relief { fill: var(--surface); stroke: var(--navy); stroke-width: 1.8; }
.rotation-style-diagram .rs-arrow { fill: none; stroke: var(--navy-2); stroke-width: 1.8; stroke-linecap: round; }
.rotation-style-diagram .rs-arrow-dashed { stroke-dasharray: 4 3; }
.rotation-style-diagram .rs-arrow-head { fill: var(--navy-2); }
.rotation-style-diagram .rs-group { fill: none; stroke: var(--line-strong); stroke-width: 1.2; stroke-dasharray: 3 3; }

.checkbox-list { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 400; cursor: pointer; }
.checkbox-inline input { width: 18px; height: 18px; }

/* 申し込み画面のボット避けの入力欄(人には見せない) */
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==================================================================
   回る順番の並べ替え(rotation_groups#edit_sequence)
================================================================== */
.sequence-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.sequence-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  font-size: 15px;
}

.sequence-item-rest { border-style: dashed; border-color: var(--line-strong); background-color: var(--bg); color: var(--muted); }

.seq-drag-handle { cursor: grab; color: var(--gray-400); display: inline-flex; }
.seq-drag-handle:active { cursor: grabbing; }

.sequence-remove {
  margin-left: auto;
  min-width: 40px;
  min-height: 40px;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.sequence-remove:hover { color: var(--danger); background-color: var(--danger-bg); }

/* ==================================================================
   一覧の表
================================================================== */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.table-card-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.table-wrapper { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table thead th {
  background-color: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.data-table tbody tr:last-child td,
.data-table tbody tr:last-child th { border-bottom: none; }
.data-table tbody tr:hover { background-color: var(--gray-25); }

.data-table .text-center { text-align: center; }
.data-table .nowrap { white-space: nowrap; }

/* 項目名と値を縦に並べる表(詳細画面) */
.detail-table th { width: 160px; color: var(--muted); font-weight: 500; font-size: 13px; }

/* button_to は <form> になるので、表の中やボタンの列では横に並べる */
.data-table form.button_to,
.form-card form.button_to { display: inline-block; }

.chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 9px;
  background: var(--group-bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--group-text);
  text-decoration: none;
}

/* 必要/不要・出勤/休みの切り替え(押すと変わる札) */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  white-space: nowrap;
}
.status-pill-on { background-color: var(--ok-bg); color: var(--ok-text); border-color: #BFE0CD; }
.status-pill-on:hover { border-color: var(--ok); }
.status-pill-off { background-color: var(--surface); color: var(--muted); border-color: var(--line-strong); }
.status-pill-off:hover { border-color: var(--navy-2); color: var(--navy); }
@media (pointer: coarse) { .status-pill { min-height: var(--tap); } }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* ==================================================================
   配置場所一覧: 班ごとのまとまり
================================================================== */
.group-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.group-section-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.group-section-label { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-width: 0; }
.group-section-name { font-size: 16px; font-weight: 700; color: var(--navy); }

.group-section-details > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 16px;
  border-top: 1px solid var(--line);
  color: var(--navy-2);
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}
.group-section-details > summary::-webkit-details-marker { display: none; }
.group-section-details > summary::before { content: "＋"; width: 1em; }
.group-section-details[open] > summary::before { content: "－"; }
.group-section-details[open] > summary { border-bottom: 1px solid var(--line); }

.posts-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.posts-pagination-status { font-size: 13px; color: var(--muted); }
.posts-pagination [aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* 配置場所一覧: スマホで見出しが1字ずつ縦に折り返さないよう、表は横にスクロールして見る */
.post-table th, .post-table td { white-space: nowrap; }

/* 配置場所の画面: 班に入っている配置場所の案内 */
.cycle-member-note {
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--group-bg);
  color: var(--group-text);
}
.cycle-member-note p { margin: 0 0 6px; }

/* ==================================================================
   配置画面(rotations#show)
================================================================== */
.rotation-show-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.rotation-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 24px 0 16px;
}
.rotation-head-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 14px; }

/* 手順。済んだ手順・まだ先の手順は1行の小さな札、今やる手順(と足りなかった赤い手順)だけ大きく。
   札は横に詰めて並べ、大きい手順が残りの幅を取る(スマホでも2〜3段に収まる) */
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.steps-item { flex: 0 1 auto; min-width: 0; display: flex; }
.steps-item-wide { flex: 1 1 150px; }

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
  padding: 6px 12px 6px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  min-width: 0;
}
.step:hover { border-color: var(--navy-2); color: var(--text); }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--solo-bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.step-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.step-title { font-weight: 500; white-space: nowrap; }
/* 数は、今やる手順と赤い手順にだけ出す(済んだ手順の数は見出しの横にも出ている) */
.step-count { display: none; color: var(--muted); font-size: 12px; }
.step-count-part { white-space: nowrap; }

.step.is-done .step-num { background: var(--ok); color: #FFFFFF; }

/* 今やる手順: 白い札に紺の太い枠。番号も大きく */
.step.is-current {
  padding: 8px 14px 8px 12px;
  background: var(--surface);
  border: 2px solid var(--navy);
  color: var(--navy);
  gap: 10px;
}
.step.is-current .step-num { width: 26px; height: 26px; font-size: 13px; background: var(--navy); color: #FFFFFF; }
.step.is-current .step-title,
.step.is-missing .step-title { white-space: normal; }
.step.is-current .step-title { font-size: 15px; font-weight: 800; }
.step.is-current .step-count,
.step.is-missing .step-count { display: block; }

/* 自動配置を押したのに足りなかった手順: 赤く縁取り、何回か光らせる */
.step.is-missing {
  padding: 8px 14px 8px 12px;
  border: 2px solid var(--danger);
  background: var(--danger-bg);
  color: var(--danger-text);
  gap: 10px;
  animation: step-missing-pulse 1.2s ease-in-out 3;
}
.step.is-missing .step-num { width: 26px; height: 26px; font-size: 13px; background: var(--danger); color: #FFFFFF; }
.step.is-missing .step-title { font-size: 15px; font-weight: 800; }
.step.is-missing .step-count { color: var(--danger-text); }
@keyframes step-missing-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180, 35, 24, 0); }
  50% { box-shadow: 0 0 0 6px rgba(180, 35, 24, 0.28); }
}
@media (prefers-reduced-motion: reduce) {
  .step.is-missing { animation: none; }
}

/* 本体と右側(PC幅)。狭い画面では右側は下に回る */
.rotation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
.rotation-layout-single { grid-template-columns: minmax(0, 1fr); }
.rotation-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.rotation-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }

@media (max-width: 1023px) {
  .rotation-layout { grid-template-columns: minmax(0, 1fr); }
  .rotation-aside { position: static; max-height: none; overflow: visible; }
}

.aside-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aside-card h2 { margin: 0; font-size: 15px; color: var(--navy); }
.aside-card p { margin: 0; font-size: 13px; line-height: 1.8; color: var(--muted); }
.aside-card form.button_to { margin: 0; }
.aside-card .btn { width: 100%; }
.aside-links { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.aside-links a { display: flex; align-items: center; justify-content: center; min-height: var(--tap); font-weight: 700; }

.caution-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.caution-list li { display: flex; gap: 8px; font-size: 13px; line-height: 1.7; color: var(--warn-text); }
.caution-list li .icon { margin-top: 3px; }
.caution-list .caution-ok { color: var(--ok-text); }
.caution-count { margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--warn-text); }
.caution-body { display: flex; flex-direction: column; min-width: 0; }
/* どの配置場所の話か。押すとそのカードへ飛ぶ */
.caution-places { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.caution-place { font-weight: 700; color: var(--navy-2); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.caution-text { overflow-wrap: anywhere; }
/* 「気をつけること」から飛んできた配置場所のカード。上の帯に隠れないよう少し下げて止め、枠で示す */
.post-card { scroll-margin-top: 88px; }
/* 配置の画面で、休憩回しを切り替えたあとに戻る所(ReliefSettingsController)。広い幅では上の帯(.navbar)が
   画面に固定されるので、その下に隠れないよう帯の分だけ下で止める(2026-11-28 作り手の声) */
#schedule-outdated, #relief-mode { scroll-margin-top: 76px; }
@media (max-width: 960px) { #schedule-outdated, #relief-mode { scroll-margin-top: 12px; } }
.post-card:target { outline: 2px solid var(--warn); outline-offset: 2px; }
@media (max-width: 1023px) { .post-card { scroll-margin-top: 12px; } }

/* 配置から時間割まで作る(方針を選んで実行) */
.policy-card {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.policy-card h2 { margin: 0 0 10px; font-size: 16px; }

.policy-form-row { display: flex; gap: 4px 20px; align-items: flex-start; flex-wrap: wrap; }
.policy-select-col { flex: 1 1 320px; min-width: 0; }
.policy-select-row { display: flex; gap: 10px; flex-wrap: wrap; }
.policy-select-row select { flex: 1 1 220px; min-width: 0; }
.policy-select-row .btn { flex: 0 0 auto; }
/* ［配置から時間割まで作る］。狭い幅では指で押しやすい幅にする */
.policy-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.policy-actions .btn { flex: 1 1 220px; white-space: normal; }
.policy-actions-help { margin: 10px 0 0; }

/* 配置をもう作った日の上の1行。自動の配置からやり直すときだけ開く(手動で直した配置が消えるので、畳んでおく) */
.redo-plan { margin: 0; }
.redo-plan-policy { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.redo-plan .day-posts-bar-button { white-space: nowrap; }

/* すべてのカードのあとの［この配置で時間割を再作成する］(配置だけの日は［この配置で時間割を作る］) */
.make-schedule {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.make-schedule form.button_to { margin: 0; }
.make-schedule .btn { width: 100%; white-space: normal; }
.make-schedule .shortage-note { margin: 0; }
.make-schedule-help { margin: 0; }

/* 方針の説明: 「方針」のすぐ下に「方針の説明を見る」の1行だけ。押すとその場で開き、選ぶ欄の上に出る */
.policy-description-card { margin: -2px 0 8px; min-width: 0; }
.policy-description-card[open] { padding: 8px 12px 10px; background: var(--bg); border-radius: var(--radius-sm); }
.policy-description-card > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--navy-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.policy-description-card > summary::-webkit-details-marker { display: none; }
.policy-description-card > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
}
.policy-description-card[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.policy-description-text { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.policy-description-text strong { color: var(--text); font-weight: 700; }

/* 配置の画面の休憩回しの範囲の切り替え(rotations/_relief_mode_switch)。今の側を紺で塗る */
.relief-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.relief-switch-label { font-size: 14px; font-weight: 700; color: var(--navy); }
.relief-switch-form { margin: 0; }
.relief-switch-buttons { display: inline-flex; border: 1px solid var(--navy); border-radius: var(--radius-sm); overflow: hidden; }
.relief-switch-button { min-height: 40px; padding: 6px 14px; border: 0; background: var(--surface); color: var(--navy);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.relief-switch-button + .relief-switch-button { border-left: 1px solid var(--navy); }
.relief-switch-button.is-current { background: var(--navy); color: #fff; cursor: default; }
.relief-switch-button:not(.is-current):hover { background: var(--bg); }
.relief-switch-button:focus-visible { outline: 2px solid var(--navy-2); outline-offset: -4px; }
.relief-switch-current { font-size: 14px; color: var(--navy); }
.relief-switch-help { flex-basis: 100%; margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.relief-mode-note { margin: 0; font-size: 13px; color: var(--muted); }
.relief-mode-note a { font-weight: 700; margin-left: 6px; }
.relief-mode-moved { margin: 0 0 16px; }
.relief-mode-moved a { margin: 0 2px; }

.rest-suggestion {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #F3C9A4;
  border-radius: var(--radius-md);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 14px;
}

/* 班ごとの白いカード */
.cluster-group { display: flex; flex-direction: column; gap: 16px; }

.cluster-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.cluster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 14px;
}
.cluster-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.cluster-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.cluster-status { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; font-size: 13px; color: var(--muted); }
.cluster-section-title { margin: 8px 0 10px; font-size: 15px; color: var(--navy); display: flex; align-items: center; gap: 8px; }

.post-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

/* 配置場所ごとの枠(班のカードの中) */
.post-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  background-color: var(--surface);
  min-width: 0;
}
/* 単独・固定の配置場所は、それ自体が1枚のカード */
.post-card.post-card-solo { border-radius: var(--radius-lg); padding: 18px; }
/* 人・資格・点が足りない配置場所。朝の確認で目に入るよう、注意色の太い枠にする */
.post-card.is-short { border: 2px solid var(--warn); background-color: #FFFBF7; }
.post-card.is-ng { border: 2px solid var(--danger); background-color: var(--danger-bg); }

.post-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.post-card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.post-card-title h3 { margin: 0; font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.post-card-edit {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-2);
  text-decoration: none;
}
.post-card-edit:hover { text-decoration: underline; }
@media (pointer: coarse) { .post-card-edit { min-height: var(--tap); } }

.post-card-meta { margin: 8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ローテーションの中の、特定時間の配置。休憩中のスタッフが入るので名札の欄は無く、地の色で通常の配置と分ける */
.spot-posts { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.spot-posts-title { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--navy); }
.post-card.post-card-spot { background-color: var(--bg); }
.post-card-spot .post-card-header { margin-bottom: 6px; }
.post-card-spot-need { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
.post-card-spot .post-card-meta { margin-top: 4px; }
.post-card-spot-left { margin: 8px 0 0; font-size: 12px; color: var(--warn-text); line-height: 1.6; overflow-wrap: anywhere; }

.post-card-members { margin: 0; }
.post-card-members-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* 人の名前の行(ドラッグで動かせる名札) */
.slot-list-container {
  min-height: 44px;
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slot-item {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  font-size: 13px;
  color: var(--text);
}
.slot-item:active { cursor: grabbing; }

.person-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-height: var(--tap);
  padding: 8px 12px;
  background: var(--bg);
  border-color: var(--bg);
  font-size: 14px;
}
.person-row strong { font-weight: 700; }
.grip { display: inline-flex; color: var(--gray-400); margin-left: -4px; }
.person-score { color: var(--muted); font-size: 12px; }

.standby-pool {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.standby-pool h3 { margin: 0; font-size: 15px; color: var(--navy); }
.standby-pool-count { font-size: 13px; color: var(--muted); margin: 4px 0; }
.standby-pool-help { margin: 4px 0 10px; }
/* 名札に重ねると入れ替え、下の空いたところに落とすと待機に加わる(班の待機の欄と同じ) */
.standby-pool-list { position: relative; margin: 10px 0 0; padding: 0 0 34px; list-style: none; min-height: 60px; }

/* 待機(休憩を回す人)の点線の枠 */
.standby-group {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.standby-group-label { font-size: 13px; color: var(--muted); }
.standby-group-label strong { color: var(--text); }
/* 名札の真ん中に重ねて離すと入れ替え、それ以外(とくに上の「ここに落とすと…」の帯)で離すと待機に加わる。
   帯は名札の並びの上に置く: 待機の欄は配置場所より下にあり、スマホでは上から下へドラッグするので、
   名札の上を通る前に帯へ届く。待機の人が何人いても欄の入り口に見える。指で狙いやすい高さ(56px) */
.standby-group-list { position: relative; min-height: 64px; margin-top: 6px; padding-top: 64px; padding-bottom: 8px; }
.standby-pool-list { padding: 64px 0 8px; min-height: 64px; }
.standby-group-list::before,
.standby-pool-list::before {
  content: "ここに落とすと休憩回しに加わります";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 56px;
  line-height: 54px;
  display: block;
  box-sizing: border-box;
  text-align: center;
  padding: 0 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}
/* 動かしている名札は待機の欄へは入れず、元の場所に薄く残す(drag_controller.js の onMove)。
   入れ替えか加わるかは、指(マウス)の位置で決めて、名札の「ここで離すと入れ替え」・帯で見せる */
/* 指の下に付いてくる名札の写し(body に置く)。名札の幅のまま、横書きで出す */
.sortable-fallback { box-shadow: var(--shadow-md); white-space: normal; writing-mode: horizontal-tb; }
/* 加わる位置にいる間は帯を、入れ替えになる名札の上にいる間はその名札を強調する */
.standby-group-list.is-drop-add::before,
.standby-pool-list.is-drop-add::before {
  content: "ここで離すと休憩回しに加わります";
  color: var(--navy);
  font-weight: 700;
  background: var(--group-bg);
  border: 2px solid var(--navy);
  line-height: 52px;
}
/* 必要人数ちょうどの配置場所からつかんだときは、加われないことを帯で知らせる(入れ替えだけできる) */
.standby-group-list.is-drop-blocked::before,
.standby-pool-list.is-drop-blocked::before {
  content: "人数が減るので加われません。名札に重ねると入れ替え";
  color: var(--warn-text);
  font-weight: 700;
  background: var(--warn-bg);
  border: 2px solid var(--warn);
  line-height: 52px;
}
ul[data-drag-swap="hover"] > li.drop-target-highlight { position: relative; }
ul[data-drag-swap="hover"] > li.drop-target-highlight::after {
  content: "ここで離すと入れ替え";
  position: absolute;
  top: -10px;
  right: 6px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  pointer-events: none;
}
.standby-group-empty { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* 待機の名札は点線で控えめに */
.slot-item-rest,
.slot-item.cell-rest {
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

/* 待機の人が時間割でどこへ回るか */
.standby-destination { display: inline-flex; padding: 1px 8px; border-radius: var(--radius-full); background: var(--solo-bg); color: var(--solo-text); font-size: 12px; font-weight: 700; }
.standby-destination-shared { background: var(--group-bg); color: var(--group-text); }
.standby-destination-fill { background: var(--warn-bg); color: var(--warn-text); }
.standby-members { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }

/* 休憩の見込み */
.rest-forecast { display: inline; font-size: 13px; color: var(--muted); font-weight: 400; }
.rest-forecast-none { color: var(--warn-text); font-weight: 700; }
.rest-forecast-fixed { color: var(--muted); }
.post-card-rest { margin: 0 0 8px; }

/* 自動配置で選んだ理由と、配置場所ごとの気をつけること(小さく灰色で) */
.assign-reason { display: block; flex-basis: 100%; margin: 0; font-size: 11px; font-weight: 400; color: var(--muted); line-height: 1.5; }
.assign-warnings { margin: 0 0 8px; padding: 0; list-style: none; color: var(--warn-text); font-size: 12px; line-height: 1.6; }

/* 慣れ度(「初」「3回目」)と資格の札 */
.exp-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.7;
  background: var(--solo-bg);
  color: var(--solo-text);
  white-space: nowrap;
}
.exp-badge-first { background: var(--warn-bg); color: var(--warn-text); }

/* スタッフの評価の札(S〜D)。文字で評価を出し、色は補助。D は控えめ(責任者の画面だけ) */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
  border: 1px solid transparent;
}
.grade-badge-s { background: var(--navy); color: #FFFFFF; box-shadow: inset 0 -2px 0 var(--accent); }
.grade-badge-a { background: var(--navy-soft); color: #FFFFFF; }
.grade-badge-b { background: var(--group-bg); color: var(--group-text); }
.grade-badge-c { background: var(--surface); color: var(--warn-text); border-color: var(--warn); }
.grade-badge-d { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); font-weight: 600; }
/* 責任者が手動で固定した評価の印(文字の右上の小さな点。StaffsHelper#grade_badge)。色は札の文字の色のまま */
.grade-badge-manual::after { content: ""; width: 4px; height: 4px; margin: 0 0 6px 2px; border-radius: 50%; background: currentColor; flex: none; }
/* 久しぶりに来た人の札 */
.return-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.7;
  white-space: nowrap;
  background: var(--warn-bg);
  color: var(--warn-text);
}
/* 評価の札の意味(凡例) */
.grade-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.grade-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.grade-legend-note { flex-basis: 100%; }
.type-title .grade-badge { margin-right: 2px; }
/* 出勤登録の評価の見方(閉じておく) */
.grade-legend-box { margin: 12px 0 16px; font-size: 13px; color: var(--muted); }
.grade-legend-box summary { cursor: pointer; color: var(--navy-2); }
.grade-legend-box .grade-legend { margin: 8px 0 0; }

/* スタッフの評価の目安の設定と、スタッフ編集の今の評価の行 */
.grade-settings-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.grade-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 4px 0 10px; }
fieldset.form-group { border: 0; padding: 0; margin-inline: 0; min-width: 0; }

.qual-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.7;
  background: var(--group-bg);
  color: var(--group-text);
  white-space: nowrap;
}
.qual-status { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.qual-status-short { color: var(--warn-text); font-weight: 700; }
/* 配置のカードの「重要な配置場所に要注意（D）の人」(CautionPlacementAlert)。印と文を横に並べる */
.caution-member { display: flex; gap: 6px; align-items: flex-start; }
.caution-member svg { flex: none; margin-top: 2px; }
/* 資格者が休憩・待機中のため資格の無い人が入る時間(班長の決めどおり)。本当の不足より一段弱く、灰色の地に細い線 */
.qual-status-resting { color: var(--muted); font-weight: 400; padding-left: 8px; border-left: 2px solid var(--line-strong); }

/* NG(一緒にできない組み合わせ)の知らせ */
.ng-alert-banner {
  display: none;
  background-color: var(--danger-bg);
  border: 1px solid #EBC3BE;
  color: var(--danger-text);
  padding: 6px 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  line-height: 1.5;
}
.ng-alert-banner strong { display: block; margin-bottom: 2px; }

/* ==================================================================
   準備のチェックリスト(はじめにやること)。控えめに
================================================================== */
.onboarding-card {
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.onboarding-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.onboarding-head h3 { margin: 0; font-size: 15px; }
.onboarding-count { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--muted); }
.onboarding-progress { height: 4px; margin: 10px 0 8px; border-radius: 999px; background: var(--solo-bg); overflow: hidden; }
.onboarding-progress span { display: block; height: 100%; background: var(--ok); }
.onboarding-lead { margin: 0 0 10px; font-size: 14px; }
.onboarding-list { margin: 0; padding: 0; list-style: none; }
.onboarding-item { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-top: 1px solid var(--line); font-size: 14px; }
.onboarding-item:first-child { border-top: none; }
.onboarding-item-next { background: var(--group-bg); border-radius: var(--radius-sm); }
.onboarding-item-done .onboarding-body strong { color: var(--muted); font-weight: 500; }
.onboarding-mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: #FFFFFF;
}
.onboarding-item-done .onboarding-mark { background: var(--ok); border-color: var(--ok); }
.onboarding-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.onboarding-body small { color: var(--muted); font-size: 12px; }
.onboarding-sample { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg); border: 1px dashed var(--line-strong); }
.onboarding-sample p { margin: 0 0 8px; font-size: 13px; }
.onboarding-more { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

/* チェックリストの「次はここ」で移動したとき、上の帯に隠れないように */
#step3,
#step4 { scroll-margin-top: 80px; }
@media (max-width: 960px) { #step3, #step4 { scroll-margin-top: 16px; } }

.onboarding-hint {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--group-bg);
  color: var(--group-text);
  font-size: 13px;
  line-height: 1.7;
}

/* 開閉式の説明(班の一覧など) */
.help-card {
  margin: 0 0 16px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.help-card summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
}
.help-card[open] { padding-bottom: 12px; }
/* 畳んだカードを開けることが一目で分かるボタン風の札 */
.help-card .summary-toggle {
  margin-left: auto;
  flex-shrink: 0;
  padding: 4px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.help-card summary:hover .summary-toggle { border-color: var(--navy); }
.help-card[open] .summary-toggle .when-closed,
.help-card:not([open]) .summary-toggle .when-open { display: none; }
.help-card-body { font-size: 14px; line-height: 1.8; }
.help-card-body p { margin: 0 0 8px; }
.help-card-body ul { margin: 4px 0; padding-left: 1.4em; }
.help-card-body .card-title { margin: 18px 0 6px; font-size: 15px; }
.help-card-body .card-title:first-child { margin-top: 4px; }
.hint-banner summary { cursor: pointer; display: flex; align-items: center; min-height: 32px; }
.hint-banner[open] summary { margin-bottom: 4px; }

/* 説明の帯(時間割の操作のしかたなど) */
.hint-banner {
  margin: 0 0 16px;
  padding: 12px 16px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.hint-banner strong { color: var(--text); }
.hint-banner ul { margin: 4px 0 0; padding-left: 1.3em; }

.notice-card {
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.7;
}
.notice-card-warning { background-color: var(--warn-bg); border: 1px solid #F3C9A4; color: var(--warn-text); }

/* 1行に並べる小さなフォーム(会社の設定・資格・NGペアなど) */
.template-bar-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; max-width: 100%; }
.template-bar-form .form-control { width: auto; min-width: 0; max-width: 100%; }
.template-bar-form input[type="text"] { flex: 1 1 140px; }

/* ==================================================================
   時間割の表(班の時間割・すべての班の時間割)
================================================================== */
.board-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}
.board-page .page-header { margin-bottom: 16px; }

.header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.header-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
}
.header-main { min-width: 0; }
.header-main h2 { margin: 0 0 6px; font-size: 17px; }
.meta-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.matrix-board { max-width: 1040px; padding: 0 20px; }
.board-divider { max-width: 1040px; margin: 28px auto; border: none; border-top: 1px solid var(--line); }

.matrix-card {
  width: fit-content;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.matrix-scroll-wrapper { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }

.matrix-table { width: max-content; border-collapse: collapse; table-layout: fixed; }

.matrix-table th, .matrix-table td {
  border: 1px solid var(--line);
  padding: 4px;
  text-align: center;
  vertical-align: middle;
}

.matrix-table thead th {
  background-color: var(--bg);
  font-size: 12px;
  color: var(--muted);
  min-width: 110px;
  width: 110px;
  padding: 8px 4px;
}

.time-start { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.time-sep { font-size: 10px; color: var(--gray-400); margin: -2px 0; }
.time-end { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.time-slot-edit-form { margin: 0; }
.time-slot-edit-form .time-slot-row { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 4px; }
.time-slot-edit-form input[type="number"] {
  width: 46px;
  min-height: 30px;
  font-size: 12px;
  padding: 2px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}
.time-slot-edit-form .time-slot-unit { font-size: 11px; color: var(--muted); }
.time-slot-edit-form button {
  min-height: 30px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  cursor: pointer;
  border: 1px solid var(--navy);
  color: var(--navy);
  border-radius: 6px;
  background: var(--surface);
  font-family: inherit;
}
.time-slot-edit-form button:hover { background: var(--group-bg); }

/* 左端に固定する列(時間) */
.sticky-col {
  position: sticky;
  left: 0;
  background-color: var(--surface);
  z-index: 2;
  box-shadow: 1px 0 0 var(--line);
  min-width: 112px !important;
  width: 112px !important;
}
.header-staff { background-color: var(--bg) !important; z-index: 3; }
.staff-cell { text-align: left !important; padding-left: 12px !important; }

.post-meta-info { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }

.group-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* 崩れないよう、セルは幅を決めておく */
.slot-cell {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
  vertical-align: top;
  padding: 4px;
}

.standby-row td { background-color: var(--bg); }

/* 時間割のセル(ScheduleSlot#color_class)。配置場所ごとの色分けはしない(色が多いと読みにくい)。
   持ち場は白地に紺の文字、休憩は薄い灰色、待機は白地に点線の枠。色が分からなくても文字で分かる */
.cell-duty { background-color: var(--surface); color: var(--navy); font-weight: 700; }
.cell-rest { background-color: var(--cell-rest); color: var(--muted); border-color: var(--cell-rest); font-weight: 500; }
.cell-standby { background-color: var(--surface); color: var(--muted); border-color: var(--line-strong); font-weight: 500; outline: 1px dashed var(--line-strong); outline-offset: -4px; }

.slot-empty { color: var(--gray-300); }
.slot-cell.is-ng { background-color: var(--danger-bg); box-shadow: inset 0 0 0 2px var(--danger); }

/* 基本の交代時間と違うコマ(このコマだけ時間を変えている)。印は左の時刻のマスだけ(表のマスは白のまま) */
.time-header-custom { background-color: var(--warn-bg) !important; }


.time-row-label {
  background-color: var(--bg);
  font-size: 12px;
  color: var(--muted);
  min-width: 112px;
  width: 112px;
  padding: 8px 4px;
}


.slot-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---- 場所ごとの時間割(_matrix): 横 = 配置場所、縦 = 時刻、マス = そこに入る人の名札 ----
   壁に貼る配置表の形。色は少なく: 見出しとマスは白地に紺の文字、休憩の列だけ薄い灰色、待機の列は点線の名札。
   紺は今の行の帯だけに使い、どこを見ればいいかを1つにする */
.place-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  color: var(--navy);
  border-color: var(--line);
  border-bottom: 2px solid var(--line-strong);
  font-size: 14px;
  font-weight: 700;
  width: 104px;
  min-width: 104px;
  padding: 8px 4px;
  line-height: 1.35;
}
.place-matrix-table thead th.place-corner { z-index: 6; background: var(--surface) !important; color: var(--muted); font-weight: 500; font-size: 12px; }
.place-matrix-table thead th.place-col-off { color: var(--muted); }
.place-matrix-table thead th.place-col-rest { background: var(--cell-rest); }
.place-col-name { display: block; overflow-wrap: anywhere; }
.place-col-count { display: block; margin-top: 1px; font-size: 10.5px; font-weight: 500; color: var(--muted); }

.place-slot-cell { width: 104px; min-width: 104px; max-width: 104px; }
.place-slot-cell.place-col-rest { background-color: var(--cell-rest); }
.place-matrix-table .place-off-start { border-left: 2px solid var(--line-strong); }
.place-slot-list { min-height: 32px; gap: 4px; }

.place-tag {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 4px;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--navy);
  font-size: 14px;
  text-align: center;
}
.place-tag .slot-name { font-weight: 700; }
.place-tag .exp-badge { font-size: 10px; padding: 0 6px; line-height: 1.5; }
/* 休憩・待機の名札は点線。休憩は灰色の列に溶け込ませて控えめに、待機は白い名札のまま */
.place-col-off .place-tag { border-style: dashed; color: var(--muted); }
.place-col-off .place-tag .slot-name { font-weight: 500; }
.place-col-rest .place-tag { background: transparent; }
/* 全体の休憩回しの人(班に属さず全部の班を回る)の印。班の外から来た人と分かるよう、灰色の小さな札 */
.place-relief-mark {
  display: inline-block;
  padding: 0 4px;
  border-radius: var(--radius-sm, 4px);
  background: var(--bg);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}
/* 人が足りない時間(配置場所に誰もいない・人数が足りない) */
/* 名札(白地・実線の枠)と見分けるため、文字は灰色。枠の点線だけ注意の色 */
.place-gap {
  display: block;
  margin-top: 4px;
  padding: 3px 4px;
  border: 1px dashed var(--warn);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.place-slot-list:empty + .place-gap { margin-top: 0; }


/* この班の人と休憩の合計(見るだけ) */
.matrix-people { margin: 0 0 10px; }
.matrix-people-lead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 6px; }
.matrix-people-title { font-size: var(--fs-small); font-weight: 700; color: var(--navy); }
.matrix-people-note { font-size: 12px; color: var(--muted); }
.is-editing .matrix-person { cursor: pointer; box-shadow: inset 0 0 0 1px currentColor; }
.matrix-person.drop-target-highlight { outline: 2px solid var(--navy); outline-offset: 2px; }
/* 人ごとの表の列の見出しの名前(押すと、2人の1日を丸ごと入れ替える) */
.is-editing .person-staff-swappable { cursor: pointer; }
.matrix-people-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.matrix-person {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  min-height: 32px;
  align-content: center;
  padding: 3px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--navy);
  font-size: 13px;
  user-select: none;
  -webkit-user-select: none;
}
.matrix-person-name { font-weight: 700; }
/* 当日の朝に足した人の来る時刻(「13:00〜」) */
.staff-arrival { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.matrix-person .staff-rest-minutes { display: inline; font-size: 11.5px; color: var(--muted); }
.matrix-person .staff-relief-tag { display: inline-block; margin: 0; }
/* 班をまたいで休憩回しを共有する班の、休憩回しの人の一言(表の上) */
.matrix-relief-note { margin: 0 0 6px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.matrix-relief-note a { color: var(--navy-2); }
.matrix-person .staff-rest-other { white-space: nowrap; }

/* 時間割は1枚で全部の行を出し、縦は画面のスクロールだけにする(表の中と外で2回スクロールしない。班長の声)。
   横に入りきらないときだけ表の中を横に動かす(時刻の列は左に残る)。見出しの行は画面の上に貼り付ける(sticky_head_controller.js) */
.matrix-board .matrix-scroll-wrapper { max-height: none; overflow-x: auto; overflow-y: hidden; }
/* スマホ幅だけ、8コマごとに配置場所の名前の行をはさむ */
.place-repeat-head { display: none; }
.place-repeat-head td {
  padding: 3px 4px;
  background: var(--bg);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.place-repeat-head td.place-col-off { color: var(--muted); }
.place-repeat-head td.place-col-rest { background: var(--cell-rest); }
.place-repeat-head td.sticky-col { background: var(--bg); }

/* 名札を押して選んだ状態(tap_swap_controller.js) */
.tap-swap-selected { outline: 3px solid var(--navy); outline-offset: 2px; box-shadow: 0 0 0 6px rgba(45, 74, 128, 0.28); }

.tap-swap-guide {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--navy);
  color: #FFFFFF;
  font-size: 14px;
  box-shadow: var(--shadow-md);
}

/* 「休憩回し」の札(場所ごとの表の「この班の人」・人ごとの表の見出し) */
.staff-relief-tag {
  display: block;
  width: fit-content;
  margin: 2px auto 0;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
}



/* 時間割: 休憩の偏りと、休憩の無い人の知らせ */
.staff-rest-minutes { display: block; font-size: 11px; font-weight: 400; opacity: 0.9; }
.rest-warning { margin: 8px 0 0; padding: 8px 12px; border-radius: var(--radius-md); background: var(--warn-bg); color: var(--warn-text); font-size: 13px; }
.rest-overview { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); font-size: 14px; }
.rest-unshared { margin: 0 0 16px; padding: 12px 16px; }
.rest-unshared p, .rest-unshared ul { margin: 4px 0; }

/* 配置場所の「必要な時間」(11:00 〜 14:00) */
.need-time-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.need-time-sep { color: var(--muted); }

/* どのローテーションにも入っていない出勤の人の知らせ(.unassigned-pool-note)は、このファイルの終わりの方 */

/* 隊員への共有リンク */
.share-box {
  margin: 0 0 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.share-box-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 10px; }
.share-box-head strong { color: var(--navy); display: inline-flex; align-items: center; gap: 6px; }
.share-box-head .text-muted { font-size: 13px; }
.share-box-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-url { flex: 1 1 260px; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/* ==================================================================
   ドラッグ中
================================================================== */
.sortable-ghost { opacity: 0.4; }
.sortable-chosen { box-shadow: var(--shadow-md); }

.drop-target-highlight {
  outline: 3px solid var(--navy) !important;
  outline-offset: 1px;
  background-color: var(--group-bg) !important;
  transition: background-color 0.1s ease;
}

/* ==================================================================
   スタッフ一覧
================================================================== */
.staff-ng-heading { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.ng-pair-list { list-style: none; margin: 0 0 12px; padding: 0; }
.ng-pair-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ng-pair-list li:last-child { border-bottom: none; }

.staff-sort-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.staff-sort-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.staff-sort-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}
.staff-sort-tab:hover { border-color: var(--navy-2); color: var(--navy); }
.staff-sort-tab.is-current { background: var(--navy-2); border-color: var(--navy-2); color: #FFFFFF; font-weight: 700; }
/* スマホで文字が1字ずつ縦に折り返さないよう、表は横にスクロールして見る */
.staff-table th, .staff-table td { white-space: nowrap; }

.staff-filter-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.staff-filter-form .form-control { width: auto; flex: 1 1 150px; min-width: 0; }
.roster-join-actions { padding: 12px 16px; border-top: 1px solid var(--line); }
.roster-join-actions .form-help { margin: 6px 0 0; }
.staff-table label { cursor: pointer; font-weight: inherit; }

.staff-table td { vertical-align: middle; }
.staff-number { color: var(--muted); font-variant-numeric: tabular-nums; }
.staff-name { display: block; font-weight: 700; color: var(--text); }
.staff-kana { display: block; font-size: 12px; color: var(--muted); }
.staff-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* 出勤の切り替え: 今の状態を大きく、押したときの動きを小さく */
.attendance-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: var(--tap);
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  line-height: 1.25;
  cursor: pointer;
}
.attendance-toggle-state { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.attendance-toggle-hint { font-size: 11px; opacity: 0.85; }
.attendance-toggle.is-on { background: var(--ok-bg); border-color: #BFE0CD; color: var(--ok-text); }
.attendance-toggle.is-on:hover { border-color: var(--ok); }
.attendance-toggle.is-off:hover { border-color: var(--navy-2); color: var(--navy); }

/* スタッフの画面の「出勤を付け終わったら［配置から時間割まで作る］」 */
.daily-plan-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.daily-plan-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.daily-plan-text strong { color: var(--navy); font-size: 15px; }
.daily-plan-count { color: var(--muted); font-size: 13px; }
.daily-plan-count-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.rotation-count-note { margin-top: 10px; }
.daily-plan-form { margin: 0; }
@media (max-width: 640px) {
  .daily-plan-form, .daily-plan-form .btn { width: 100%; }
  .daily-plan-form { flex: 1 1 100%; }
}

/* チェックを付けた人をまとめて出勤にする */
.bulk-attend-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -4px 12px rgba(20, 33, 61, 0.06);
}
/* 角丸のはみ出しは切りつつ、下に付いてくる出勤ボタン(sticky)は効くようにする */
.table-card.staff-list-card { overflow: clip; }
.bulk-attend-bar .form-help { margin: 0; flex: 1 1 260px; }
.staff-pick-cell { width: 1%; }
.staff-pick-cell input { width: 20px; height: 20px; cursor: pointer; }

/* スマホでは表を横にスクロールさせず、1人を1枚のカードにして出勤ボタンと操作を見えるところに出す */
@media (max-width: 640px) {
  .staff-list-table thead { display: none; }
  .staff-list-table, .staff-list-table tbody { display: block; }
  .staff-list-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .staff-list-table tbody tr:hover { background: none; }
  .staff-list-table td { display: block; padding: 0; border: none; white-space: normal; }
  /* 名前と出勤ボタンで1行を埋め、番号などは次の行に送る */
  .staff-list-table .staff-pick-cell { order: 1; flex: 0 0 auto; width: auto; line-height: 0; }
  .staff-list-table .staff-pick-cell:empty { display: none; }
  .staff-list-table .staff-name-cell { order: 1; flex: 1 1 calc(100% - 180px); min-width: 0; }
  .staff-list-table .staff-attendance-cell { order: 2; flex: 0 0 auto; }
  .staff-list-table .staff-number,
  .staff-list-table .staff-meta { order: 3; font-size: 12px; color: var(--muted); }
  .staff-list-table td[data-label]::before { content: attr(data-label) " "; }
  .staff-list-table .staff-actions-cell { order: 4; flex-basis: 100%; margin-top: 6px; }
  /* よく使う「編集」を大きく。「削除」は押し間違えにくいよう広げない */
  .staff-list-table .staff-actions-cell .btn:first-child { flex: 1; }
  .staff-list-table td[colspan] { flex-basis: 100%; }
  .bulk-attend-bar { padding: 10px 16px; }
  .bulk-attend-bar .form-help { font-size: 12px; }
  .bulk-attend-bar .btn { flex: 1; }
}
/* スタッフの登録・編集の一覧(スマホ): 名前を1段目に、社員番号・評価などは2段目に並べる。空の欄は出さない */
@media (max-width: 640px) {
  .staff-manage-table .staff-name-cell { flex-basis: 100%; }
  .staff-manage-table td:empty { display: none; }
}

/* 取り込み(CSV・写真)のフォームの1行 */
.file-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.file-row input[type="file"] { max-width: 100%; font: inherit; font-size: 14px; }

/* エクセルからの貼り付け(スタッフ画面の「スタッフを増やす」) */
.paste-roster-form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.paste-roster-textarea { width: 100%; min-height: 8em; font-size: 16px; line-height: 1.6; tab-size: 8; }

/* 貼り付けた名簿の「列の割り当て」: 列ごとに見本と選択欄を並べる(スマホは1列ずつ縦に) */
.paste-columns { margin-top: 16px; }
.paste-columns form { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.paste-columns-warnings { margin-bottom: 12px; }
.paste-columns-title-note { display: flex; gap: 6px; align-items: flex-start; }
.paste-columns-title-note .icon { flex: 0 0 auto; margin-top: 3px; }
.paste-columns-warnings p { display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.paste-columns-warnings p + p { margin-top: 4px; }
.paste-columns-warnings .icon { flex: 0 0 auto; margin-top: 4px; }
.paste-columns-header { display: flex; align-items: flex-start; gap: 8px; font-weight: 700; cursor: pointer; }
.paste-columns-header input { width: 20px; height: 20px; flex: 0 0 auto; margin: 2px 0 0; }
.paste-columns-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; width: 100%; }
.paste-column { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--gray-25); }
.paste-column-label { font-weight: 700; font-size: 14px; color: var(--navy); overflow-wrap: anywhere; }
.paste-column-heading { font-weight: 400; color: var(--muted); }
.paste-column-samples { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); }
.paste-column-samples li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paste-column .form-control { width: 100%; font-size: 16px; }
@media (max-width: 640px) {
  .paste-columns { padding: 14px; }
  .paste-columns-list { grid-template-columns: minmax(0, 1fr); }
  .paste-columns form .btn { width: 100%; justify-content: center; }
}

/* 名簿の確認(写真・貼り付け): PC は表のように1行に並べ、スマホは1人ずつのカードにする */
.roster-confirm { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.roster-confirm-head,
.roster-confirm-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1.3fr);
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
}
/* 貼り付けは区分の列が増える */
.roster-confirm.has-type .roster-confirm-head,
.roster-confirm.has-type .roster-confirm-row {
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1.3fr);
}
.roster-confirm-type-default { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.roster-confirm-type-default label { font-weight: 700; }
.roster-confirm-type-default .form-control { width: 12em; max-width: 100%; font-size: 16px; }
.roster-confirm-type-default .form-help { flex-basis: 100%; margin: 0; }
.roster-confirm-head { font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--gray-25); }
.roster-confirm-head span:first-child { text-align: center; }
.roster-confirm-row + .roster-confirm-row { border-top: 1px solid var(--line); }
.roster-confirm-row.is-flagged { background: var(--warn-bg); }
.roster-confirm-row.is-flagged .badge { background: var(--surface); border: 1px solid #F3C9A4; }
.roster-confirm-row.is-flagged .badge-danger { border-color: currentColor; }
.roster-confirm-check { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 40px; cursor: pointer; }
.roster-confirm-check input { width: 20px; height: 20px; }
.roster-confirm-field { display: block; min-width: 0; margin: 0; }
.roster-confirm-field .form-control { width: 100%; }
.roster-confirm-status { font-size: 13px; min-width: 0; }
.roster-confirm-status .badge { white-space: normal; text-align: left; border-radius: 8px; line-height: 1.5; }
.roster-confirm-mobile-label { display: none; }
.roster-confirm-changes { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.roster-confirm-attend { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.roster-confirm-attend input { width: 20px; height: 20px; }
.roster-confirm-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 640px) {
  .roster-confirm-head { display: none; }
  .roster-confirm-row,
  .roster-confirm.has-type .roster-confirm-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; padding: 12px; }
  .roster-confirm-check { justify-content: flex-start; min-height: 0; font-weight: 700; }
  .roster-confirm-status { text-align: right; }
  .roster-confirm-field:nth-of-type(3) { grid-column: 1 / -1; order: -1; }
  .roster-confirm-check { order: -2; }
  .roster-confirm-status { order: -2; }
  .roster-confirm-mobile-label { display: inline; font-size: 12px; color: var(--muted); }
  .roster-confirm-field .roster-confirm-mobile-label { display: block; margin-bottom: 2px; }
  /* 下に付いてくる登録ボタンの帯は、名簿を隠しすぎないよう低くする */
  .roster-confirm + .sticky-actions { padding: 10px 12px; gap: 8px; }
  .roster-confirm-buttons { flex-wrap: nowrap; width: 100%; gap: 8px; }
  .roster-confirm-buttons .btn-large { flex: 1 1 auto; padding: 12px 10px; font-size: 15px; }
  .roster-confirm-buttons .btn-outline { flex: 0 0 auto; padding-inline: 14px; }
}

/* 写真取り込みの確認: スクロールしても押せる位置に付いてくる */
.sticky-actions {
  position: sticky;
  bottom: 0;
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 -4px 12px rgba(20, 33, 61, 0.06);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* NGペアの登録フォームの「と」 */
.ng-pair-joint { align-self: center; padding-top: 22px; font-weight: 700; color: var(--muted); }

/* 会社の設定: ユーザーの役割・担当現場・パスワードを1行に並べる(狭い画面では折り返す) */
.user-role-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-role-form .form-control { width: auto; max-width: 260px; }

/* お支払いの状態 */
.billing-status p { margin: 0 0 6px; }
.billing-status p:last-child { margin-bottom: 0; }
.plan-list { margin: 0 0 12px; padding-left: 1.3em; color: var(--muted); font-size: 13px; line-height: 1.8; }

/* ログイン・申し込みの画面(幅を狭くして真ん中に) */
.auth-page { max-width: 440px; }
.auth-page.is-wide { max-width: 640px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin: 32px 0 0; color: var(--navy); font-size: 18px; font-weight: 900; }
.auth-note { margin: 16px 0 0; font-size: 14px; }

/* ==================================================================
   確認ダイアログ(data-turbo-confirm。app/javascript/confirm_dialog.js)
================================================================== */
.confirm-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: min(440px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-family: var(--font-sans);
}
.confirm-dialog::backdrop { background: rgba(20, 33, 61, 0.45); }
.confirm-dialog-message { margin: 0 0 20px; line-height: 1.7; white-space: pre-wrap; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

/* ==================================================================
   利用規約などの文章のページ
================================================================== */
.legal-page { max-width: 760px; line-height: 1.9; }
.legal-page .page-title { margin: 28px 0 16px; }
.legal-page h2 { font-size: 17px; margin: 28px 0 8px; }
.legal-page ol,
.legal-page ul { padding-left: 1.5em; }
.legal-page .data-table th { width: 30%; min-width: 120px; color: var(--muted); font-weight: 700; font-size: 13px; vertical-align: top; }
.legal-page .data-table td { line-height: 1.8; }

/* 画面の一番下のリンク(利用規約など) */
.site-footer {
  max-width: 1040px;
  margin: 40px auto 24px;
  padding: 0 20px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 4px 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.site-footer a { color: inherit; display: inline-flex; align-items: center; min-height: 36px; }

/* ==================================================================
   隊員向けの閲覧専用ページ(/s/:token)。古いスマホでも見られるよう、基本の作りだけで組む
================================================================== */
.shared-page { max-width: 1000px; margin: 0 auto; padding: 16px; }

.shared-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 900;
}

.shared-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.shared-header .page-title { font-size: 22px; }

.shared-staff-picker {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
/* 名前を選ぶ欄と「表示する」ボタン(選んでも切り替わらない端末向け)を横に並べる */
.shared-staff-picker-row { display: flex; gap: 8px; align-items: stretch; }
.shared-staff-picker-row .form-control { flex: 1 1 auto; min-width: 0; }
.shared-staff-picker-row .btn { flex: none; min-height: var(--tap); }

.shared-group { margin-bottom: 24px; }
.shared-relief-lead { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.shared-relief-group-name { display: block; font-size: 11px; color: var(--muted); }
.shared-group h2,
.shared-personal h2 { font-size: 17px; margin: 0 0 8px; }

.shared-matrix-table td,
.shared-matrix-table th { white-space: nowrap; font-size: 14px; padding: 8px 10px; }
.shared-matrix-table thead th { background: var(--surface); color: var(--navy); font-size: 14px; font-weight: 700; border-bottom: 2px solid var(--line-strong); }

.shared-time { font-variant-numeric: tabular-nums; }

/* 表の見かた(色の見本)。表のコマと同じ色・同じ書き方 */
.shared-legend { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.shared-legend li { display: flex; align-items: center; gap: 6px; }
.shared-legend-swatch { display: inline-block; padding: 2px 8px; border-width: 1px; border-style: solid; border-radius: 4px; font-size: 12px; line-height: 1.6; }
.shared-legend-swatch.cell-duty { border-color: var(--line-strong); }
.shared-legend-now { background: var(--now-bg); border-color: var(--now-bg); color: #FFFFFF; font-weight: 700; }
/* ほかの表(別の班・別の配置場所)に入っている時間。空きと見分けられるよう、点線の枠と薄い文字 */
.shared-elsewhere { color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 4px; background: var(--surface); }
.shared-matrix-table td.shared-elsewhere-cell { padding: 3px 4px; }
.shared-elsewhere-cell .shared-elsewhere { display: block; padding: 2px 6px; font-size: 12px; text-align: center; }
.shared-elsewhere-cell .shared-elsewhere small { display: block; font-size: 10px; }

.shared-timeline { list-style: none; padding: 0; margin: 0 0 16px; }
.shared-timeline-item {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 16px;
}
.shared-timeline-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 7.5em; margin-right: 12px; color: var(--navy); }
.shared-timeline-item.cell-duty .shared-timeline-place { font-size: 17px; }
.shared-timeline-item.cell-rest,
.shared-timeline-item.cell-standby { font-weight: 500; color: var(--muted); }
.shared-timeline-item.cell-rest { background: var(--cell-rest); border-color: var(--cell-rest); }
.shared-timeline-item.cell-standby { border-style: dashed; border-color: var(--line-strong); outline: 0; }
.shared-timeline-item.cell-rest .shared-timeline-time,
.shared-timeline-item.cell-standby .shared-timeline-time { color: var(--muted); }

/* 配置場所の「スタッフ向けの説明」。名前を押すとその場で開く(details/summary だけで、JS は使わない) */
.post-guide { display: inline-block; max-width: 100%; vertical-align: top; text-align: left; }
.post-guide-name {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  list-style: none;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.post-guide-name::-webkit-details-marker { display: none; }
.post-guide-name::marker { content: ""; }
.post-guide-mark { display: inline-flex; color: var(--navy-2); transition: transform 0.15s ease; }
.post-guide[open] .post-guide-mark { transform: rotate(90deg); }
.post-guide-body {
  margin-top: 6px;
  padding: 8px 10px;
  min-width: 13em;
  max-width: 22em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: anywhere;
}
.post-guide-body p, .post-guide-text { margin: 0 0 4px; }
.post-guide-body p:last-child { margin-bottom: 0; }
.shared-timeline-time { flex: none; white-space: nowrap; }
.shared-timeline-place { flex: 1; min-width: 0; }
.shared-timeline-place .post-guide-body { font-size: 15px; max-width: none; }
.post-guide-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 14px; margin: 8px 0 0; font-size: 14px; }
.post-guide-list-label { flex-basis: 100%; color: var(--muted); font-size: 12px; font-weight: 700; }
@media (max-width: 480px) {
  .post-guide-body { min-width: 11em; max-width: calc(100vw - 64px); }
}
.guide-caution {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 13px;
  line-height: 1.6;
}
.guide-caution .icon { flex: none; margin-top: 2px; }

/* 現場のルール(Site#rules_text)。共有ページでは時間割の上に閉じて置き、押すと開く(JS なし)。
   掲示板に貼った紙のように、左に紺の線を引いて「全員の決まり」と分かるようにする */
.site-rules {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius-lg);
}
.site-rules-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 12px;
  min-height: 48px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}
.site-rules-summary::-webkit-details-marker { display: none; }
.site-rules-summary::marker { content: ""; }
.site-rules-summary:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; border-radius: var(--radius-lg); }
.site-rules-title { display: inline-flex; align-items: center; gap: 6px; color: var(--navy); font-size: 16px; font-weight: 700; }
.site-rules-updated { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.site-rules-summary .post-guide-mark { margin-left: auto; }
.site-rules[open] .post-guide-mark { transform: rotate(90deg); }
.site-rules-body { padding: 12px 16px 14px; border-top: 1px solid var(--line); font-size: 15px; }
/* ルールの文章(共有ページ・編集画面の1つ前の文章)。改行はそのまま、長い英数字も折り返す */
.rules-text { line-height: 1.8; overflow-wrap: anywhere; }
.rules-text p { margin: 0 0 8px; }
.rules-text p:last-child { margin-bottom: 0; }

/* 時間割の画面の共有リンクのカードの中の、現場のルールへの入口 */
.share-box-rules {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.share-box-rules .icon { color: var(--navy-2); vertical-align: -3px; margin-right: 4px; }
.share-box-rules a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 700; }

/* 現場のルールの編集画面 */
.rules-edit-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 4px; }
.rules-edit-head h3 { margin: 0; }
.rules-updated { color: var(--muted); font-size: 13px; }
.rules-textarea { min-height: 18em; line-height: 1.8; font-size: 16px; }
.rules-textarea + .form-help { margin-top: 6px; }
.rules-previous {
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.rules-previous summary { cursor: pointer; color: var(--navy-2); font-weight: 700; min-height: 32px; display: list-item; }
.rules-previous-body {
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
}

/* スタッフからの報告(StaffReport) ------------------------------------------------ */
/* 共有ページの見出しの横のボタン(報告する・印刷) */
.shared-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* 共有ページの下の入口。時間割を見終えたところに、目立たせずに置く */
.report-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 24px 0 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.report-entry-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.report-entry-text strong { display: inline-flex; align-items: center; gap: 6px; color: var(--navy); font-size: 15px; }
.report-entry-text span { color: var(--muted); font-size: 13px; }

/* 送る画面。本文を書くことだけに集中できるよう、幅を狭くして1列に並べる */
.report-page { max-width: 640px; }
.report-page .back-link { margin-top: 0; }
.report-page-title { font-size: 22px; margin: 4px 0 12px; }
.report-guide {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--group-bg);
  border-radius: var(--radius-md);
  color: var(--group-text);
  font-size: 15px;
  line-height: 1.7;
}
.report-guide p { margin: 0; }
.report-guide p + p { margin-top: 4px; font-size: 14px; }
.report-page .flash { margin-bottom: 16px; }
.report-form {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.report-textarea { min-height: 11em; font-size: 16px; line-height: 1.7; }
.report-form input.form-control { font-size: 16px; } /* iPhone で欄を押したときに拡大されないよう16px */
.report-count { margin: 6px 0 0; text-align: right; }
.report-optional { color: var(--muted); font-weight: 400; font-size: 13px; }
.report-submit { width: 100%; }
.report-notes { margin: 16px 0 0; padding-left: 1.2em; color: var(--muted); font-size: 13px; line-height: 1.7; }
.report-notes li + li { margin-top: 4px; }

/* 送ったあと */
.report-sent {
  padding: 20px 18px;
  background: var(--surface);
  border: 1px solid #BFE0CD;
  border-radius: var(--radius-lg);
}
.report-sent-message { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ok-text); font-size: 16px; font-weight: 700; }
.report-sent-sub { margin: 6px 0 16px; color: var(--muted); font-size: 14px; }
.report-sent-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* 責任者の一覧の画面 */
.report-acceptance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.report-acceptance-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; }
.report-acceptance-text strong { display: inline-flex; align-items: center; gap: 8px; color: var(--navy); font-size: 16px; }
.report-acceptance-text span { color: var(--muted); font-size: 13px; line-height: 1.6; }
.report-acceptance-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-400); flex: none; }
.report-acceptance.is-on .report-acceptance-dot { background: var(--ok); }
.report-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.report-list { list-style: none; margin: 0; padding: 0; }
.report-item {
  margin-bottom: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
/* 未確認は左に紺の線を引いて、確認済みと見分ける */
.report-item.is-unchecked { border-left: 4px solid var(--navy); }
.report-item.is-checked .report-item-body { color: var(--muted); }
.report-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 8px; font-size: 13px; }
.report-item-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.report-item-name { color: var(--navy); font-weight: 700; }
.report-item-name.is-anonymous { color: var(--muted); font-weight: 400; }
.report-new-badge {
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--group-bg);
  color: var(--group-text);
  font-size: 12px;
  font-weight: 700;
}
.report-item-body { font-size: 15px; }
.report-item-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.report-checked-by { display: inline-flex; align-items: center; gap: 4px; color: var(--ok-text); overflow-wrap: anywhere; }
/* 削除は右の端に離して置き、「確認した」と押し間違えないようにする */
.report-item-foot > form:last-child { margin-left: auto; }
.btn-link-plain {
  min-height: 36px;
  padding: 0 4px;
  background: none;
  border: 0;
  color: var(--navy-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-link-plain:hover { color: var(--navy); }
.report-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 14px; font-weight: 700; }
.report-pager a { display: inline-flex; align-items: center; min-height: var(--tap); }
.report-unchecked-count { margin-left: 6px; color: var(--navy); }
.share-box-reports { margin-top: 0; border-top: 0; padding-top: 0; }

/* スタッフからの報告を、トラブル報告に上げたあとのつなぎ */
.report-raised { display: inline-flex; align-items: center; min-height: 36px; color: var(--navy-2); font-weight: 700; }

/* トラブル報告(TroubleReport) ------------------------------------------------------ */
/* 区分の札。色だけに頼らず、いつも文字を入れる。枠の線で形も見えるようにする */
.trouble-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.trouble-tag-trouble { background: var(--group-bg); color: var(--group-text); }
.trouble-tag-accident { background: var(--danger-bg); color: var(--danger-text); }
.trouble-tag-injury { background: var(--warn-bg); color: var(--warn-text); }
.trouble-tag-lost_person { background: #E1F0F3; color: #1D5866; }
.trouble-tag-other { background: var(--solo-bg); color: var(--solo-text); }

.trouble-checked { display: inline-flex; align-items: center; gap: 4px; color: var(--ok-text); font-weight: 700; overflow-wrap: anywhere; }

/* 個人プランの人への案内(控えめに) */
.trouble-plan-guide {
  max-width: 560px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.trouble-plan-guide p { margin: 0 0 10px; }
.trouble-plan-guide-lead { color: var(--navy); font-size: 16px; font-weight: 700; }
.trouble-gone { margin-top: 28px; }
/* 個人プランに戻った会社の管理者だけ: 法人のときの報告を消す一覧(中身は出さない) */
.trouble-leftover { max-width: 560px; }
.trouble-leftover-note { margin: 0 0 10px; font-size: 13px; line-height: 1.7; }
.trouble-leftover-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.trouble-leftover-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 14px; font-size: 14px; }
.trouble-leftover-list li + li { border-top: 1px solid var(--line); }
.trouble-leftover-when { font-variant-numeric: tabular-nums; }
.trouble-leftover-site { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.trouble-leftover-list form { margin-left: auto; }

/* 一覧: 業務日誌のように、左に起きた時刻、右に中身を並べる */
.trouble-filters { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; margin-bottom: 4px; }
.trouble-filters .report-tabs { margin-bottom: 8px; }
.trouble-site-filter { display: flex; gap: 6px; min-width: 0; max-width: 100%; }
.trouble-site-filter .form-control { width: auto; max-width: 100%; min-width: 0; }
.trouble-list { list-style: none; margin: 0; padding: 0; }
.trouble-list > li + li { margin-top: 10px; }
.trouble-entry {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
}
.trouble-entry:hover { border-color: var(--line-strong); }
.trouble-entry:focus-visible { outline: 3px solid rgba(45, 74, 128, 0.35); outline-offset: 2px; }
.trouble-entry.is-unchecked { border-left: 4px solid var(--navy); padding-left: 13px; }
.trouble-entry-when { display: flex; flex-direction: column; gap: 2px; padding-right: 12px; border-right: 1px solid var(--line); }
.trouble-entry-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.trouble-entry-time { color: var(--navy); font-size: 22px; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.trouble-entry-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trouble-entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.trouble-entry-site { color: var(--navy); font-weight: 700; }
.trouble-entry-place { color: var(--muted); overflow-wrap: anywhere; }
.trouble-entry-body { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.trouble-entry.is-checked .trouble-entry-body { color: var(--muted); }
.trouble-entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); font-size: 12px; }
.trouble-entry-meta > span { display: inline-flex; align-items: center; gap: 3px; }
.trouble-entry-author { overflow-wrap: anywhere; min-width: 0; }

/* 書く画面 */
.trouble-form-page { max-width: 680px; }
.trouble-form-title { font-size: 22px; margin: 4px 0 6px; }
.trouble-form-site { margin: 0 0 14px; font-size: 14px; }
.trouble-form-site .text-muted { font-size: 12px; margin-left: 4px; }
.trouble-form-reselect { margin: 8px 0 0; font-size: 13px; }
.trouble-category-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.trouble-category-choice { position: relative; display: inline-flex; cursor: pointer; }
.trouble-category-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.trouble-category-choice .trouble-tag { min-height: var(--tap); padding: 0 14px; font-size: 15px; border-color: var(--line-strong); }
.trouble-category-choice input:checked + .trouble-tag { border-color: currentColor; box-shadow: inset 0 0 0 1.5px currentColor; }
.trouble-category-choice input:checked + .trouble-tag::before { content: ""; width: 8px; height: 13px; margin-right: 8px; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: translateY(-2px) rotate(45deg); }
.trouble-category-choice input:focus-visible + .trouble-tag { outline: 3px solid rgba(45, 74, 128, 0.35); outline-offset: 2px; }
.trouble-datetime { max-width: 260px; font-size: 16px; }
.trouble-place-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.trouble-form .form-control { font-size: 16px; } /* iPhone で欄を押したときに拡大されないよう16px */
.trouble-photo-input { display: block; max-width: 100%; font-size: 14px; }

/* 1件の画面 */
.trouble-show-page { max-width: 760px; }
.trouble-sheet {
  margin-top: 4px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.trouble-sheet.is-unchecked { border-top: 4px solid var(--navy); }
.trouble-sheet-head { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.trouble-sheet-title { margin: 8px 0 10px; color: var(--navy); font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.trouble-sheet-facts { display: grid; gap: 4px; margin: 0; font-size: 14px; }
.trouble-sheet-facts > div { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 8px; }
.trouble-sheet-facts dt { color: var(--muted); }
.trouble-sheet-facts dd { margin: 0; overflow-wrap: anywhere; }
.trouble-sheet-body { font-size: 16px; }
.trouble-photos { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0 0; padding: 0; }
.trouble-photos a { display: block; border-radius: var(--radius-md); overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.trouble-photos img { display: block; width: 100%; height: 220px; object-fit: cover; }
.trouble-source { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.trouble-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.trouble-comments .section-heading { margin-top: 28px; }
.trouble-comment-list { list-style: none; margin: 0 0 14px; padding: 0; border-left: 2px solid var(--line-strong); }
.trouble-comment { padding: 4px 0 12px 14px; }
.trouble-comment + .trouble-comment { padding-top: 12px; border-top: 1px dashed var(--line); }
.trouble-comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-bottom: 4px; font-size: 13px; }
.trouble-comment-who { color: var(--navy); font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.trouble-comment-role { padding: 0 8px; border-radius: var(--radius-full); background: var(--solo-bg); color: var(--solo-text); font-size: 12px; }
.trouble-comment-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.trouble-comment-head form { margin-left: auto; }
.trouble-comment-delete { font-size: 13px; font-weight: 400; }
.trouble-comment-empty { margin: 0 0 14px; font-size: 14px; }
.trouble-comment-form { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.trouble-comment-textarea { font-size: 16px; line-height: 1.7; }
.trouble-comment-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.trouble-danger-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 32px; font-size: 13px; }

@media (max-width: 640px) {
  .trouble-entry { grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .trouble-entry.is-unchecked { padding-left: 9px; }
  .trouble-entry-when { padding-right: 8px; }
  .trouble-entry-date { font-size: 11px; white-space: normal; }
  .trouble-entry-time { font-size: 19px; }
  .trouble-place-fields { grid-template-columns: minmax(0, 1fr); }
  .trouble-sheet { padding: 14px; }
  .trouble-sheet-title { font-size: 20px; }
  .trouble-photos img { height: 150px; }
  .trouble-filters { flex-direction: column; align-items: stretch; }
}

/* 共有ページの一番下の紹介(小さく目立たせない) */
.shared-footer { margin: 32px 0 16px; font-size: 12px; color: var(--muted); text-align: center; }
.shared-footer a { color: inherit; text-decoration: underline; }

/* ==================================================================
   印刷: 画面操作用の部品を隠し、時間割の表だけを紙に収める
================================================================== */
@media print {
  .navbar,
  .work-date-bar,
  .account-notice,
  .flash-wrapper,
  .header-actions,
  .hint-banner,
  .onboarding-hint,
  .time-slot-edit-form,
  .ng-alert-banner,
  .post-guide-body,
  .post-guide-mark,
  .no-print {
    display: none !important;
  }

  /* 説明は印刷しない(開いていても)。名前はふつうの文字にする */
  .post-guide-name { text-decoration: none; }

  body { background: #FFFFFF; }

  .matrix-scroll-wrapper { overflow: visible !important; max-height: none !important; }
  .place-matrix-table thead th { position: static; }
  .place-repeat-head { display: none !important; }

  .rotation-show-container,
  .shared-group { break-inside: avoid; }

  .slot-cell,
  .matrix-table td,
  .matrix-table th,
  .matrix-person,
  .place-tag {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ==================================================================
   狭い画面
================================================================== */
@media (max-width: 640px) {
  .container,
  .page-container,
  .board-page { padding-left: 16px; padding-right: 16px; }
  .rotation-show-container { padding: 0 16px 24px; }
  .flash-wrapper { padding: 12px 16px 0; }
  .page-header { margin: 20px 0 16px; }
  .page-title { font-size: 22px; }
  .card, .form-card, .cluster-card, .policy-card, .aside-card { padding: 16px; }
  .header-actions .btn { flex: 1 1 auto; }
  .form-actions .btn { flex: 1 1 auto; }
}

/* ==================================================================
   時間割の記録(records/show)・その日のメモ
================================================================== */
.record-filter .form-row { margin-bottom: 8px; }
.record-filter .form-help { margin: 0; }
.record-filter-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.record-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.7;
}
.record-print-head { display: none; }
.record-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.record-post-grid .card { margin-bottom: 0; }
.record-post { padding: 16px; }
.record-post-link { color: var(--navy); text-decoration: none; }
.record-post-link:hover { text-decoration: underline; }
.record-blocks th, .record-blocks td { padding: 8px 10px; }
.record-focus-list { list-style: none; margin: 0 0 16px; padding: 0; }
.record-focus-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.record-focus-list li:last-child { border-bottom: none; }
.record-focus-name, .record-focus-flow { margin: 0; }
.record-focus-flow { font-size: 13px; }
.record-subheading { font-size: 14px; font-weight: 700; color: var(--navy); margin: 8px 0; }
.record-row-focus td, .record-row-focus th { background: var(--group-bg); }
.record-change-list { list-style: none; margin: 0; padding: 0; }
.record-change-list > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.record-change-list > li:last-child { border-bottom: none; }
.record-change-head { margin: 0 0 4px; font-size: 14px; }
.record-change-details { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.7; }
.record-change-none { margin: 0; font-size: 13px; }
/* 時間割を作ったときの記録(畳んでおき、押すと開く) */
.record-change-fold > summary { cursor: pointer; color: var(--text); }
.record-change-fold > summary::marker { color: var(--navy-2); }
.record-change-fold[open] > summary { margin-bottom: 6px; }
.record-export-lead { margin: 0 0 12px; }
.record-export-period { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.record-export-period .form-group { margin-bottom: 0; flex: 1 1 140px; min-width: 0; max-width: 220px; }
.record-export-period .form-control { width: 100%; }
.record-export-tilde { padding-bottom: 10px; color: var(--muted); }
.record-export-kinds { list-style: none; margin: 0 0 8px; padding: 0; }
.record-export-kinds li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.record-export-kinds .btn { flex: 0 0 auto; min-width: 140px; justify-content: center; }
.record-export-kinds .text-muted { font-size: 13px; line-height: 1.6; }
.record-export-form .form-help { margin: 0; }
.record-export-locked { margin: 0; font-size: 14px; line-height: 1.7; }
@media (max-width: 480px) {
  .record-export-kinds li { flex-direction: column; align-items: stretch; gap: 6px; }
}
.day-note-list { list-style: none; margin: 0 0 12px; padding: 0; }
.day-note { padding: 8px 0; border-bottom: 1px solid var(--line); }
.day-note-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.day-note-meta { margin: 2px 0 0; font-size: 12px; }
.day-note-empty { margin: 0 0 12px; }
.day-note-form .form-control { width: 100%; margin-bottom: 6px; }
.day-note-form .form-help { margin-bottom: 8px; }

@media print {
  .record-print-head { display: block; margin: 0 0 12px; font-size: 14px; }
  .record-page .page-subtitle { display: none; }
  .record-page .card { break-inside: avoid; border-color: #999; }
  .record-post-grid { grid-template-columns: 1fr 1fr; }
  .record-row-focus td, .record-row-focus th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.board-notes { margin-top: 24px; }
.board-notes-link { font-size: 13px; margin: -8px 0 16px; }

/* ==================================================================
   見直し(2): 全画面に効く共通部品の手直し
   - スマホの日付の帯を2段にまとめる
   - 小さな一覧の表を、スマホでは1行=1枚のカードにする(.table-stack)
   - 開け閉めできる札(details)に、開くことが分かる印を付ける
================================================================== */

/* 見出しの段: 一覧へ戻るリンクと見出しの間をそろえる */
.page-header .page-subtitle { line-height: 1.75; }
.page-title + .page-subtitle { margin-top: 6px; }
.section-heading { line-height: 1.45; }
.form-card h3, .card-title { line-height: 1.45; }

/* 表: 見出しの段を少し落ち着かせ、数字はけたをそろえる */
.data-table thead th { letter-spacing: 0.02em; }
.data-table td { font-variant-numeric: tabular-nums; }
.data-table td.cell-actions,
.data-table th:last-child { white-space: nowrap; }

/* 「削除」などの文字だけのボタンが1字ずつ縦に折れないように */
.link-danger { white-space: nowrap; }

/* 開け閉めできる札: 右端に「開く」向きの矢印(線)を出し、開いたら上向きにする */
.help-card > summary,
.hint-banner > summary { list-style: none; }
.help-card > summary::-webkit-details-marker,
.hint-banner > summary::-webkit-details-marker { display: none; }
.hint-banner > summary { min-height: var(--tap); gap: 8px; color: var(--navy); }
details.hint-banner { padding-top: 0; padding-bottom: 0; }
details.hint-banner[open] { padding-bottom: 12px; }
.help-card > summary:not(:has(.summary-toggle))::after,
.hint-banner > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 4px 4px auto;
  border-right: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: rotate(45deg);
}
.help-card[open] > summary:not(:has(.summary-toggle))::after,
.hint-banner[open] > summary::after { margin-top: 6px; margin-bottom: 0; transform: rotate(-135deg); }
.help-card > summary:hover::after,
.hint-banner > summary:hover::after { border-color: var(--navy); }

/* 空のときの枠: 線の印の丸を上に置けるようにし、文字の幅を読みやすく絞る */
.empty-state p { max-width: 34em; margin-left: auto; margin-right: auto; line-height: 1.8; }
.empty-state .btn { margin-top: 16px; }

@media (max-width: 640px) {
  /* ---- 日付の帯: 「前の日・日付・次の日」を1段目、「現場・日付を選ぶ・今日へ」を2段目に ---- */
  .work-date-bar-inner { row-gap: 0; column-gap: 8px; padding: 8px 16px; }
  .work-date-controls { display: contents; }
  .work-date-prev, .work-date-current, .work-date-next { order: 0; }
  .work-date-current {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0 6px;
    padding: 0;
    font-size: 15px;
    text-align: center;
  }
  .work-date-bar-inner::after { content: ""; order: 1; flex: 0 0 100%; height: 0; }
  .work-site, .work-date-today, .work-date-pick { order: 2; margin-top: 8px; }
  .work-site { flex: 1 1 0; min-width: 0; gap: 6px; }
  .site-switcher { flex: 1 1 auto; }
  .site-switcher select { width: 100%; max-width: none; min-width: 0; }
  .work-date-pick .work-date-input { width: 148px; }
  .work-date-bar .btn-sm { min-height: 40px; padding: 0 10px; }

  /* ---- 小さな一覧の表: 1行を1枚に。項目名は左に小さく ---- */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr { display: block; width: 100%; }
  .table-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-stack tbody tr:last-child { border-bottom: 0; }
  .table-stack tbody tr:hover { background: none; }
  .table-stack td {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 3px 0;
    border: 0;
    white-space: normal;
    text-align: left;
  }
  .table-stack td.text-center { text-align: left; }
  .table-stack td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 7.5em;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }
  .table-stack td.cell-main { padding-bottom: 6px; font-size: 15px; overflow-wrap: anywhere; }
  .table-stack td > .template-bar-form { flex: 1 1 auto; }
  .table-stack td.cell-block { display: block; }
  .table-stack td.cell-block::before { display: block; margin-bottom: 6px; }
  .table-stack td.cell-actions { padding-top: 8px; flex-wrap: wrap; }
  .table-stack td.cell-actions:empty { display: none; }
  .table-stack td[colspan] { display: block; padding: 8px 0; text-align: center; }

  /* 人数の多い表(会社の名簿): 1段目に名前と操作、2段目に番号などを小さく */
  .table-stack-compact tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 10px 16px; }
  .table-stack-compact td { display: block; padding: 0; }
  .table-stack-compact td.cell-main { order: 0; flex: 1 1 calc(100% - 140px); min-width: 0; padding: 0; font-weight: 700; }
  .table-stack-compact td.cell-actions { order: 1; padding: 0; }
  .table-stack-compact td[data-label] { order: 2; font-size: 12px; color: var(--muted); }
  .table-stack-compact td[data-label]::before { content: attr(data-label) " "; display: inline; flex: none; }

  /* ログインできる人の入力欄は横幅いっぱいに */
  .user-role-form .form-control { width: 100%; max-width: none; }
  .user-role-form .checkbox-list { flex-basis: 100%; }

  /* 特商法の表記など: 項目名を上、内容を下にして、内容を横幅いっぱいで読めるように */
  .legal-page .data-table th,
  .legal-page .data-table td { display: block; width: auto; }
  .legal-page .data-table th { padding-bottom: 0; border-bottom: 0; }
  .legal-page .data-table td { padding-top: 4px; }

  /* 詳細画面の項目名の列を細く */
  .detail-table th { width: 9.5em; padding-right: 8px; }
}

/* ==================================================================
   見直し(3): 情報の重みで差をつける
   - 文字の段を5つに決める(見出し・小見出し・カードの題・本文・補足)
   - スマホの上の帯を2段に縮め、朝よく使う画面だけを並べる(「その他」で設定・ログアウト)
   - 時間割は表だけをカードにし、班の名前は地の上の小見出しにする
   - 補助の説明(この画面でやること・休憩の偏り)は枠を外して静かに
   - キーボードのフォーカスを見えるように。動きを減らす設定を尊重する
================================================================== */
:root {
  --fs-title: 26px;     /* 画面の見出し */
  --fs-section: 19px;   /* 地の上の小見出し(班の名前・まとまりの名前) */
  --fs-card: 16px;      /* カードの題 */
  --fs-body: 15px;      /* 本文 */
  --fs-small: 13px;     /* 補足 */
  --fs-caption: 12px;   /* 表の見出し・札 */
}

.page-title { font-size: var(--fs-title); letter-spacing: 0.01em; }
.section-heading { font-size: var(--fs-section); margin-top: 36px; }
.card-title, .form-card h3, .policy-card h2, .empty-state h3 { font-size: var(--fs-card); }
.legal-page h2 { font-size: 18px; }
.page-subtitle, .legal-page p, .legal-page li { max-width: 44em; }

/* ---- フォーカス: どこにいるかが見えるように ---- */
a:focus-visible,
summary:focus-visible,
select:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
[tabindex]:focus-visible,
.nav-more-toggle:focus-visible {
  outline: 3px solid rgba(45, 74, 128, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}
.navbar a:focus-visible, .navbar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .btn:active { transform: none; }
}

/* ---- 上の帯 ---- */
.nav-account { display: flex; align-items: center; gap: 4px; margin-left: auto; }

/* 設定▾(details)。開くと、白いカードで最初に決める画面と会社の設定を出す */
.nav-settings { position: relative; flex: none; }
.nav-settings > summary { list-style: none; gap: 4px; user-select: none; }
.nav-settings > summary::-webkit-details-marker { display: none; }
.nav-settings[open] > summary { color: #FFFFFF; background-color: rgba(255, 255, 255, 0.14); }
.nav-settings-caret { width: 14px; height: 14px; flex: none; transition: transform .15s ease; }
.nav-settings[open] .nav-settings-caret { transform: rotate(180deg); }
.nav-settings-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 232px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(20, 33, 61, 0.18);
}
.nav-settings-item {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--navy);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.nav-settings-item:hover { background: var(--group-bg); color: var(--navy); }
.nav-settings-item.is-current { background: var(--group-bg); font-weight: 700; box-shadow: inset 3px 0 0 var(--navy); }
.navbar .nav-settings-item:focus-visible { outline: 2px solid var(--navy-2); outline-offset: -2px; }
.nav-settings-sep { height: 1px; margin: 4px 6px; background: var(--line); }
@media (prefers-reduced-motion: reduce) {
  .nav-settings-caret { transition: none; }
}

@media (max-width: 960px) {
  .navbar-inner { padding: 4px 0 6px 12px; column-gap: 8px; }
  /* ロゴの段の右に、使い方・ログアウト */
  .nav-account { order: 2; flex-wrap: nowrap; gap: 2px; flex-shrink: 0; padding-right: 8px; }
  .nav-account .nav-link, .nav-account .nav-logout-form { flex-shrink: 0; white-space: nowrap; }
  /* 下の段: 毎日の画面は1列のまま横にスクロール(右端を薄くして続きがあることを見せる)。
     設定▾はスクロールの外の右端に固定し、開いた中身が切れないようにする */
  .navbar-menu { order: 3; flex: 0 0 100%; gap: 0; }
  .navbar-links {
    flex: 1 1 auto;
    gap: 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-right: 12px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .navbar-links::-webkit-scrollbar { display: none; }
  .navbar-links .nav-link { flex-shrink: 0; white-space: nowrap; }
  .nav-settings { padding: 0 8px 0 4px; border-left: 1px solid rgba(255, 255, 255, 0.16); }
  .nav-settings-panel { left: auto; right: 8px; }
}
@media (max-width: 400px) {
  .nav-link { padding: 0 8px; }
  .navbar-brand span { font-size: 16px; }
}

/* ---- 補助の説明は静かに: 枠と塗りを外し、左の細い線だけ ---- */
.onboarding-hint {
  padding: 2px 0 2px 12px;
  border-radius: 0;
  background: none;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}
.onboarding-hint strong { color: var(--navy); font-weight: 700; }

.rest-overview {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
}
.rest-overview strong, .rest-overview b { color: var(--navy); }

/* 準備が全部済んだら、チェックリストは1行の知らせ程度に */
.onboarding-done-list { margin: 4px 0 0; }
.onboarding-done-list > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--navy-2);
  font-size: var(--fs-small);
  font-weight: 700;
  cursor: pointer;
}

/* ---- 時間割: 表が主役。班の名前は地の上の小見出しにして、表だけをカードに ---- */
.matrix-board .header-card {
  padding: 0;
  margin: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: none;
  align-items: flex-end;
}
.matrix-board .header-main h2 { font-size: var(--fs-section); margin-bottom: 4px; }
.matrix-board .meta-badges .badge { background: none; padding: 0; color: var(--muted); font-size: var(--fs-small); font-weight: 500; }
.matrix-board .meta-badges { gap: 4px 14px; }
.matrix-board .rest-warning,
.matrix-board .qual-status { flex-basis: 100%; }
.matrix-card { border-color: var(--line-strong); }

/* 時間は1行に(08:30〜09:15)。行が低くなり、1画面に見えるコマが増える */
.time-row-label { padding: 6px 2px; white-space: nowrap; }
.time-row-label .time-start,
.time-row-label .time-sep,
.time-row-label .time-end { display: inline; margin: 0; font-size: 12.5px; letter-spacing: -0.01em; }
.time-row-label .time-sep { color: var(--muted); }
.time-row-label .time-end { color: var(--text); font-weight: 700; }
.time-slot-edit-form .time-slot-row { margin-top: 2px; }

/* 班と班の間は、線ではなく余白で区切る */
.board-divider { border-top-color: transparent; margin: 20px auto; }

@media (max-width: 640px) {
  :root { --fs-title: 22px; --fs-section: 18px; }
  .matrix-board .header-card { align-items: stretch; }
  /* 時刻の列を細くして、配置場所の列が2つ半ほど見えるようにする */
  .place-matrix-table .sticky-col { min-width: 80px !important; width: 80px !important; }
  .place-matrix-table .time-row-label .time-end { display: block; }
  .place-matrix-table .time-slot-edit-form input[type="number"] { width: 38px; }
  .place-matrix-table thead th, .place-slot-cell { width: 96px; min-width: 96px; max-width: 96px; }
  /* 表の中の縦のスクロールはやめ、ページと一緒に動かす(指が表とページの間で引っかからないように)。
     横は表の中だけで動かす。見出しの行はページの上に残せないので、8コマごとに名前の行をはさむ */
  .matrix-board .matrix-scroll-wrapper { max-height: none; overflow-x: auto; overflow-y: hidden; }
  .place-matrix-table thead th { position: static; }
  .place-matrix-table thead th.sticky-col { position: sticky; }
  /* 見出しの行は画面の上に貼り付く(sticky_head_controller.js)ので、8コマごとの名前の行は出さない */
  /* ✎ の帯のぶん、［編集する］のときだけマスを広げて名前が切れないようにする */
  .is-editing .place-matrix-table thead th:not(.sticky-col),
  .is-editing .place-slot-cell { width: 116px; min-width: 116px; max-width: 116px; }
}

/* 会社の名簿の「名簿から削除」: 押すと理由(退職した／間違えて登録した)のボタンが開く */
.roster-remove > summary { list-style: none; display: inline-flex; align-items: center; }
.roster-remove > summary::-webkit-details-marker { display: none; }
.roster-remove-panel {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  white-space: normal;
  text-align: left;
  max-width: 20em;
}
.roster-remove-lead { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.roster-remove-option { margin: 0; }
.roster-remove-option .btn { width: 100%; }
.roster-remove-note { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.roster-remove-note:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  /* 開いたら、理由のボタンを名前の下に横幅いっぱいで出す */
  .table-stack-compact td.cell-actions:has(.roster-remove[open]) { flex: 1 1 100%; order: 3; }
  .roster-remove[open] .roster-remove-panel { max-width: none; }
}

/* 時間割を作るボタンの上の「人数が足りません」 */
.shortage-note { margin: 0 0 12px; font-size: 13px; }

/* ==================================================================
   数字の画面(運営者だけ。FunnelsController)
================================================================== */
.funnel-period { display: grid; gap: 14px; }
.funnel-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.funnel-preset {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-full);
  background: var(--surface); color: var(--muted); font-size: var(--fs-small); font-weight: 600; text-decoration: none;
}
.funnel-preset:hover { color: var(--text); border-color: var(--gray-400); }
.funnel-preset-active, .funnel-preset-active:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.funnel-preset:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; }
.funnel-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.funnel-custom .form-group { margin: 0; min-width: 0; flex: 1 1 140px; max-width: 200px; }
.funnel-period-label { margin: 0; color: var(--navy); font-weight: 700; font-size: var(--fs-body); }

.funnel-caution {
  display: flex; gap: 8px; align-items: flex-start;
  margin: 0 0 16px; padding: 10px 14px;
  background: var(--group-bg); color: var(--group-text); border-radius: var(--radius-md);
  font-size: var(--fs-small); line-height: 1.7;
}
.funnel-caution .icon { flex: none; margin-top: 3px; }

.funnel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.funnel-card-title { margin: 0 0 14px; font-size: var(--fs-card); color: var(--navy); }
.funnel-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.funnel-total { margin: 0 0 14px; color: var(--muted); font-size: var(--fs-small); }
.funnel-total strong { color: var(--navy); font-size: var(--fs-body); }
.funnel-sub-title { margin: 0 0 8px; font-size: var(--fs-small); color: var(--muted); font-weight: 700; }

/* 入口から先の段階。棒は最初の段階に対する長さ */
.funnel-steps { list-style: none; margin: 0 0 12px; padding: 0; }
.funnel-step { padding: 0; }
.funnel-step-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.funnel-step-label { font-size: var(--fs-small); color: var(--text); font-weight: 600; min-width: 0; }
.funnel-step-count {
  flex: none; font-size: 22px; font-weight: 800; color: var(--navy);
  font-variant-numeric: tabular-nums; line-height: 1.3;
}
.funnel-step-count small { font-size: var(--fs-small); font-weight: 600; margin-left: 2px; color: var(--muted); }
.funnel-bar { height: 10px; margin-top: 4px; background: var(--gray-100); border-radius: var(--radius-full); overflow: hidden; }
.funnel-bar span { display: block; height: 100%; background: var(--navy-2); border-radius: var(--radius-full); }
.funnel-step-last .funnel-bar span { background: var(--navy); }
.funnel-rate {
  margin: 6px 0 6px 10px; padding-left: 12px; border-left: 2px solid var(--line-strong);
  font-size: var(--fs-caption); color: var(--muted); line-height: 1.9;
}
.funnel-rate strong { color: var(--navy); font-size: var(--fs-small); }

.funnel-now { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.funnel-now-list { margin: 0; display: grid; gap: 4px; }
.funnel-now-list > div { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-small); }
.funnel-now-list dt { color: var(--muted); }
.funnel-now-list dd { margin: 0; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }

/* 日ごとの人数の棒グラフ(外部のライブラリは使わない) */
.funnel-chart { position: relative; }
.funnel-chart-peak { display: block; font-size: var(--fs-caption); color: var(--muted); margin-bottom: 4px; }
.funnel-chart-bars {
  display: flex; align-items: flex-end; gap: 2px; height: 140px;
  padding-top: 2px; border-top: 1px dashed var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.funnel-chart-bar { flex: 1 1 0; min-width: 1px; background: var(--navy-2); border-radius: 2px 2px 0 0; }
.funnel-chart-bar-weekend { background: var(--navy-soft); opacity: 0.7; }
.funnel-chart-axis { display: flex; justify-content: space-between; font-size: var(--fs-caption); color: var(--muted); margin-top: 4px; }
.funnel-daily-table { margin: 14px 0 0; }
.funnel-daily-table summary { cursor: pointer; color: var(--navy-2); font-size: var(--fs-small); font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
/* 列の多い表(現場の手引き)は、スマホで横にだけ動かす */
.funnel-wide-scroll { overflow-x: auto; }
.funnel-table-scroll { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.funnel-table td { overflow-wrap: anywhere; }
.funnel-landing-pages { margin-top: 16px; }
.funnel-landing-pages caption { text-align: left; }
.funnel-table td:not(:first-child), .funnel-table th:not(:first-child) { text-align: right; white-space: nowrap; }

@media (max-width: 720px) {
  .funnel-grid { grid-template-columns: minmax(0, 1fr); }
  .funnel-custom .form-group { max-width: none; }
  .funnel-chart-bars { height: 110px; gap: 1px; }
}

/* ==================================================================
   使い方(HelpController)
   1列の読みもの。毎日の流れだけは時間割の縦の列のように番号を線でつなぎ、ほかは白いカードに静かに並べる
================================================================== */
.help-page { max-width: 760px; }
.help-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.help-heading { margin: 0 0 14px; font-size: 17px; color: var(--navy); }
.help-text { margin: 0 0 10px; font-size: 14px; line-height: 1.85; color: var(--text); }
.help-text:last-child { margin-bottom: 0; }
.help-note { margin: 12px 0 0; font-size: 13px; line-height: 1.8; color: var(--muted); }

/* 毎日の流れ: 番号の丸を縦の線でつなぐ */
.help-flow { list-style: none; margin: 0; padding: 0; }
.help-flow-step { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.help-flow-step:last-child { padding-bottom: 0; }
.help-flow-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--line-strong);
}
.help-flow-num {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.help-flow-body { min-width: 0; padding-top: 4px; }
.help-flow-body strong { display: block; font-size: 15px; color: var(--navy); }
.help-flow-body p { margin: 4px 0 4px; font-size: 14px; line-height: 1.8; color: var(--text); }
.help-flow-body a { font-size: 14px; font-weight: 700; }

/* 名前と説明の2列(狭い画面では縦に) */
.help-list { margin: 0; }
.help-list-row {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 4px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.help-list-row:first-child { border-top: 0; padding-top: 0; }
.help-list dt { font-weight: 700; color: var(--navy); font-size: 14px; }
.help-list dd { margin: 0; font-size: 14px; line-height: 1.8; color: var(--text); overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .help-list-row { grid-template-columns: minmax(0, 1fr); }
  .help-section { padding: 16px; }
}

/* 評価の表 */
.help-grade-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 14px; }
.help-grade-table th,
.help-grade-table td { padding: 7px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.help-grade-table tr:first-child th,
.help-grade-table tr:first-child td { border-top: 0; }
.help-grade-table th { width: 2.5em; }
.help-grade-how { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }

.help-mail { margin: 4px 0 0; font-size: 16px; font-weight: 700; }
.help-restart .inline-form { margin-top: 4px; }

/* 共有画面: 同じ会社の別の現場(応援)に入っている時間。「ほかの持ち場」と同じ点線の枠で、地を薄い灰色にして見分ける。
   行き先は出さず「別の現場」とだけ書く */
.shared-elsewhere.shared-other-site { background: var(--bg); }
/* その人の勤務の前・後(「開始前」「終了後」)。本当の空きと見分けられるよう、薄い文字だけ */
.shared-matrix-table td.shared-outside-cell { padding: 3px 4px; text-align: center; }
.shared-outside { color: var(--muted); font-size: 11px; }
.shared-timeline-item.shared-timeline-other-site { border-style: dashed; border-color: var(--line-strong); background: var(--bg); color: var(--muted); }

/* ==================================================================
   時間割: 表の見せ方(人ごと・場所ごと)、見る・直す、今の時刻の線
================================================================== */
.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 4px 0 16px;
}
.board-toolbar-top { margin: 0 0 12px; }
.board-toolbar-top .back-link { margin: 0; }
.board-toolbar-note { margin: 0; font-size: var(--fs-small); color: var(--muted); flex: 1 1 16em; text-align: right; }

/* 人ごと・場所ごとの切り替え。押せる幅を広く取り、選んでいる方を紺で塗る */
.view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.view-switch-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5em;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.view-switch-item:hover { background: var(--group-bg); text-decoration: none; }
.view-switch-item[aria-current="page"] { background: var(--navy); color: #FFFFFF; }

/* ［編集する］。見つけやすいよう紺地に白い文字(オレンジは共有リンクのボタンに使うので使わない)。
   編集している間は［編集を終える］になり、白地に紺の枠へ変えて、表の枠も紺にする */
.schedule-edit-toggle { gap: 6px; border: 2px solid var(--navy); }
/* JS が動かないときは出さない(.btn の display より強く) */
.schedule-edit-toggle[hidden], .schedule-edit-status[hidden] { display: none; }
.schedule-edit-toggle[aria-pressed="true"] { background: var(--surface); color: var(--navy); border-color: var(--navy); }
.schedule-edit-toggle[aria-pressed="true"]:hover { background: var(--group-bg); color: var(--navy); }
/* 班の見出しの横の［編集する］ */
.matrix-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 4px; }
.matrix-board .matrix-title-row h2 { margin: 0; }
.schedule-edit-status {
  flex-basis: 100%;
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid var(--navy-2);
  background: var(--group-bg);
  color: var(--group-text);
  font-size: var(--fs-small);
}
.is-editing .matrix-card { box-shadow: 0 0 0 2px var(--navy-2); }

/* 「見る」状態では、直すための道具を出さない。名札をつかむ形のカーソルもやめる */
.is-viewing .edit-only { display: none !important; }
/* 「見る」と編集中で言い方を変える案内(RotationGroupsHelper#edit_state_text)。
   開いた直後(JS が状態を付ける前)は見るときの言い方を出す */
.edit-state-editing { display: none; }
.is-editing .edit-state-viewing { display: none; }
.is-editing .edit-state-editing { display: inline; }
.is-viewing .matrix-person { cursor: default; }

/* ---- 今のコマ(now_slot_controller.js。共有リンクはページの中の小さな JS) ----
   今の時刻を含むコマの行を紺の帯にする(線より見やすいという現場の声)。行のマスは紺地に白い文字、
   休憩・待機のマスは少し明るい紺。場所ごとの表の名札は白いまま帯の上に並ぶ。左の時刻のマスには「いま」の札。
   印刷では付けない(screen だけ) */
.now-layer { position: relative; width: max-content; }
/* 終わったコマは薄く(何をしたかは読める) */
tr.is-past > td, tr.is-past > th, td.is-past, th.is-past { opacity: 0.42; }
/* 左に固定した時刻の列は、透かすと下を流れる表が透けて見えるので、文字の色だけ薄くする */
tr.is-past > .sticky-col, th.person-time.is-past { opacity: 1; color: var(--gray-400); }
tr.is-past > .sticky-col .time-start, tr.is-past > .sticky-col .time-end { color: var(--gray-400); }

@media screen {
  /* 行のマス(場所ごと・人ごと・共有リンク) */
  .matrix-table tr.is-now > td,
  .person-table tr.is-now > td {
    background-color: var(--now-bg);
    color: #FFFFFF;
    border-color: var(--now-bg);
  }
  .matrix-table tr.is-now > td.place-col-rest,
  .matrix-table tr.is-now > td.cell-rest,
  .matrix-table tr.is-now > td.cell-standby,
  .matrix-table tr.is-now > td.shared-elsewhere-cell,
  .person-table tr.is-now > td.cell-rest,
  .person-table tr.is-now > td.cell-standby,
  .person-table tr.is-now > td.person-cell-none,
  .person-table tr.is-now > td.person-cell-elsewhere {
    background: var(--now-off-bg);
    color: var(--on-navy);
    box-shadow: none;
  }
  .matrix-table tr.is-now > td.cell-standby,
  .person-table tr.is-now > td.cell-standby { outline-color: var(--on-navy); }
  /* 重なり・NG は直すべきことなので、帯の中でも注意の色のまま */
  .person-table tr.is-now > td.person-cell-overlap { background: var(--warn-bg); color: var(--warn-text); }
  .matrix-table tr.is-now > td.slot-cell.is-ng { background: var(--danger-bg); color: var(--text); }
  /* 場所ごとの表: 休憩の名札は帯の上で白い文字・白い点線 */
  .matrix-table tr.is-now .place-col-rest .place-tag { color: #FFFFFF; border-color: var(--on-navy); }
  /* 配置場所の説明(押すと開く)の印も帯の上では白く */
  tr.is-now .post-guide-mark { color: inherit; }
  .shared-matrix-table tr.is-now .shared-elsewhere { background: transparent; color: var(--on-navy); border-color: var(--on-navy); }
  .shared-matrix-table tr.is-now .shared-outside { color: var(--on-navy); }

  /* 左の時刻のマス(場所ごと・人ごと・共有リンク) */
  tr.is-now > .time-row-label,
  tr.is-now > .person-time,
  tr.is-now > .shared-time { background-color: var(--now-bg) !important; color: #FFFFFF; }
  tr.is-now > .time-row-label .time-start,
  tr.is-now > .time-row-label .time-end,
  tr.is-now > .time-row-label .time-sep,
  tr.is-now > .person-time .person-time-end { color: var(--on-navy); }
  tr.is-now > .time-row-label .time-start { color: #FFFFFF; font-weight: 700; }
  tr.is-now > .time-row-label::before,
  tr.is-now > .person-time::before,
  tr.is-now > .shared-time::before,
  .shared-timeline-item.is-now .shared-timeline-time::before {
    content: "いま";
    display: block;
    width: fit-content;
    margin: 0 auto 2px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--navy);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 0.04em;
  }

  /* 共有リンクの「○○さんの1日」: 今の項目を紺の帯に */
  .shared-timeline-item.is-now {
    background: var(--now-bg);
    border-color: var(--now-bg);
    color: #FFFFFF;
  }
  .shared-timeline-item.is-now.cell-rest,
  .shared-timeline-item.is-now.cell-standby,
  .shared-timeline-item.is-now.shared-timeline-other-site { background: var(--now-off-bg); border-color: var(--now-off-bg); color: var(--on-navy); }
  .shared-timeline-item.is-now .shared-timeline-time { color: inherit; }
  .shared-timeline-item.is-now .shared-timeline-time::before { margin: 0 0 3px; }
}

/* ---- 人ごとの表の［編集する］(person_edit_controller.js) ---- */
.is-editing .person-cell-editable { cursor: pointer; }
.is-editing .person-cell-editable:hover { box-shadow: inset 0 0 0 2px var(--navy-2); }
.person-table td.tap-swap-selected { outline: 3px solid var(--navy); outline-offset: -3px; box-shadow: none; }
.is-editing .person-card { box-shadow: 0 0 0 2px var(--navy-2); }
/* マスを押したときの選ぶ欄。画面の下に出す(スマホで指が届くところ) */
.person-edit-panel {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 40;
  width: min(480px, calc(100vw - 24px));
  max-height: 70vh;
  overflow: auto;
  padding: 14px 16px;
  border: 2px solid var(--navy);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.person-edit-panel[hidden] { display: none; }
/* 名札(マス)を押したときの小さな選択(slot_menu.js)。ボタンは縦に並べ、指で押しやすい高さにする(オレンジは使わない) */
.slot-menu { z-index: 45; }
.slot-menu-actions { display: grid; gap: 8px; margin: 6px 0 8px; }
.slot-menu-actions .btn { width: 100%; min-height: var(--tap); justify-content: center; white-space: normal; overflow-wrap: anywhere; }
.place-tag.slot-menu-open, .person-table td.slot-menu-open { outline: 3px solid var(--navy); outline-offset: -3px; }
/* この時間だけ変えたマスの印(作り直しても残る) */
.place-change-mark {
  display: inline-block;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--navy-2);
  box-shadow: inset 0 0 0 1px var(--navy-2);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}
.person-edit-title { margin: 0 0 2px; font-size: 15px; font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.person-edit-hint { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.person-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.person-edit-actions .btn { flex: 1 1 auto; min-height: var(--tap); justify-content: center; }

/* 配置場所の名前(その配置場所の時間割へ)。ふだんの文字の見た目のまま、点線の下線だけ */
.person-cell-place { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.person-cell-place:hover { text-decoration-style: solid; }
.is-editing .person-cell-place { text-decoration: none; }
.person-table th.tap-swap-selected { outline: 3px solid var(--navy); outline-offset: -3px; box-shadow: none; }
/* 班の見出しの「ローテーション順」「編集」(編集するときだけ) */
.person-group-actions { display: inline-flex; gap: 10px; margin-left: 10px; font-weight: 700; }
.person-group-actions a { color: var(--navy-2); }
/* 時刻のマスの分数(コマの長さ)。編集するときは時刻の列を広げる */
.person-time-group { display: block; margin-top: 2px; font-size: 10px; font-weight: 500; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
/* 時刻のマス(押すとコマの長さの欄)。編集するときだけ押せる */
.is-editing .person-time-editable { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.person-time-panel-forms { display: grid; gap: 8px; }
.person-time-panel-forms .time-slot-edit-form .time-slot-row { justify-content: flex-start; }
.person-time-panel-forms .person-time-group { font-size: 12px; color: var(--navy); font-weight: 700; }
tr.is-now > .person-time .person-time-group { color: var(--on-navy); }

/* ---- 見出しの行の写し(sticky_head_controller.js・共有リンクの画面の中の JS) ----
   表の見出しが画面の上に隠れたら、紺の帯の下に写しを重ねる。横の位置は表に合わせて JS が動かす */
.sticky-head-bar {
  position: fixed;
  z-index: 15;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 0 var(--line-strong), 0 4px 8px rgba(20, 33, 61, 0.08);
}
.sticky-head-bar[hidden] { display: none; }
.sticky-head-bar table { table-layout: fixed; margin: 0; }
.sticky-head-bar th { position: static !important; background-clip: padding-box; }
.sticky-head-bar .person-corner, .sticky-head-bar .place-corner, .sticky-head-bar .sticky-col { position: relative !important; z-index: 2; }
@media print { .sticky-head-bar { display: none !important; } }

/* ---- 配置場所の時間割(_post_board。人ごとの表で配置場所の名前を押したとき) ---- */
.post-board-title { margin: 0 0 4px; font-size: var(--fs-section); color: var(--navy); }
.post-board-lead { margin: 0 0 12px; font-size: var(--fs-small); color: var(--muted); }
.person-card.post-board-card { width: 100%; max-width: 560px; }
.post-board-card .now-layer { width: 100%; }
.person-table.post-board-table { width: 100%; }
.post-board-head { text-align: left !important; color: var(--navy); font-size: 13px; }
.post-board-cell { text-align: left !important; }
.post-board-names { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; }
.post-board-name { font-size: 15px; font-weight: 700; }
.post-board-guide { max-width: 560px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); font-size: 13px; }
.post-board-guide-title { display: block; margin-bottom: 2px; font-size: 12px; color: var(--navy); }
.post-board-closed { color: var(--muted); font-size: 13px; font-weight: 500; }
tr.is-now .post-board-closed { color: var(--on-navy); }
.post-board-names .place-gap { margin: 0; display: inline-block; padding: 1px 10px; }

/* ---- 人ごとの表 ---- */
.person-board { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ---- 時間割の「お知らせ（◯件）」(rotation_groups/_notice_box) ----
   表の上に知らせを並べず、押すと開くボタンにまとめる。控えめな知らせだけのときは白い控えめなボタン。
   強い知らせ(本当の不足・休憩0分・時間の重なりなど)があるときは、枠と件数の札を紺にして目立たせる(オレンジは使わない) */
.notice-box { flex-basis: 100%; margin: 8px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); }
.notice-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-height: var(--tap);
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}
.notice-toggle::-webkit-details-marker { display: none; }
.notice-toggle::marker { content: ""; }
.notice-toggle .icon { flex: none; color: var(--muted); }
.notice-count {
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: var(--solo-bg);
  color: var(--solo-text);
  font-size: 12px;
  line-height: 1.7;
}
.notice-toggle-note { font-size: 12px; font-weight: 500; color: var(--navy); }
.notice-mark { display: inline-flex; margin-left: auto; color: var(--navy-2); transition: transform 0.15s ease; }
.notice-box[open] .notice-mark { transform: rotate(90deg); }
.notice-box[open] .notice-toggle { border-bottom: 1px solid var(--line); }
.notice-box-strong { border: 2px solid var(--navy); }
.notice-box-strong .notice-toggle .icon { color: var(--navy); }
.notice-box-strong .notice-count { background: var(--navy); color: #FFFFFF; }
.notice-toggle:focus-visible { outline: 3px solid rgba(45, 74, 128, 0.45); outline-offset: 2px; border-radius: var(--radius-md); }

.notice-body { padding: 4px 12px 10px; }
.notice-section + .notice-section { margin-top: 8px; }
.notice-section-title { display: block; margin: 6px 0 2px; font-size: var(--fs-small); color: var(--navy); }
.notice-list { list-style: none; margin: 0; padding: 0; }
/* 知らせ1件。今までの知らせのクラス(rest-warning など)は付けたまま、箱の見た目はここでそろえる */
.notice-list .notice-item {
  margin: 0;
  padding: 8px 0 8px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
  box-shadow: inset 2px 0 0 var(--line-strong);
}
.notice-list .notice-item:first-child { border-top: 0; }
.notice-list .notice-item-strong { color: var(--warn-text); font-weight: 700; box-shadow: inset 3px 0 0 var(--warn); }
.notice-list .notice-item p, .notice-list .notice-item ul { margin: 2px 0; font-weight: 400; }
.notice-list .notice-item strong { color: inherit; }
.notice-list .notice-item a { color: var(--navy-2); }
/* 一覧の下に添える評価の凡例など(件数に数えない) */
.notice-footer { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.notice-footer .grade-legend { margin: 0; }

.person-card {
  max-width: 100%;
  width: fit-content;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
/* 表の中だけ縦・横にスクロール。見出しと時刻の列は動かさない */
/* 表は1枚で全部の行を出す(縦は画面のスクロールだけ)。横に入りきらないときだけ表の中を横に動かす */
.person-scroll { overflow-x: auto; overflow-y: hidden; max-width: 100%; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.person-scroll:focus-visible { outline: 3px solid rgba(45, 74, 128, 0.45); outline-offset: -3px; }

.person-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; font-size: 12.5px; }
.person-table th, .person-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
}
.person-table .group-start { border-left: 2px solid var(--line-strong); }

.person-table thead th { position: sticky; background: var(--bg); z-index: 3; }
.person-group-row th { top: 0; height: 28px; }
.person-staff-row th { top: 28px; }
.person-corner {
  left: 0;
  top: 0;
  z-index: 5 !important;
  width: 64px;
  min-width: 64px;
  font-size: var(--fs-caption);
  color: var(--muted);
  font-weight: 500;
}
.person-group {
  padding: 0 6px !important;
  text-align: left !important;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
/* 班の名前は、横に送っても見えている間は左に寄せて残す */
.person-group span { position: sticky; left: 72px; }
.person-staff {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.person-staff-name { display: block; }
.person-staff .staff-arrival { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 500; }
.person-staff-rest { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.person-staff .staff-relief-tag { margin-top: 3px; }

.person-time {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 64px;
  min-width: 64px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  vertical-align: top !important;
  white-space: nowrap;
}
.person-time-start { display: block; font-size: 12.5px; }
.person-time-end { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }

.person-cell { line-height: 1.3; font-size: 13px; }
.person-cell-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-weight: 700;
  overflow-wrap: anywhere;
  line-break: strict; /* 「ー」を行の頭に送らない(受付カウンタ／ー にしない) */
}
.person-cell-minutes, .person-cell-group { display: block; font-size: 10.5px; font-weight: 500; opacity: 0.85; }
.person-cell-off { font-weight: 500; }
.person-cell-off .person-cell-label { font-weight: 500; }
/* 同じ時間に2つの班に入っている(重なり)。直すべきことなので注意の色で */
.person-cell-overlap { background: var(--warn-bg); color: var(--warn-text); box-shadow: inset 0 0 0 2px var(--warn); }
.person-overlap-mark { display: block; font-weight: 700; }
.person-overlap-place { display: block; font-size: 10.5px; line-height: 1.3; overflow-wrap: anywhere; }
/* その日の表に無いコマ(前の日の夜勤の続きなど)。場所ごとの表の「ほかの班」と同じく点線で薄く */
.person-cell-elsewhere { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.person-cell-elsewhere .person-cell-label { font-weight: 500; }
/* 勤務の無い時間。空いているだけと分かるよう、斜めの細い線で */
.person-cell-none { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--line) 6px 7px); }
/* その人の勤務の前・後(「開始前」「終了後」)。斜線は残し、薄い文字だけ足す(PersonBoardHelper::Board#outside) */
.person-cell-outside-label { display: inline-block; padding: 0 4px; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.4; border-radius: 3px; }

@media (max-width: 640px) {
  .person-board { padding-left: 16px; padding-right: 16px; }
  .board-toolbar-note { text-align: left; }
  .person-staff { width: 80px; min-width: 80px; max-width: 80px; font-size: 12.5px; }
  .person-corner, .person-time { width: 58px; min-width: 58px; }
  .person-group span { left: 66px; }
}

@media print {
  .board-toolbar, .schedule-edit-status { display: none !important; }
  .person-scroll { overflow: visible !important; max-height: none; }
  .person-table thead th, .person-time { position: static; }
  .person-cell, .person-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr.is-past > td, tr.is-past > th, td.is-past, th.is-past { opacity: 1; }
  .edit-only { display: none !important; }
}

/* 共有リンクのカード: 作る前・作ったあとの一言と、作り直しの注意 */
.share-box-lead { margin: 0 0 10px; font-size: var(--fs-body); color: var(--text); }
.share-box-note { margin: 8px 0 0; font-size: var(--fs-small); color: var(--muted); }

/* ==================================================================
   使っている人の声(「使ってみてどうですか」の欄。Feedback の先頭)。
   画面のいちばん下に、控えめに。ボタンはオレンジにしない
================================================================== */
.feedback-card {
  margin: 24px 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.feedback-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.feedback-title { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-card); color: var(--navy); }
.feedback-title .icon { flex: none; color: var(--navy-2); }
.feedback-lead { margin: 6px 0 12px; font-size: var(--fs-small); color: var(--muted); }
.feedback-form { display: grid; gap: 8px; justify-items: start; }
.feedback-form .form-label { margin: 0; }
.feedback-body { width: 100%; min-height: 72px; resize: vertical; }
.feedback-contact { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-small); color: var(--text); overflow-wrap: anywhere; cursor: pointer; }
.feedback-contact input[type="checkbox"] { flex: none; width: 18px; height: 18px; margin: 1px 0 0; }
/* 試用のあとに使えなくなった現場・ログインできる人の注記(会社の設定) */
.locked-note { margin: 4px 0 0; color: var(--warn-text); }
.trial-features-note { color: var(--navy); }

/* 試用のアンケートの画面(FeedbacksController#new) */
.survey-page { max-width: 720px; }
.survey-offer {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 0 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-left: 4px solid var(--navy);
  border-radius: var(--radius-lg); background: var(--surface);
  color: var(--navy); font-size: var(--fs-body); overflow-wrap: anywhere;
}
.survey-offer .icon { flex: none; margin-top: 3px; }
.survey-offer p { margin: 0; }
.survey-form { display: grid; gap: 12px; }
.survey-question {
  min-width: 0; margin: 0; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
}
.survey-question.has-error { border-color: #F3C9A4; background: var(--warn-bg); }
/* legend は枠の線の上に乗るので、float で枠の中に入れる */
.survey-legend { display: block; float: left; width: 100%; padding: 0; margin: 0 0 10px; font-weight: 700; color: var(--navy); font-size: var(--fs-body); overflow-wrap: anywhere; }
.survey-choices { clear: both; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.survey-choice {
  display: flex; align-items: flex-start; gap: 8px; min-width: 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); cursor: pointer; overflow-wrap: anywhere;
}
.survey-choice input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--navy); }
.survey-choice:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.survey-body { width: 100%; min-height: 96px; resize: vertical; }
.survey-checks { display: grid; gap: 10px; }
.survey-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* 試用のあとにプランを選ぶ画面(PlanChoicesController) */
.plan-choice-page { max-width: 760px; }
.plan-choice-max { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); overflow-wrap: anywhere; }
.plan-choice-max strong { color: var(--navy); }
.plan-choice-card {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
}
.plan-choice-main { margin: 0 0 16px; border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.plan-choice-name { margin: 0; font-size: var(--fs-card); color: var(--navy); overflow-wrap: anywhere; }
.plan-choice-lead { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.plan-choice-price { margin: 0; font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.plan-choice-card .plan-list { margin: 0; }
.plan-choice-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.plan-choice-actions form, .plan-choice-actions .btn { width: 100%; }
.plan-choice-other { margin: 0 0 16px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.plan-choice-other-title { margin: 0 0 8px; font-size: var(--fs-small); font-weight: 700; color: var(--muted); }
.plan-choice-other-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 0; }
.plan-choice-other-row p { flex: 1 1 280px; min-width: 0; margin: 0; font-size: var(--fs-small); color: var(--text); overflow-wrap: anywhere; }
.plan-choice-other-row .btn { font-size: var(--fs-small); }
.plan-choice-note { margin: 0 0 12px; font-size: var(--fs-small); color: var(--muted); overflow-wrap: anywhere; }

/* 数字の画面(/numbers)の「使っている人の声」 */
.funnel-answer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 16px; }
.funnel-answer { min-width: 0; }
.funnel-feedback-answers { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 6px; font-size: var(--fs-small); color: var(--navy); overflow-wrap: anywhere; }
.funnel-feedback-answers span { padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; }
.funnel-feedback-list { list-style: none; margin: 0 0 12px; padding: 0; }
.funnel-feedback { padding: 12px 0; border-top: 1px solid var(--line); }
.funnel-feedback:first-child { border-top: none; padding-top: 0; }
.funnel-feedback-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 6px; font-size: var(--fs-small); color: var(--muted); overflow-wrap: anywhere; }
.funnel-feedback-body { font-size: var(--fs-body); color: var(--text); overflow-wrap: anywhere; }
.funnel-feedback-body p { margin: 0 0 4px; }

/* ==================================================================
   登録なしで触れる見本(DemoSite の先頭)の帯・手順
   ================================================================== */
.demo-band { background-color: var(--navy-soft); color: #FFFFFF; }
.demo-band-inner {
  max-width: 1040px; margin: 0 auto; padding: 10px 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
}
.demo-band-text { margin: 0; font-size: 14px; line-height: 1.6; }
.demo-band-text span { display: inline-block; }
.demo-band-text strong { margin-right: 4px; }
.demo-band-form { flex: 0 0 auto; }
.demo-band-btn { background-color: transparent; color: #FFFFFF; border-color: #FFFFFF; }
.demo-band-btn:hover { background-color: #FFFFFF; color: var(--navy); }

.btn-navy { background-color: var(--navy); color: #FFFFFF; }
.btn-navy:hover { background-color: var(--navy-2); color: #FFFFFF; }

.demo-guide-wrap { max-width: 1040px; margin: 0 auto; padding: 16px 20px 0; }
.demo-guide { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0 16px; }
.demo-guide-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: var(--tap); cursor: pointer; font-weight: 700; color: var(--navy);
}
.demo-guide-count { font-size: var(--fs-small); color: var(--muted); font-weight: 400; }
.demo-guide-list { list-style: none; margin: 0; padding: 0 0 8px; display: grid; gap: 8px; }
.demo-guide-item { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); }
.demo-guide-item.is-done { color: var(--ok-text); }
.demo-guide-item.is-next { color: var(--text); }
.demo-guide-mark {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line-strong); font-size: 13px; font-weight: 700;
}
.demo-guide-item.is-done .demo-guide-mark { border-color: var(--ok); background: var(--ok-bg); }
.demo-guide-item.is-next .demo-guide-mark { border-color: var(--navy); background: var(--navy); color: #FFFFFF; }
.demo-guide-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 2px; }
.demo-guide-body small { font-size: var(--fs-small); line-height: 1.6; overflow-wrap: anywhere; }
.demo-guide-link { font-size: 14px; font-weight: 700; color: var(--navy-2); }
.demo-guide-note { margin: 0; padding: 8px 0 12px; border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--muted); }
.demo-guide-done { padding: 12px 0 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; justify-items: start; }
.demo-guide-done p { margin: 0; font-size: 14px; line-height: 1.7; }

.demo-shared-note {
  margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--group-bg); color: var(--group-text); font-size: 14px; line-height: 1.6;
}

@media (max-width: 640px) {
  .demo-band-inner { padding: 10px 16px; }
  .demo-band-form, .demo-band-form .btn { width: 100%; }
  .demo-guide-wrap { padding: 12px 16px 0; }
  .demo-guide-done, .demo-guide-done form, .demo-guide-done .btn { width: 100%; }
}

/* ==================================================================
   配置場所の負担度(ドクロの印。PostsHelper#burden_skulls)
   配置場所の画面と配置の画面だけに出す。色は控えめな紺の線。半分は左半分だけ見せる
================================================================== */
.burden-skulls {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: var(--navy-soft);
  vertical-align: middle;
  white-space: nowrap;
}
.burden-skulls .icon { vertical-align: 0; }
.burden-skull-half { display: inline-flex; width: 8px; overflow: hidden; }
/* ドクロの前の「負担度」の小さな字(何の印か分かるように) */
.burden-skulls-word { font-size: 11px; font-weight: 600; color: var(--navy-soft); margin-right: 3px; letter-spacing: 0; }

/* ==================================================================
   休憩が少なめの人(rest_histories/show。責任者向け)
================================================================== */
.rest-history-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
/* 日ごとの表が広くても、画面の幅を押し広げない(表の中だけ横に動く) */
.rest-history-list > li { min-width: 0; }
.rest-history-item {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.rest-history-item > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding: 12px 14px;
  min-height: 44px;
}
.rest-history-item > summary::-webkit-details-marker { display: none; }
.rest-history-item > summary:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; border-radius: var(--radius-md); }
.rest-history-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--navy-2);
  overflow-wrap: anywhere;
}
.rest-history-mark { display: inline-flex; transition: transform 0.15s ease; }
.rest-history-item[open] .rest-history-mark { transform: rotate(90deg); }
.rest-history-diff { color: var(--text); }
.rest-history-diff strong { color: var(--warn-text); font-size: 16px; }
.rest-history-meta { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.rest-history-item[open] > summary { border-bottom: 1px solid var(--line); }
.rest-history-item .table-wrapper { padding: 4px 6px 8px; }
.rest-history-days { font-size: 13px; }
.rest-history-days .text-right { text-align: right; }
.rest-history-days th,
.rest-history-days th:last-child { white-space: normal; }
.rest-history-days .nowrap { white-space: nowrap; }
.rest-history-group { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.rest-history-short { color: var(--warn-text); font-weight: 700; }
.rest-history-availability { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.rest-history-note { font-size: 13px; color: var(--muted); line-height: 1.7; }
.rest-history-note p { margin: 0 0 4px; }
@media (max-width: 480px) {
  .rest-history-item .table-wrapper { padding: 2px 2px 6px; }
  .rest-history-days th, .rest-history-days td { padding: 8px 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .rest-history-mark { transition: none; }
}

/* ==================================================================
   その日の配置場所(配置場所の画面・配置の画面の［編集］)
   毎日見る画面なので、名前とスイッチだけを並べる。スイッチは指で押しやすい大きさにし、
   状態は色だけでなく「必要」「不要」「一部」の文字でも出す
================================================================== */
.day-posts-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 24px 0 6px;
}
.day-posts-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.day-posts-title .page-title { margin: 0; }
.help-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--navy-2);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  position: relative;
}
.help-mark::after { content: ""; position: absolute; inset: -7px; } /* 押せる範囲を 44px に広げる */
.help-mark:hover { border-color: var(--navy-2); }
.day-posts-total { margin: 0; color: var(--muted); font-size: 15px; font-weight: 700; }
.day-posts-total strong { color: var(--navy); font-size: 30px; line-height: 1; margin: 0 2px; font-variant-numeric: tabular-nums; }
.day-posts-page { max-width: 800px; }
.day-posts-lead { margin: 0 0 16px; max-width: none; }

.day-switches { display: grid; gap: 12px; }
.switch-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.switch-list { list-style: none; margin: 0; padding: 0; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 6px 12px 6px 16px;
  border-top: 1px solid var(--line);
}
.switch-row-head { border-top: 0; background: var(--gray-25); min-height: 64px; }
.switch-card .switch-list .switch-row { padding-left: 28px; } /* ローテーションの中の配置場所は一段下げる */
.switch-card-single .switch-list .switch-row { padding-left: 16px; }
.switch-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 12px 16px;
  background: var(--gray-25);
}
.switch-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; font-size: 15px; color: var(--text); }
.switch-name-text { font-weight: 700; overflow-wrap: anywhere; }
.switch-group-name { font-size: 17px; color: var(--navy); overflow-wrap: anywhere; }
.switch-kind {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-sm);
  background: var(--group-bg);
  color: var(--group-text);
  font-size: 12px;
  font-weight: 700;
}
.switch-card-title .switch-kind { background: var(--solo-bg); color: var(--solo-text); }
.switch-meta { color: var(--muted); font-size: 13px; }

.day-switch-form { margin: 0; flex: none; }
.day-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 4px 0 8px;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.day-switch-text { min-width: 2.2em; text-align: right; font-size: 14px; font-weight: 700; color: var(--muted); }
.day-switch-track {
  position: relative;
  display: inline-block;
  width: 58px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--gray-300);
  transition: background-color .15s ease;
}
.day-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(20, 33, 61, .35);
  transition: transform .15s ease;
}
/* ON(出勤・必要)は、紺のテーマに合う明るめの青にする(紺だと暗く見える。2026-11-21 作り手の声)。一部だけ ON は薄い青 */
.day-switch-on .day-switch-text { color: var(--switch-on-text); }
.day-switch-on .day-switch-track { background: var(--switch-on); }
.day-switch-on .day-switch-knob { transform: translateX(24px); }
.day-switch-mixed .day-switch-text { color: var(--switch-on-text); }
.day-switch-mixed .day-switch-track { background: var(--switch-mixed); }
.day-switch-mixed .day-switch-knob { transform: translateX(12px); }
.day-switch:hover .day-switch-track { box-shadow: 0 0 0 2px var(--line-strong); }
.day-switch:focus-visible { outline: none; }
.day-switch:focus-visible .day-switch-track { outline: 2px solid var(--navy-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .day-switch-track, .day-switch-knob { transition: none; }
}

/* 畳んだ欄(その日だけ単独で使う) */
.switch-fold {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.switch-fold > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 4px 16px;
  color: var(--navy-2);
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}
.switch-fold > summary::-webkit-details-marker { display: none; }
.switch-fold > summary::before { content: "＋"; width: 1em; flex: none; }
.switch-fold[open] > summary::before { content: "－"; }
.switch-fold-note { margin: 0; padding: 0 16px 10px; color: var(--muted); font-size: 13px; }
.day-posts-manage { margin: 20px 0 8px; display: flex; justify-content: center; }
.day-posts-manage .btn { gap: 8px; }
@media (max-width: 640px) {
  .day-posts-manage .btn { width: 100%; }
  .switch-row { padding-right: 8px; }
  .switch-card .switch-list .switch-row { padding-left: 20px; }
  .switch-card-single .switch-list .switch-row { padding-left: 16px; }
}

/* ==================================================================
   出勤登録(毎日の画面)。配置場所のスイッチと同じ見た目で、1人1行。
   左に休みの人だけのチェック、名前と小さな評価の札、右に出勤・休みのスイッチ
================================================================== */
.attendance-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.attendance-total-sep { color: var(--line-strong); }
.attendance-short {
  align-self: center;
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 13px;
}
.attendance-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.attendance-search .form-control { flex: 1 1 200px; width: auto; min-width: 0; }

/* 下に付いてくる「チェックをつけた人を出勤にする」(sticky)が効くよう、角丸のはみ出しは clip で切る */
.switch-card.attendance-card { overflow: clip; }
.attendance-card-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.attendance-pick-all { display: inline-flex; align-items: center; gap: 10px; min-height: 32px; margin: 0; color: var(--navy); font-size: 14px; font-weight: 700; cursor: pointer; }
.attendance-card .switch-list .switch-row { padding-left: 16px; }
.attendance-card .switch-list .switch-row:first-child { border-top: 0; }
.attendance-row { justify-content: flex-start; }
.attendance-pick { flex: none; width: 22px; line-height: 0; }
.attendance-pick-all input,
.attendance-pick input { width: 22px; height: 22px; margin: 0; cursor: pointer; }
.attendance-name { flex: 1 1 auto; }
.attendance-name .staff-name { display: inline; font-size: 16px; overflow-wrap: anywhere; }
.attendance-name label.staff-name { cursor: pointer; }
.attendance-name .staff-kana { flex-basis: 100%; margin-top: -2px; }
.attendance-row .day-switch-form { margin-left: auto; }
.attendance-row.is-working { background: var(--gray-25); }
.attendance-empty { margin: 0; padding: 16px; color: var(--muted); }
.attendance-card .bulk-attend-bar { border-radius: 0; }
.attendance-page .daily-plan-card { margin: 16px 0 0; }
@media (max-width: 640px) {
  .attendance-total strong { font-size: 26px; }
  .attendance-card .switch-list .switch-row { padding-left: 12px; gap: 10px; }
  .attendance-card-head { padding: 10px 12px; }
}

/* 配置の画面の上の1行。［編集］で、その場でスイッチの一覧が開く */
.day-posts-bar {
  margin: 0 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.day-posts-bar > summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-height: 56px;
  padding: 6px 12px 6px 16px;
  cursor: pointer;
  list-style: none;
}
.day-posts-bar > summary::-webkit-details-marker { display: none; }
.day-posts-bar-label { color: var(--navy); font-size: 15px; font-weight: 700; }
.day-posts-bar-count { color: var(--navy); font-size: 20px; font-variant-numeric: tabular-nums; }
.day-posts-bar-button { margin-left: auto; min-width: 72px; pointer-events: none; }
.day-posts-bar > summary:hover .day-posts-bar-button { border-color: var(--navy-2); }
.day-posts-bar > summary:focus-visible { outline: 2px solid var(--navy-2); outline-offset: -2px; border-radius: var(--radius-lg); }
.day-posts-bar .when-open { display: none; }
.day-posts-bar[open] .when-open { display: inline; }
.day-posts-bar[open] .when-closed { display: none; }
.day-posts-bar-body { padding: 12px; border-top: 1px solid var(--line); background: var(--bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.day-posts-bar-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 4px 2px; font-size: 14px; }

/* 配置場所の登録・編集。表にすると狭い画面ではみ出すので、行の並びにする(狭い画面では2段) */
.manage-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.manage-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 6em minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 6px 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.manage-row-head { border-top: 0; background: var(--gray-25); color: var(--muted); font-size: 12px; font-weight: 700; padding-top: 8px; padding-bottom: 8px; }
.manage-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.manage-name-link { font-size: 15px; font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.manage-condition { padding: 0 6px; border-radius: var(--radius-sm); background: var(--solo-bg); color: var(--solo-text); font-size: 12px; }
.manage-label { display: none; }
.manage-actions { justify-self: end; }
.manage-note { margin: 12px 0 0; font-size: 13px; }
/* 配置場所の登録・編集で、選んだ配置場所からローテーションを作る(posts/manage) */
.make-rotation-form { margin: 0; }
.make-rotation { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 12px;
  scroll-margin-top: 76px; }
.make-rotation-help { margin: 0; flex: 1 1 280px; font-size: 13px; color: var(--muted); }
.manage-pick { width: 20px; height: 20px; margin: 0; accent-color: var(--navy); flex: none; }
.manage-pick-space { width: 20px; flex: none; }
/* 行の中で決める必要な時間・休憩の時間。保存したら、この行に戻って少し色を付ける */
.manage-row { scroll-margin-top: 76px; }
.manage-row:target { background: var(--group-bg); }
.manage-time { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 13px; }
.manage-time-label { color: var(--muted); font-weight: 700; }
.manage-time .need-time-row { flex: none; flex-wrap: nowrap; gap: 6px; }
.manage-time .form-control { width: 7.5em; min-width: 0; height: 36px; padding: 4px 8px; font-size: 14px; }
.manage-time-help { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  .manage-row-head { display: none; }
  .manage-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 12px 12px 16px; }
  .manage-name { grid-column: 1; grid-row: 1; }
  .manage-count { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 13px; }
  .manage-group { grid-column: 1; grid-row: 3; color: var(--muted); font-size: 13px; }
  .manage-actions { grid-column: 2; grid-row: 1 / span 3; }
  .manage-time { grid-column: 1 / -1; grid-row: 4; margin-top: 6px; }
  .manage-label { display: inline; margin-right: 6px; }
  .manage-label::after { content: "："; }
}
@media (max-width: 960px) { .manage-row { scroll-margin-top: 12px; } }


/* ==================================================================
   「記録」の画面のタブ(時間割の記録・その日のメモ・トラブル報告・スタッフからの報告。records/_tabs)
   広い幅では1列に並べ、スマホ幅(〜600px)では2列にして横にはみ出さない
================================================================== */
.record-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.record-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}
.record-tab:hover { border-color: var(--navy-2); color: var(--navy); }
.record-tab.is-current { background: var(--navy); border-color: var(--navy); color: #FFFFFF; font-weight: 700; }
.record-tab-count {
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .record-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .record-tab { justify-content: center; flex-wrap: wrap; text-align: center; min-width: 0; padding: 6px 8px; font-size: 13px; }
  .record-tab-label { overflow-wrap: anywhere; }
}
.record-notes-link { font-size: 13px; margin: 0 0 16px; }
.day-note-write-link { margin: 0; font-size: 14px; }

/* 時間割の画面の下の「その日のメモ」(件数と、記録の画面へのリンクだけ) */
.board-notes-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.board-notes-text { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.board-notes-card + .board-notes-link { margin-top: -8px; }

/* ローテーションの一覧の「回る配置場所」(名前をそのまま並べる) */
.group-post-names { overflow-wrap: anywhere; }

/* ==================================================================
   時間割の［スタッフを追加する］と、出勤登録の行の［時間割に追加］(staffs/_schedule_add)
================================================================== */
.add-staff-button { display: inline-flex; align-items: center; gap: 4px; }
.unassigned-pool-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid #F3C9A4;
  border-radius: var(--radius-md);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 14px;
}
.unassigned-pool-note-text { display: flex; align-items: flex-start; gap: 6px; margin: 0; flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.unassigned-pool-note-text .icon { flex: none; margin-top: 3px; }
.unassigned-pool-note-link { flex: none; background: var(--surface); }

.schedule-add-guide {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.schedule-add-guide h2 { margin: 0 0 6px; font-size: 16px; color: var(--navy); }
.schedule-add-guide ol { margin: 0; padding-left: 1.4em; font-size: 14px; line-height: 1.7; }
.schedule-add-guide-count { margin: 8px 0 0; font-size: 14px; color: var(--warn-text); }
.schedule-add-alert {
  display: flex; align-items: flex-start; gap: 6px;
  margin: 0 0 12px; padding: 8px 12px;
  border-radius: var(--radius-md); background: var(--warn-bg); color: var(--warn-text); font-size: 14px;
}
.schedule-add-alert .icon { flex: none; margin-top: 3px; }

.attendance-row.has-schedule-add { flex-wrap: wrap; }
.schedule-add { flex: 1 0 100%; min-width: 0; margin: 2px 0 6px; }
.schedule-add-summary {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 10px;
  min-height: 32px; cursor: pointer; list-style: none;
  color: var(--navy-2); font-size: 14px; font-weight: 700;
}
.schedule-add-summary::-webkit-details-marker { display: none; }
.schedule-add-summary-label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.schedule-add-note { color: var(--warn-text); font-size: 12px; font-weight: 400; }
.schedule-add-form {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px;
  margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg);
}
.schedule-add-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.schedule-add-target { flex-direction: row; align-items: center; min-height: 40px; font-size: 14px; }
.schedule-add-label { color: var(--muted); }
.schedule-add-time { width: 8.5em; }
.schedule-add-select { width: auto; min-width: 0; max-width: 100%; }
.schedule-add-field:has(.schedule-add-select) { flex: 1 1 160px; }
.schedule-add-submit { min-height: 40px; }
.schedule-add-help { flex: 1 0 100%; margin: 0; color: var(--muted); font-size: 12px; }

/* ==================================================================
   済んだ日(見るだけ。WorkDay.closed? の先頭)
================================================================== */
.closed-day-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--solo-bg);
  color: var(--solo-text);
  font-size: 14px;
  line-height: 1.6;
}
.closed-day-note .icon { flex: none; margin-top: 3px; }
.closed-day-note strong { color: var(--navy); }
.closed-day-note-text { margin-left: 0.5em; }
/* 済んだ日の「必要」は、押せない札で出す(スイッチの形のまま、押せる見た目にしない) */
.day-switch-readonly { cursor: default; }
.day-switch-readonly .day-switch-track { opacity: 0.55; }
/* 済んだ日の配置の画面の「その日の配置場所」(数だけ。［編集］は出さない) */
.day-posts-bar-static { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-height: 56px; padding: 6px 12px 6px 16px; }

/* 運営者の申し込みの一覧(operator_signups) */
.signup-list { display: grid; gap: 12px; margin-bottom: 24px; }
.signup-item { padding: 16px; scroll-margin-top: 76px; }
.signup-item:target { outline: 2px solid var(--navy-2); }
.signup-item.is-test { background: var(--gray-50); }
.signup-item.is-test .signup-item-name { color: var(--muted); }
.signup-item-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.signup-item-name { margin: 0; font-size: 16px; font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.signup-item-meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.signup-item-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin: 12px 0 0; }
.signup-item-fields > div { min-width: 0; }
.signup-item-fields .is-wide { grid-column: 1 / -1; }
.signup-item-fields dt { font-size: 12px; color: var(--muted); }
.signup-item-fields dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.signup-item-message { white-space: pre-wrap; }
.signup-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; }
.signup-steps li { display: inline-flex; align-items: center; gap: 4px; }
.signup-steps .is-done { color: var(--ok-text); font-weight: 700; }
.signup-steps .is-todo { color: var(--muted); }
@media (max-width: 960px) { .signup-item { scroll-margin-top: 12px; } }

/* 日付を出さない画面で、今日以外を選んでいるときの一言(折り返す) */
.work-date-other-note { margin: 4px 0 0; white-space: normal; flex-basis: 100%; }

/* 配置場所の「必要な資格」は記述式(2026-12-04)。登録済みの資格は書き始めたときの候補に出すだけで、
   選ぶ形(▼の印)には見せない */
.qualification-row input[list]::-webkit-calendar-picker-indicator {
  display: none !important;
}
