/* =========================================================
   佐伯システム — 希望シフト提出画面
   LINEアプリ内ブラウザ / スマホ縦画面前提
   ========================================================= */

:root {
  --line-green: #06c755;
  --line-green-dark: #05a648;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1f2328;
  --text-sub: #8a9099;
  --border: #e4e6ea;
  --sun: #e8503a;
  --sat: #2f7de6;
  --warn: #b8860b;
  --error: #b00020;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .07), 0 8px 24px rgba(0, 0, 0, .04);
  --footer-h: 88px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/*
 * hidden 属性を必ず効かせる（全画面共通）。
 * ブラウザ既定の [hidden] { display: none } は詳細度が低く、クラスで display を指定すると負ける。
 * 実際に .app-footer { display: flex } が勝ってしまい、シフト作成画面の募集が無い月や staff、
 * 募集日登録画面の staff でも「確定する／登録する」ボタンが見えていた（2026-09-15 発見）。
 * JS は el.hidden = true/false で出し入れしているので、それが素直に効くようにしておく。
 */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.6;
  font-size: 16px;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: calc(var(--footer-h) + env(safe-area-inset-bottom));
}

/* ---- ヘッダー ---- */

.app-header {
  background: var(--line-green);
  color: #fff;
  padding: 18px 20px 20px;
}

/* ☰ を置く画面。見出しは .app-head-text に包まれる（assets/shell.js） */
.app-header.has-nav {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.app-head-text { flex: 1 1 auto; min-width: 0; }

.nav-btn {
  flex: none;
  width: 40px; height: 40px;
  margin: -6px 0 0 -8px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn:active { background: rgba(255, 255, 255, .18); }

/* 三本線。真ん中の線を疑似要素の本体、上下を before/after で出す */
.nav-ico, .nav-ico::before, .nav-ico::after {
  display: block;
  width: 20px; height: 2px;
  background: #fff;
  border-radius: 2px;
}
.nav-ico { position: relative; }
.nav-ico::before, .nav-ico::after { content: ''; position: absolute; left: 0; }
.nav-ico::before { top: -6px; }
.nav-ico::after  { top: 6px; }

/* ---- 画面の切り替えメニュー ---- */

.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .38);
  z-index: 30;
}

.nav-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(280px, 82vw);
  z-index: 31;
  background: var(--surface);
  box-shadow: 2px 0 16px rgba(0, 0, 0, .18);
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: nav-in .16s ease-out;
}
@keyframes nav-in { from { transform: translateX(-100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .nav-drawer { animation: none; }
}

.nav-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 22px;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
}
.nav-close:active { background: var(--bg); }

.nav-head {
  margin: 4px 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
}

.nav-list { display: flex; flex-direction: column; gap: 4px; }

.nav-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}
.nav-link:active { background: var(--bg); }
.nav-link-label { font-size: 14px; font-weight: 600; }
.nav-link-note { font-size: 11.5px; color: var(--text-sub); }

/* いま開いている画面。押す先が無いので <span> で出す */
.nav-link.is-here {
  background: var(--bg);
  cursor: default;
}
.nav-link.is-here .nav-link-label { color: var(--text-sub); }

.nav-wait {
  margin: 10px 12px 0;
  font-size: 11.5px;
  color: var(--text-sub);
}

.app-title { margin: 0; font-size: 18px; font-weight: 700; }
.app-deadline { margin: 4px 0 0; font-size: 12px; opacity: .92; }

/* 管理画面は色を変えて、提出画面と取り違えないようにする */
.app-header-admin { background: #2f6fae; }

/* ---- 入力パネル（管理画面） ---- */

.panel {
  margin: 12px 12px 0;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
}

.month-picker { display: flex; align-items: center; gap: 8px; }

.month-nav {
  width: 40px; height: 44px;
  flex: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.month-nav:active { background: var(--bg); }

.month-input, .date-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.month-input:focus, .date-input:focus {
  outline: none;
  border-color: #2f6fae;
  background: var(--surface);
}

/* ---- 日付の選択（管理画面） ---- */

.pickday {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.pickday.is-on { border-color: #2f6fae; background: #eef5fc; }
.pickday:active { transform: scale(.995); }

.pickday-date {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.pickday-date.is-sun { color: var(--sun); }
.pickday-date.is-sat { color: var(--sat); }
.pickday-date .dow { font-size: 12px; font-weight: 500; color: var(--text-sub); margin-left: 3px; }

.pickday-mark {
  width: 28px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #2f6fae;
  line-height: 1;
}

/* 管理画面のフッターボタンもヘッダーと同じ色に揃える */
.app-header-admin ~ .app-footer .submit-btn { background: #2f6fae; }
.app-header-admin ~ .app-footer .submit-btn:active:not(:disabled) { background: #25587f; }

/* ---- ステータス ---- */

.status {
  margin: 12px 12px 0;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text-sub);
}
.status.is-error { color: var(--error); background: #ffe8e8; box-shadow: none; }

/* 読み込み失敗時の再試行。#status は本文の外にあるので、本文が hidden でも押せる */
.status-text { display: block; }
.retry-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.retry-btn:disabled { opacity: .5; cursor: default; }

/* 読み込み中の枠（retry.js が「読み込んでいます…」のあいだだけ出す） */
.skeleton { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-row {
  height: 56px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--border) 0%, var(--surface) 50%, var(--border) 100%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.4s ease-in-out infinite;
  opacity: .7;
}
@keyframes skeleton-shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton-row { animation: none; } }

/* 前回の中身を先に出しているあいだ（最新が届くまで押せない） */
.is-stale { pointer-events: none; opacity: .55; }

/* 投げ直しているあいだの小さな知らせ（retry.js が出し入れする） */
.retry-note {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(12px + env(safe-area-inset-top));
  max-width: 90vw;
  width: max-content;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fdf6e3;
  border: 1px solid var(--warn);
  color: var(--warn);
  font-size: 12.5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  z-index: 20;
}

/* ---- 一括操作 ---- */

.bulk {
  display: flex;
  gap: 8px;
  padding: 12px 12px 0;
}

.bulk-btn {
  flex: 1;
  font: inherit;
  font-size: 13px;
  padding: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  border-radius: 8px;
  cursor: pointer;
}
.bulk-btn:active { background: var(--bg); }

/* 曜日ごとにまとめて外す／入れる（募集日登録）。
   その曜日が 全部入っている＝塗り / 一部＝点線の枠 / 全部外れている＝薄い、で分ける */
.dowbar {
  display: flex;
  gap: 6px;
  padding: 8px 12px 0;
}
.dow-btn {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-sub);
  cursor: pointer;
}
.dow-btn.is-all { background: #2f6fae; border-color: #2f6fae; color: #fff; }
.dow-btn.is-some { background: #eef5fc; border: 1px dashed #2f6fae; color: #2f6fae; }
.dow-btn.is-none { text-decoration: line-through; opacity: .7; }
.dow-btn.is-none.is-sun { color: var(--sun); }
.dow-btn.is-none.is-sat { color: var(--sat); }
.dow-btn:active { transform: scale(.97); }
.dowbar-hint {
  margin: 6px 12px 0;
  font-size: 11.5px;
  color: var(--text-sub);
}

/* ---- 日ごとの行 ---- */

.days {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.day {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 3px solid transparent;
}
.day.is-answered { border-left-color: var(--line-green); }

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.day-date {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.day-date.is-sun { color: var(--sun); }
.day-date.is-sat { color: var(--sat); }
.day-date .dow { font-size: 12px; font-weight: 500; color: var(--text-sub); margin-left: 3px; }

/* ---- 〇 / × ---- */

.choice { display: flex; gap: 8px; }

.choice-btn {
  width: 52px;
  height: 40px;
  font-size: 18px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}
.choice-btn:active { transform: scale(.96); }

.choice-yes.is-on {
  background: var(--line-green);
  border-color: var(--line-green);
  color: #fff;
}
.choice-no.is-on {
  background: #6b7280;
  border-color: #6b7280;
  color: #fff;
}

/* ---- 備考 ---- */

.note {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  min-height: 38px;
  resize: none;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}
.note:focus {
  outline: none;
  border-color: var(--line-green);
  background: var(--surface);
}
.note::placeholder { color: var(--text-sub); }

/* ---- フッター ---- */

.app-footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.count {
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.submit-btn {
  width: 100%;
  border: none;
  background: var(--line-green);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
}
.submit-btn:active:not(:disabled) { background: var(--line-green-dark); }
.submit-btn:disabled { opacity: .55; cursor: default; }

/* ---- 提出済みの読み取り専用表示 ---- */

.submitted-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.submitted-row {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 3px solid var(--border);
}
.submitted-row.is-yes { border-left-color: var(--line-green); }
.submitted-row.is-unanswered { border-left-color: var(--warn); }

.submitted-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.submitted-mark {
  font-size: 20px;
  font-weight: 700;
  color: var(--line-green-dark);
  line-height: 1;
  min-width: 52px;
  text-align: center;
}
.submitted-mark.is-unanswered {
  font-size: 12px;
  color: var(--warn);
}

.submitted-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-sub);
  background: var(--bg);
  border-radius: 8px;
  padding: 7px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* フッターに複数ボタンが並ぶときの間隔 */
.app-footer .bulk-btn { margin-top: 2px; }

/* ---- 月バー・タブ（確定シフト閲覧） ---- */

.monthbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 12px 0;
}

.monthbar-label {
  font-size: 16px;
  font-weight: 700;
  min-width: 120px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 12px 12px 0;
}

.tab {
  flex: 1;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  border-radius: 8px;
  cursor: pointer;
}
.tab.is-on {
  background: var(--line-green);
  border-color: var(--line-green);
  color: #fff;
}

/* ---- 確定シフトの行 ---- */

.shiftday {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 3px solid transparent;
}
.shiftday.is-mine { border-left-color: var(--line-green); }

.shiftday-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shift-count { font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; }

.shift-tag {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--line-green-dark);
  background: #e6f7ed;
  padding: .25em .7em;
  border-radius: 999px;
}

/* 「自分のシフト」タブは日付とタグを横並びにする */
.shiftday.is-mine > .day-date { display: inline-block; }
.shiftday:not(:has(.shiftday-head)) { flex-direction: row; align-items: center; }

.names { display: flex; flex-wrap: wrap; gap: 6px; }

.name-chip {
  font-size: 13px;
  padding: .25em .7em;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-sub);
}
.name-chip.is-me {
  background: var(--line-green);
  color: #fff;
  font-weight: 700;
}

.empty-note {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
}

/* 追加登録（締切後の希望を管理者が代わりに入れる） */
.extra-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 0 12px 10px;
  padding: 11px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
}
.extra-btn:active { background: #eef2f6; }

.extra-step {
  margin: 14px 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}

/* 確定でシフトに入っている日。希望から外せない */
.day.is-locked { border-color: var(--line-green); }
.day-locked {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--line-green-dark);
}
.choice-btn:disabled { opacity: .55; cursor: default; }
.pickday.is-locked { opacity: .75; cursor: default; }
.pickday.is-locked.is-on { border-color: var(--line-green); background: #eefaf1; }

/* ---- 人数が足りていない日 ---- */

/* シフト作成の一覧。足りない日だけ左に線を入れて、流し見でも拾えるように */
.shiftday.is-short { border-left: 3px solid var(--warn); }
.shift-count.is-short { color: var(--warn); font-weight: 700; }

.short-bar {
  margin: 0 12px 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  background: #fdf6e3;
  font-size: 13px;
  line-height: 1.6;
  color: var(--warn);
}

/* 募集日登録の下に出る不足パネル */
.short-panel {
  margin: 20px 12px 0;
  padding: 16px 16px 18px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: #fdf6e3;
}
.short-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--warn);
}
.short-lead {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-sub);
}
.short-days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.short-chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: .3em .8em;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--warn);
  color: var(--warn);
  white-space: nowrap;
}
.bulk-btn.is-short-cta {
  border-color: var(--warn);
  color: var(--warn);
  font-weight: 700;
}

/* 提出画面の追加募集。確定が出たあとに、足りない日だけを出す */
.extra-call {
  margin: 0 12px 12px;
  padding: 14px 14px 16px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: #fdf6e3;
}
.extra-call-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--warn);
}
.extra-call-lead {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-sub);
}
.extra-call-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.extra-day {
  font-size: 13px;
  font-weight: 600;
  padding: .45em .9em;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--warn);
  color: var(--warn);
  white-space: nowrap;
  cursor: pointer;
}
.extra-day.is-on {
  background: var(--warn);
  color: #fff;
}
/* すでに〇で出してある日。押す先が無いので、色を落として印だけ残す */
.extra-day.is-said {
  border-color: var(--border);
  background: var(--bg);
  color: var(--text-sub);
  cursor: default;
}
.extra-call-btn { margin-top: 14px; }

/* 入力中の一覧で、追加募集の日に付ける印 */
.day.is-extra { border-color: var(--warn); }
.day-extra {
  margin-left: 8px;
  padding: .15em .6em;
  border-radius: 999px;
  background: #fdf6e3;
  border: 1px solid var(--warn);
  font-size: 11px;
  font-weight: 700;
  color: var(--warn);
  white-space: nowrap;
}

/* 提出画面: 〇を付けなかった日は×で送る、の案内 */
.form-lead {
  margin: 0;
  padding: 12px 12px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-sub);
}
/* まだ選んでいない日の行に、送ると×になることを薄く出す */
.day-default {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-sub);
  white-space: nowrap;
}
/* 〇が1日も無いまま提出しようとしたときの確認（フッターの中） */
.confirm-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.confirm-text {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--warn);
}

/* 任意項目の印と、その下の補足 */
.field-opt {
  margin-left: 6px;
  padding: .1em .5em;
  border-radius: 999px;
  background: var(--bg);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
}
.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-sub);
}

/* 承認画面: 管理者は承認の対象外だと伝える一行 */
.admin-note {
  margin: 16px 12px 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-sub);
}

/* 人ごとの提出状況 */
.personrow { cursor: default; }
.personrow.is-nosubmit { opacity: .6; }

/* 日付チップはボタン。押すとその日の割り当て画面へ飛ぶ */
.name-chip.is-jump {
  border: 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, .18);
  text-underline-offset: 2px;
}
.name-chip.is-jump:active { transform: scale(.96); }

/* シフトに入れた日。ひと目で分かるように、一覧の割り当て済みと同じ緑で塗る */
.name-chip.is-assigned {
  background: var(--line-green);
  color: #fff;
  font-weight: 700;
}
.shift-count.is-picked { color: var(--line-green-dark); font-weight: 700; }

.people-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 12px 0;
  font-size: 12px;
  color: var(--text-sub);
}
/* 見た目は .name-chip.is-assigned と同じ。凡例用に別クラスにしてある
   （.name-chip のままだと、一覧を数える処理がこの見本まで拾ってしまう） */
.legend-chip {
  font-size: 12px;
  padding: .2em .6em;
  border-radius: 999px;
  background: var(--line-green);
  color: #fff;
  font-weight: 700;
}
/* 備考つき（「18:00〜」など）は見落とすと困るので色を変える */
.personrow .name-chip.has-note {
  background: #fdf6e3;
  color: var(--warn);
  font-weight: 600;
}
.extra-step #extra-who { color: var(--text); }

/* 仮確定の帯。管理者にだけ出る（published はスタッフには返らない） */
.draft-note {
  margin: 12px 12px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--warn);
  background: #fdf6e3;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  color: var(--warn);
}

/* 確定シフト: 足りない日の追加募集は提出画面から、の案内 */
.extra-guide {
  margin: 12px 12px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--line-green);
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-sub);
}
.extra-guide a { color: var(--line-green-dark); font-weight: 700; white-space: nowrap; }

/* ---- シフト作成 ---- */

/* 日付一覧の行はボタンなので、既定のボタン見た目を打ち消す */
.datebtn {
  width: 100%;
  border: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.datebtn:active { transform: scale(.995); }
.datebtn.is-mine { border-left-color: #2f6fae; }
.datebtn .name-chip.is-me { background: #2f6fae; }

.detail-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 0;
}

.detail-bar .bulk-btn { flex: 0 0 auto; }

.detail-date {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 候補者の行 */
.cand-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cand-name { font-size: 16px; font-weight: 700; }

.cand-note {
  font-size: 12px;
  color: var(--text-sub);
  white-space: pre-wrap;
  word-break: break-word;
}
.pickday.is-on .cand-note { color: #2f6fae; }

/* 希望は出ていないのに確定に入っている人。外せるように候補へ混ぜてある */
.cand-nowish {
  font-size: 12px;
  font-weight: 600;
  color: var(--warn);
}

/* ---- トースト ---- */

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--footer-h) + 16px + env(safe-area-inset-bottom));
  max-width: 90vw;
  width: max-content;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  z-index: 10;
}
.toast.is-ok { background: #1f2937; }
.toast.is-warn { background: var(--warn); }
.toast.is-error { background: var(--error); }

/* ---- フォーカス可視 ---- */

button:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--line-green-dark);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .choice-btn:active,
  .pickday:active { transform: none; }
}

/* ---- シフト作成: 月の一覧（見出しをタップして開く） ---- */

.monthbar-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 150px;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.monthbar-pick:active { background: var(--bg); }
.monthbar-pick[aria-expanded="true"] { border-color: #2f6fae; color: #2f6fae; }
.monthbar-caret { font-size: 11px; color: var(--text-sub); transition: transform .15s; }
.monthbar-pick[aria-expanded="true"] .monthbar-caret { transform: rotate(180deg); color: #2f6fae; }

.month-menu {
  margin: 10px 12px 0;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.month-menu-status { grid-column: 1 / -1; margin: 0; box-shadow: none; }

.month-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 8px 12px;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}
.month-item:active { transform: scale(.98); }
.month-item-name { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.month-item-sub { font-size: 12px; color: #2f6fae; }
.month-item.is-empty .month-item-name,
.month-item.is-empty .month-item-sub { color: var(--text-sub); }
.month-item.is-on { background: #eef5fc; border-color: #2f6fae; }
.month-item.is-on .month-item-name { color: #2f6fae; }

/* ---- シフト作成: 前の日／次の日（割り当て画面のフッター） ---- */

/* フッターが1段増えるぶん、本文の下の余白とトーストの位置を上げる */
/* shell.js が実寸を入れるまでの保険。入ったあとはインラインの値が勝つ */
.app.is-detail { --footer-h: 148px; }

.daynav { display: flex; gap: 8px; }

.daynav-btn {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font: inherit;
  text-align: left;
  color: #2f6fae;
  background: var(--surface);
  border: 1px solid #2f6fae;
  border-radius: 10px;
  cursor: pointer;
}
.daynav-btn.is-next { justify-content: flex-end; text-align: right; }
.daynav-btn:active:not(:disabled) { background: #eef5fc; }
.daynav-btn:disabled { color: var(--text-sub); border-color: var(--border); background: var(--bg); cursor: default; }
.daynav-arrow { flex: none; font-size: 22px; line-height: 1; }
.daynav-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.daynav-cap { font-size: 11px; opacity: .8; }
.daynav-date { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- 承認待ちバッジ（シフト作成・募集日登録の上部） ---- */

.pending-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 12px 0;
  padding: 12px 14px;
  background: #fff6e0;
  border: 1px solid #f0c674;
  border-radius: var(--radius);
  color: #8a6100;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.pending-badge:active { background: #ffefcc; }

/* 承認待ちが居ないときは、ただの入口として控えめに出す */
.pending-badge.is-quiet {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-sub);
  font-weight: 500;
}
.pending-badge.is-quiet:active { background: var(--bg); }
.pending-badge .arrow { font-size: 18px; line-height: 1; }

/* 提出画面: 今月の追加募集への案内（見た目は承認待ちの入口と同じ。ボタンなので幅と文字をそろえる） */
.extra-jump {
  width: calc(100% - 24px);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

/* ---- スタッフの承認画面 ---- */

.section-title {
  margin: 18px 12px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.section-count { font-size: 12px; font-weight: 500; }

.staffrow {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
}
.staffrow.is-pending { border-left-color: #f0c674; }

.staffrow-head { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.staff-name { font-size: 16px; font-weight: 700; }
.staff-sub { font-size: 12px; color: var(--text-sub); }
.staff-sub:empty { display: none; }

.staff-field { display: flex; flex-direction: column; gap: 6px; }
.staff-cap { font-size: 12px; color: var(--text-sub); word-break: break-all; }
.staff-input {
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.staff-input:focus { outline: none; border-color: #2f6fae; background: var(--surface); }

.staff-actions { display: flex; gap: 8px; }
.staff-btn {
  flex: 1;
  min-height: 44px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-sub);
  cursor: pointer;
}
.staff-btn.is-primary { background: #2f6fae; border-color: #2f6fae; color: #fff; }
.staff-btn:active:not(:disabled) { opacity: .8; }
.staff-btn:disabled { opacity: .5; cursor: default; }

/* ---- 確定のときの選択肢（シフト作成のフッター） ---- */

.save-opts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 2px 4px;
}

.save-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.save-opt input { width: 18px; height: 18px; accent-color: #2f6fae; flex: none; }
.save-opt input:disabled { opacity: .4; }
.save-opt input:disabled + span { color: var(--text-sub); }

/* 仮確定のあいだは、公開していないことが一目で分かるようにする */
.save-opts.is-draft { border-left: 3px solid var(--warn); padding-left: 8px; }
.app-header-admin ~ .app-footer .save-opts.is-draft ~ .submit-btn { background: var(--warn); }

/* ---- 時間帯の板（assets/timepicker.js。config の timeRanges があるときだけ出る） ---- */

body.tp-open { overflow: hidden; }

.tp-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 40;
}

.tp-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  padding: 6px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
  z-index: 41;
}

.tp-grip {
  width: 40px;
  height: 5px;
  margin: 4px auto 8px;
  border-radius: 3px;
  background: var(--border);
}

.tp-title {
  margin: 0;
  text-align: center;
  font-weight: 700;
}
.tp-hint {
  margin: 0 0 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
}

.tp-cols {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.tp-col { flex: 1; min-width: 0; }
.tp-col-label {
  margin: 0 0 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
}
.tp-sep { padding-bottom: 98px; color: var(--text-sub); }

.tp-frame { position: relative; }
/* 真ん中の行（選んでいる行）の印 */
.tp-frame::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 88px;
  height: 44px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(6, 199, 85, .08);
  border-radius: 8px;
  pointer-events: none;
}

.tp-wheel {
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  outline: none;
}
.tp-wheel::-webkit-scrollbar { display: none; }
.tp-wheel:focus-visible { box-shadow: 0 0 0 2px var(--line-green); border-radius: 8px; }

.tp-item {
  height: 44px;
  line-height: 44px;
  text-align: center;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--text-sub);
  scroll-snap-align: center;
  cursor: pointer;
  user-select: none;
}
.tp-item.is-on { color: var(--text); font-weight: 700; }
.tp-item.is-disabled { color: var(--border); cursor: default; }

.tp-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.tp-btn {
  flex: 1;
  min-height: 48px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.tp-allday {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.tp-ok {
  border: 0;
  background: var(--line-green);
  color: #fff;
}

/* 時間帯の表示（提出・シフト作成・確定シフト） */
.day-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--line-green);
  border-radius: 999px;
  background: rgba(6, 199, 85, .06);
  color: var(--line-green-dark);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.day-time::after { content: '変える'; font-size: 11px; font-weight: 600; color: var(--text-sub); }
.submitted-time,
.shift-time,
.cand-wish {
  font-size: 13px;
  font-weight: 600;
  color: var(--line-green-dark);
}
.submitted-time { margin-left: auto; margin-right: 10px; }
.shift-time { margin-left: 8px; }
.name-time { margin-left: 4px; font-size: 11.5px; font-weight: 600; opacity: .8; }
/* 選んだ人の時間。候補の行（.pickday.is-on）のすぐ下に、同じ色で続けて出す */
.cand-time-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -9px;
  padding: 4px 10px 8px 14px;
  border: 1px solid #2f6fae;
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #eef5fc;
}
.cand-time-bar .cand-time { font-size: 14px; font-weight: 700; color: #2f6fae; }
.pickday.is-on:has(+ .cand-time-bar:not([hidden])) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.cand-time-bar .bulk-btn { flex: 0 0 auto; margin-left: auto; }
