/* ==========================================================================
   シフト調整アプリ — デザインシステム
   落ち着いたセージグリーン / 余白と階層でみせるミニマルUI
   ========================================================================== */

:root {
  /* 面 */
  --bg:        #f6f8f7;
  --surface:   #ffffff;
  --line:      #e6ebe8;
  --line-soft: #eef2f0;

  /* 文字 */
  --ink:       #1e2a24;
  --ink-2:     #4b5a52;
  --ink-3:     #8b9a92;

  /* ブランド */
  --brand:     #4f8a68;
  --brand-ink: #2f5a43;
  --brand-bg:  #eef5f0;

  /* 角丸 */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  /* 影(ごく薄く) */
  --shadow-1: 0 1px 2px rgba(30, 42, 36, .05);
  --shadow-2: 0 4px 16px -6px rgba(30, 42, 36, .16);

  /* モバイル下部ナビ高さ */
  --navh: 60px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont,
               'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  font-feature-settings: 'palt' 1;
  letter-spacing: .01em;
  color: var(--ink);
  background: var(--bg);
}

/* 数字は等幅で揃える */
.tnum, table, .cal, .stat-num { font-variant-numeric: tabular-nums; }

/* ---------- 面 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-1);
}
@media (max-width: 640px) {
  .card { padding: 16px; border-radius: var(--r); }
}

.card-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
}
.card-title .fas, .card-title .far { font-size: .8125rem; color: var(--brand); }

.card-sub { font-size: .75rem; color: var(--ink-3); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--line-soft); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }

.btn-sm { min-height: 32px; padding: 0 12px; font-size: .75rem; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

.btn-danger { background: #fff; border-color: #f1d6d6; color: #b4514f; }
.btn-danger:hover { background: #fdf3f3; color: #9c403e; }

/* アイコンだけの丸ボタン */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  font-size: .75rem;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex: none;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }

.plain-btn {
  background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--ink-3); transition: color .15s;
}
.plain-btn:hover { color: var(--ink); }

/* ---------- セグメント切替 ---------- */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--line-soft);
  border-radius: var(--r);
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.seg-btn:hover { color: var(--ink-2); }
.seg-btn.is-on {
  background: var(--surface);
  color: var(--brand-ink);
  box-shadow: var(--shadow-1);
}

/* ---------- フォーム ---------- */
.label {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 6px;
  letter-spacing: .03em;
}
.field {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-size: .875rem;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field::placeholder { color: var(--ink-3); }
.field:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 138, 104, .12);
}
select.field {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%238b9a92'%3E%3Cpath d='M4.6 6.4 8 9.8l3.4-3.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}
input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: .8; }

/* ---------- リスト行 ---------- */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  transition: border-color .15s;
}
.row:hover { border-color: var(--line); }
.stack > * + * { margin-top: 8px; }

.empty {
  padding: 24px 0;
  text-align: center;
  font-size: .8125rem;
  color: var(--ink-3);
}

/* ---------- チップ / バッジ ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: .6875rem;
  color: var(--ink-3);
}

/* ---------- カレンダー ---------- */
.cal { width: 100%; }
.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink-3);
  text-align: center;
  padding-bottom: 8px;
}
.cal-dow .sun { color: #c9736f; }
.cal-dow .sat { color: #6f92c9; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  grid-auto-rows: minmax(60px, auto);
}
@media (min-width: 640px) {
  .cal-grid { gap: 6px; grid-auto-rows: minmax(78px, auto); }
  .cal-grid.dense { grid-auto-rows: minmax(88px, auto); }
}

/* 希望休の提出など、指でタップするカレンダーはさらに大きく */
.cal-big .cal-dow { font-size: .875rem; padding-bottom: 10px; }
.cal-big .cal-grid { gap: 7px; grid-auto-rows: minmax(70px, auto); }
@media (min-width: 640px) {
  .cal-big .cal-grid { gap: 9px; grid-auto-rows: minmax(96px, auto); }
}

/* PC では暦全体をほぼ正方形のシルエットに保ちつつ、マスが縦長になりすぎない比率にする */
@media (min-width: 640px) {
  .cal-sq {
    display: grid;
    grid-template-rows: auto 1fr;
    aspect-ratio: 7 / calc(var(--rows, 6) * 1.04);
  }
  .cal-sq .cal-grid,
  .cal-sq .cal-grid.dense {
    grid-template-rows: repeat(var(--rows, 6), minmax(0, 1fr));
    grid-auto-rows: auto;
    height: 100%;
  }
}
.cal-cell {
  border-radius: 8px;
  background: var(--line-soft);
  border: 1px solid transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.cal-cell.blank { background: #fbfcfb; }
.cal-num {
  font-size: .8125rem;
  font-weight: 700;
  color: var(--ink-2);
  padding: 5px 0 3px;
  text-align: center;
  flex: none;
}
.cal-cell.today { border-color: var(--brand); }
.cal-cell.today .cal-num { color: var(--brand); }
button.cal-cell { cursor: pointer; }
button.cal-cell:active { background: #e4eae7; }

/* 出勤カレンダー: PC は名前一覧 / スマホは店舗ドットのみ */
.cal-full { display: none; }
.cal-mini { display: flex; flex: 1; align-items: center; justify-content: center; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.cal-dot { width: 6px; height: 6px; border-radius: 999px; display: block; }
@media (min-width: 640px) {
  .cal-full { display: block; }
  .cal-mini { display: none; }
}

/* ---------- テーブル(横長表示) ---------- */
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  -webkit-overflow-scrolling: touch;
}
.tbl { border-collapse: separate; border-spacing: 0; font-size: .75rem; }
.tbl th, .tbl td { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.tbl thead th { background: #fafbfa; font-weight: 600; color: var(--ink-2); padding: 6px 4px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .sticky-col { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); }
.tbl thead .sticky-col { background: #fafbfa; z-index: 3; }

/* ---------- モーダル ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  background: rgba(24, 34, 29, .38);
  backdrop-filter: blur(2px);
  animation: fadeIn .16s ease-out;
}
.modal-panel {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 20px;
  box-shadow: var(--shadow-2);
  animation: sheetUp .2s cubic-bezier(.2,.8,.3,1);
}
@media (min-width: 640px) {
  .modal-bg { align-items: center; padding: 24px; }
  .modal-panel { border-radius: var(--r-lg); animation: popIn .16s ease-out; }
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes sheetUp { from { transform: translateY(16px); opacity: .6 } to { transform: none; opacity: 1 } }
@keyframes popIn { from { transform: scale(.98); opacity: .6 } to { transform: none; opacity: 1 } }

/* ---------- ヘッダー / ナビ ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brandmark {
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--ink);
}

.tabs { display: flex; gap: 4px; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: 10px 12px 12px;
  border: 0;
  background: none;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s;
}
.tab:hover { color: var(--ink-2); }
.tab.is-on { color: var(--brand-ink); font-weight: 600; }
.tab.is-on::after {
  content: '';
  position: absolute; left: 8px; right: 8px; bottom: 0;
  height: 2px; border-radius: 2px 2px 0 0;
  background: var(--brand);
}

/* モバイル下部タブ */
.botnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.botnav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  min-height: var(--navh);
  border: 0; background: none;
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .15s;
}
.botnav-btn i { font-size: 1rem; }
/* タブが多いときは文字を詰める(7タブでも折り返さないように) */
.botnav-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) {
  .botnav-btn { font-size: .5625rem; gap: 2px; }
  .botnav-btn i { font-size: .9375rem; }
}
.botnav-btn.is-on { color: var(--brand); }

/* ---------- トースト ---------- */
.toast {
  position: fixed; z-index: 70;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--navh) + 16px);
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(30, 42, 36, .93);
  color: #fff;
  font-size: .8125rem;
  box-shadow: var(--shadow-2);
  animation: toastIn .2s cubic-bezier(.2,.8,.3,1);
}
.toast.is-error { background: #b4514f; }
@media (min-width: 640px) {
  .toast { bottom: auto; top: 20px; left: auto; right: 20px; transform: none; }
}
@keyframes toastIn { from { opacity: 0 } to { opacity: 1 } }

/* ---------- シフト表セルボタン ---------- */
.cell-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  font-size: 10px; line-height: 1.25;
  padding: 1px 4px;
  border-radius: var(--r-sm);
  transition: background .12s ease;
}
.cell-btn:hover { background: var(--line-soft); }

/* ---------- スクロールバー ---------- */
* { scrollbar-width: thin; scrollbar-color: #d6ded9 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #d6ded9; border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 補足の注記 ---------- */
.note {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--brand-bg);
  font-size: .8125rem; line-height: 1.6;
  color: var(--ink-2);
}
.note i { flex: none; margin-top: 3px; color: var(--brand); font-size: .8125rem; }

/* ---------- 早番 / 遅番 のタグ・時刻表示 ---------- */
.slot-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 15px; height: 15px; padding: 0 3px; margin-left: 3px;
  border-radius: 4px;
  font-size: 9px; font-weight: 700; line-height: 1;
  vertical-align: middle;
}
/* カレンダーセル内の時刻 */
.cell-time {
  display: block;
  font-size: 9px; line-height: 1.2;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
/* 横長シフト表の出勤セル(店舗略称 + 早遅 / 時刻の2段) */
.wcell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.15; }
.wcell-top { display: inline-flex; align-items: center; }
.wcell-time { font-size: 8.5px; font-weight: 500; opacity: .75; letter-spacing: -.02em; }

/* ---------- 時刻入力の行 ---------- */
.time-row { display: flex; align-items: center; gap: 8px; }
.time-sep { flex: none; font-size: .8125rem; color: var(--ink-3); }
.input {
  flex: 1; min-width: 0;
  min-height: 42px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  font-size: .875rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 138, 104, .12);
}
.time-row .btn { flex: none; min-height: 42px; padding: 0 12px; }

/* 選択中のボタン(店舗 / 早遅) */
.btn.is-sel { font-weight: 700; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }

/* ==========================================================================
   誰が・どこの店舗に・いつ を見せるパーツ
   ========================================================================== */

/* ---------- 店舗タグ ---------- */
.store-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap;
}
.store-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; }

/* ---------- 絞り込みバー ---------- */
.filter-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.filter-cap {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .6875rem; font-weight: 600; color: var(--ink-3);
  margin-right: 2px;
}
.filter-cap i { font-size: .625rem; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
  font-size: .75rem; font-weight: 600; color: var(--ink-3);
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.fchip:hover { color: var(--ink-2); border-color: #d6ded9; }
.fchip.is-on { color: inherit; }
.fdot { width: 7px; height: 7px; border-radius: 999px; flex: none; }

/* ---------- 日別タイムライン ---------- */
.tl { display: flex; flex-direction: column; gap: 2px; }
.tl-group {
  padding: 10px 0 12px;
  border-top: 1px solid var(--line-soft);
}
.tl-group:first-of-type { border-top: 0; padding-top: 2px; }
.tl-store {
  display: flex; align-items: center;
  gap: 8px; margin-bottom: 8px;
}
/* 必要人数を右端に寄せる */
.tl-store .tl-count { margin-left: auto; }
.tl-count {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .6875rem; font-weight: 700; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.tl-count.is-short { color: #b4514f; }

.tl-row { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.tl-row + .tl-row { margin-top: 3px; }
.tl-label {
  flex: none; width: 84px;
  display: flex; align-items: center; justify-content: flex-end; gap: 2px;
  font-size: .75rem; color: var(--ink-2);
  overflow: hidden;
}
.tl-name {
  display: inline-flex; align-items: baseline; gap: 2px;
  overflow: hidden; white-space: nowrap; min-width: 0;
}
.nm-sei { font-weight: 600; flex: none; }
.nm-mei { font-weight: 400; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tl-track {
  position: relative; flex: 1; min-width: 0;
  height: 22px;
  border-radius: var(--r-sm);
  background:
    repeating-linear-gradient(to right,
      var(--line-soft) 0 1px,
      transparent 1px calc(100% / var(--hn, 6)));
  background-color: #fafbfa;
}
.tl-bar {
  position: absolute; top: 2px; bottom: 2px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(30, 42, 36, .1);
}
.tl-time {
  font-size: 10px; font-weight: 700; color: #fff;
  letter-spacing: .01em; white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
}
.tl-none { position: absolute; left: 6px; top: 4px; font-size: 10px; color: var(--ink-3); }

/* 時間目盛り */
.tl-scale { min-height: 18px; margin-bottom: 4px; }
.tl-scale .tl-track { height: 14px; background: none; }
.tl-hour {
  position: absolute; top: 0;
  font-size: 9px; font-weight: 600; color: var(--ink-3);
  transform: translateX(-2px);
  font-variant-numeric: tabular-nums;
}

.tl-empty {
  margin-left: 94px;
  font-size: .75rem; color: #b4514f;
}
.tl-group .tl-empty:not(:has(i)) { color: var(--ink-3); }

/* 休みの行 */
.off-line {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 14px; padding: 10px 12px;
  border-radius: var(--r);
  background: #fafbfa; border: 1px solid var(--line-soft);
  font-size: .75rem; color: var(--ink-2); line-height: 1.9;
}
.off-line > i { color: var(--ink-3); margin-top: 5px; flex: none; }
.off-type {
  display: inline-block; margin: 0 8px 0 3px;
  padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700;
}

.today-pill {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px; margin-left: 2px;
  border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: .6875rem; font-weight: 700;
}
.dow-mark { margin-left: 2px; font-weight: 600; color: var(--ink-3); }

/* ---------- 月カレンダー: 1人1行(行の色 = 店舗) ---------- */
.cal-line {
  display: flex; align-items: center; gap: 4px;
  padding: 1px 4px; margin-bottom: 2px;
  border-radius: 4px;
  font-size: 10px; line-height: 1.45;
  overflow: hidden; white-space: nowrap;
}
.cal-ini {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .65);
  font-size: 9px; font-weight: 800;
}
.cal-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cal-when { flex: none; font-size: 9px; opacity: .8; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cal-none { font-size: 10px; color: var(--ink-3); text-align: center; }

/* スマホ: 店舗の頭文字 + 人数 */
.cal-badges { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; align-items: center; }
.cal-badge {
  display: inline-flex; align-items: center; gap: 1px;
  min-width: 20px; height: 16px; padding: 0 3px;
  border-radius: 4px;
  font-size: 9px; font-weight: 700; line-height: 1;
}
.cal-badge b { font-size: 9px; font-weight: 800; }

/* ---------- 管理者 月表示: 1人1行(行の色 = 店舗) ---------- */
.mrow {
  width: 100%;
  display: flex; align-items: center; gap: 3px;
  padding: 1px 3px; margin-bottom: 1px;
  border-radius: 4px;
  font-size: 10px; line-height: 1.4;
  overflow: hidden; white-space: nowrap;
  transition: filter .12s ease;
}
.mrow:hover { filter: brightness(.95); }
.mrow-empty { color: var(--ink-3); }
.mrow-empty:hover { background: var(--line-soft); filter: none; }
.mrow-ini {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 12px; height: 12px;
  border-radius: 3px;
  color: #fff; font-size: 8px; font-weight: 800;
}
.mrow-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; font-weight: 600; }
.mrow-t { flex: none; font-size: 9px; opacity: .85; letter-spacing: -.03em; }

/* ==========================================================
   希望休の提出: 休みたい日をワンタップで選ぶ
   ========================================================== */

/* 残り枠のメーター */
.quota { display: flex; align-items: center; gap: 10px; }
.quota-dots { display: inline-flex; gap: 4px; }
.quota-dot {
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--line); border: 1px solid var(--line);
}
.quota-dot.is-used { background: var(--brand); border-color: var(--brand); }
/* 選択中(まだ申請していない)分は塗りつぶさず枠線で示す */
.quota-dot.is-pick { background: #fff; border-color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.quota-txt { font-size: .8125rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.quota-txt b { font-size: 1.0625rem; }
.quota-txt.is-full { color: #b4514f; }

/* 選択済みの日をまとめて表示するボックス */
.pickbox {
  margin: 14px 0 18px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: var(--brand-bg);
}
.pickbox-cap {
  display: flex; align-items: center; gap: 7px;
  font-size: .75rem; font-weight: 700; color: var(--brand-ink);
  margin-bottom: 9px;
}
.picked-row { display: flex; flex-wrap: wrap; gap: 7px; }
.picked-empty { font-size: .8125rem; color: var(--ink-3); }
.picked-pill {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 0 10px 0 12px;
  border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: .8125rem; font-weight: 700;
  cursor: pointer;
  transition: background .12s, opacity .12s;
}
.picked-pill:hover { background: var(--brand-ink); }
.picked-pill .pp-dow { font-size: .6875rem; font-weight: 600; opacity: .85; }
.picked-pill .pp-x { font-size: .75rem; opacity: .8; margin-left: 1px; }
.picked-pill.is-approved { background: #4f8a68; cursor: default; }
.picked-pill.is-approved:hover { background: #4f8a68; }
/* 選択中(未申請)。白地＋枠線で「まだ出していない」ことを見た目で区別する */
.picked-pill.is-pick {
  background: #fff; color: var(--brand-ink);
  border: 1.5px solid var(--brand);
}
.picked-pill.is-pick:hover { background: #eef5f0; }
/* 申請済み(承認待ち)。取り消せるので黄系にする */
.picked-pill.is-sent { background: #d9a441; }
.picked-pill.is-sent:hover { background: #c4922f; }

/* ==========================================================
   申請の流れ: ①選ぶ → ②一覧で確認 → ③申請
   ========================================================== */

/* 手順の見出し */
.step-head {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 12px;
}
.step-no {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: .75rem; font-weight: 800; color: var(--ink-3);
}
.step-no.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.step-head b { display: block; font-size: .875rem; font-weight: 700; color: var(--ink); }
.step-sub { display: block; margin-top: 2px; font-size: .75rem; color: var(--ink-3); }

/* 選択中のマス。申請済みと混ざらないよう、はっきり濃い緑にする */
.daycell.is-picking {
  background: #dff0e5; border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset;
}
.daycell.is-picking .dcheck { background: var(--brand); color: #fff; }
.daycell.is-picking .dstate { color: var(--brand-ink); }

/* 申請済みの一覧ボックス */
.sentbox {
  margin-bottom: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.sentbox-cap {
  display: flex; align-items: center; gap: 7px;
  font-size: .75rem; font-weight: 700; color: var(--ink-2);
  margin-bottom: 9px;
}

/* 画面下に貼りつく申請バー。選択が0件のときは隠す */
.submitbar {
  position: fixed; z-index: 55;
  left: 0; right: 0;
  bottom: 0;
  padding: 10px 14px env(safe-area-inset-bottom);
  padding-top: 10px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(30, 42, 36, .07);
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: transform .18s ease-out, opacity .18s;
}
.submitbar.is-on { transform: translateY(0); opacity: 1; pointer-events: auto; }
.submitbar-in {
  max-width: 860px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.submitbar-txt { flex: 1; min-width: 0; font-size: .8125rem; font-weight: 700; color: var(--ink); }
.submitbar-txt b { font-size: 1.125rem; color: var(--brand-ink); margin-right: 1px; }
.submitbar-sub {
  display: block; margin-top: 2px;
  font-size: .6875rem; font-weight: 500; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.submitbar-act { flex: none; display: flex; gap: 8px; }

/* 申請バーが本文の最後に重ならないよう、バーがある画面は下に余白を足す */
#main-content:has(.submitbar.is-on) { padding-bottom: 116px; }

@media (max-width: 767px) {
  .submitbar { padding: 9px 12px env(safe-area-inset-bottom); padding-top: 9px; }
  .submitbar-in { gap: 8px; }
  .submitbar-act .btn { padding: 0 11px; font-size: .6875rem; }
  /* 幅が足りないので「選択をクリア」はモバイルでは隠す(ピルの×で外せる) */
  .submitbar-act #do-clear, .submitbar-act #pd-clear { display: none; }
}

/* 確認モーダルの一覧 */
.confirm-list {
  max-height: 260px; overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 14px;
}
.confirm-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .875rem;
}
.confirm-row:last-child { border-bottom: 0; }
.cr-date { font-weight: 700; }
.cr-dow { font-size: .8125rem; font-weight: 700; }
.cr-tag {
  margin-left: auto;
  padding: 3px 9px; border-radius: 999px;
  background: var(--brand-bg); color: var(--brand-ink);
  font-size: .6875rem; font-weight: 700;
}
.confirm-sum {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 2px;
  font-size: .8125rem; color: var(--ink-2);
}
.confirm-sum b { font-size: .9375rem; color: var(--ink); }

/* カレンダーのマス(1タップで選択/解除) */
.daycell {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: var(--line-soft);
  cursor: pointer;
  transition: background .13s, border-color .13s, transform .08s;
}
.daycell:active { transform: scale(.96); }
.daycell .dnum { font-size: 1.0625rem; font-weight: 700; line-height: 1; color: var(--ink); }
.daycell .dstate { font-size: .625rem; font-weight: 700; line-height: 1; }
.daycell .dcheck {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 999px;
  font-size: .625rem;
}

.daycell.is-free:hover { background: #e2ece6; border-color: #b8d2c4; }
.daycell.is-pending { background: #fbf0df; border-color: #e6c88a; }
.daycell.is-pending .dcheck { background: #d9a441; color: #fff; }
.daycell.is-pending .dstate { color: #8a6224; }
.daycell.is-approved { background: #dbe9e0; border-color: #7fae94; cursor: default; }
.daycell.is-approved .dcheck { background: #4f8a68; color: #fff; }
.daycell.is-approved .dstate { color: #2f5a43; }
.daycell.is-rejected { background: #fbeceb; border-color: #e8c2c0; }
.daycell.is-rejected .dstate { color: #a8514e; }
.daycell.is-locked { opacity: .45; cursor: not-allowed; }
.daycell.is-today { box-shadow: inset 0 0 0 2px var(--brand); }
.daycell.is-past .dnum { opacity: .5; }
.daycell.is-busy { opacity: .5; pointer-events: none; }

@media (min-width: 640px) {
  .daycell .dnum { font-size: 1.25rem; }
  .daycell .dstate { font-size: .6875rem; }
  .daycell .dcheck { width: 24px; height: 24px; font-size: .75rem; }
}

/* ---------- 単位つき入力(「3日分」「90日間有効」など) ---------- */
.unit-field { display: flex; align-items: center; gap: 8px; }
.unit-field .field { flex: 1; min-width: 0; }
.unit {
  flex: none;
  font-size: .8125rem; font-weight: 600; color: var(--ink-2);
  white-space: nowrap;
}
.quick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.vchip {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .75rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.vchip:hover { background: var(--line-soft); }
.vchip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- スタッフ名の所属店舗マーカー ---------- */
.who { display: flex; align-items: center; gap: 6px; }
.who-bar { flex: none; width: 3px; height: 13px; border-radius: 2px; }
.cnt-dot {
  display: inline-block; width: 5px; height: 5px;
  border-radius: 999px; margin-right: 4px; vertical-align: 1px;
}

/* ---------- 一覧表(スタッフ × 日) ---------- */
.lcell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  min-height: 30px; padding: 2px 1px;
  border-radius: 5px;
  line-height: 1.15;
}
.lcell-s { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; }
.lcell-t { font-size: 8.5px; font-weight: 600; opacity: .8; letter-spacing: -.02em; }
.lcell-off {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; border-radius: 4px;
  font-size: 10px; font-weight: 700;
}

/* ---------- 次の出勤カード(スタッフ) ---------- */
.next-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--bar, var(--brand));
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-1);
}
.next-cap {
  font-size: .6875rem; font-weight: 700; letter-spacing: .08em;
  color: var(--ink-3); margin-bottom: 7px;
}
.next-main { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.next-date {
  font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--ink); line-height: 1;
}
.next-dow { font-size: .875rem; font-weight: 700; color: var(--ink-3); margin-left: 3px; }
.next-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.next-time {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: .9375rem; font-weight: 700; color: var(--ink-2);
}

/* ---------- 今月のまとめ ---------- */
.sum-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  padding: 10px 12px; margin-bottom: 14px;
  border-radius: var(--r);
  background: #fafbfa; border: 1px solid var(--line-soft);
  font-size: .75rem; color: var(--ink-3);
}
.sum-item b { font-size: .9375rem; font-weight: 800; color: var(--ink); margin-right: 1px; }
.sum-store {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: .6875rem; font-weight: 700;
}
.sum-store b { font-size: .75rem; font-weight: 800; }

@media (max-width: 639px) {
  .tl-row { gap: 7px; }
  .tl-label { width: 62px; font-size: .6875rem; }
  .tl-label .nm-mei { display: none; }   /* 狭い画面では姓のみ */
  .tl-empty { margin-left: 69px; }
  .tl-time { font-size: 9px; }
  .tl-hour { font-size: 8.5px; }
  .next-date { font-size: 1.5rem; }
  .next-card { padding: 13px 15px; }
  .filter-bar { gap: 6px; padding-bottom: 12px; margin-bottom: 12px; }
  .fchip { min-height: 28px; padding: 0 9px; font-size: .6875rem; }
}

/* ---------- スタッフ用 大きなメニューボタン ---------- */
.menu-grid { display: grid; gap: 12px; }
.menu-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 18px 16px;
  min-height: 84px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .06s;
}
.menu-btn:hover { border-color: var(--brand); box-shadow: var(--shadow-2); }
.menu-btn:active { transform: scale(.99); }
.menu-ico {
  flex: none;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px;
  font-size: 1.125rem;
}
.menu-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.menu-label { font-size: 1rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.menu-desc { font-size: .75rem; color: var(--ink-3); line-height: 1.4; }
.menu-badge {
  flex: none;
  font-size: .6875rem; font-weight: 600;
  padding: 4px 9px; border-radius: 999px;
  background: var(--brand-bg); color: var(--brand-ink);
}
.menu-arrow { flex: none; font-size: .75rem; color: var(--ink-3); }
@media (min-width: 640px) {
  .menu-btn { padding: 22px 20px; min-height: 96px; }
  .menu-label { font-size: 1.0625rem; }
  .menu-desc { font-size: .8125rem; }
}

/* ---------- 戻るボタン / ページ見出し ---------- */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .8125rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.back-btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.back-btn i { font-size: .6875rem; }
.page-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: .9375rem; font-weight: 700; color: var(--ink);
  white-space: nowrap; pointer-events: none;
}
.appbar-row { position: relative; }

/* ---------- 2択の切替ボタン ---------- */
.switch-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  max-width: 420px; margin-left: auto; margin-right: auto;
}
.switch-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 48px; padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  font-size: .875rem; font-weight: 600; color: var(--ink-3);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.switch-btn:hover { color: var(--ink-2); }
.switch-btn.is-on {
  background: var(--brand-bg);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.switch-btn i { font-size: .875rem; }

/* ==========================================================
   店舗設定: 早番/遅番のON・OFF と 必要人数
   ========================================================== */

/* チェックボックス付きの選択カード(押せる範囲を大きく取る) */
.check-card {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.check-card:hover { border-color: var(--brand); background: var(--brand-bg); }
.check-card:has(.chk:checked) { border-color: var(--brand); background: var(--brand-bg); }
.chk {
  flex: none;
  width: 20px; height: 20px; margin-top: 1px;
  accent-color: var(--brand);
  cursor: pointer;
}
.check-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.check-body b { font-size: .875rem; font-weight: 700; color: var(--ink); }
.check-sub { font-size: .75rem; line-height: 1.55; color: var(--ink-3); }

/* 早番 / 遅番 / 枠なし の設定ボックス */
.slot-box {
  padding: 12px 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.slot-box-t {
  display: flex; align-items: center;
  font-size: .8125rem; font-weight: 700;
  margin-bottom: 9px;
}
.num-sm { width: 84px; flex: none; text-align: center; }

/* 「早番・遅番なし」などの状態バッジ */
.badge-soft {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--line-soft);
  font-size: .6875rem; font-weight: 700; color: var(--ink-2);
  white-space: nowrap;
}
.noslot-tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--line-soft);
  font-size: .625rem; font-weight: 700; color: var(--ink-3);
  white-space: nowrap;
}
.lbl-note { margin-left: 7px; font-size: .6875rem; font-weight: 500; color: var(--ink-3); }

/* 曜日ごとの必要人数 */
.dow-grid { display: flex; flex-direction: column; gap: 5px; }
.dow-head, .dow-row {
  display: grid;
  grid-template-columns: 30px 1fr 1fr;
  align-items: center; gap: 8px;
}
/* 枠なしの店舗は列がひとつだけ */
.dow-grid.is-day .dow-head,
.dow-grid.is-day .dow-row { grid-template-columns: 30px 1fr; }
.dow-h { font-size: .6875rem; font-weight: 700; color: var(--ink-3); text-align: center; }
.dow-lab { font-size: .8125rem; font-weight: 700; text-align: center; }
.dow-row .num-sm { width: 100%; min-height: 38px; }

/* ---------- ユーティリティ ---------- */
.hairline { border-bottom: 1px solid var(--line-soft); }
.muted { color: var(--ink-3); }
.stat-num { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }

/* ==========================================================
   人区(にんく)ベースのシフト組み
   ========================================================== */

/* ---------- 店舗の人区パネル ---------- */
.ninku {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.ninku-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ninku-cap {
  display: flex; align-items: center; gap: 7px;
  font-size: .8125rem; font-weight: 700; color: var(--ink);
  margin-bottom: 4px;
}
.ninku-cap i { color: var(--brand); }
.ninku-formula { display: block; font-size: .75rem; color: var(--ink-3); }
.ninku-formula b { color: var(--ink); font-size: .8125rem; }
.ninku-note { margin-left: 5px; opacity: .8; }
.ninku-num { flex: none; text-align: right; line-height: 1; }
.ninku-num b { font-size: 1.75rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.ninku-num b.is-done { color: var(--brand); }
.ninku-num span { font-size: .875rem; font-weight: 600; color: var(--ink-3); }
.ninku-bar {
  height: 7px; border-radius: 999px; background: var(--line-soft);
  overflow: hidden; margin-bottom: 9px;
}
.ninku-bar span { display: block; height: 100%; border-radius: 999px; transition: width .25s ease-out; }
.ninku-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .75rem; }
.nk-ok { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-ink); font-weight: 700; }
.nk-left { color: #8a6224; font-weight: 600; }
.nk-left b { font-size: .9375rem; color: #b4514f; }
.nk-days { color: var(--ink-3); }
.nk-days b { color: var(--ink-2); }
.nk-slot { margin-left: auto; color: var(--ink-3); }
.nk-slot b { color: var(--ink-2); }

/* ---------- 人区の帯(シフト表の上) ---------- */
.nkstrip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.nkchip {
  flex: 1 1 168px; min-width: 148px;
  display: grid; grid-template-columns: 1fr auto; gap: 3px 8px;
  padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
}
.nkchip.is-done { border-color: #cfe2d6; background: #f7fbf8; }
.nkchip-nm { font-size: .75rem; font-weight: 700; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nkchip-num { font-size: .75rem; color: var(--ink-3); text-align: right; }
.nkchip-num b { font-size: .9375rem; font-weight: 800; color: var(--ink); }
.nkchip-u { margin-left: 2px; font-size: .625rem; }
.nkchip-bar { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.nkchip-bar i { display: block; height: 100%; border-radius: 999px; }
.nkchip-left { grid-column: 1 / -1; font-size: .6875rem; font-weight: 600; color: #8a6224; }
.nkchip-left b { font-size: .8125rem; color: #b4514f; margin: 0 1px; }
.nkchip.is-done .nkchip-left { color: var(--brand-ink); }
.nkchip.is-done .nkchip-left i { margin-right: 3px; }

/* ---------- 日ごとの枠(店舗ベースで組む本体) ---------- */
.bgrid { display: flex; flex-direction: column; gap: 5px; }
.brow {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
}
.brow.is-short { border-color: #eddada; background: #fdf7f7; }
.brow.is-today { box-shadow: inset 3px 0 0 var(--brand); }
.brow-day {
  flex: none; width: 42px;
  display: flex; align-items: baseline; gap: 4px;
}
.brow-day b { font-size: .9375rem; font-weight: 700; }
.brow-day span { font-size: .6875rem; font-weight: 600; opacity: .75; }
.brow-cells { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.brow-none { font-size: .75rem; color: var(--ink-3); }
.brow-st {
  flex: none; min-width: 52px; text-align: right;
  font-size: .6875rem; font-weight: 700; color: #b4514f;
  line-height: 1.25;
}
.brow-need { display: block; font-size: .625rem; font-weight: 600; opacity: .85; }
.brow-st.is-ok { color: var(--brand); }

/* 1マス = 1人ぶんの枠 */
.nslot-grp { display: flex; align-items: center; gap: 4px; }
.nslot-cap {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 5px;
  font-size: .625rem; font-weight: 700;
}
.nslot {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 62px; height: 32px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
  font-size: .75rem; font-weight: 700; color: var(--ink);
  cursor: pointer;
  transition: filter .12s, background .12s, border-color .12s;
}
.nslot.is-filled { border-color: transparent; }
.nslot.is-filled:hover { filter: brightness(.94); }
.nslot.is-empty {
  border-style: dashed; border-color: #d3c9b6; background: #fffdf7; color: #b08a3c;
}
.nslot.is-empty:hover { background: #fdf6e6; border-color: #c9a862; }
.nslot-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 72px; }
.nslot-w { font-size: 8px; color: #d9a441; }
/* 早番・遅番が未設定のまま入っている出勤 */
.nslot.is-orphan { box-shadow: inset 0 0 0 1.5px #d9a441; }

/* ---------- スタッフの残り休みボード ---------- */
.restboard {
  margin-top: 14px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface);
  padding: 15px 17px;
  box-shadow: var(--shadow-1);
}
.rb-cap {
  display: flex; align-items: center; gap: 7px;
  font-size: .8125rem; font-weight: 700; color: var(--ink);
  margin-bottom: 11px;
}
.rb-cap i { color: var(--brand); }
.rb-list { display: flex; flex-direction: column; gap: 4px; }
.rb-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: #fcfdfc;
  font-size: .8125rem;
}
.rb-row.is-done { background: #f7fbf8; border-color: #cfe2d6; }
.rb-row.is-tight { background: #fffdf5; border-color: #e8dcbe; }
.rb-row.is-over { background: #fdf7f7; border-color: #eddada; }
.rb-bar { flex: none; width: 3px; height: 15px; border-radius: 2px; }
.rb-nm { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-work { flex: none; font-size: .6875rem; color: var(--ink-3); }
.rb-off { flex: none; font-size: .6875rem; color: var(--ink-2); }
.rb-off b { font-size: 1rem; font-weight: 800; color: #b4514f; margin: 0 2px; }
.rb-row.is-done .rb-off b { color: var(--brand); }
.rb-can {
  flex: none; min-width: 56px; text-align: right;
  font-size: .6875rem; font-weight: 600; color: var(--ink-3);
}

/* 表の右端「あと○日休ませる」 */
.restpill {
  display: inline-flex; align-items: baseline; gap: 1px;
  padding: 2px 8px; border-radius: 999px;
  background: #fdf1f1; color: #b4514f;
  font-size: .625rem; font-weight: 700;
}
.restpill b { font-size: .8125rem; }
.restpill.is-tight { background: #fdf6e6; color: #8a6224; }
.restpill.is-zero { background: var(--brand-bg); color: var(--brand-ink); }

/* ---------- 候補者リスト(誰を入れるか選ぶ) ---------- */
.cdlist {
  max-height: 340px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--r);
}
.cdrow {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px;
  border: 0; border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  text-align: left; cursor: pointer;
  transition: background .12s;
}
.cdrow:last-child { border-bottom: 0; }
.cdrow:hover:not(:disabled) { background: var(--brand-bg); }
.cdrow.is-here { background: #f7fbf8; }
.cdrow.is-blocked { opacity: .55; cursor: not-allowed; }
.cd-main { flex: 1; min-width: 0; }
.cd-nm { display: block; font-size: .875rem; font-weight: 700; color: var(--ink); }
.cd-home { margin-left: 5px; font-size: 9px; color: var(--brand); }
.cd-note { display: block; margin-top: 1px; font-size: .6875rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-badge {
  flex: none; padding: 3px 8px; border-radius: 999px;
  font-size: .625rem; font-weight: 700;
}
.cd-badge.is-here { background: var(--brand-bg); color: var(--brand-ink); }
.cd-badge.is-other { background: #eef2f7; color: #3a6088; }
.cd-badge.is-off { background: #f0efec; color: #6b6459; }
.cd-badge.is-wish { background: #fdf3e0; color: #8a6224; }
.cd-badge.is-tight { background: #fdf1f1; color: #b4514f; }
.cd-nums { flex: none; display: flex; align-items: baseline; gap: 9px; }
.cd-rest, .cd-can {
  min-width: 30px; text-align: right;
  display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 1px;
  font-size: .625rem; font-weight: 600; color: var(--ink-3);
}
.cd-rest b { font-size: 1.0625rem; font-weight: 800; color: #b4514f; }
.cd-rest.is-zero b { color: var(--brand); }
.cd-can b { font-size: 1.0625rem; font-weight: 800; color: var(--ink-2); }
.cd-can.is-zero b { color: #b4514f; }

/* ---------- スマホ ---------- */
@media (max-width: 767px) {
  .ninku { padding: 12px 13px; }
  .ninku-num b { font-size: 1.5rem; }
  .nk-slot { margin-left: 0; width: 100%; }
  .brow { gap: 7px; padding: 6px 8px; }
  .brow-day { width: 36px; }
  .brow-st { min-width: 44px; }
  .brow-st { min-width: 44px; }
  .brow-cells { gap: 4px 7px; }
  .nslot { min-width: 54px; height: 34px; padding: 0 7px; font-size: .6875rem; }
  .nslot-nm { max-width: 54px; }
  .rb-row { gap: 7px; padding: 8px 9px; font-size: .75rem; }
  .rb-work { display: none; }
  .rb-can { min-width: 48px; }
  .nkchip { flex: 1 1 132px; min-width: 132px; padding: 8px 10px; }
}
