@media (min-width: 1025px) {
  .sticky-toggle-toolbar-btn,
  .sticky-toolbar-toggle,
  .sticky-toolbar-close-btn {
    display: none !important;
  }
}
/* 希望一覧タブUI */
.request-tab-bar {
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.request-tab-btn {
  padding: 4px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--chrome-soft);
  color: var(--text2);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s, border .15s;
}
.request-tab-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
/* 修飾キー案内: マウスがある端末だけ。タッチ端末は別文面 */
.hint-modkey{font-size:12px;color:var(--text)}
.hint-touch{display:none;font-size:12px;color:var(--text)}
@media (pointer: coarse), (hover: none) {
  .hint-modkey{display:none !important}
  .hint-touch{display:inline}
}
.schedule-guide{
  margin:2px 0 10px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.schedule-guide-row{
  display:flex;
  flex-wrap:wrap;
  gap:6px 8px;
  align-items:center;
}
.schedule-guide-chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:3px 8px;
  border-radius:6px;
  font-size:12px;
  font-weight:600;
  color:var(--text);
  background:var(--surface2);
  border:1px solid var(--line);
  line-height:1.3;
}
.schedule-guide-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  display:inline-block;
  flex-shrink:0;
}
.schedule-guide-swatch{
  width:14px;
  height:10px;
  border-radius:2px;
  display:inline-block;
  flex-shrink:0;
}
.schedule-guide-swatch-sq{
  width:10px;
  height:10px;
  border-radius:3px;
}
.schedule-guide-proxy{
  position:relative;
  width:18px;
  height:13px;
  border-radius:4px;
  display:inline-block;
  flex-shrink:0;
  box-sizing:border-box;
  overflow:hidden;
}
.schedule-guide-proxy b{display:none}
.schedule-guide-proxy-off{
  background:var(--proxy-off-bg);
  box-shadow:inset 0 0 0 1px var(--proxy-off-edge);
}
.schedule-guide-proxy-hol{
  background:var(--proxy-hol-bg);
  box-shadow:inset 0 0 0 1px var(--proxy-hol-edge);
}
.schedule-guide-note{
  margin:0;
  font-size:12px;
  font-weight:600;
  color:var(--text);
  line-height:1.45;
}
/* 全画面共通のスタイル定義。 */
/* ── Reset ── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{
  font-size:14px;
  -webkit-text-size-adjust:100%;
  scrollbar-gutter:stable;
  --page-gutter:18px;
  --panel:var(--surface);
  --chrome:var(--surface2);
  --chrome-soft:var(--surface2);
  /* ホバー用（選択の強調色1とは別。強調色2で乗せる） */
  --chrome-hover:color-mix(in srgb, var(--surface2) 58%, var(--proxy-off) 42%);
  --chrome-hover-strong:color-mix(in srgb, var(--surface2) 45%, var(--proxy-off) 55%);
  --chrome-hover-border:color-mix(in srgb, var(--border) 35%, var(--proxy-off) 65%);
  /* 強調色2／補助色2（PHP/JS が accent から色相シフト）。代理セル・ホバー・週末などに割当 */
  --proxy-off:var(--accent);
  --proxy-hol:var(--accent2);
  --proxy-off-bg:color-mix(in srgb, var(--proxy-off) 40%, var(--surface) 60%);
  --proxy-off-edge:color-mix(in srgb, var(--proxy-off) 72%, var(--border) 28%);
  --proxy-hol-bg:color-mix(in srgb, var(--proxy-hol) 40%, var(--surface) 60%);
  --proxy-hol-edge:color-mix(in srgb, var(--proxy-hol) 72%, var(--border) 28%);
  --line:var(--border);
  --page:var(--bg);
}
body{font-family:'Segoe UI','Hiragino Sans','Meiryo',system-ui,sans-serif;background:var(--page);color:var(--text);min-height:100vh;transition:background .25s,color .25s}
a{text-decoration:none;color:inherit}
input,select,textarea,button{font-family:inherit}

/* ── Header ── */
.header{position:sticky;top:0;z-index:200;background:var(--bg);border-bottom:0;box-shadow:none;display:flex;align-items:flex-start;gap:10px 12px;padding:10px var(--page-gutter) 0;min-height:72px;flex-wrap:wrap}
.logo{font-size:17px;font-weight:800;letter-spacing:.5px;color:var(--accent);white-space:nowrap;display:flex;align-items:center;gap:6px;margin-left:0}
.logo-sub{color:var(--proxy-hol);font-weight:600}
.nav{display:flex;gap:4px;flex:1 0 100%;width:100%;order:3;overflow-x:auto;padding-top:4px}
.nav-link{padding:8px 13px 9px;border-radius:7px;font-size:12.5px;color:var(--text2);transition:color .15s,background .15s,border-color .15s;white-space:nowrap;display:flex;align-items:center;gap:5px}
.nav-link:hover{background:var(--chrome-hover);color:var(--text)}
.nav-link.active:hover{background:var(--surface);color:var(--accent)}
.nav-link-button{width:100%;border:0;background:none;text-align:left;cursor:pointer;font:inherit}
.nav-link.active{background:var(--surface);color:var(--accent);font-weight:700;border-bottom-color:var(--accent)}
/* Windows PC版ソルバのダウンロードはスマホ・タブレット・Macでは非表示 */
html.nsp-mobile-device .nsp-windows-only,
html.nsp-mac-device .nsp-windows-only{display:none !important}
.nav-unread-badge{margin-left:4px;display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:18px;padding:0 6px;border-radius:999px;background:color-mix(in srgb, var(--accent) 70%, var(--accent2) 30%);color:var(--accent-fg);font-size:10.5px;font-weight:800;line-height:1;border:1px solid color-mix(in srgb, var(--accent) 60%, var(--border) 40%)}
.nav-unread-badge[hidden]{display:none}
.header-right{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-left:auto;flex-wrap:wrap;order:2}
.header-right form{display:flex;align-items:stretch;margin:0}
.header-right > .btn,
.header-right > .auth-badge,
.header-right form .btn,
.header-right .toast-history-toggle{
  box-sizing:border-box;
  height:28px;
  min-height:28px;
  padding-top:0;
  padding-bottom:0;
  line-height:1;
}
.hamburger{display:none !important}
.theme-switcher{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.theme-switcher-prefix{font-size:11.5px;font-weight:700;color:var(--text2);white-space:nowrap}
.theme-select{padding:5px 10px;border-radius:6px;border:1px solid var(--line);background:var(--chrome-soft);color:var(--text);font-size:12px;cursor:pointer;transition:all .15s;outline:none}
.theme-select:hover{border-color:var(--chrome-hover-border);background:var(--chrome-hover);color:var(--text)}
.theme-select:focus{border-color:var(--accent);box-shadow:0 0 0 2px rgba(0,0,0,0.1)}
.theme-select option{background:var(--surface);color:var(--text)}
.theme-editor{display:grid;gap:10px;max-width:380px}
.theme-editor .theme-dropdown{width:100%;min-width:0;max-width:100%}
.theme-editor-field{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--text2);font-weight:700}
.theme-editor-colors{display:flex;gap:10px 14px;flex-wrap:wrap}
.theme-swatch{position:relative;display:flex;flex-direction:column;align-items:center;gap:5px;min-width:48px}
.theme-swatch-dot{width:28px;height:28px;padding:0;border-radius:50%;border:2px solid var(--border);box-shadow:inset 0 0 0 1px rgba(0,0,0,.14);cursor:pointer;background:var(--surface2)}
.theme-swatch-dot:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.theme-swatch-name{font-size:11px;font-weight:700;color:var(--text2);white-space:normal;text-align:center;line-height:1.2;max-width:58px}
.theme-editor-hint{font-size:11.5px;color:var(--text2);font-weight:400}
.theme-picker{position:absolute;z-index:1600;width:min(260px,92vw);padding:10px;border-radius:10px;border:1px solid var(--line);background:var(--panel);box-shadow:0 12px 28px rgba(0,0,0,.22)}
.theme-picker-title{font-size:12px;font-weight:800;color:var(--text);margin:0 0 8px}
.theme-picker-board{position:relative;height:132px;border-radius:8px;border:1px solid var(--border);cursor:crosshair;overflow:hidden}
.theme-picker-board-white,.theme-picker-board-black{position:absolute;inset:0}
.theme-picker-board-white{background:linear-gradient(to right,#fff,rgba(255,255,255,0))}
.theme-picker-board-black{background:linear-gradient(to top,#000,rgba(0,0,0,0))}
.theme-picker-knob{position:absolute;width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.35);pointer-events:none}
.theme-picker-hue{position:relative;height:16px;margin-top:10px;border-radius:999px;border:1px solid var(--border);cursor:pointer;background:linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)}
.theme-picker-hue-knob{position:absolute;top:50%;width:12px;height:12px;margin:-6px 0 0 -6px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.35);pointer-events:none}
.theme-picker-sub{font-size:11px;font-weight:700;color:var(--text2);margin:10px 0 6px}
.theme-picker-grid{display:flex;flex-wrap:wrap;gap:6px}
.theme-picker-item{padding:0;border:none;background:transparent;cursor:pointer}
.theme-picker-item-dot{display:block;width:20px;height:20px;border-radius:50%;border:2px solid var(--border);box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}
.theme-picker-item.active .theme-picker-item-dot{border-color:var(--text);box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent)}
.theme-select-native-hidden{position:absolute !important;left:-9999px !important;opacity:0 !important;pointer-events:none !important;width:1px !important;height:1px !important}
.theme-dropdown{position:relative;width:clamp(220px, 28vw, 340px);min-width:220px;max-width:min(92vw, 340px)}
.theme-dropdown-toggle{width:100%;height:31px;padding:0 9px;border-radius:6px;border:1px solid var(--line);background:var(--chrome-soft);color:var(--text);font-size:12px;cursor:pointer;display:flex;align-items:center;gap:7px;justify-content:space-between;transition:all .15s}
.theme-dropdown-toggle:hover{border-color:var(--chrome-hover-border);background:var(--chrome-hover);color:var(--text)}
.theme-dropdown.open .theme-dropdown-toggle{border-color:var(--accent);box-shadow:0 0 0 2px rgba(0,0,0,.1)}
.theme-dropdown-label{flex:1;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.theme-dropdown-caret{font-size:10px;color:var(--text2);flex-shrink:0}
.theme-dot{display:inline-block;width:10px;height:10px;border-radius:50%;border:1px solid rgba(0,0,0,.18);flex-shrink:0}
.theme-dropdown-menu{position:absolute;top:calc(100% + 6px);left:0;right:0;z-index:450;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 26px rgba(0,0,0,.24);padding:5px;display:none;max-height:260px;overflow-y:auto;overflow-x:hidden}
.theme-dropdown.open .theme-dropdown-menu{display:block}
.theme-dropdown-item{width:100%;min-height:34px;padding:6px 8px;border:none;background:transparent;color:var(--text);font-size:12px;border-radius:6px;display:flex;align-items:flex-start;gap:8px;cursor:pointer}
.theme-dropdown-item:hover{background:var(--chrome-hover)}
.theme-dropdown-item.active:hover{background:color-mix(in srgb, var(--surface2) 70%, var(--accent) 30%)}
.theme-dropdown-item.active{background:color-mix(in srgb, var(--surface2) 78%, var(--accent) 22%)}
.theme-item-label{text-align:left;white-space:normal;word-break:break-word;line-height:1.25}
.auth-badge{font-size:12px;padding:4px 11px;border-radius:6px;background:var(--chrome-soft);color:var(--text2);border:1px solid var(--line);display:inline-flex;align-items:center;gap:5px;white-space:nowrap;font-weight:600;transition:all .15s}
.auth-badge:hover,.auth-badge.leader:hover{border-color:var(--chrome-hover-border);color:var(--text);background:var(--chrome-hover)}
.auth-badge.active,.auth-badge.active:hover,.auth-badge.leader.active,.auth-badge.leader.active:hover{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}

/* ── Buttons ── */
.btn{display:inline-flex;align-items:center;gap:5px;padding:7px 16px;border-radius:8px;border:none;cursor:pointer;font-size:12.5px;font-weight:600;transition:all .15s;white-space:nowrap}
.btn:active{transform:scale(.97)}
.btn-primary{background:var(--accent);color:var(--accent-fg)}
.btn-primary:hover{filter:brightness(1.12)}
.btn-ghost{background:var(--chrome-soft);color:var(--text2);border:1px solid var(--line)}
.btn-ghost:hover{
  background:var(--chrome-hover);
  border-color:var(--chrome-hover-border);
  color:var(--text);
}
.btn-ghost.active:hover,
.btn-ghost.is-active:hover,
.btn-ghost.is-on:hover{
  background:var(--accent);
  border-color:var(--accent);
  color:var(--accent-fg);
  filter:brightness(1.06);
}
.btn-ghost.btn-logout{background:color-mix(in srgb, var(--surface2) 70%, var(--danger) 30%);color:var(--text);border-color:color-mix(in srgb, var(--danger) 46%, var(--border) 54%)}
.btn-ghost.btn-logout:hover{border-color:var(--danger);color:var(--text);background:color-mix(in srgb, var(--surface2) 58%, var(--danger) 42%)}
.bulk-action-btn.active,.day-action-btn.active{border-color:var(--accent);color:var(--accent);background:var(--surface)}
.btn-success{background:var(--success);color:#fff}
.btn-danger{background:var(--danger);color:#fff}
.btn-sm{padding:4px 11px;font-size:12px;border-radius:6px}
.btn-xs{padding:2px 8px;font-size:11px;border-radius:5px}
.btn-disabled{background:var(--chrome-soft);color:var(--text3);border:1px solid var(--line);cursor:not-allowed;opacity:0.5}
.btn-disabled:hover{background:var(--surface2);color:var(--text3)}
.btn-icon{padding:6px;border-radius:7px}

/* ── Floating shortcut (mobile) ── */
.fab-top{position:fixed;right:14px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:1400;width:44px;height:44px;border-radius:999px;border:1px solid var(--border);background:var(--accent);color:var(--accent-fg);display:none;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 8px 20px rgba(0,0,0,.22);opacity:0;transform:translateY(8px);transition:opacity .18s,transform .18s,border-color .15s,color .15s;pointer-events:none}
.fab-top-icon{width:24px;height:24px;display:block;transform:translateY(-1px)}
.fab-top-icon path{fill:none;stroke:currentColor;stroke-width:3.8;stroke-linecap:round;stroke-linejoin:round}
.fab-top:hover,.fab-top:focus-visible{border-color:var(--accent);color:var(--accent-fg);filter:brightness(1.06)}
.fab-top.show{opacity:1;transform:translateY(0);pointer-events:auto}

/* ── Sticky bottom bar (mobile) ── */
.sticky-bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:1450;display:none;align-items:center;justify-content:center;gap:10px;padding:8px 12px calc(8px + env(safe-area-inset-bottom));background:color-mix(in srgb, var(--header-bg) 78%, var(--proxy-hol) 22%);border-top:1px solid var(--border);backdrop-filter:blur(3px)}
.sticky-bottom-link{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:0 14px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-size:12px;font-weight:700;cursor:pointer}
.sticky-bottom-link:hover{background:var(--chrome-hover);border-color:var(--chrome-hover-border);color:var(--text)}

/* ── Main ── */
.main{padding:16px var(--page-gutter) 48px;width:100%;max-width:none;margin:0}
.main:has(.msg-wrap){display:flex;flex-direction:column;min-height:0;padding-bottom:16px;height:calc(100dvh - 72px)}
.main:has(.msg-wrap) .page-header{margin-bottom:10px;flex-shrink:0}
.page-header{display:flex;align-items:center;gap:10px;margin-bottom:18px;flex-wrap:wrap}
.profile-page-header,.nav-profile .page-header{justify-content:flex-start}
.profile-page-header>a.btn,.nav-profile .page-header>a.btn{display:none!important}
.page-title{font-size:19px;font-weight:800;color:var(--text)}
.log-retention-note{font-size:12.5px;color:var(--text2);line-height:1.6;margin:-8px 0 16px}
.log-retention-settings{margin:0 0 16px;border:1px solid var(--line);border-radius:10px;background:var(--panel);padding:0}
.log-retention-settings>summary{cursor:pointer;padding:10px 14px;font-size:13px;font-weight:700;color:var(--text);list-style:none}
.log-retention-settings>summary::-webkit-details-marker{display:none}
.log-retention-settings[open]>summary{border-bottom:1px solid var(--border)}
.log-retention-form{display:flex;gap:8px;flex-wrap:wrap;align-items:end;padding:12px 14px 8px}
.log-retention-schedule{font-size:12px;color:var(--text2);line-height:1.6;padding:0 14px 12px}
.page-sub{font-size:12px;color:var(--text2)}

/* ── Staff sticky toolbar ── */
.staff-sticky-toolbar{
  position:sticky;
  top:var(--staff-sticky-top, 88px);
  z-index:180;
  margin:-6px 0 14px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
  box-shadow:0 6px 18px rgba(0,0,0,.12);
}
.staff-sticky-actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.staff-sticky-filters{display:flex;flex-direction:column;gap:4px}
.staff-sticky-filter-title{font-size:13px;color:var(--text2);font-weight:700}
.staff-filter-hint{margin-left:6px;font-size:11px;color:var(--text2);font-weight:400}
.group-filter-btn{
  background:var(--chrome-soft);
  color:var(--text2);
  border:1px solid var(--line);
}
.group-filter-btn:hover{
  background:var(--chrome-hover);
  border-color:var(--chrome-hover-border);
  color:var(--text);
}
.group-filter-btn.btn-primary{
  background:var(--accent);
  border-color:var(--accent);
  color:var(--accent-fg);
}
.group-filter-btn.btn-primary:hover{filter:brightness(1.08)}

/* ── Index/Requests sticky toolbar ── */
.page-sticky-toolbar{
  position:sticky;
  top:var(--page-sticky-top, 88px);
  z-index:175;
  margin:-6px 0 14px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
  box-shadow:0 6px 18px rgba(0,0,0,.12);
}
.page-sticky-toolbar .schedule-filter-panel{
  background:transparent;
  border:0;
  padding:0;
  margin:0;
}
.page-sticky-actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.work-req-selection-bar{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px;
  margin:10px 0;padding:8px 0 10px;
  border:0;border-bottom:1px solid var(--border);border-radius:0;
  background:none;font-size:13px;font-weight:700
}
#scheduleMainTable.solver-help-pick-active [data-date-key]{cursor:pointer}
#scheduleMainTable .solver-help-date-selected{outline:2px solid var(--accent);outline-offset:-2px;background-color:color-mix(in srgb,var(--accent) 14%,var(--surface))}
#scheduleMainTable.solver-help-pick-active .solver-help-date-selected{outline-width:3px}
.page-sticky-toolbar .legend{margin:12px 0 8px}
.page-sticky-toolbar .schedule-filter-bar{margin:0}
.page-sticky-toolbar .request-tab-bar{margin:0 0 12px}
.requests-sticky-toolbar .schedule-filter-bar{margin:0}
.requests-sticky-toolbar{top:calc(var(--page-sticky-top, 88px) + 10px)}
/* ── Index toolbar: mode segment & labeled groups ── */
.schedule-mode-seg-wrap{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 10px}
.schedule-mode-seg-label{font-size:11.5px;font-weight:700;color:var(--text2)}
.schedule-mode-seg{display:inline-flex;align-items:center;gap:2px;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--chrome-soft)}
.schedule-mode-seg .btn{border:1px solid transparent;background:transparent;color:var(--text2);border-radius:6px;box-shadow:none;min-height:28px}
.schedule-mode-seg .btn.btn-ghost:hover{background:color-mix(in srgb,var(--surface2) 75%,transparent);color:var(--text)}
.schedule-mode-seg .btn.btn-primary{background:var(--accent);color:var(--accent-fg);border-color:var(--accent)}
.schedule-mode-seg .btn.btn-primary:hover{filter:brightness(1.08)}
.schedule-mode-hint{font-size:11.5px;color:var(--text2)}
.schedule-toolbar-group{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}
.schedule-toolbar-group:last-child{margin-bottom:0}
.schedule-toolbar-group-label{font-size:11px;font-weight:700;color:var(--text2);letter-spacing:.4px}
.schedule-toolbar-controls .page-sticky-actions{margin-bottom:0}
.schedule-toolbar-controls .schedule-filter-panel{margin-bottom:0}
.schedule-toolbar-controls .work-req-selection-bar{margin:2px 0 0}
/* 応援モード中はシフト入力の選択バーを隠し、応援バーを表示する */
body.help-mode-on #dayCellSelectionBar,
body.help-mode-on #dayCellSelectionMobileBar{display:none !important}
.schedule-mobile-controls{margin:0}
.schedule-mobile-controls>summary{display:none}
.schedule-mobile-controls[open]>.schedule-toolbar-controls{display:block}
/* 予定表(index)はPCでも開閉トグルを表示（初期は閉じた状態） */
@media(min-width:1025px){
  #indexStickyToolbar .schedule-mobile-controls>summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    min-height:36px;
    padding:0 10px;
    color:var(--text2);
    font-size:12px;
    font-weight:700;
    cursor:pointer;
    list-style:none;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface2);
  }
  #indexStickyToolbar .schedule-mobile-controls>summary::-webkit-details-marker{display:none}
  #indexStickyToolbar .schedule-mobile-controls>summary::after{content:'＋';font-size:16px;color:var(--accent)}
  #indexStickyToolbar .schedule-mobile-controls[open]>summary{margin-bottom:8px}
  #indexStickyToolbar .schedule-mobile-controls[open]>summary::after{content:'－'}
  /* PCではツールバーをスクロール固定しない（スクロールで流れる） */
  #indexStickyToolbar.page-sticky-toolbar{
    position:static;
    top:auto;
  }
}

/* ── Month nav ── */
.month-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.month-label{font-size:15px;font-weight:700;min-width:100px;text-align:center}
@media(max-width:1024px){
  .request-page-header{align-items:flex-start}
  .request-month-nav{margin-top:8px}
}

/* ── Legend ── */
.legend{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:12px}
.legend-item{display:flex;align-items:center;gap:5px;padding:3px 9px;border-radius:5px;font-size:11.5px;background:var(--panel);border:1px solid var(--line)}
.legend-dot{width:8px;height:8px;border-radius:50%}

/* ── Calendar ── */
.calendar-wrap{background:var(--panel);border:1px solid var(--line);border-radius:13px;overflow:hidden;margin-bottom:18px}
.calendar{display:grid;grid-template-columns:repeat(7,1fr)}
.cal-head{text-align:center;padding:9px 0;font-size:11.5px;font-weight:700;letter-spacing:.5px;background:var(--chrome);color:var(--text);border-bottom:1px solid var(--line)}
.cal-head.sun{color:var(--danger)}
.cal-head.sat{color:var(--proxy-hol)}
.cal-cell{min-height:96px;border-right:1px solid var(--border);border-bottom:1px solid var(--border);padding:5px;cursor:pointer;transition:background .1s;display:flex;flex-direction:column;gap:2px;position:relative;user-select:none}
.cal-cell:nth-child(7n){border-right:none}
.cal-cell:hover{background:var(--surface2)}
.cal-cell.empty{background:var(--bg);cursor:default;opacity:.4}
.cal-cell.weekend .cell-day-num{color:var(--proxy-hol)}
.cal-cell.is-sun .cell-day-num{color:var(--danger)}
.cal-cell.today .cell-day-num{background:var(--accent);color:var(--accent-fg);border-radius:50%;width:22px;height:22px;display:flex;align-items:center;justify-content:center;font-size:11px}
.cal-cell.past{opacity:.6}
.cal-cell.selected-range{background:rgba(var(--accent-rgb,.4),0.08);outline:2px solid var(--accent);outline-offset:-2px}
.cell-top{display:flex;align-items:center;justify-content:space-between}
.cell-day-num{font-size:11px;font-weight:700;color:var(--text2);line-height:1;min-width:22px}
.cell-req-badge{font-size:9px;padding:1px 4px;border-radius:3px;background:var(--surface2);color:var(--accent);border:1px solid var(--accent)}
.cell-shifts{display:flex;flex-direction:column;gap:2px;flex:1}
.shift-badge{display:flex;align-items:center;gap:3px;padding:2px 5px;border-radius:4px;font-size:9.5px;overflow:hidden;border-left-width:2px;border-left-style:solid}
.shift-badge-short{font-weight:800;font-size:10px;flex-shrink:0}
.shift-badge-name{color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:52px}
.cell-more{font-size:9px;color:var(--text3);padding:0 2px}
.cell-empty-hint{font-size:9.5px;color:var(--text3);margin-top:4px}
.cell-footer{display:flex;gap:5px;margin-top:auto;font-size:9.5px;color:var(--text3)}

/* ── Summary table ── */
.card{background:var(--panel);border:1px solid var(--line);border-radius:13px;padding:18px;margin-bottom:16px;overflow:hidden}
.profile-overview-card{overflow:visible}
.card-title{font-size:13px;font-weight:700;color:var(--text2);margin-bottom:14px;letter-spacing:.3px}
.schedule-filter-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:-4px 0 12px}
.schedule-filter-label{font-size:11.5px;font-weight:700;color:var(--text2)}
.schedule-filter-group{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.schedule-group-filter-block{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:6px}
.schedule-filter-panel{
  padding:10px 12px;
  border:1px solid var(--line);
  background:var(--chrome);
  border-radius:10px;
  margin:0 0 10px
}
.schedule-filter-btn.btn-ghost,
.request-filter-btn.btn-ghost{
  background:var(--chrome-soft);
  border-color:var(--line);
}
.schedule-filter-btn.btn-ghost:hover,
.request-filter-btn.btn-ghost:hover{
  background:var(--chrome-hover);
  border-color:var(--chrome-hover-border);
  color:var(--text);
}
.schedule-filter-btn.active{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}
.schedule-filter-btn.active:hover,
.request-filter-btn.active:hover{
  background:var(--accent) !important;
  border-color:var(--accent) !important;
  color:var(--accent-fg) !important;
  filter:brightness(1.06);
}
.btn.request-filter-btn.active{
  background:var(--accent) !important;
  border-color:var(--accent) !important;
  color:var(--accent-fg) !important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent-fg) 16%, transparent 84%);
}
.schedule-section-filters{display:flex;align-items:center;gap:6px;flex-wrap:wrap;max-width:100%}
.schedule-section-chip{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border:1px solid var(--line);border-radius:6px;background:var(--chrome-soft);font-size:11px;color:var(--text2);cursor:pointer;line-height:1.2;white-space:nowrap}
.mobile-staff-filter-panel{padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--chrome);margin-bottom:10px}
.mobile-staff-select{width:100%;max-width:none;background:var(--surface);border-color:color-mix(in srgb, var(--border) 70%, var(--accent) 30%)}
.table-wrap{position:relative;overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:10px;isolation:isolate}
.table-wrap::after{
  content:'';
  position:absolute;
  inset:0;
  z-index:40;
  pointer-events:none;
  border:1px solid var(--line);
  border-radius:10px;
}
.table-wrap-top-scroll{display:none;overflow-x:auto;overflow-y:hidden;height:14px;border:1px solid var(--line);border-radius:8px;background:var(--chrome);margin:0 0 8px}
.table-wrap-top-scroll-inner{height:1px}
.table-wrap-top-scroll::-webkit-scrollbar{height:10px}
.table-wrap-top-scroll::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--accent) 55%, var(--border) 45%);border-radius:6px}
.table-wrap-top-scroll::-webkit-scrollbar-track{background:transparent}
table{width:100%;border-collapse:collapse;min-width:fit-content}
th,td{padding:8px 4px;text-align:left;font-size:11.5px}
th{background:var(--chrome);font-weight:700;color:var(--text);border-bottom:2px solid var(--line);position:sticky;top:0;z-index:10}
td{border-bottom:1px solid var(--border);color:var(--text)}
tbody tr:hover{background:var(--surface2)}
tbody tr[data-section-header]{background:transparent !important;color:var(--text2);font-weight:700;font-size:12px;padding:6px 8px !important}
tbody tr[data-section-header] td{background:var(--chrome);border:1px solid var(--line);color:var(--text);padding:7px 10px;font-weight:700;letter-spacing:.2px;text-align:left}
.schedule-table-responsive tr[data-section-header] td{padding-left:4px !important;text-align:left !important}
.request-staff-table tr[data-section-header] .request-section-action-cell{text-align:center}
tbody tr[data-section-member]:first-of-type{border-top:none}
.staff-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0;display:inline-block;margin-right:6px}
.role-badge{display:inline-block;background:var(--chrome-soft);color:var(--text2);padding:2px 6px;border-radius:4px;font-size:10px;font-weight:600}
.td-highlight{font-weight:700;color:var(--accent);background:var(--surface2)}
.link-button{color:var(--accent);cursor:pointer;transition:opacity .15s}
.link-button:hover{opacity:.6}
table{width:100%;border-collapse:collapse;font-size:12.5px}
th{text-align:center;padding:7px 8px;background:var(--chrome);color:var(--text);font-size:11px;font-weight:700;letter-spacing:.3px;border-bottom:1px solid var(--line);white-space:nowrap}
th:first-child,th:nth-child(2){text-align:left}
td{text-align:center;padding:7px 8px;border-bottom:1px solid var(--border);color:var(--text2)}
td:first-child{text-align:left}
.log-filter-form{display:flex;gap:8px;flex-wrap:wrap;align-items:end}
.log-filter-field{display:flex;flex-direction:column;gap:4px;min-width:140px}
.log-filter-field .form-select,.log-filter-field .form-input{width:100%}
.log-filter-actions{display:flex;align-items:end}
.log-filter-actions .btn{min-height:37px;padding:8px 16px;border-radius:7px;font-size:13px}
.log-restore-note{font-size:12px;color:var(--text2);margin-bottom:12px;line-height:1.6}
.log-table th,.log-table td{vertical-align:top;text-align:left;border-right:1px solid var(--border)}
.log-table th:last-child,.log-table td:last-child{border-right:none}
.log-table th:nth-child(1),.log-table td:nth-child(1){min-width:158px;white-space:nowrap}
.log-table th:nth-child(2),.log-table td:nth-child(2),
.log-table th:nth-child(3),.log-table td:nth-child(3){min-width:88px;white-space:nowrap}
.log-table .log-detail{text-align:left;white-space:pre-wrap;line-height:1.65;padding:8px 12px}
.log-table th:nth-child(5),.log-table td:nth-child(5){
  width:148px;
  min-width:148px;
  max-width:160px;
  text-align:left;
  background:color-mix(in srgb, var(--surface2) 70%, transparent 30%);
}
.log-restore-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-start}
.log-restore-none{color:var(--text3)}
.log-pager{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px;flex-wrap:wrap}
.log-pager-meta{font-size:12px;color:var(--text2)}
.log-pager-links{display:flex;gap:6px;flex-wrap:wrap}
.monthly-summary-table th:nth-child(2),
.monthly-summary-table td:nth-child(2){text-align:left}
.request-day-summary-table th,
.request-day-summary-table td{
  text-align:left;
}
tr:last-child td{border-bottom:none}
tr:hover td{background:var(--surface2)}
.schedule-table-responsive th:nth-child(2),
.schedule-table-responsive td:nth-child(2){text-align:center}
.schedule-table-responsive,
.request-staff-table{
  border:none;
}
.card:has(#scheduleMainTable) .table-wrap,
.card:has(.monthly-summary-table) .table-wrap,
.card:has(.request-staff-table) .table-wrap,
.card:has(.request-day-summary-table) .table-wrap{
  --schedule-line:var(--line);
  border:1px solid var(--schedule-line);
}
.card:has(#scheduleMainTable) .table-wrap::after,
.card:has(.monthly-summary-table) .table-wrap::after,
.card:has(.request-staff-table) .table-wrap::after,
.card:has(.request-day-summary-table) .table-wrap::after{
  display:none;
}
.schedule-table-responsive{
  border-collapse:separate;
  border-spacing:0;
}
.schedule-table-responsive thead th,
.schedule-table-responsive tbody td{
  border:0;
  border-right:1px solid var(--schedule-line);
  border-bottom:1px solid var(--schedule-line);
  background-clip:padding-box;
}
.schedule-table-responsive thead tr:first-child th:last-child,
.schedule-table-responsive tbody td:last-child{
  border-right:0;
}
.schedule-table-responsive tbody tr[data-section-header] td{
  border:0;
  border-bottom:1px solid var(--schedule-line);
}
.schedule-table-responsive tbody tr:last-child td{
  border-bottom:0;
}
.monthly-summary-table{
  border-collapse:separate;
  border-spacing:0;
}
.monthly-summary-table thead th,
.monthly-summary-table tbody td{
  border:0;
  border-right:1px solid var(--schedule-line);
  border-bottom:1px solid var(--schedule-line);
  background-clip:padding-box;
}
.monthly-summary-table thead th,
.monthly-summary-table tbody td:first-child,
.monthly-summary-table tbody tr[data-section-header] td{
  background:var(--chrome);
}
.monthly-summary-table tbody tr[data-section-header] td{
  border:0;
  border-bottom:1px solid var(--schedule-line);
}
.monthly-summary-table thead th:last-child,
.monthly-summary-table tbody td:last-child{
  border-right:0;
}
.monthly-summary-table tbody tr:last-child td{
  border-bottom:0;
}
.monthly-summary-table tbody tr:hover td:first-child,
.monthly-summary-table tbody tr[data-section-header]:hover td{
  background:var(--chrome-hover);
}
.request-staff-table,
.request-day-summary-table{
  border-collapse:separate;
  border-spacing:0;
}
.request-staff-table thead th,
.request-staff-table tbody td,
.request-day-summary-table thead th,
.request-day-summary-table tbody td{
  border:0;
  border-right:1px solid var(--schedule-line);
  border-bottom:1px solid var(--schedule-line);
  background-clip:padding-box;
}
.request-staff-table thead th,
.request-staff-table tbody td:first-child,
.request-staff-table tbody tr[data-section-header] td,
.request-day-summary-table thead th{
  background:var(--chrome);
}
.request-staff-table tbody tr[data-section-header] td{
  border:0;
  border-right:1px solid var(--schedule-line);
  border-bottom:1px solid var(--schedule-line);
}
.request-staff-table tbody tr[data-section-header] td:last-child{
  border-right:0;
}
.request-staff-table thead tr:first-child th:last-child,
.request-staff-table tbody td:last-child,
.request-day-summary-table thead th:last-child,
.request-day-summary-table tbody td:last-child{
  border-right:0;
}
.request-staff-table tbody tr:last-child td,
.request-day-summary-table tbody tr:last-child td{
  border-bottom:0;
}
.request-staff-table tbody tr:hover td:first-child,
.request-staff-table tbody tr[data-section-header]:hover td{
  background:var(--chrome-hover);
}
.schedule-table-responsive thead th,
.schedule-table-responsive tbody td:first-child,
.schedule-table-responsive tbody tr[data-section-header] td,
.monthly-summary-table thead th,
.monthly-summary-table tbody td:first-child,
.monthly-summary-table tbody tr[data-section-header] td,
.request-staff-table thead th,
.request-staff-table tbody td:first-child,
.request-staff-table tbody tr[data-section-header] td,
.request-day-summary-table thead th{
  color:var(--text);
}
.schedule-table-responsive th.day-col-today{background:color-mix(in srgb, var(--surface2) 72%, var(--accent) 28%);color:var(--text)!important;box-shadow:none}
.schedule-table-responsive th.wr-date-header{
  position:relative;
  text-align:center;
  vertical-align:middle;
  line-height:1;
  letter-spacing:0;
  padding:3px 0 4px;
}
.schedule-table-responsive th.is-company-off{
  /* 生産休止日：淡い accent2（代理有休より薄く） */
  background:color-mix(in srgb, var(--surface2) 82%, var(--accent2) 18%);
}
.schedule-table-responsive td.day-cell-past{background:color-mix(in srgb, var(--surface2) 62%, var(--text3) 38%) !important;color:var(--text3)!important;opacity:.5;cursor:not-allowed !important}
.schedule-table-responsive td.day-cell-past:hover{background:color-mix(in srgb, var(--surface2) 62%, var(--text3) 38%) !important}
.schedule-table-responsive td.day-cell-today{background:color-mix(in srgb, var(--surface2) 64%, var(--accent) 36%) !important;box-shadow:inset 0 0 0 1px var(--accent)}
.schedule-table-responsive td.day-cell-warning{background:color-mix(in srgb, var(--surface2) 55%, var(--warn) 45%) !important;box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--warn) 70%, var(--border) 30%)}
.schedule-table-responsive td.day-cell-warning:hover{background:color-mix(in srgb, var(--surface2) 48%, var(--warn) 52%) !important}
.schedule-table-responsive td.day-cell-warning.day-cell-warning-pinned{
  box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--warn) 70%, #000 30%), 0 0 0 1px color-mix(in srgb, var(--warn) 65%, var(--surface2) 35%);
}
.schedule-table-responsive td.day-cell-selected-multi{
  background:color-mix(in srgb, var(--surface2) 58%, var(--proxy-off) 42%) !important;
  box-shadow:inset 0 0 0 1px var(--proxy-off), 0 0 0 1px color-mix(in srgb, var(--proxy-off) 35%, transparent 65%);
}
.schedule-table-responsive td.day-cell-warning.day-cell-warning-pinned::before{
  content:'!';
  position:absolute;
  left:2px;
  top:2px;
  width:12px;
  height:12px;
  border-radius:999px;
  font-size:9px;
  line-height:12px;
  text-align:center;
  font-weight:800;
  color:#fff;
  background:color-mix(in srgb, var(--warn) 70%, #000 30%);
}
.schedule-table-responsive td.day-cell-warning.day-cell-warning-pulse{
  animation:warningPulseCell 1.2s ease-out;
}
@keyframes warningPulseCell{
  0%{box-shadow:inset 0 0 0 2px var(--warn),0 0 0 0 color-mix(in srgb,var(--warn) 60%,transparent 40%)}
  45%{box-shadow:inset 0 0 0 2px var(--warn),0 0 0 8px color-mix(in srgb,var(--warn) 20%,transparent 80%)}
  100%{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--warn) 70%, var(--border) 30%),0 0 0 0 transparent}
}

.swap-warning-tooltip{
  position:absolute;
  z-index:3200;
  width:min(320px,calc(100vw - 16px));
  background:color-mix(in srgb, var(--surface) 92%, var(--warn) 8%);
  border:1px solid color-mix(in srgb, var(--warn) 60%, var(--border) 40%);
  border-radius:10px;
  box-shadow:0 12px 30px rgba(0,0,0,.24);
  padding:10px;
  display:none;
}
.swap-warning-tooltip.show{display:block}
.swap-warning-tooltip-title{font-size:12px;font-weight:800;color:var(--text);margin-bottom:6px}
.swap-warning-tooltip-list{margin:0 0 6px 16px;padding:0;font-size:12px;color:var(--text2);line-height:1.45}
.swap-warning-tooltip-candidates{font-size:11.5px;color:var(--text2);margin-bottom:8px}
.swap-warning-tooltip-actions{display:flex;gap:6px;flex-wrap:wrap}

.swap-warning-banner{
  position:fixed;
  top:78px;
  left:50%;
  transform:translateX(-50%);
  z-index:3100;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--warn) 55%, var(--border) 45%);
  background:color-mix(in srgb, var(--surface2) 84%, var(--warn) 16%);
  box-shadow:0 6px 18px rgba(0,0,0,.2);
}
.swap-warning-banner-text{font-size:12px;font-weight:700;color:var(--text)}
.swap-warning-banner-actions{display:flex;align-items:center;gap:6px}

.swap-warning-panel{
  position:fixed;
  right:12px;
  top:118px;
  z-index:3090;
  width:min(360px,calc(100vw - 20px));
  max-height:62vh;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:12px;
  background:color-mix(in srgb, var(--surface) 90%, transparent 10%);
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  padding:10px;
}
.swap-warning-panel-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.swap-warning-panel-body{display:flex;flex-direction:column;gap:7px}
.swap-warning-panel-empty{font-size:12px;color:var(--text2);padding:8px 4px}
.swap-warning-row{display:flex;align-items:flex-start;gap:8px;padding:7px;border:1px solid var(--line);border-radius:8px;background:var(--chrome-soft)}
.swap-warning-row.active{border-color:color-mix(in srgb, var(--warn) 68%, var(--border) 32%)}
.swap-warning-row-main{flex:1;border:none;background:transparent;cursor:pointer;text-align:left;padding:0}
.swap-warning-row-title{display:block;font-size:12px;font-weight:700;color:var(--text)}
.swap-warning-row-reason{display:block;margin-top:3px;font-size:11px;color:var(--text2);line-height:1.35}

.swap-warning-sheet{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:3300;
  display:none;
  flex-direction:column;
  max-height:min(44vh,260px);
  background:color-mix(in srgb, var(--surface) 96%, var(--warn) 4%);
  border-top:1px solid color-mix(in srgb, var(--warn) 55%, var(--border) 45%);
  border-radius:14px 14px 0 0;
  box-shadow:0 -10px 30px rgba(0,0,0,.28);
  padding:6px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  overscroll-behavior:contain;
}
.swap-warning-sheet.show{display:flex}
.swap-warning-sheet-handle{width:36px;height:4px;border-radius:999px;background:var(--border);margin:0 auto 5px;flex:0 0 auto}
.swap-warning-sheet-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:5px;flex:0 0 auto}
.swap-warning-sheet-title{font-size:12px;font-weight:800;color:var(--text)}
.swap-warning-sheet-body{overflow:auto;-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;gap:4px;max-height:112px}
.swap-warning-sheet-empty{font-size:12px;color:var(--text2);padding:6px 4px}
.swap-warning-sheet-row{display:flex;flex-direction:column;gap:5px;padding:4px 8px;border:1px solid var(--line);border-radius:8px;background:var(--chrome-soft)}
.swap-warning-sheet-row.active{border-color:color-mix(in srgb, var(--warn) 68%, var(--border) 32%)}
.swap-warning-sheet-row-line{display:flex;align-items:center;gap:6px;min-height:26px}
.swap-warning-sheet-row-main{flex:1;display:flex;align-items:center;justify-content:space-between;gap:6px;border:none;background:transparent;cursor:pointer;text-align:left;padding:0;min-width:0}
.swap-warning-sheet-row-title{font-size:12px;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.swap-warning-sheet-row-caret{font-size:10px;color:var(--text2);border:1px solid var(--border);border-radius:999px;padding:0 6px;flex:0 0 auto}
.swap-warning-sheet-detail{border-top:1px dashed var(--line);padding-top:5px}
.swap-warning-sheet-detail-actions{margin-top:5px;display:flex;justify-content:flex-end}
.swap-warning-sheet-reasons{margin:0 0 0 16px;padding:0;font-size:11px;color:var(--text2);line-height:1.4}
.swap-warning-sheet-reasons-empty{font-size:11px;color:var(--text2)}
html.nsp-mobile-device body.swap-sheet-open .toast{bottom:calc(184px + env(safe-area-inset-bottom, 0px))}
html.nsp-mobile-device .swap-warning-tooltip{display:none !important}

@media(max-width:768px){
  .swap-warning-banner{top:66px;left:10px;right:10px;transform:none;border-radius:12px;align-items:flex-start;flex-direction:column}
  .swap-warning-banner-actions{width:100%;justify-content:flex-end;flex-wrap:wrap}
  .swap-warning-panel{top:auto;bottom:12px;left:10px;right:10px;width:auto;max-height:52vh}
}
.swap-mode-hint{margin:-6px 0 10px;font-size:13px;color:var(--text);padding:10px 14px;border-radius:8px;background:color-mix(in srgb, var(--surface2) 78%, var(--accent) 22%);border:1px solid var(--border);display:flex;flex-direction:column;gap:5px}
.swap-hint-row{display:block;line-height:1.5}
.swap-hint-green{color:color-mix(in srgb, var(--accent) 80%, var(--success) 20%)}
.swap-hint-accent{color:var(--accent);font-weight:700}
.shift-swap-handle{display:inline-block;padding:1px 2px;border-radius:4px}
.schedule-table-responsive td.schedule-swap-cell{background:var(--surface2)}
.schedule-table-responsive td .shift-swap-handle{color:inherit}
.schedule-table-responsive td.schedule-swap-cell[data-editable="1"],
.schedule-table-responsive td.schedule-swap-draggable,
.schedule-table-responsive td.schedule-swap-draggable .shift-swap-handle{
  cursor: url("cursors/grab.svg") 16 6, grab;
}
.schedule-table-responsive td.schedule-swap-cell[data-editable="1"]:active,
.schedule-table-responsive td.schedule-swap-draggable:active,
.schedule-table-responsive td.day-cell-dragging,
body.schedule-swap-dragging-global,
body.schedule-swap-dragging-global *{
  cursor: url("cursors/grabbing.svg") 16 10, grabbing !important;
}
.schedule-table-responsive td.schedule-swap-draggable .shift-swap-handle{cursor:inherit}
.schedule-table-responsive td.schedule-swap-draggable:not(.day-cell-warning):not(.day-cell-past):hover{
  background:color-mix(in srgb, var(--surface2) 70%, var(--accent) 30%) !important;
}
.schedule-table-responsive td.schedule-swap-source{
  background:color-mix(in srgb, var(--surface2) 58%, var(--proxy-off) 42%) !important;
  box-shadow:inset 0 0 0 2px var(--proxy-off);
}
.schedule-table-responsive td.schedule-swap-source .shift-swap-handle{
  color:var(--accent-fg) !important;
  text-shadow:0 1px 0 color-mix(in srgb, var(--bg) 45%, transparent 55%);
}
.schedule-table-responsive td.schedule-swap-target-recommended:not(.schedule-swap-source){
  background:color-mix(in srgb, var(--surface2) 56%, var(--accent) 44%) !important;
  box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--proxy-off) 70%, var(--border) 30%);
}
.schedule-table-responsive td.schedule-swap-target-recommended:not(.schedule-swap-source) .shift-swap-handle{
  color:var(--accent-fg) !important;
  text-shadow:0 1px 0 color-mix(in srgb, var(--bg) 45%, transparent 55%);
}
.schedule-table-responsive td.schedule-swap-draggable,
.schedule-table-responsive td.schedule-swap-draggable *{
  user-select:none;
  -webkit-user-select:none;
  -ms-user-select:none;
}
.schedule-swap-dragging-global,
.schedule-swap-dragging-global *{
  user-select:none !important;
  -webkit-user-select:none !important;
  -ms-user-select:none !important;
}
.schedule-table-responsive td.day-cell-dragging{opacity:.55}
.schedule-table-responsive td.day-cell-drop-target{outline:2px dashed var(--accent);outline-offset:-2px;background:color-mix(in srgb, var(--surface2) 62%, var(--accent) 38%) !important}
.schedule-table-responsive td.day-cell-swapped{position:relative;overflow:hidden}
.schedule-table-responsive td.day-cell-swapped::after{
  content:'';
  position:absolute;
  top:0;right:0;
  width:0;height:0;
  border-style:solid;
  border-width:0 7px 7px 0;
  border-color:transparent var(--accent2) transparent transparent;
}
.schedule-table-responsive td.day-cell-swapped.day-cell-swapped-recent::after{
  border-width:0 11px 11px 0;
  border-color:transparent color-mix(in srgb, var(--accent) 82%, var(--accent2) 18%) transparent transparent;
  filter:drop-shadow(0 0 3px color-mix(in srgb, var(--accent) 70%, transparent 30%));
}
.schedule-table-responsive td.day-cell-swapped.day-cell-swapped-seen::after{
  border-width:0 7px 7px 0;
  border-color:transparent color-mix(in srgb, var(--accent) 34%, var(--surface2) 66%) transparent transparent;
  filter:none;
}
.schedule-table-responsive thead th:not(:first-child):not(:last-child){width:32px;min-width:32px;max-width:32px;padding:7px 0}
/* 応援・人数不足の行を追加しても日付列の幅を揃える（rowspan見出しで :first-child/:last-child がずれるため） */
.schedule-table-responsive thead th.wr-date-header,
.schedule-table-responsive thead th.wr-staffing-header{width:32px;min-width:32px;max-width:32px}
.schedule-table-responsive thead th[rowspan="2"],
.schedule-table-responsive thead th[rowspan="4"],
.request-staff-table thead th[rowspan="2"]{
  vertical-align:middle;
}
.schedule-table-responsive thead tr.cal-dow-row th,
.request-staff-table thead tr.cal-dow-row th{
  font-size:10px;
  font-weight:700;
  line-height:1.1;
  padding:2px 0 5px;
  position:static;
  left:auto;
  text-align:center;
  box-sizing:border-box;
}
.schedule-table-responsive thead tr.cal-dow-row th,
.request-staff-table thead tr.cal-dow-row th{
  border-bottom:1px solid var(--schedule-line);
}
.schedule-table-responsive thead tr.cal-dow-row th{
  width:32px !important;
  min-width:32px !important;
  max-width:32px !important;
}
.request-staff-table thead tr.cal-dow-row th{
  width:28px !important;
  min-width:28px !important;
  max-width:28px !important;
}
.cell-when,.cell-date-col,.cell-dow-col,.work-count-label{display:none}
.schedule-table-responsive td[data-label$="日"]{width:32px;min-width:32px;max-width:32px;padding:4px 0 !important}
.request-staff-table td[data-label$="日"]{width:28px;min-width:28px;max-width:28px;padding:6px 0}
.schedule-table-responsive .shift-swap-handle,.request-staff-table td[data-label$="日"] span,.req-type{display:inline-flex;align-items:center;justify-content:center;min-width:1.2em;line-height:1;white-space:nowrap}
/* --- 名前列固定化 --- */
.schedule-table-responsive thead th.wr-corner,
.schedule-table-responsive td:first-child,
.request-staff-table th:first-child,
.request-staff-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--chrome);
  z-index: 11;
}
.schedule-table-responsive thead th:not(.day-col-today),
.schedule-table-responsive tbody tr[data-section-header] td,
.schedule-table-responsive tbody td:first-child {
  background: var(--chrome);
}
.schedule-table-responsive tbody tr:hover td:first-child,
.schedule-table-responsive tbody tr[data-section-header]:hover td {
  background: var(--chrome-hover);
}

@media (min-width: 1025px) {
  #scheduleMainTable.schedule-table-responsive {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    table-layout: fixed;
  }

  #scheduleMainTable.schedule-table-responsive thead th:not(:first-child):not(:last-child),
  #scheduleMainTable.schedule-table-responsive tbody td.schedule-swap-cell {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding-left: 1px;
    padding-right: 1px;
  }

  #scheduleMainTable.schedule-table-responsive thead th.wr-date-header,
  #scheduleMainTable.schedule-table-responsive thead th.wr-staffing-header {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding-left: 1px;
    padding-right: 1px;
  }

  #requestStaffTable.request-staff-table {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    table-layout: fixed;
  }

  #requestStaffTable.request-staff-table thead th[data-date-key],
  #requestStaffTable.request-staff-table thead tr.cal-dow-row th,
  #requestStaffTable.request-staff-table tbody td[data-label$="日"] {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding-left: 1px;
    padding-right: 1px;
  }

  .schedule-table-responsive,
  .request-staff-table {
    width: max-content;
    min-width: 100%;
  }

  .schedule-table-responsive thead th.wr-corner,
  .schedule-table-responsive td:first-child {
    width: 188px;
    min-width: 188px;
    max-width: 188px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .schedule-table-responsive td:first-child .link-button {
    display: inline-block;
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }

  .schedule-table-responsive thead th.wr-count,
  .schedule-table-responsive td:last-child {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    text-align: center;
  }

  #scheduleMainTable.schedule-view-custom th.wr-corner,
  #scheduleMainTable.schedule-view-custom td:first-child {
    width: 188px;
    min-width: 188px;
    max-width: 188px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }

  #scheduleMainTable.schedule-view-custom td:first-child .link-button {
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .request-staff-table th:first-child,
  .request-staff-table td:first-child {
    width: 188px;
    min-width: 188px;
    max-width: 188px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .request-staff-table th:nth-child(2),
  .request-staff-table td:nth-child(2) {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    text-align: center;
  }

  .request-staff-table th:nth-last-child(3),
  .request-staff-table td:nth-last-child(3),
  .request-staff-table th:nth-last-child(2),
  .request-staff-table td:nth-last-child(2),
  .request-staff-table th:last-child,
  .request-staff-table td:last-child {
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    text-align: center;
  }
}

#scheduleMainTable tr.schedule-row-filtered-out {
  display: none !important;
}
.staff-dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:7px;vertical-align:middle}
.role-badge{display:inline-block;padding:1px 7px;border-radius:20px;font-size:10.5px;background:var(--chrome-soft);color:var(--text2)}
.td-highlight{font-weight:700;color:var(--accent)}
.td-warn{color:var(--warn)!important;font-weight:700}

/* ── Modal ── */
.modal-overlay{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.55);backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .2s;padding:12px}
.modal-overlay.open{opacity:1;pointer-events:all}
.modal{background:var(--panel);border:1px solid var(--line);border-radius:15px;width:100%;max-width:680px;max-height:96vh;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 20px 70px rgba(0,0,0,.5);transform:translateY(16px) scale(.98);transition:transform .2s}
.modal-overlay.open .modal{transform:none}
.modal-sm{max-width:420px}
.modal-md{max-width:540px}
.modal-lg{max-width:900px}
.modal-xl{max-width:1120px}
.modal-header{display:flex;align-items:flex-start;justify-content:space-between;padding:18px 20px 14px;border-bottom:1px solid var(--border);flex-shrink:0}
.modal-title{font-size:16px;font-weight:800;color:var(--text)}
.modal-sub{font-size:11.5px;color:var(--text2);margin-top:3px}
.modal-close{background:none;border:none;color:var(--text2);font-size:17px;cursor:pointer;padding:3px 6px;border-radius:6px;line-height:1;transition:all .15s}
.modal-close:hover{background:var(--surface2);color:var(--text)}
.modal-body{padding:16px 20px;overflow-y:auto;flex:1;min-height:0}
.modal-footer{display:flex;justify-content:flex-end;flex-wrap:wrap;align-items:center;gap:8px;padding:12px 20px;border-top:1px solid var(--border);flex-shrink:0}
.company-off-note{color:var(--text2);font-size:12.5px;margin:0 0 12px;line-height:1.6}
.company-off-sections{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
.company-off-section{padding:5px 10px;border:1px solid var(--line);border-radius:8px;background:var(--surface2);color:var(--text);cursor:pointer;font-weight:700;font-size:12px}
.company-off-section:hover{background:var(--chrome-hover);border-color:var(--chrome-hover-border)}
.company-off-section.is-on{background:color-mix(in srgb, var(--accent) 22%, var(--surface) 78%);border-color:var(--accent);color:var(--accent)}
.company-off-section.is-on:hover{background:color-mix(in srgb, var(--accent) 30%, var(--surface) 70%);border-color:var(--accent);color:var(--accent)}
.company-off-label{font-size:12px;font-weight:700;margin:10px 0 6px;color:var(--text)}
.company-off-weekdays{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 8px}
.company-off-chip{min-width:36px;padding:6px 8px;border:1px solid var(--line);border-radius:8px;background:var(--surface2);color:var(--text);cursor:pointer;font-weight:700}
.company-off-chip:hover{background:var(--chrome-hover);border-color:var(--chrome-hover-border)}
.company-off-chip.is-on{background:color-mix(in srgb, var(--accent) 22%, var(--surface) 78%);border-color:var(--accent);color:var(--accent)}
.company-off-chip.is-on:hover{background:color-mix(in srgb, var(--accent) 30%, var(--surface) 70%);border-color:var(--accent);color:var(--accent)}
.company-off-month-actions{margin:0 0 8px}
.company-off-dows{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
.company-off-cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.company-off-dow{text-align:center;font-size:11px;font-weight:700;color:var(--text2);padding:2px 0}
.company-off-pad{min-height:36px}
.company-off-day{min-height:40px;border:1px solid var(--line);border-radius:8px;background:var(--surface2);color:var(--text);cursor:pointer;font-weight:700}
.company-off-day:hover{background:var(--chrome-hover);border-color:var(--chrome-hover-border)}
.company-off-day.is-off{background:color-mix(in srgb, var(--accent) 22%, var(--surface) 78%);border-color:var(--accent);color:var(--accent)}
.company-off-day.is-off:hover{background:color-mix(in srgb, var(--accent) 30%, var(--surface) 70%);border-color:var(--accent);color:var(--accent)}
.company-off-count{margin-top:10px;font-size:12px;font-weight:700;color:var(--text2)}
.day-msg-acts{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-right:auto}
.day-msg-acts-label{font-size:12px;font-weight:700;color:var(--text2);white-space:nowrap}
.modal-section{margin-bottom:16px}
.modal-section-label{font-size:11.5px;font-weight:700;color:var(--text2);letter-spacing:.4px;margin-bottom:8px;text-transform:uppercase}

/* ── Two-column modal layout ── */
.modal-split-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start;margin-bottom:10px}
.modal-split-grid > *{min-width:0}

/* ── Staff rows (avoid text clipping issues) ── */
.bulkStaffRow span{min-width:0}
.bulkStaffRow .staff-main{display:flex;align-items:center;gap:6px;max-width:100%;overflow:hidden}
.bulkStaffRow .staff-name-text{display:inline-block;flex:0 0 8.5em;max-width:8.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bulkStaffRow .staff-meta{color:var(--text2);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
/* 日別モーダルは氏名欄を常に同じ幅で揃える(状況によって伸縮させない) */
.dayStaffRow .staff-name-text{flex:0 0 22em;max-width:22em}
.dayStaffRow .staff-meta{flex:0 1 auto;max-width:9em}

/* ── Clicked target staff highlight (day modal) ── */
.dayStaffRow.is-target{position:relative;outline:3px solid var(--accent);outline-offset:-2px;box-shadow:inset 0 0 0 2px var(--accent), 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent 45%);background:color-mix(in srgb, var(--surface2) 70%, var(--accent) 30%) !important;z-index:1}
.dayStaffRow.is-target::after{content:"📍クリックしたスタッフ";position:absolute;top:-9px;right:8px;background:var(--accent);color:var(--accent-fg);font-size:10px;font-weight:700;padding:1px 7px;border-radius:999px;line-height:1.5;box-shadow:0 1px 3px rgba(0,0,0,.25);white-space:nowrap}

@media(max-width:980px){
  .modal-split-grid{grid-template-columns:1fr}
}

/* ── Shift selector bar ── */
.shift-bar{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:14px}
.shift-btn{display:flex;align-items:center;gap:5px;padding:6px 13px;border-radius:7px;border:2px solid transparent;background:var(--chrome-soft);color:var(--text2);cursor:pointer;font-size:12px;transition:all .15s}
.shift-btn:hover{color:var(--text)}
.shift-btn.active{font-weight:700}
.shift-btn-short{font-weight:800;font-size:13px}

/* ── Staff grid (modal) ── */
.staff-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:6px;margin-bottom:14px}
.staff-card{display:flex;align-items:center;gap:7px;padding:7px 9px;border-radius:9px;border:2px solid var(--line);background:var(--chrome-soft);cursor:pointer;transition:all .15s;position:relative}
.staff-card:hover{border-color:var(--accent)}
.staff-card.checked{border-color:var(--accent);background:var(--surface)}
.staff-card-bar{width:5px;align-self:stretch;border-radius:3px;flex-shrink:0}
.staff-card-info{flex:1;overflow:hidden;min-width:0}
.staff-card-name{font-size:11.5px;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.staff-card-role{font-size:10px;color:var(--text3)}
.staff-card-shift{font-size:14px;font-weight:800;min-width:20px;text-align:center;flex-shrink:0}
.staff-card-cb{position:absolute;top:5px;right:5px;width:14px;height:14px;accent-color:var(--accent)}

/* ── Bulk controls ── */
.bulk-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 14px;background:var(--chrome);border-radius:8px;border:1px solid var(--line);margin-bottom:14px}
.bulk-label{font-size:12px;color:var(--text2);font-weight:600}
.select-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.day-range-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.dow-btns{display:flex;gap:3px}
.dow-btn{width:28px;height:28px;border-radius:6px;border:1.5px solid var(--line);background:var(--chrome-soft);color:var(--text2);cursor:pointer;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;transition:all .15s}
.dow-btn.active{border-color:var(--accent);color:var(--accent);background:var(--surface)}
.dow-btn.sun-btn{color:var(--danger)}
.dow-btn.sun-btn.active{border-color:var(--danger)}
.dow-btn.sat-btn{color:var(--proxy-hol)}
.dow-btn.sat-btn.active{border-color:var(--proxy-hol)}

/* ── Notes ── */
.modal-notes{width:100%;min-height:60px;background:var(--chrome-soft);border:1px solid var(--line);border-radius:7px;color:var(--text);padding:8px 10px;font-size:12.5px;font-family:inherit;resize:vertical;outline:none;transition:border-color .15s}
.modal-notes:focus{border-color:var(--accent)}

/* ── Navigation Drawer ── */
.hamburger{display:none;background:none;border:none;color:var(--text);font-size:20px;cursor:pointer;padding:8px;border-radius:6px;transition:all .15s;margin-right:8px}
.hamburger:hover{background:var(--surface2)}
.nav-drawer-overlay{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.6);backdrop-filter:blur(3px);opacity:0;pointer-events:none;transition:opacity .3s}
.nav-drawer-overlay.open{opacity:1;pointer-events:all}
.nav-drawer{position:fixed;top:0;left:0;bottom:0;width:280px;z-index:1001;background:var(--panel);border-right:1px solid var(--line);transform:translateX(-100%);transition:transform .3s cubic-bezier(0.4,0,0.2,1);overflow-y:auto;display:flex;flex-direction:column;padding:16px 0}
.nav-drawer.open{transform:translateX(0)}
.nav-drawer-header{padding:0 16px;margin-bottom:16px;border-bottom:1px solid var(--border);padding-bottom:12px}
.nav-drawer-title{font-size:16px;font-weight:800;color:var(--text)}
.nav-drawer-sub{font-size:11px;color:var(--text2);margin-top:4px}
.nav-drawer-close{position:absolute;top:8px;right:8px;background:none;border:none;color:var(--text2);font-size:24px;cursor:pointer;padding:4px;border-radius:6px;transition:all .15s;width:32px;height:32px;display:flex;align-items:center;justify-content:center}
.nav-drawer-close:hover{background:var(--surface2);color:var(--text)}
.nav-drawer .nav-link{border-radius:0;padding:12px 16px;margin:0;border-left:3px solid transparent;border-bottom:0;font-size:14px;color:var(--text2);transition:all .15s}
.nav-drawer .nav-link:hover{background:var(--surface2);color:var(--text);border-left-color:var(--accent)}
.nav-drawer .nav-link.active{background:var(--surface2);color:var(--accent);border-left-color:var(--accent);font-weight:600}
.nav-drawer-divider{height:1px;background:var(--border);margin:8px 0}

/* ── Tablet/Mobile schedule layout ── */
@media(max-width:1024px){
  .schedule-mobile-controls>summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    min-height:36px;
    padding:0 10px;
    color:var(--text2);
    font-size:12px;
    font-weight:700;
    cursor:pointer;
    list-style:none;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface2);
  }
  .schedule-mobile-controls>summary::-webkit-details-marker{display:none}
  .schedule-mobile-controls>summary::after{content:'＋';font-size:16px;color:var(--accent)}
  .schedule-mobile-controls[open]>summary{margin-bottom:8px}
  .schedule-mobile-controls[open]>summary::after{content:'－'}
  .schedule-toolbar-controls{padding-top:0}
  #mobileStaffFilter{display:block !important}
  #mobileRequestStaffFilter{display:block !important}
  .fab-top{display:flex}
  .schedule-filter-panel{padding:9px 10px;border-radius:9px;gap:8px}
  .schedule-group-filter-block{width:100%;align-items:flex-start;row-gap:8px}
  .schedule-filter-group{width:100%}
  .schedule-filter-group .btn{flex:1;justify-content:center}
  .schedule-section-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:100%}
  .schedule-section-chip{width:100%;justify-content:flex-start;padding:6px 8px;border-radius:6px;background:var(--surface)}
  .mobile-staff-filter-panel{padding:9px 10px;border-radius:9px}
  .mobile-staff-select{min-height:36px}
  .schedule-table-responsive{display:table !important}
  .schedule-table-responsive thead{display:table-header-group}
  .schedule-table-responsive tbody{display:table-row-group}
  .schedule-table-responsive tr{display:table-row}
  .schedule-table-responsive tr[data-section-header]{display:table-row;background:transparent;color:var(--text2);padding:0;border:none;margin-top:0}
  .schedule-table-responsive tr[data-section-header] td{padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:var(--chrome);color:var(--text);font-weight:700;font-size:12px}
  .schedule-table-responsive tr[data-section-header].hidden{display:none}
  .schedule-table-responsive tr[data-staff-id].hidden{display:none !important}
  .schedule-table-responsive td{display:table-cell;border-bottom:1px solid var(--border);padding:7px 8px;font-size:11px}
  .schedule-table-responsive td:first-child{font-weight:700;color:var(--text);min-width:unset}

  /* スマホのみ: テーブルを縦並びカード表示（PCは既存のまま） */
  .mobile-stack-table thead{display:none !important}
  .mobile-stack-table tbody{display:block}
  .mobile-stack-table tr[data-section-header]{display:block;border:1px solid var(--line);background:var(--chrome);border-radius:9px;padding:7px 10px;margin:8px 0 6px;pointer-events:none}
  .schedule-table-responsive.mobile-stack-table tr[data-section-header]{
    border:none !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    padding:0 !important;
    margin:0 0 8px;
    width:100%
  }
  .schedule-table-responsive.mobile-stack-table tr[data-section-header] td{
    display:block;
    width:100%;
    box-sizing:border-box;
    border:none !important;
    border-radius:0 !important;
    background:var(--surface2) !important;
    box-shadow:none !important;
    color:var(--text2) !important;
    padding:9px 12px !important;
    margin:0;
    font-size:12.5px;
    font-weight:700
  }
  .schedule-table-responsive.mobile-stack-table tr[data-section-header] .section-toggle-indicator{
    display:none
  }
  .mobile-stack-table tr[data-section-header] td{display:block;border:none;background:transparent;border-radius:0;padding:0;color:var(--text2);font-weight:700}
  .mobile-stack-table tr[data-section-header] td::before{display:none}
  .mobile-stack-table tr[data-section-header] td:first-child{text-align:left}
  .request-staff-table tr[data-section-header]{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;pointer-events:auto}
  .request-staff-table tr[data-section-header] td:last-child{justify-self:end}
  .request-staff-table tr[data-section-header] .btn{min-width:36px;height:24px;padding:0 8px;justify-content:center}
  .mobile-stack-table tr[data-section-member]{display:block;background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:8px;margin-bottom:8px}
  .schedule-table-responsive.mobile-stack-table tr[data-section-member]{
    border:none;
    border-radius:0;
    background:transparent;
    padding:0 0 20px;
    margin:0 0 20px;
    box-shadow:none !important;
    overflow:visible
  }
  .schedule-table-responsive.mobile-stack-table tr[data-section-member] + tr[data-section-member]{
    margin-top:24px;
    padding-top:4px
  }
  .schedule-table-responsive.mobile-stack-table tr[data-section-member] > td:first-child{
    display:flex;
    align-items:center;
    width:100%;
    box-sizing:border-box;
    margin:0 0 8px;
    padding:9px 12px;
    border:none;
    background:var(--surface2);
    color:var(--text);
    font-weight:700
  }
  .schedule-table-responsive.mobile-stack-table tr[data-section-member] > td:first-child::before{
    display:none !important;
    content:none
  }
  .schedule-table-responsive.mobile-stack-table tr[data-section-member] > td:first-child .staff-dot{
    order:2;
    margin:0 0 0 8px
  }
  .schedule-table-responsive.mobile-stack-table .work-count-cell{
    display:grid !important;
    grid-template-columns:6.6em minmax(0,1fr);
    align-items:stretch;
    width:100% !important;
    max-width:none !important;
    gap:0;
    margin:0;
    padding:0 !important;
    background:transparent !important
  }
  .schedule-table-responsive.mobile-stack-table .work-count-cell::before{display:none !important;content:none}
  .schedule-table-responsive.mobile-stack-table .work-count-label,
  .schedule-table-responsive.mobile-stack-table .work-count-value{
    display:flex;
    align-items:center;
    box-sizing:border-box;
    border:1px solid var(--border);
    border-top:none;
    padding:6px 10px;
    font-size:13px;
    font-weight:700;
    line-height:1.15
  }
  .schedule-table-responsive.mobile-stack-table .work-count-label{
    justify-content:center;
    background:var(--surface2);
    color:var(--text)
  }
  .schedule-table-responsive.mobile-stack-table .work-count-value{
    justify-content:flex-start;
    border-left:none;
    background:var(--surface);
    color:var(--accent);
    font-weight:800
  }
  .mobile-stack-table tr[data-staff-id].hidden{display:none !important}
  .request-staff-table tr[data-staff-id].hidden{display:none !important}
  .request-staff-table tr[data-section-header].hidden{display:none !important}
  .mobile-stack-table td{display:flex;align-items:center;justify-content:flex-start;gap:6px;border:none;padding:3px 2px;font-size:11.5px;text-align:left}
  .mobile-stack-table td::before{content:attr(data-label);color:var(--text3);font-weight:700;text-align:left;white-space:nowrap;display:inline-block;min-width:40px;flex-shrink:0}
  .mobile-stack-table td:first-child{padding-top:2px;align-items:flex-start}
  .mobile-stack-table td:first-child::before{color:var(--text2)}
  .mobile-stack-table td:first-child .staff-dot{margin-top:2px;vertical-align:top}
  .mobile-stack-table td.schedule-swap-cell{
    display:grid;
    grid-template-columns:6.6em minmax(0,1fr);
    align-items:stretch;
    gap:0;
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    min-height:0;
    padding:0 !important;
    margin:0;
    line-height:1.2;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    opacity:1 !important;
    color:inherit !important;
    --cell-col-bg:var(--surface2);
    --cell-col-fg:var(--text3)
  }
  .mobile-stack-table td.schedule-swap-cell::before,
  .mobile-stack-table td.schedule-swap-cell::after{content:none;display:none !important}
  .mobile-stack-table td.schedule-swap-cell .cell-when{
    display:grid;
    grid-template-columns:4.2em 2.4em;
    grid-column:1;
    align-items:stretch;
    gap:0;
    padding:0;
    margin:0;
    background:var(--cell-col-bg)
  }
  .mobile-stack-table td.schedule-swap-cell .cell-date-col,
  .mobile-stack-table td.schedule-swap-cell .cell-dow-col{
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
    z-index:1;
    width:auto;
    min-width:0;
    background:transparent;
    color:var(--cell-col-fg);
    font-weight:700;
    line-height:1.15;
    padding:6px 8px;
    margin:0;
    border:1px solid var(--border);
    border-radius:0;
    font-size:13px;
    white-space:nowrap;
    box-sizing:border-box
  }
  .mobile-stack-table td.schedule-swap-cell .cell-dow-col{border-left:none}
  .mobile-stack-table td.schedule-swap-cell + td.schedule-swap-cell .cell-date-col,
  .mobile-stack-table td.schedule-swap-cell + td.schedule-swap-cell .cell-dow-col,
  .mobile-stack-table td.schedule-swap-cell + td.schedule-swap-cell .shift-swap-handle,
  .mobile-stack-table td.schedule-swap-cell + td.schedule-swap-cell .shift-cell-mark{
    border-top:none
  }
  .mobile-stack-table td.schedule-swap-cell.day-cell-today .cell-when{
    --cell-col-bg:color-mix(in srgb, var(--surface2) 64%, var(--accent) 36%);
    --cell-col-fg:var(--text)
  }
  .mobile-stack-table td.schedule-swap-cell.day-cell-past .cell-when{
    --cell-col-bg:color-mix(in srgb, var(--surface2) 62%, var(--text3) 38%);
    --cell-col-fg:var(--text3)
  }
  .mobile-stack-table td.schedule-swap-cell.day-cell-selected-multi .cell-when{
    --cell-col-bg:color-mix(in srgb, var(--surface2) 58%, var(--proxy-off) 42%);
    --cell-col-fg:var(--text)
  }
  .mobile-stack-table td.schedule-swap-cell.day-cell-warning .cell-when{
    --cell-col-bg:color-mix(in srgb, var(--surface2) 55%, var(--warn) 45%)
  }
  .mobile-stack-table td.schedule-swap-cell[data-dow="0"] .cell-date-col,
  .mobile-stack-table td.schedule-swap-cell[data-dow="0"] .cell-dow-col{color:var(--danger)}
  .mobile-stack-table td.schedule-swap-cell[data-dow="6"] .cell-date-col,
  .mobile-stack-table td.schedule-swap-cell[data-dow="6"] .cell-dow-col{color:var(--proxy-hol)}
  .mobile-stack-table td.schedule-swap-cell .req-dot{
    grid-column:2;
    justify-self:end;
    z-index:2
  }
  .mobile-stack-table td.schedule-swap-cell .shift-swap-handle,
  .mobile-stack-table td.schedule-swap-cell .shift-cell-mark{
    grid-column:2;
    min-width:0;
    width:100%;
    align-self:stretch;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    padding:6px 10px;
    margin:0;
    border:1px solid var(--border);
    border-left:none;
    border-radius:0;
    box-sizing:border-box
  }
  .mobile-stack-table td.schedule-swap-cell[data-editable="1"]{
    user-select:none;
    -webkit-user-select:none;
    -webkit-touch-callout:none
  }
  .mobile-stack-table td.schedule-swap-cell.day-cell-selected-multi .shift-cell-empty{
    color:var(--accent);font-weight:800
  }
  .request-staff-table td[data-label="操作"] .btn{min-width:36px;height:24px;padding:0 8px;justify-content:center}
  .request-day-summary-table tr[data-day-summary-row]{display:block;background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:8px;margin-bottom:8px}
  .request-day-summary-table td{display:flex;align-items:flex-start;justify-content:flex-start;gap:8px;border:none;padding:4px 2px;font-size:11.5px;text-align:left}
  .request-day-summary-table td::before{content:attr(data-label);color:var(--text3);font-weight:700;text-align:left;white-space:nowrap;display:inline-block;min-width:42px;flex-shrink:0}
  .request-day-summary-table .request-day-names{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
  .request-day-summary-table .request-day-chip{margin:0;font-size:11px}
}

/* ── Responsive Layout ── */
@media(max-width:920px){
  .header{flex-wrap:nowrap;padding:0 var(--page-gutter);min-height:0}
  .logo{margin-left:0}
  .nav{display:none !important}
  .hamburger{display:block !important}
  .header-right{gap:4px}
  .auth-badge-name{display:none}
  .btn-sm{padding:4px 8px;font-size:11px}
  
}

@media(max-width:1024px){
  html{font-size:13px;--page-gutter:12px}
  .header{min-height:56px;padding:6px var(--page-gutter);gap:8px}
  .logo{font-size:15px}
  .logo-sub{display:none}
  .main{padding:12px var(--page-gutter) 40px;width:100%}
  .main:has(.msg-wrap){height:calc(100dvh - 56px);padding-bottom:12px}
  .schedule-filter-bar{margin:-2px 0 10px}
  .schedule-group-filter-block{width:100%}
  .schedule-section-filters{width:100%}
  .month-label{font-size:13px;min-width:90px}
  .page-title{font-size:17px}
  .nav-drawer{width:75vw;max-width:280px}
  .header-right{gap:2px}
  .theme-select{padding:4px 8px;font-size:11px}
  .theme-dropdown-toggle{height:29px;font-size:11px;padding:0 8px}
  .theme-dropdown{width:clamp(210px, 56vw, 320px);min-width:210px;max-width:min(90vw, 320px)}
  .btn-sm{padding:3px 7px;font-size:11px}
  th,td{padding:6px 3px;font-size:11px}
  .table-wrap{border-radius:8px;overflow:visible}
  
}

/* ── Form ── */
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.form-group{display:flex;flex-direction:column;gap:5px}
.form-group.full{grid-column:1/-1}
.form-label{font-size:11.5px;font-weight:700;color:var(--text2);letter-spacing:.3px}
.form-input,.form-select{background:var(--chrome-soft);border:1px solid var(--line);border-radius:7px;color:var(--text);padding:8px 11px;font-size:13px;width:100%;outline:none;transition:border-color .15s}
.form-input:focus,.form-select:focus{border-color:var(--accent)}
.form-select option{background:var(--surface);color:var(--text)}
.theme-select option{background:var(--surface);color:var(--text)}
.color-dots{display:flex;flex-wrap:wrap;gap:6px}
.color-dot{width:26px;height:26px;border-radius:50%;cursor:pointer;border:3px solid transparent;transition:border-color .15s,transform .1s}
.color-dot:hover,.color-dot.active{border-color:var(--text);transform:scale(1.1)}

/* ── Constraint inputs (requests 等) ── */
.constraint-input{width:100%;background:var(--chrome-soft);border:1px solid var(--line);border-radius:7px;color:var(--text);padding:7px;font-size:15px;font-weight:700;text-align:center;outline:none;transition:border-color .15s}
.constraint-input:focus{border-color:var(--accent)}

/* ── Login ── */
body.login-page{
  --bg:#e8eaee;
  --surface:#ffffff;
  --surface2:#f3f4f6;
  --border:#d1d5db;
  --text:#1f2937;
  --text2:#6b7280;
  --text3:#9ca3af;
  --text-secondary:#6b7280;
  --accent:#4b5563;
  --accent-fg:#ffffff;
  --accent2:#64748b;
  --danger:#b45353;
  --success:#3f7d5a;
  --warn:#9a7a3a;
  --header-bg:#e8eaee;
  background:var(--bg);
  color:var(--text);
  color-scheme:light;
  transition:none;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
body.login-page a[href]{color:var(--accent)}
body.login-page a[href]:hover{text-decoration:underline}
body.login-page .form-input{
  background:var(--surface);
  border-color:var(--text2);
}
body.login-page .form-input:focus{border-color:var(--accent)}
.xrea-ad-slot{
  width:100%;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 8px 14px;
  margin-top:auto;
  text-align:center;
  overflow:visible;
  position:relative;
  z-index:1;
}
.xrea-ad-slot:empty{display:none;padding:0}
.xrea-ad-slot iframe,
.xrea-ad-slot img,
.xrea-ad-slot table{
  max-width:100%;
}
.login-wrap{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:20px}
.login-card{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:36px 32px;width:100%;max-width:420px;box-shadow:0 10px 36px rgba(31,41,55,.12)}
.login-finder{margin-top:16px;border:1px solid var(--line);border-radius:10px;background:var(--chrome)}
.login-finder>summary{cursor:pointer;padding:10px 12px;font-size:13px;font-weight:700;color:var(--text2);list-style:none}
.login-finder>summary::-webkit-details-marker{display:none}
.login-finder[open]>summary{border-bottom:1px solid var(--border)}
.login-finder-body{padding:12px}
.login-finder-note{font-size:12px;color:var(--text3);line-height:1.6;margin:0 0 10px}
.login-group-details{margin:0 0 10px}
.login-group-details>summary{cursor:pointer;font-size:12px;font-weight:700;color:var(--text2);padding:4px 0}
.login-group-filter{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:8px}
.login-group-chip{display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border:1px solid var(--line);border-radius:999px;background:var(--panel);font-size:12px;cursor:pointer;line-height:1.2}
.login-group-chip:has(input:checked){color:var(--accent);background:color-mix(in srgb, var(--accent) 12%, var(--surface) 88%)}
.login-logo{font-size:28px;font-weight:800;color:var(--accent);text-align:center;margin-bottom:6px}
.login-logo span{color:var(--proxy-hol)}
.login-sub{font-size:12.5px;color:var(--text2);text-align:center;margin-bottom:28px}
.login-tabs{display:flex;border-radius:8px;overflow:hidden;border:1px solid var(--line);margin-bottom:22px}
.login-tab{flex:1;padding:8px;border:none;background:var(--chrome-soft);color:var(--text2);cursor:pointer;font-size:13px;font-weight:600;transition:all .15s}
.login-tab.active{background:var(--accent);color:var(--accent-fg)}
.login-panel{display:none}
.login-panel.active{display:block}
.login-error{font-size:12px;color:var(--danger);margin-top:8px;text-align:center;min-height:18px}
.staff-name-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:14px;max-height:220px;overflow-y:auto}
.staff-name-btn{padding:8px;border-radius:7px;border:2px solid var(--line);background:var(--chrome-soft);color:var(--text);cursor:pointer;font-size:12.5px;font-weight:600;transition:all .15s;display:flex;align-items:center;gap:6px}
.staff-name-btn:hover,.staff-name-btn.active{border-color:var(--accent);color:var(--accent)}

/* ── Request page ── */
.request-info{padding:12px 16px;border-radius:9px;border:1px solid color-mix(in srgb, var(--accent) 62%, var(--border) 38%);background:color-mix(in srgb, var(--surface2) 84%, var(--accent) 16%);color:var(--text);font-size:12.5px;margin-bottom:16px;line-height:1.6}
.request-info b{color:var(--accent)}
.request-info.request-info-success{border-color:color-mix(in srgb, var(--success) 58%, var(--border) 42%);background:color-mix(in srgb, var(--surface2) 80%, var(--success) 20%);color:var(--text)}
.request-info.request-info-danger{border-color:color-mix(in srgb, var(--accent2) 58%, var(--border) 42%);background:color-mix(in srgb, var(--surface2) 80%, var(--accent2) 20%);color:var(--text)}
.request-info.request-info-danger b{color:var(--accent2)}
.request-info.request-info-warn{border-color:color-mix(in srgb, var(--warn) 58%, var(--border) 42%);background:color-mix(in srgb, var(--surface2) 80%, var(--warn) 20%);color:var(--text)}
.request-submit-cell{border-radius:0}
.request-submit-cell.is-submitted{background:color-mix(in srgb, var(--surface2) 84%, var(--success) 16%)}
.request-submit-cell.is-pending{background:color-mix(in srgb, var(--surface2) 82%, var(--accent) 18%)}
.request-submit-state{font-weight:800;font-size:11px}
.request-submit-state--submitted{color:var(--success)}
.request-submit-state--pending{color:var(--accent)}
.request-type-off{color:var(--accent);font-weight:700;font-size:11px}
.request-type-hol{color:var(--accent2);font-weight:700;font-size:11px}
.request-type-empty{color:var(--text3)}
.request-day-cell{text-align:center;cursor:default;border-radius:0}
.request-day-cell.is-off{background:color-mix(in srgb, var(--surface2) 78%, var(--accent) 22%)}
.request-day-cell.is-hol{background:color-mix(in srgb, var(--surface2) 74%, var(--accent2) 26%)}
.request-day-cell.is-off.is-proxy{background:var(--proxy-off-bg);box-shadow:inset 0 0 0 1px var(--proxy-off-edge)}
.request-day-cell.is-hol.is-proxy{background:var(--proxy-hol-bg);box-shadow:inset 0 0 0 1px var(--proxy-hol-edge)}
.request-day-cell.is-self{box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--text2) 35%, transparent)}
.request-day-cell.is-nice{opacity:.78}
.request-day-cell.is-must .request-type-off,
.request-day-cell.is-must .request-type-hol{font-weight:800}
.req-pri-tag{display:inline-block;margin-left:1px;font-size:9px;font-weight:800;line-height:1;vertical-align:super}
.req-pri-tag.is-must-tag{color:var(--danger)}
.req-pri-tag.is-nice-tag{color:var(--text2);font-weight:700}
.request-proxy-legend{display:flex;flex-wrap:wrap;gap:10px 14px;font-size:11px;color:var(--text2);margin:4px 0 8px;padding:0 4px}
.request-legend-self{padding:1px 6px;border:1px solid color-mix(in srgb, var(--text2) 40%, transparent);border-radius:4px}
.request-legend-proxy{padding:1px 6px;border-radius:4px;background:var(--proxy-off-bg);box-shadow:inset 0 0 0 1px var(--proxy-off-edge)}
.request-day-cell.is-editable{cursor:pointer}
.request-day-cell.is-editable:hover{outline:1px solid var(--accent);outline-offset:-1px}
.request-day-cell.is-locked{position:relative;cursor:not-allowed}
.request-day-cell.is-locked:hover{outline:1px dashed color-mix(in srgb, var(--text2) 45%, transparent);outline-offset:-1px}
.request-lock-mark{position:absolute;top:0;right:1px;font-size:6px;color:var(--text2);opacity:.7;pointer-events:none}
.request-row-dirty{color:var(--warn);margin-left:4px;font-size:10px}
.request-proxy-paint{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:8px 0 4px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
.request-proxy-paint .request-paint-btn.is-active,
.request-proxy-paint .request-pri-btn.is-active{border-color:var(--accent);color:var(--accent);background:color-mix(in srgb, var(--surface2) 70%, var(--accent) 30%)}
.request-proxy-paint .request-paint-btn.is-active:hover,
.request-proxy-paint .request-pri-btn.is-active:hover{border-color:var(--accent);color:var(--accent-fg);background:var(--accent);filter:brightness(1.06)}
.request-proxy-sep{color:var(--text3);padding:0 2px}
.request-proxy-hint{font-size:11px;color:var(--text2)}
.schedule-solver-hint{display:inline-flex;align-items:center;font-size:11px;color:var(--text2);padding:0 8px;border:1px dashed var(--line);border-radius:6px;min-height:30px}
.schedule-req-proxy-off{
  background:var(--proxy-off-bg) !important;
  box-shadow:inset 0 0 0 1px var(--proxy-off-edge);
}
.schedule-req-proxy-hol{
  background:var(--proxy-hol-bg) !important;
  box-shadow:inset 0 0 0 1px var(--proxy-hol-edge);
}
.schedule-swap-cell .req-dot,
.schedule-swap-cell .shift-swap-handle,
.schedule-swap-cell .shift-cell-mark,
.schedule-swap-cell .cell-when,
.schedule-swap-cell .cell-pin-mark{
  pointer-events:none;
}
.request-settings-panel{margin-bottom:14px;border:1px solid var(--line);border-radius:11px;background:var(--panel);overflow:hidden}
.request-settings-summary{list-style:none;cursor:pointer;padding:12px 16px;font-size:12.5px;font-weight:700;color:var(--text);background:var(--chrome);user-select:none}
.request-settings-summary::-webkit-details-marker{display:none}
.request-settings-summary::after{content:'＋';float:right;color:var(--text2);font-size:14px}
.request-settings-panel[open] .request-settings-summary::after{content:'－'}
.request-settings-form{padding:14px 16px}
.request-settings-grid{display:grid;grid-template-columns:repeat(3,minmax(0,120px)) auto;gap:10px;margin-bottom:12px;align-items:end}
.request-settings-field{display:flex;flex-direction:column;gap:6px;font-size:11.5px;color:var(--text2)}
.request-settings-submit-wrap{grid-column:4;display:flex;align-items:flex-end}
.request-settings-submit-wrap .btn{min-width:120px;min-height:39px;padding:7px 12px;border-radius:7px;font-size:15px;font-weight:700;justify-content:center}
.request-settings-note{font-size:12px;color:var(--text2)}
@media(max-width:720px){.request-settings-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.request-settings-submit-wrap{grid-column:1/-1}.request-settings-submit-wrap .btn{min-width:100%}.request-settings-form{padding:12px}.request-settings-summary{padding:11px 13px}}
.request-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-bottom:16px}
.request-type-btn.active,
.request-weekday-btn.active{
  border-color:var(--accent) !important;
  color:var(--accent) !important;
  background:color-mix(in srgb, var(--surface2) 72%, var(--accent) 28%) !important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, var(--border) 45%);
}
.req-head{text-align:center;padding:6px 2px;font-size:11px;font-weight:700;color:var(--text)}
.req-head.sun-h{color:var(--danger)}
.req-head.sat-h{color:var(--proxy-hol)}
.req-cell{min-height:52px;height:52px;border-radius:6px;border:1.5px solid var(--line);background:var(--chrome-soft);padding:4px;cursor:pointer;transition:all .15s;display:flex;flex-direction:column;align-items:center;gap:2px;position:relative}
.req-cell:hover{border-color:var(--accent)}
.req-cell.empty{opacity:0;pointer-events:none}
.req-cell.past{opacity:.4;pointer-events:none}
.req-cell.req-off{border-color:var(--accent);background:color-mix(in srgb, var(--surface2) 76%, var(--accent) 24%)}
.req-cell.req-hol{border-color:var(--accent2);background:color-mix(in srgb, var(--surface2) 72%, var(--accent2) 28%)}
.req-cell.req-nice{opacity:.82}
.req-pri-mark{font-size:9px;margin-left:2px;font-weight:700}
.schedule-swap-cell.schedule-cell-pinned{outline:1px dashed var(--accent);outline-offset:-1px}
.cell-pin-mark{position:absolute;bottom:1px;left:1px;font-size:8px;color:var(--accent);line-height:1}
.req-cell.deadline-past{pointer-events:none;opacity:.5}
.req-day-num{font-size:11px;font-weight:700;color:var(--text2)}
.req-type{font-size:10px;font-weight:700}
.req-clear{position:absolute;top:2px;right:2px;width:14px;height:14px;border-radius:50%;background:var(--danger);color:#fff;font-size:9px;display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transition:opacity .15s}
.req-cell:hover .req-clear{opacity:1}
.req-legend{display:flex;gap:10px;font-size:12px;color:var(--text2)}
.request-day-names{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
.request-day-chip{max-width:100%;line-height:1.35}

/* ── Toast ── */
.toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%) translateY(8px);background:var(--chrome);color:var(--text);padding:10px 22px;border-radius:28px;font-size:12.5px;font-weight:600;box-shadow:0 8px 32px rgba(0,0,0,.4);opacity:0;pointer-events:none;transition:opacity .22s,transform .22s;z-index:9999;white-space:nowrap;border:1px solid var(--line)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.err{border-color:var(--danger);color:var(--danger)}
.toast.show.is-action{pointer-events:auto;cursor:pointer;white-space:normal;max-width:min(520px,calc(100vw - 24px));text-align:center;line-height:1.45}
.toast.show.is-action:hover{border-color:var(--accent)}
.toast-history-action{margin-top:8px}
.toast-history-toggle{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:28px;min-height:28px;padding:0 6px;border:none;border-radius:0;background:transparent;color:var(--text2);cursor:pointer;flex-shrink:0}
.toast-history-toggle:hover,.toast-history-toggle.is-open{border:none;background:transparent;color:var(--accent)}
.toast-history-toggle.is-floating{position:fixed;top:12px;right:12px;z-index:10000}
.toast-history-badge{position:absolute;top:-5px;right:-5px;min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:var(--danger);color:#fff;font-size:10px;font-weight:800;line-height:16px;text-align:center;border:1px solid color-mix(in srgb,var(--danger) 70%,#fff 30%)}
.toast-history-badge[hidden]{display:none}
.toast-history-empty{font-size:12.5px;color:var(--text2);padding:8px 4px}
.toast-history-panel{position:fixed;right:16px;top:var(--page-sticky-top, 72px);z-index:9998;width:min(420px,calc(100vw - 24px));max-height:min(52vh,420px);overflow:auto;background:color-mix(in srgb,var(--surface) 94%,transparent 6%);border:1px solid var(--border);border-radius:12px;box-shadow:0 10px 32px rgba(0,0,0,.24);padding:12px 12px;backdrop-filter:blur(2px)}
.toast-history-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:9px}
.toast-history-header-left{display:flex;flex-direction:column;gap:1px}
.toast-history-title{font-size:13px;font-weight:700;color:var(--text2)}
.toast-history-esc-hint{font-size:11px;color:var(--text2);opacity:.62}
.toast-history-close{background:none;border:none;cursor:pointer;font-size:20px;color:var(--text2);padding:0 4px;line-height:1;opacity:.62;flex-shrink:0;margin-top:-2px}
.toast-history-close:hover{color:var(--danger);opacity:1}
.toast-history-item{font-size:13.5px;line-height:1.5;color:var(--text);padding:8px 10px;border-radius:9px;background:var(--chrome-soft);border:1px solid var(--line);margin-bottom:8px;word-break:break-word}
.toast-history-item.err{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 50%,var(--border) 50%)}
.toast-history-item[data-has-detail="1"]{position:relative;cursor:help}
.toast-history-item-detail{
  display:block;
  max-height:0;
  overflow:hidden;
  margin-top:0;
  white-space:pre-wrap;
  font-size:12px;
  line-height:1.45;
  color:var(--text);
  background:color-mix(in srgb, var(--surface) 92%, var(--accent2) 8%);
  border:1px solid color-mix(in srgb, var(--accent2) 45%, var(--border) 55%);
  border-radius:8px;
  box-shadow:0 4px 12px rgba(0,0,0,.16);
  padding:0 9px;
  opacity:0;
  transition:max-height .18s ease, opacity .14s ease, margin-top .14s ease, padding .14s ease;
}
.toast-history-item[data-has-detail="1"]:hover .toast-history-item-detail,
.toast-history-item[data-has-detail="1"]:focus-within .toast-history-item-detail{
  max-height:180px;
  margin-top:7px;
  padding:8px 9px;
  opacity:1;
  overflow:auto;
}
.btn.is-loading{pointer-events:none;opacity:.9}
.btn-loading-spinner{width:12px;height:12px;border:2px solid color-mix(in srgb,var(--accent-fg) 35%,transparent 65%);border-top-color:var(--accent-fg);border-radius:50%;display:inline-block;animation:btn-spin .8s linear infinite;margin-right:6px;vertical-align:-2px}
@keyframes btn-spin{to{transform:rotate(360deg)}}
@media(max-width:768px){.toast-history-panel{left:10px;right:10px;top:var(--page-sticky-top, 64px);width:auto;max-height:44vh;padding:10px 10px}.toast-history-title{font-size:12px}.toast-history-item{font-size:13px;line-height:1.45}}

/* ── ラジオ／チェック（枠基準のはみ出しレ点） ── */
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]){
  --pick-size:16px;
  --pick-check-w:10px;
  --pick-check-h:16px;
  --pick-check-b:3px;
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:6px;
  overflow:visible;
  cursor:pointer;
  user-select:none;
}
label:has(> .pick-mark) > input[type="checkbox"],
label:has(> .pick-mark) > input[type="radio"]{
  position:absolute !important;
  opacity:0 !important;
  width:1px !important;
  height:1px !important;
  margin:0 !important;
  pointer-events:none;
  overflow:hidden;
  clip:rect(0,0,0,0);
}
.pick-mark{
  position:relative;
  width:var(--pick-size, 16px);
  height:var(--pick-size, 16px);
  flex-shrink:0;
  overflow:visible;
  border:2px solid color-mix(in srgb, var(--text2) 50%, var(--border) 50%);
  background:var(--surface);
  border-radius:5px;
  box-shadow:inset 0 1px 2px color-mix(in srgb, var(--text) 10%, transparent);
}
input[type="radio"] + .pick-mark{border-radius:50%}
.msg-compose-row > label,
.msg-compose-choices > label,
.shift-type-toggle-check,
.shift-type-radio-group label{
  min-height:28px;padding:3px 8px;
  border:1px solid var(--line);border-radius:6px;
  background:var(--chrome-soft)
}
.shift-type-toggle-check:has(input:checked),
.shift-type-radio-group label:has(input:checked),
.msg-compose-row > label:has(input:checked),
.msg-compose-choices > label:has(input:checked){
  color:var(--accent);
  border-color:color-mix(in srgb, var(--accent) 36%, var(--border) 64%);
  background:color-mix(in srgb, var(--accent) 22%, var(--surface) 78%)
}
.pick-mark::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:var(--pick-check-w, 10px);
  height:var(--pick-check-h, 16px);
  border:solid transparent;
  border-width:0 var(--pick-check-b, 3px) var(--pick-check-b, 3px) 0;
  transform:translate(-40%,-72%) rotate(40deg) scale(.2);
  transform-origin:center;
  pointer-events:none;
}
input:checked + .pick-mark{
  border-color:var(--accent);
  background:color-mix(in srgb, var(--accent) 16%, var(--surface) 84%);
  box-shadow:none;
}
input:checked + .pick-mark::after{
  border-color:var(--accent);
  transform:translate(-40%,-72%) rotate(40deg) scale(1);
  filter:drop-shadow(0 1px 0 var(--surface));
}
label:has(> input[type="checkbox"]:focus-visible),
label:has(> input[type="radio"]:focus-visible){
  box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
label:has(> input[type="checkbox"]:disabled),
label:has(> input[type="radio"]:disabled){
  opacity:.6;
  cursor:not-allowed;
}
.schedule-section-chip,
.login-group-chip,
label:has(> .daySectionFilter),
label:has(> .bulkSectionFilter),
.staff-delete-toggle,
.shift-type-hard-delete,
.msg-picker-only{
  --pick-size:16px;
  --pick-check-w:10px;
  --pick-check-h:16px;
  --pick-check-b:3px;
}
.check-label,
.bulkStaffRow,
.dayStaffRow,
.staff-delete-toggle,
.msg-picker-row,
.shift-type-toggle-check,
.shift-type-radio-group label{
  display:flex;
}

.check-label{
  align-items:center;min-height:36px;padding:6px 10px;
  border:1px solid var(--line);border-radius:7px;
  background:var(--chrome-soft);
  font-size:12.5px;font-weight:700;color:var(--text2);gap:8px
}
.check-label:has(input[type="checkbox"]:checked){
  color:var(--accent);
  border-color:color-mix(in srgb, var(--accent) 36%, var(--border) 64%);
  background:color-mix(in srgb, var(--accent) 22%, var(--surface) 78%)
}
.help-tip{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:20px;padding:0 8px;border-radius:999px;font-size:10px;font-weight:700;letter-spacing:.04em;background:color-mix(in srgb, var(--surface) 82%, var(--accent) 18%);border:1px solid color-mix(in srgb, var(--border) 72%, var(--accent) 28%);color:var(--text2);cursor:help;line-height:1;user-select:none;white-space:nowrap;transition:background .15s,border-color .15s,color .15s,transform .15s}
.help-tip:hover{background:color-mix(in srgb, var(--surface2) 68%, var(--accent) 32%);border-color:color-mix(in srgb, var(--accent) 56%, var(--border) 44%);color:var(--text);transform:translateY(-1px)}

/* ── Staff list page ── */
.staff-admin-panel{
  margin-bottom:20px;
  background:var(--chrome);
  border:1px solid var(--line);
  border-radius:10px;
  padding:16px;
}
.staff-admin-chip{
  display:flex;
  align-items:center;
  border:1px solid var(--line);
  border-radius:8px;
  overflow:hidden;
  background:var(--chrome-soft);
  min-width:120px;
}
.staff-admin-chip-label{
  flex:1;
  background:transparent;
  color:var(--accent);
  padding:6px 12px;
  font-size:13px;
  font-weight:600;
  white-space:nowrap;
  border-right:1px solid var(--line);
}
.staff-group-panels{display:grid;gap:10px}
.staff-group-panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:10px;
  overflow:hidden;
}
.staff-group-header{
  padding:10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  background:var(--chrome);
  border-bottom:1px solid var(--line);
}
.staff-list-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px}
.staff-list-card{background:var(--panel);border:1px solid var(--line);border-radius:11px;padding:14px;display:flex;align-items:flex-start;gap:12px;min-width:0;position:relative}
.staff-list-card .btn-ghost,
.staff-admin-chip .btn-ghost{
  background:var(--chrome-soft);
  border-color:var(--line);
}
.staff-weak-tag{font-size:11px;padding:2px 8px;border:1px solid var(--line);border-radius:11px;color:var(--text2);background:var(--chrome-soft);line-height:1.45;display:inline-block;max-width:100%}
.staff-left{display:flex;flex-direction:column;align-items:center;gap:8px;min-width:46px}
.staff-avatar{width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:800;color:#fff;flex-shrink:0}
.staff-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px;text-align:left}
.staff-info-name{font-size:14px;font-weight:700;color:var(--text);line-height:1.3;word-break:break-word}
.staff-info-reading{font-size:11px;color:var(--text3);line-height:1.3}
.staff-info-role{font-size:11px;color:var(--text2);line-height:1.2}
.staff-info-login{font-size:11px;color:var(--text3);line-height:1.4;margin-top:1px}
.staff-actions{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:5px;margin-top:3px;margin-bottom:14px}
.staff-delete-toggle{display:inline-flex;align-items:center;gap:7px;padding:0;border:none;background:none;color:var(--text2);font-size:11px;font-weight:700;cursor:pointer;user-select:none;line-height:1}
.staff-delete-toggle:hover{color:var(--text)}
.staff-delete-toggle:has(input:checked){color:var(--accent)}
.staff-delete-cb:checked + span{color:var(--accent);font-weight:800}

@media(max-width:1200px){
  .staff-list-grid{grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}
}

/* ── Responsive ── */
@media(max-width:768px){
  .main:has(.msg-wrap){height:calc(100dvh - 52px)}
  .header{height:auto;padding:8px var(--page-gutter);min-height:0}
  .logo{margin-left:0}
  .nav{display:none}
  .staff-sticky-toolbar{padding:9px 10px;margin:-4px 0 12px}
  .staff-sticky-actions .btn{flex:1 1 auto;justify-content:center}
  .page-sticky-toolbar{padding:9px 10px;margin:-4px 0 12px}
  .page-sticky-actions .btn{flex:1 1 auto;justify-content:center}
  .cal-cell{min-height:68px}
  .staff-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}
  .staff-list-grid{grid-template-columns:1fr}
  .staff-list-card{padding:12px;gap:10px}
  .staff-left{min-width:44px;gap:6px}
  .staff-delete-toggle{font-size:10.5px}
  .staff-actions{flex-wrap:wrap;gap:4px}
  .form-grid{grid-template-columns:1fr}
  .shift-btn-label{display:none}
  .month-label{min-width:80px;font-size:13px}

  .modal-overlay{padding:10px}
  .modal{max-height:92vh}
  .modal-header{padding:14px 14px 10px}
  .modal-body{padding:12px 14px}
  .modal-footer{padding:10px 14px;gap:10px}
  .modal-close{min-width:40px;min-height:40px}
  .modal-footer .btn,
  .modal-body .btn,
  .request-tab-btn,
  .group-filter-btn{min-height:40px}
  .modal input,
  .modal select,
  .modal textarea{font-size:16px}
  .modal-body{touch-action:pan-y}
}

/* ── Mobile consistency pass (align with current PC UI) ── */
@media(max-width:1024px){
  .header-right{flex:1;min-width:0;justify-content:flex-end;gap:4px}
  .theme-switcher{max-width:100%;min-width:0;gap:4px}
  .theme-dropdown{width:min(66vw,280px);min-width:170px;max-width:280px}
  .theme-dropdown-toggle{height:32px;padding:0 9px;font-size:12px}

  .page-header{align-items:flex-start}
  .month-nav{margin-left:auto}

  .page-sticky-toolbar,
  .staff-sticky-toolbar{
    margin:-2px 0 12px;
    padding:10px;
    border-radius:10px;
    box-shadow:0 5px 14px rgba(0,0,0,.12);
  }
  .requests-sticky-toolbar{top:calc(var(--page-sticky-top, 76px) + 8px)}

  .request-tab-bar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0 0 8px}
  .request-tab-bar .request-tab-btn,
  .request-tab-bar .btn{width:100%;justify-content:center;min-height:32px}
  .request-tab-bar .request-tab-btn{padding:6px 8px;border-radius:6px;font-size:12px}

  .schedule-filter-bar{row-gap:7px}
  .schedule-filter-label{font-size:11px}
  .schedule-filter-group .btn{min-height:34px}

  .mobile-stack-table tr[data-section-member],
  .request-day-summary-table tr[data-day-summary-row]{
    padding:10px 10px 8px;
    border-radius:10px;
    box-shadow:0 1px 0 color-mix(in srgb, var(--border) 75%, transparent 25%);
  }
  .mobile-stack-table td,
  .request-day-summary-table td{font-size:12px;line-height:1.35}
  .mobile-stack-table td::before,
  .request-day-summary-table td::before{min-width:50px}

  .request-staff-table td[data-label="提出"]{align-items:center}
  .request-submit-state{font-size:11.5px}

  .log-filter-form,.log-retention-form{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:end}
  .log-filter-field{min-width:0}
  .log-filter-actions{grid-column:1/-1}
  .log-filter-actions .btn{width:100%;justify-content:center;min-height:36px}
  .log-restore-note{font-size:11.5px}
  .table-wrap:has(.log-table){overflow:visible}
  .table-wrap:has(.log-table)::after{display:none}
  .card:has(.log-table) .table-wrap-top-scroll{display:none !important}
  .log-table{min-width:0}
  .log-table th,
  .log-table td,
  .log-table th:nth-child(1),
  .log-table td:nth-child(1),
  .log-table th:nth-child(2),
  .log-table td:nth-child(2),
  .log-table th:nth-child(3),
  .log-table td:nth-child(3),
  .log-table th:nth-child(5),
  .log-table td:nth-child(5){border-right:none;background:transparent;min-width:0;max-width:none;width:auto;white-space:normal;text-align:left}
  .log-table thead{display:none}
  .log-table tbody{display:block}
  .log-table tr.log-row{
    display:block;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:10px;
    padding:10px;
    margin-bottom:8px;
  }
  .log-table tr.log-empty{display:block;padding:12px;color:var(--text3)}
  .log-table tr.log-empty td{display:block;border:none;text-align:left}
  .log-table td{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:3px;
    border:none;
    padding:8px 2px;
    font-size:13px;
    text-align:left;
    white-space:normal;
    word-break:break-word;
    line-height:1.55;
  }
  .log-table td::before{
    content:attr(data-label);
    color:var(--text3);
    font-weight:700;
    font-size:11px;
    white-space:nowrap;
    min-width:0;
  }
  .log-table td.log-detail{
    margin-top:4px;
    padding:10px 12px;
    background:var(--surface2);
    border-radius:8px;
  }
  .log-table .log-detail{
    white-space:pre-wrap;
    overflow-wrap:anywhere;
    word-break:break-word;
    line-height:1.75;
    font-size:13px;
  }
  .log-table td[data-label="復元"]{
    margin-top:4px;
    background:transparent;
    text-align:left;
  }
  .log-restore-actions{width:auto;justify-content:flex-start}
  .log-restore-actions .btn{width:auto;min-height:32px}
  .log-pager{flex-direction:column;align-items:stretch}
  .log-pager-links{justify-content:stretch}
  .log-pager-links .btn{flex:1;justify-content:center;min-height:34px}
}

@media(max-width:680px){
  .request-tab-bar{grid-template-columns:1fr}
  .theme-dropdown{width:min(74vw,260px);min-width:150px}
  .schedule-section-filters{grid-template-columns:1fr}
}

/* Small-screen layout adjustments; calendar tables remain horizontally scrollable. */
@media(max-width:1024px){
  .request-staff-table.mobile-stack-table,
  .schedule-table-responsive.mobile-stack-table{width:max-content;min-width:100%;table-layout:fixed}
  #scheduleMainTable.schedule-table-responsive,
  #requestStaffTable.request-staff-table{border-collapse:separate !important;border-spacing:0 !important;border:0 !important;border-radius:0 !important}
  #scheduleMainTable.schedule-table-responsive th,
  #scheduleMainTable.schedule-table-responsive td,
  #requestStaffTable.request-staff-table th,
  #requestStaffTable.request-staff-table td{
    border:0 !important;
    border-right:1px solid var(--schedule-line) !important;
    border-bottom:1px solid var(--schedule-line) !important;
    border-radius:0 !important;
    box-shadow:none !important;
    background-clip:padding-box;
  }
  #scheduleMainTable.schedule-table-responsive thead th.wr-count,
  #scheduleMainTable.schedule-table-responsive td:last-child,
  #requestStaffTable.request-staff-table th:last-child,
  #requestStaffTable.request-staff-table td:last-child{border-right:0 !important}
  #scheduleMainTable.schedule-table-responsive thead tr.cal-dow-row th:last-child,
  #requestStaffTable.request-staff-table thead tr.cal-dow-row th:last-child{border-right:1px solid var(--schedule-line) !important}
  #scheduleMainTable.schedule-table-responsive tbody tr:last-child td,
  #requestStaffTable.request-staff-table tbody tr:last-child td{border-bottom:0 !important}
  #scheduleMainTable.schedule-table-responsive tbody tr[data-staff-id],
  #scheduleMainTable.schedule-table-responsive tbody tr[data-section-header]{margin:0 !important;padding:0 !important;border:0 !important;box-shadow:none !important}
  #scheduleMainTable.schedule-table-responsive tbody tr[data-staff-id] > td,
  #scheduleMainTable.schedule-table-responsive tbody tr[data-section-header] > td{vertical-align:middle}
  .monthly-summary-table.mobile-stack-table{width:100%;min-width:0;table-layout:fixed}
  .request-page-header{display:block;margin-bottom:10px}
  .request-page-header .month-nav{justify-content:flex-start;margin:8px 0 0}
  .request-info{padding:10px 12px;font-size:12px;line-height:1.5}
  .request-settings-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .request-settings-submit-wrap{grid-column:1/-1}
  .request-settings-submit-wrap .btn{width:100%;justify-content:center}
  .request-settings-note{line-height:1.5;overflow-wrap:anywhere}
  .request-tab-bar{grid-template-columns:repeat(2,minmax(0,1fr))}
  .request-tab-bar .btn{grid-column:1/-1}
  .request-proxy-paint{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:8px}
  .request-proxy-paint .schedule-filter-label,
  .request-proxy-hint{grid-column:1/-1}
  .request-proxy-paint .request-proxy-sep{display:none}
  .request-proxy-paint .btn{width:100%;min-width:0;justify-content:center;padding-inline:5px}
  .request-proxy-legend{display:flex;flex-wrap:wrap;gap:5px 10px;font-size:10.5px;line-height:1.4}

  .card:has(.request-staff-table) .table-wrap,
  .card:has(#scheduleMainTable) .table-wrap{overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .request-staff-table.mobile-stack-table{min-width:max-content}
  .request-day-summary-table tr[data-day-summary-row]{display:grid;grid-template-columns:1fr auto;gap:4px 8px}
  .request-day-summary-table tr[data-day-summary-row] td[data-label="希望者"]{grid-column:1/-1;min-width:0}

  .schedule-table-responsive.mobile-stack-table thead{display:table-header-group !important}
  .schedule-table-responsive.mobile-stack-table tbody{display:table-row-group}
  .schedule-table-responsive.mobile-stack-table tr,
  .schedule-table-responsive.mobile-stack-table tr[data-staff-id]{display:table-row}
  .schedule-table-responsive.mobile-stack-table td,
  .schedule-table-responsive.mobile-stack-table tr[data-staff-id] > td,
  .schedule-table-responsive.mobile-stack-table tr[data-staff-id] > td.schedule-swap-cell{display:table-cell}
  .schedule-table-responsive.mobile-stack-table thead tr:first-child th:first-child,
  .schedule-table-responsive.mobile-stack-table tbody tr[data-staff-id] > td:first-child{position:sticky;left:0;z-index:12;width:148px;min-width:148px;max-width:148px;white-space:normal !important;overflow-wrap:anywhere;background:var(--chrome)}
  .schedule-table-responsive.mobile-stack-table thead tr:first-child th:first-child{z-index:22}
  .schedule-table-responsive.mobile-stack-table thead tr.cal-dow-row th:first-child{position:static;left:auto;z-index:auto;width:38px;min-width:38px;max-width:38px}
  .schedule-table-responsive.mobile-stack-table tr[data-section-header] > td:first-child{position:static;left:auto;z-index:auto;width:auto;min-width:0;max-width:none}
  .schedule-table-responsive.mobile-stack-table tr[data-staff-id] > td:first-child{position:sticky;left:0;z-index:12;margin:0;padding:7px 8px !important;background:var(--chrome) !important}
  .schedule-table-responsive.mobile-stack-table td.schedule-swap-cell{background:var(--surface) !important}
  .schedule-table-responsive.mobile-stack-table tr[data-section-header]{display:table-row !important;border:0 !important;margin:0 !important;padding:0 !important;background:transparent !important}
  .schedule-table-responsive.mobile-stack-table tr[data-section-header] td{display:table-cell !important;width:auto !important;border-right:0 !important;border-bottom:1px solid var(--schedule-line) !important;border-radius:0;background:var(--chrome) !important;box-shadow:none !important;padding:8px 10px !important;color:var(--text) !important;text-align:left !important}
  .schedule-table-responsive.mobile-stack-table tr[data-section-header] .section-toggle-indicator{display:inline-block !important}
  .schedule-table-responsive.mobile-stack-table .shift-cell-empty{display:inline-flex !important;width:auto !important;min-width:0 !important;padding:0 2px !important;border:0 !important;background:transparent !important;box-shadow:none !important}
  .schedule-table-responsive.mobile-stack-table th:not(:first-child):not(:last-child),
  .schedule-table-responsive.mobile-stack-table td[data-label$="日"]{width:38px !important;min-width:38px !important;max-width:38px !important;padding:6px 2px !important;text-align:center}
  .schedule-table-responsive.mobile-stack-table thead th.wr-date-header,
  .schedule-table-responsive.mobile-stack-table thead th.wr-staffing-header{width:38px !important;min-width:38px !important;max-width:38px !important;text-align:center}
  .schedule-table-responsive.mobile-stack-table th:last-child,
  .schedule-table-responsive.mobile-stack-table td.work-count-cell{width:64px;min-width:64px;max-width:64px;text-align:center}
  .schedule-table-responsive.mobile-stack-table tr[data-staff-id] > td.work-count-cell{display:table-cell !important;position:static;width:64px !important;min-width:64px !important;max-width:64px !important;padding:6px 3px !important;background:var(--surface) !important;text-align:center !important;white-space:nowrap}
  .schedule-table-responsive.mobile-stack-table .work-count-label{display:none !important}
  .schedule-table-responsive.mobile-stack-table .work-count-value{display:inline !important;border:0 !important;padding:0 !important;background:transparent !important;color:var(--accent);font-weight:800}
  .schedule-table-responsive.mobile-stack-table .cell-when,
  .schedule-table-responsive.mobile-stack-table .cell-date-col,
  .schedule-table-responsive.mobile-stack-table .cell-dow-col{display:none !important}
  .schedule-table-responsive.mobile-stack-table .work-count-cell{min-width:58px;text-align:center}
  .request-staff-table.mobile-stack-table thead{display:table-header-group !important}
  .request-staff-table.mobile-stack-table tbody{display:table-row-group}
  .request-staff-table.mobile-stack-table tr[data-section-member]{display:table-row}
  .request-staff-table.mobile-stack-table th,
  .request-staff-table.mobile-stack-table tr[data-section-member] > td{border-right:1px solid var(--schedule-line) !important;border-bottom:1px solid var(--schedule-line) !important}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td{display:table-cell;min-width:0;max-width:none;width:auto;padding:7px 4px;text-align:center;white-space:normal}
  .request-staff-table.mobile-stack-table thead tr:first-child th:first-child,
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="スタッフ"]{position:sticky;left:0;z-index:12;width:148px;min-width:148px;max-width:148px;background:var(--chrome);text-align:left}
  .request-staff-table.mobile-stack-table thead tr:first-child th:first-child{z-index:22}
  .request-staff-table.mobile-stack-table thead tr.cal-dow-row th:first-child{position:static;left:auto;z-index:auto;width:38px;min-width:38px;max-width:38px}
  .request-staff-table.mobile-stack-table thead tr:first-child th:first-child,
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="スタッフ"]{padding-left:8px !important;text-align:left !important}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="スタッフ"]{white-space:normal !important;overflow-wrap:anywhere}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="スタッフ"] .staff-dot{display:none !important}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="スタッフ"]::before,
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="提出"]::before,
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="公休"]::before,
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="有休"]::before{content:none !important;display:none !important}
  .request-staff-table.mobile-stack-table thead tr:first-child th:nth-child(2){position:sticky;left:148px;z-index:21;width:72px;min-width:72px;max-width:72px;background:var(--chrome)}
  .request-staff-table.mobile-stack-table thead tr.cal-dow-row th:nth-child(2){position:static;left:auto;z-index:auto}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="提出"]{position:sticky;left:148px;z-index:12;background:var(--chrome)}
  .request-staff-table.mobile-stack-table thead tr:first-child th:nth-child(n+3):not(:nth-last-child(-n+3)),
  .request-staff-table.mobile-stack-table thead tr.cal-dow-row th{width:38px !important;min-width:38px !important;max-width:38px !important}
  .request-staff-table.mobile-stack-table thead tr:first-child th:nth-child(n+3):not(:nth-last-child(-n+3)),
  .request-staff-table.mobile-stack-table thead tr.cal-dow-row th,
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label$="日"]{text-align:center !important;vertical-align:middle;padding-left:2px !important;padding-right:2px !important}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label$="日"] > span{margin-inline:auto}
  .request-staff-table.mobile-stack-table thead tr:first-child th:nth-child(2),
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="提出"]{text-align:center !important;vertical-align:middle}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="スタッフ"]{font-size:12px;font-weight:700;border-right:1px solid var(--schedule-line) !important}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="提出"]{min-width:72px;width:72px;max-width:72px;text-align:center;white-space:normal !important;overflow-wrap:anywhere;border-right:1px solid var(--schedule-line) !important}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label$="日"]{width:38px;min-width:38px;max-width:38px;padding:7px 2px;text-align:center;border-right:1px solid var(--schedule-line) !important;border-bottom:1px solid var(--schedule-line) !important}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label$="日"]::before{content:none;display:none}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="公休"],
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="有休"]{display:table-cell;text-align:center !important;vertical-align:middle;min-width:52px;width:52px;padding-inline:2px;border-right:1px solid var(--schedule-line) !important;border-bottom:1px solid var(--schedule-line) !important}
  .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="操作"]{min-width:52px;width:52px;text-align:center;background:var(--chrome);border-left:1px solid var(--schedule-line) !important}
  .request-staff-table.mobile-stack-table .request-section-action-cell{display:none}
  .card:has(#scheduleMainTable) .table-wrap,
  .card:has(.request-staff-table) .table-wrap{overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .monthly-summary-table.mobile-stack-table tbody tr[data-section-member]{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 8px;
    margin:0 0 8px;
    padding:8px;
    border:1px solid var(--line);
    border-radius:9px;
    background:var(--panel);
  }
  .monthly-summary-table.mobile-stack-table tbody tr[data-section-member] td:first-child{grid-column:1/-1;position:static}
  .monthly-summary-table.mobile-stack-table tbody tr[data-section-member] td{min-width:0;overflow-wrap:anywhere}
  .monthly-summary-table.mobile-stack-table tbody tr[data-section-member] td::before{min-width:0}

  .schedule-guide-row{gap:5px}
  .schedule-guide-chip{font-size:10.5px;padding:3px 6px}
  .schedule-guide-note{font-size:11px;line-height:1.4}
  .index-sticky-toolbar .page-sticky-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .index-sticky-toolbar .page-sticky-actions .btn{width:100%;min-width:0;min-height:40px;justify-content:center;padding:6px}
  .index-sticky-toolbar .schedule-filter-group{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
  .index-sticky-toolbar .schedule-filter-group .btn{min-width:0;padding-inline:5px;font-size:11px}
  .index-sticky-toolbar .legend{display:flex;flex-wrap:wrap;gap:5px 10px}
  .index-sticky-toolbar .legend-item{min-width:0;font-size:10.5px}
  .index-sticky-toolbar .schedule-mode-seg-wrap{flex-direction:column;align-items:stretch;gap:6px}
  .index-sticky-toolbar .schedule-mode-seg{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;width:100%}
  .index-sticky-toolbar .schedule-mode-seg .btn{width:100%;justify-content:center;min-height:34px;padding-inline:5px}
}

@media(max-width:420px){
  .index-sticky-toolbar .page-sticky-actions{grid-template-columns:1fr}
  .index-sticky-toolbar .page-sticky-actions .btn{min-height:38px}
}

html.nsp-mobile-device #scheduleMainTable.schedule-table-responsive.mobile-stack-table tbody tr[data-section-header] > td.schedule-section-sticky-cell{
  position:sticky;
  left:0;
  z-index:14;
  width:148px !important;
  min-width:148px !important;
  max-width:148px !important;
  background:var(--chrome) !important;
}
html.nsp-mobile-device #scheduleMainTable.schedule-table-responsive.mobile-stack-table tbody tr[data-section-header] .section-name-sticky{
  position:static;
  left:auto;
  display:inline-flex;
  align-items:center;
  min-height:28px;
  margin:0;
  padding:0;
  background:transparent;
  border:0;
  box-shadow:none;
  transform:none;
}
html.nsp-mobile-device #scheduleMainTable.schedule-table-responsive.mobile-stack-table tbody tr[data-staff-id] > td:first-child{
  position:sticky !important;
  left:0;
  z-index:12;
  width:148px;
  min-width:148px;
  max-width:148px;
  background:var(--chrome) !important;
}

@media(max-width:1024px){
  .request-staff-table.mobile-stack-table tr[data-section-header]{display:none !important}
}

/* Narrow desktop windows keep desktop tables; device mode is selected by UA class. */
@media(max-width:1024px){
  html:not(.nsp-mobile-device) .mobile-stack-table thead{display:table-header-group !important}
  html:not(.nsp-mobile-device) .mobile-stack-table tbody{display:table-row-group !important}
  html:not(.nsp-mobile-device) .mobile-stack-table tr,
  html:not(.nsp-mobile-device) .mobile-stack-table tr[data-section-header],
  html:not(.nsp-mobile-device) .mobile-stack-table tr[data-section-member],
  html:not(.nsp-mobile-device) .mobile-stack-table tr[data-staff-id]{
    display:table-row !important;
    position:static;
    width:auto;
    min-width:0;
    max-width:none;
    margin:0;
    padding:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    pointer-events:auto;
  }
  html:not(.nsp-mobile-device) .mobile-stack-table th,
  html:not(.nsp-mobile-device) .mobile-stack-table td,
  html:not(.nsp-mobile-device) .mobile-stack-table td.schedule-swap-cell{
    display:table-cell !important;
    position:static;
    width:auto;
    min-width:0;
    max-width:none;
    padding:7px 8px;
    border-radius:0;
    box-shadow:none;
    opacity:1;
    vertical-align:middle;
  }
  html:not(.nsp-mobile-device) .mobile-stack-table td::before,
  html:not(.nsp-mobile-device) .mobile-stack-table td.schedule-swap-cell::after{content:none !important;display:none !important}
  html:not(.nsp-mobile-device) .schedule-table-responsive.mobile-stack-table tbody tr[data-section-header] td{
    border:0;
    border-bottom:1px solid var(--schedule-line);
    background:var(--chrome);
    padding:7px 10px;
  }
  html:not(.nsp-mobile-device) .schedule-table-responsive.mobile-stack-table tbody tr[data-staff-id] > td:first-child,
  html:not(.nsp-mobile-device) .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="スタッフ"]{
    position:static;
    left:auto;
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
  }
  html:not(.nsp-mobile-device) .request-staff-table.mobile-stack-table tr[data-section-header]{display:table-row !important}
  html:not(.nsp-mobile-device) .request-staff-table.mobile-stack-table th:nth-child(2),
  html:not(.nsp-mobile-device) .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="提出"],
  html:not(.nsp-mobile-device) .request-staff-table.mobile-stack-table tr[data-section-member] > td[data-label="操作"]{
    position:static;
    left:auto;
    right:auto;
    z-index:auto;
    width:auto;
    min-width:0;
    max-width:none;
  }
  html:not(.nsp-mobile-device) .schedule-table-responsive.mobile-stack-table .work-count-cell{
    display:table-cell !important;
    width:56px !important;
    min-width:56px !important;
    max-width:56px !important;
    padding:6px 3px !important;
    background:var(--surface);
  }
  html:not(.nsp-mobile-device) .schedule-table-responsive.mobile-stack-table .work-count-label{display:none !important}
  html:not(.nsp-mobile-device) .schedule-table-responsive.mobile-stack-table .work-count-value{display:inline !important;padding:0;border:0;background:transparent}
  html:not(.nsp-mobile-device) .schedule-table-responsive.mobile-stack-table .cell-when,
  html:not(.nsp-mobile-device) .schedule-table-responsive.mobile-stack-table .cell-date-col,
  html:not(.nsp-mobile-device) .schedule-table-responsive.mobile-stack-table .cell-dow-col{display:none !important}
}

@media(max-width:768px){
  .theme-switcher-prefix{display:none}
}

/* ── Scrollbar ── */
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:var(--text3)}

/* 制約の人数不足と業務不足を日付ヘッダー／日別モーダルで並べて見せる */
.wr-date-stack{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:100%;
  gap:2px;
}
.need-dots{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:2px;
  width:100%;
  height:8px;
  margin:0;
  line-height:0;
}
.wr-date-num{
  display:block;
  width:100%;
  text-align:center;
  line-height:1.15;
  letter-spacing:0;
}
.need-dot,
span.need-dot,
i.need-dot{
  display:block;
  width:6px;
  height:6px;
  margin:0;
  padding:0;
  border:0;
  border-radius:1px;
  flex:0 0 auto;
  font-style:normal;
  font-size:0;
  line-height:0;
}
.need-dot-staffing{background:var(--accent)}
.need-dot-work{background:var(--accent2)}
.need-header-tip{
  position:fixed;
  z-index:4000;
  display:none;
  pointer-events:none;
  max-width:280px;
  padding:8px 10px;
  background:var(--surface);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:0 8px 22px rgba(0,0,0,.2);
  font-size:12px;
  font-weight:600;
  line-height:1.45;
  white-space:normal
}
.need-header-tip.show{display:block}
.need-header-tip .need-tip-h{
  font-weight:800;
  margin:6px 0 2px
}
.need-header-tip .need-tip-h:first-child{margin-top:0}
.need-header-tip .need-tip-row{font-weight:700}
.need-header-tip .need-tip-note{
  margin-top:6px;
  font-size:11px;
  font-weight:600;
  color:var(--text2);
  line-height:1.4
}
.day-need-hint{
  font-size:11px;
  color:var(--text2);
  line-height:1.45;
  margin:0 0 8px;
}
.day-need-empty{
  font-size:12px;
  color:var(--text3);
}
.day-need-group{
  padding:8px;
  border:1px solid color-mix(in srgb, var(--border) 72%, var(--accent) 28%);
  border-radius:8px;
  background:color-mix(in srgb, var(--surface2) 88%, var(--accent) 12%);
  margin-bottom:6px;
}
.day-need-group:last-child{margin-bottom:0}
.day-need-group-name{
  font-size:12px;
  font-weight:700;
  margin-bottom:6px;
}
.day-need-row{
  display:flex;
  gap:8px;
  align-items:flex-start;
  margin-bottom:5px;
}
.day-need-k{
  flex:0 0 2.2em;
  font-size:11px;
  font-weight:700;
  color:var(--text2);
  padding-top:3px;
}
.day-need-chips{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.day-need-chip{
  display:inline-flex;
  align-items:center;
  font-size:11px;
  font-weight:700;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--surface);
}
.day-need-chip.is-ok{
  border-color:color-mix(in srgb, var(--success) 50%, var(--border) 50%);
  background:color-mix(in srgb, var(--surface) 82%, var(--success) 18%);
  color:var(--text);
}
.day-need-chip.is-short{
  border-color:color-mix(in srgb, var(--accent) 62%, var(--border) 38%);
  background:color-mix(in srgb, var(--surface) 72%, var(--accent) 28%);
  color:var(--text);
}
.day-need-chip.is-short-work{
  border-color:color-mix(in srgb, var(--accent2) 62%, var(--border) 38%);
  background:color-mix(in srgb, var(--surface) 72%, var(--accent2) 28%);
  color:var(--text);
}
.day-need-note{
  font-size:11px;
  color:var(--text2);
  line-height:1.4;
  margin-top:4px;
}

/* ===== 予定表: ヘッダー行＋スタッフ列の両固定（縦横スクロール）＋スマホ表レイアウト修正 ===== */
/* 表を縦横スクロールの箱にする（縦スクロールで sticky ヘッダーを効かせる） */
.card:has(#scheduleMainTable) .table-wrap{
  /* 画面の高さ − ヘッダー − ツールバー に合わせ、ツールバーと表ヘッダーを同時に見えるようにする */
  max-height:calc(100vh - var(--page-sticky-top, 88px) - var(--sched-toolbar-h, 150px) - 28px);
  max-height:calc(100dvh - var(--page-sticky-top, 88px) - var(--sched-toolbar-h, 150px) - 28px);
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
/* PC: 高さ制限を外してページスクロールにする（内スクロールは横方向のみ＝機能は残す）
   表の上でもホイールがページへ伝わるよう overscroll の contain を解除する */
@media (min-width: 1025px){
  .card:has(#scheduleMainTable) .table-wrap{
    max-height:none;
    overscroll-behavior:auto;
    overscroll-behavior-x:contain;
    overscroll-behavior-y:auto;
  }
}
/* ヘッダー行の高さを確定（応援→人数不足→日付→曜日。行が無い場合は0で日付＝0px） */
#scheduleMainTable{--hdr-help-h:0px;--hdr-staffing-h:0px;--hdr-date-h:28px;--hdr-dow-h:22px}
#scheduleMainTable.has-need-rows{--hdr-help-h:20px;--hdr-staffing-h:16px}
#scheduleMainTable thead tr.wr-help-row{height:var(--hdr-help-h)}
#scheduleMainTable thead tr.wr-staffing-row{height:var(--hdr-staffing-h)}
#scheduleMainTable thead tr.wr-date-row{height:var(--hdr-date-h)}
#scheduleMainTable thead tr.cal-dow-row{height:var(--hdr-dow-h)}
#scheduleMainTable thead th.wr-date-header{padding:1px 0 2px !important}
/* 応援の行（日付の上の1行目）：縦固定 */
#scheduleMainTable thead tr.wr-help-row > th{
  position:sticky !important;
  top:0 !important;
  z-index:34;
}
/* 人数不足の行（日付の上の2行目）：応援の行の高さぶん下げて縦固定 */
#scheduleMainTable thead tr.wr-staffing-row > th{
  position:sticky !important;
  top:var(--hdr-help-h) !important;
  z-index:33;
}
/* 日付の行：応援＋人数不足の高さぶん下げて縦固定 */
#scheduleMainTable thead tr.wr-date-row > th{
  position:sticky !important;
  top:calc(var(--hdr-help-h) + var(--hdr-staffing-h)) !important;
  z-index:31;
}
/* 曜日の行：日付の行の高さぶんさらに下げて縦固定 */
#scheduleMainTable thead tr.cal-dow-row > th{
  position:sticky !important;
  top:calc(var(--hdr-help-h) + var(--hdr-staffing-h) + var(--hdr-date-h)) !important;
  z-index:30;
}
/* 左上の角（スタッフ見出し）：縦＋横固定で最前面 */
#scheduleMainTable thead th.wr-corner{
  left:0 !important;
  z-index:42 !important;
}
#scheduleMainTable thead tr.wr-help-row > th.wr-corner{
  left:0 !important;
  z-index:44 !important;
}
/* 本文のスタッフ列：横固定を維持 */
#scheduleMainTable tbody td:first-child{
  position:sticky !important;
  left:0 !important;
  z-index:20;
  background:var(--chrome);
}
#scheduleMainTable tbody tr[data-section-header] > td:first-child{
  position:sticky !important;
  left:0 !important;
  z-index:21;
  background:var(--chrome) !important;
}

@media(max-width:1024px){
  /* 予定表はスマホでも表レイアウトに統一し、縦積みカード用の枠・ラベル・grid を無効化する */
  .schedule-table-responsive.mobile-stack-table td.schedule-swap-cell{
    display:table-cell !important;
    background:var(--surface2) !important;
    text-align:center !important;
    padding:6px 2px !important;
    border:0 !important;
    border-right:1px solid var(--schedule-line) !important;
    border-bottom:1px solid var(--schedule-line) !important;
    box-shadow:none !important;
  }
  .schedule-table-responsive.mobile-stack-table td.schedule-swap-cell::before,
  .schedule-table-responsive.mobile-stack-table td.schedule-swap-cell::after{
    content:none !important;
    display:none !important;
  }
  .schedule-table-responsive.mobile-stack-table td.schedule-swap-cell .cell-when,
  .schedule-table-responsive.mobile-stack-table td.schedule-swap-cell .cell-date-col,
  .schedule-table-responsive.mobile-stack-table td.schedule-swap-cell .cell-dow-col{
    display:none !important;
  }
  .schedule-table-responsive.mobile-stack-table td.schedule-swap-cell .shift-swap-handle,
  .schedule-table-responsive.mobile-stack-table td.schedule-swap-cell .shift-cell-mark{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:auto !important;
    min-width:1.2em !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-sizing:border-box;
  }
}

/* 勤務対象外日（入社前/退職後/休職・長期休）のセル: 編集不可・薄表示 */
#scheduleMainTable td.day-cell-inactive{
  background:repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--border) 35%, transparent) 6px 7px);
  color:var(--muted);
  cursor:default !important;
}
#scheduleMainTable td.day-cell-inactive .shift-cell-mark,
#scheduleMainTable td.day-cell-inactive .shift-swap-handle{
  color:var(--muted) !important;
  border:0 !important;
  background:transparent !important;
}
