/* 講師アサイン（仮称）— 画面のスタイル。
   配色は 白・黒＋差し色1色。差し色は /api/config の accent を app.js が起動時に --accent へ入れる
   （文字色 --accent-ink は明るさで白／黒を選ぶ）。未充足の「赤枠」は差し色とは別の固定の赤（--red）。
   スマホ幅 375px が主。横スクロールを出さない（grid は minmax(0,1fr)・長い語は折り返す）。タップ領域は 44px 以上。
   外部フォント・外部CSSは使わない（端末のフォントだけ）。 */

:root {
  --bg: #ffffff;
  --ink: #111111;
  --ink-2: #3a3f47;
  --muted: #6b7280;
  --line: #e4e6ea;
  --line-2: #c9cdd4;
  --soft: #f5f6f8;
  --red: #d93025;
  --red-ink: #a1251b;
  --red-soft: #fdeceb;
  --warn-ink: #7a5000;
  --warn-soft: #fff6df;
  --warn-line: #efd28a;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: rgba(29, 78, 216, 0.10);
  --radius: 12px;
  --pad: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent;
}
body.sheet-open { overflow: hidden; }
body.has-bar .main { padding-bottom: 160px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.4; }
button:focus-visible, a:focus-visible, summary:focus-visible,
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.ico {
  width: 18px; height: 18px; flex: 0 0 auto; display: inline-block; vertical-align: -3px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.ico-sm { width: 15px; height: 15px; vertical-align: -2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.loading { padding: 28px var(--pad); color: var(--muted); text-align: center; margin: 0; }
.page-ttl { font-size: 18px; margin: 4px 0 10px; }

/* ---------- ブランド帯（2社のロゴ・スクロールで流れる） ----------
   ロゴの扱い: 色を変えない（filter・mix-blend-mode・色の上書きをしない）・縦横比を変えない（height だけ指定・width は auto）・
   切り出さない・影や枠を付けない・周りに余白をとる */
.brandband { background: var(--bg); border-bottom: 1px solid var(--line); }
.brandband-in {
  max-width: 720px; margin: 0 auto; min-height: 48px; padding: 4px var(--pad);
  display: flex; align-items: center; gap: 10px;
}
.logo { display: block; flex: 0 0 auto; width: auto; max-width: none; }
.brandband .logo-host { height: 38px; }
.brandband .logo-partner { height: 14px; }
.logo-x { flex: 0 0 auto; color: var(--muted); font-size: 13px; line-height: 1; }
.logo-name { font-weight: 700; font-size: 14px; }   /* ロゴの画像が無いときの文字 */
@media (min-width: 640px) {
  .brandband-in { min-height: 52px; }
  .brandband .logo-host { height: 40px; }
  .brandband .logo-partner { height: 15px; }
}

/* ---------- ヘッダー・タブ（まとめて上に貼り付く） ----------
   並びは index.html の「アプリ名（#hdr）→ タブ（#tabs）→ 利用者（#who）」。
   スマホ: 1段目に アプリ名 と 利用者、2段目にタブ（grid で並べ替え）。2段の間の線は、幅いっぱいに引くため
   .topbar の背景に 52px の位置で描く（.topbar-in は 720px に絞っているので、要素の枠線だと端まで届かない）。
   PC: 1行（アプリ名｜タブ｜利用者）。下の @media (min-width: 1024px) を参照 */
.topbar {
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--line), var(--line)) no-repeat 0 52px / 100% 1px, var(--bg);
}
.topbar-in {
  max-width: 720px; margin: 0 auto; display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, auto); justify-content: space-between; column-gap: 8px;
}
.hdr { grid-row: 1; grid-column: 1; min-width: 0; height: 52px; display: flex; align-items: center; padding-left: var(--pad); }
.who-box { grid-row: 1; grid-column: 2; min-width: 0; height: 52px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-right: 4px; }
.who-box:empty { display: none; }
.brand {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; flex: 0 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.brand .ico { color: var(--accent); width: 20px; height: 20px; }
.who { margin-left: auto; min-width: 0; flex: 0 1 auto; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.who-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-tag { flex: 0 0 auto; border: 1px solid var(--ink); border-radius: 999px; padding: 0 8px; font-size: 12px; line-height: 20px; white-space: nowrap; }
/* ヘッダーの名前と役割のバッジ（2026-09-30）: バッジ（「すみや管理者」など）は縮めない＝途中で切らない。縮むのは名前だけ。
   スマホで1行に入らないときは折り返して、名前の下にバッジ（名前も数文字は読める）。呼び名（partnerShort）が長すぎるときだけ 9em で …（全文は title） */
.who .role-tag { flex: 0 0 auto; max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.who-name { flex: 0 1 auto; min-width: 0; }
@media (max-width: 1023px) {
  .who { flex-wrap: wrap; justify-content: flex-end; align-content: center; row-gap: 2px; }
  .who-name { text-align: right; line-height: 1.25; }
}
.icon-btn {
  width: 44px; height: 44px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 10px; padding: 0;
}
.icon-btn:hover { background: var(--soft); }

.tabs { grid-row: 2; grid-column: 1 / -1; min-width: 0; padding-top: 1px; }   /* padding-top＝上の線（.topbar の背景）の分 */
.tabs:empty { display: none; }
.tabs-in { display: flex; }
.tab {
  flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 4px; border: 0; background: transparent;
  border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; white-space: nowrap;
}
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }

.main { max-width: 720px; margin: 0 auto; padding: 12px var(--pad) 48px; }

/* ---------- ボタン・部品 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 14px; border: 1px solid var(--ink); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.3;
  text-align: center; text-decoration: none;
}
.btn:hover { background: var(--soft); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(.95); }
.btn-big { width: 100%; min-height: 52px; font-size: 16px; font-weight: 700; }
.btn-quiet { width: 100%; border-color: var(--line-2); font-weight: 500; }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-sm { font-size: 13px; padding: 4px 12px; }
.btn-block { width: 100%; }

.seg { display: flex; border: 1px solid var(--ink); border-radius: 10px; overflow: hidden; }
.seg > button {
  flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 8px; border: 0; background: var(--bg);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px;
}
.seg > button + button { border-left: 1px solid var(--ink); }
.seg > button[aria-pressed="true"] { background: var(--ink); color: var(--bg); font-weight: 700; }

.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; line-height: 1;
}
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border: 1px solid var(--line-2);
  border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-2); line-height: 1; white-space: nowrap; vertical-align: 1px;
}
.st {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap;
}
.st-b-unfilled { border: 1.5px solid var(--red); color: var(--red); }
.st-b-filled { background: var(--accent); color: var(--accent-ink); }
/* 承認待ち（承認制）＝差し色の斜線の枠（P1-P3_仕様.md 7章） */
.st-b-pending, .mk-pending, .ck-pending {
  border: 1.5px solid var(--accent); color: var(--accent);
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 3px, var(--bg) 3px 6px);
}
.st-b-draft { border: 1.5px dotted var(--ink-2); color: var(--ink-2); }
.st-b-cancelled { border: 1px solid var(--muted); color: var(--muted); text-decoration: line-through; }
.ser {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border: 1px solid var(--line-2);
  border-radius: 999px; font-size: 12px; color: var(--ink-2); line-height: 1; white-space: nowrap;
}

.err-box {
  display: grid; gap: 10px; margin: 12px 0; padding: 12px; border: 1px solid #f3b9b3; border-radius: 10px;
  background: var(--red-soft); color: var(--red-ink);
}
.err-box p { margin: 0; }
.empty, .hint { color: var(--muted); font-size: 14px; margin: 14px 0; }
.empty-box { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 16px; text-align: center; }
.empty-box p { margin: 0 0 12px; color: var(--ink-2); }
.help { display: block; font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.info { background: var(--soft); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 0 0 14px; }
.warn-line { display: flex; gap: 6px; align-items: flex-start; color: var(--warn-ink); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 0 0 8px; }

/* ---------- カレンダー上部（未充足・地域・ツールバー・絞り込み・月送り） ---------- */
.unfilled {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 48px; margin: 0 0 10px; padding: 8px 12px;
  border: 1.5px solid var(--red); border-radius: 10px; background: var(--bg); color: var(--red); font-weight: 700; text-align: left;
}
.unfilled .grow { flex: 1 1 auto; min-width: 0; }
.unfilled-none { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 10px; color: var(--muted); font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.chip {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--bg); font-size: 14px; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 700; }

.toolbar { display: grid; gap: 8px; margin: 0 0 10px; }
.toolbar-row { display: flex; gap: 8px; }
.toolbar-row > .btn { flex: 1 1 0; min-width: 0; }

.filters {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; margin: 0 0 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft);
}
.filters .field { margin: 0; }
.filters .full { grid-column: 1 / -1; }

.mbar { display: flex; align-items: center; gap: 4px; margin: 2px 0 8px; }
.mbar .icon-btn { border: 1px solid var(--line-2); }
.mbar-ym { flex: 1 1 auto; min-width: 0; text-align: center; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 月グリッド（375px で1マス約49px・マスには日付と印だけ） ---------- */
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.grid-head { margin-bottom: 2px; }
.dow { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.dow.is-sun, .dow.is-sat { color: var(--ink-2); font-weight: 700; }   /* 赤は「未充足」専用にしておく（日曜を赤くしない） */
.cell {
  position: relative; min-width: 0; min-height: 58px; margin: 0; padding: 3px 3px 4px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); text-align: left;
}
.cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cell.is-void { background: var(--soft); border-color: transparent; }
.cell.is-past { background: #fafafb; }
.cell.is-past .cell-n { color: var(--muted); }
.cell.is-sel { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.cell-n {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  font-size: 12.5px; line-height: 1; font-variant-numeric: tabular-nums;
}
.cell.is-today .cell-n { background: var(--ink); color: var(--bg); font-weight: 700; }
.marks { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; max-width: 100%; }
.mk { position: relative; display: inline-block; flex: 0 0 auto; width: 11px; height: 7px; border-radius: 2px; }
.mk-unfilled { border: 1.5px solid var(--red); }
.mk-filled, .mk-mine { background: var(--accent); }
.mk-draft { border: 1.5px dotted var(--ink-2); }
.mk-cancelled { border: 1px solid var(--muted); }
.mk-cancelled::after {
  content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 1.5px; margin-top: -0.75px; background: var(--ink);
}
.mk-more { font-size: 10px; line-height: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mk-free {
  display: inline-block; flex: 0 0 auto; padding: 0 3px; border: 1.5px solid var(--accent); border-radius: 3px;
  color: var(--accent); font-size: 10px; font-weight: 700; font-style: normal; line-height: 12px; white-space: nowrap;
}
.mk-people {
  display: inline-block; flex: 0 0 auto; padding: 0 3px; border-radius: 3px; background: var(--accent); color: var(--accent-ink);
  font-size: 10px; font-weight: 700; font-style: normal; line-height: 13px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: 12px; color: var(--ink-2); }
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-note { width: 100%; color: var(--muted); }

/* ---------- その日の一覧・リスト表示 ---------- */
/* scroll-margin-top: 上に貼り付くヘッダー（52px）＋タブ（48px）の下に見出しが隠れないように */
.day-panel { margin-top: 14px; scroll-margin-top: 112px; }
.day-ttl, .list-day {
  display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 15px; font-weight: 700; scroll-margin-top: 112px;
}
.day-panel .day-ttl { margin-top: 0; }
.list-day:first-child { margin-top: 4px; }
.list-day.is-sel { text-decoration: underline; text-underline-offset: 4px; }

.rows { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.row {
  width: 100%; min-height: 56px; margin: 0; padding: 10px 8px 10px 12px; display: flex; align-items: flex-start; gap: 10px;
  border: 0; border-bottom: 1px solid var(--line); background: var(--bg); text-align: left; color: var(--ink);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--soft); }
div.row:hover { background: var(--bg); }   /* 窓口の行は読むだけ（押せない） */
.org-who { color: var(--ink); font-weight: 700; font-size: 14px; }
.row-time { flex: 0 0 48px; font-weight: 700; font-size: 14px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.row-time small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-ttl { font-weight: 700; line-height: 1.4; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.row-sub { display: flex; gap: 5px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.row-sub .ico { margin-top: 2px; color: var(--muted); }
.ico-chev { align-self: center; color: var(--muted); }
.row.st-unfilled { box-shadow: inset 3px 0 0 var(--red); }
.row.st-cancelled .row-ttl { text-decoration: line-through; color: var(--muted); }
.row.st-draft .row-ttl { color: var(--ink-2); }
.row.is-cur { background: var(--soft); cursor: default; opacity: 1; }
.row.is-cur .row-time::after { content: "（この回）"; display: block; font-size: 11px; font-weight: 400; color: var(--muted); }

.cards { display: grid; gap: 10px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--bg); min-width: 0; }

/* 講師のカード */
.icard.is-mine { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); padding-left: 16px; }
.icard.is-taken { background: var(--soft); color: var(--muted); }
.icard.is-cancelled { box-shadow: inset 4px 0 0 var(--muted); border-color: var(--line-2); }
.icard.is-cancelled .ic-ttl { text-decoration: line-through; color: var(--muted); }
.ic-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; }
.ic-time { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ic-ttl { margin: 4px 0 4px; font-size: 16px; font-weight: 700; }
.ic-line { display: flex; gap: 6px; align-items: flex-start; margin: 2px 0; font-size: 14px; }
.ic-line > .ico { margin-top: 3px; color: var(--muted); }
.maplink {
  display: inline-flex; align-items: center; gap: 2px; padding: 11px 6px; margin: -11px 0;
  color: var(--accent); font-weight: 600; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px;
}
.mine-badge { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--accent); font-size: 13px; }
.mine-badge.is-off { color: var(--muted); }
.taken-note { margin: 6px 0 0; font-weight: 700; color: var(--muted); }
.ic-actions { display: grid; gap: 8px; margin-top: 10px; }
.series-box { display: grid; gap: 6px; padding: 10px; border: 1px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); }
.series-days { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.series-days s { font-weight: 400; color: var(--muted); }
.series-note { margin: 0; font-size: 13px; color: var(--ink-2); }
.note-box { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--soft); font-size: 14px; white-space: pre-wrap; color: var(--ink); }
.note-lbl { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: normal; margin-bottom: 2px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* ボタンの文字は折り返さない（「Googleカレンダーに追／加」にしない・2026-09-30）。並べて入らなければボタンごと次の行へ（幅いっぱい） */
.links .btn { flex: 1 1 auto; white-space: nowrap; }
@media (max-width: 359px) { .links .btn { white-space: normal; } }   /* 320px 級では1つのボタンも入りきらないことがある＝はみ出させない */
.card-msg { margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.card-msg p { margin: 0; }
.card-msg ul { margin: 4px 0 0; padding-left: 18px; }
.msg-row { display: flex; gap: 6px; align-items: flex-start; }
.msg-row > .ico { margin-top: 3px; }
.msg-warn { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.msg-err { background: var(--red-soft); border: 1px solid #f3b9b3; color: var(--red-ink); }
.msg-taken { background: var(--red-soft); border: 1px solid #f3b9b3; color: var(--red-ink); }
.msg-sub { margin: 8px 0 6px !important; font-size: 13px; color: var(--ink-2); }
.others { display: grid; gap: 8px; }
.others .card { color: var(--ink); }
body.is-claiming [data-act="claim"], body.is-claiming [data-act="claim-series"] { pointer-events: none; opacity: .6; }

/* ---------- 自分の予定 ---------- */
details.past { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 8px; }
details.past > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--ink-2); }

/* ---------- 下書き ---------- */
.drafts-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.drow { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.drow:last-child { border-bottom: 0; }
.dchk { flex: 0 0 48px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.dchk input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.drow-main {
  flex: 1 1 auto; min-width: 0; min-height: 60px; padding: 10px 10px 10px 0; display: flex; align-items: center; gap: 8px;
  border: 0; background: transparent; text-align: left; color: var(--ink);
}
.drow-main:hover { background: var(--soft); }
.drow.is-past .row-ttl { color: var(--muted); }
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg); border-top: 1px solid var(--line);
  padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom));
}
.bar-in { max-width: 720px; margin: 0 auto; }
.bar-note { margin: 6px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- 講師（稼働） ---------- */
.wlist { display: grid; gap: 8px; }
.wrow { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wrow-main {
  width: 100%; min-height: 56px; padding: 10px 12px; display: grid; gap: 5px;
  border: 0; background: var(--bg); text-align: left; color: var(--ink);
}
.wrow-main:hover { background: var(--soft); }
.w-name { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.w-chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.wrow-main[aria-expanded="true"] .w-chev { transform: rotate(90deg); }
.w-bar { display: block; height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.w-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.w-line { font-size: 13px; }
.w-items { list-style: none; margin: 0; padding: 4px 12px 8px; border-top: 1px solid var(--line); font-size: 13px; }
.w-items li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.w-items li:last-child { border-bottom: 0; }

/* ---------- マスタ ---------- */
.m-head { margin: 18px 0 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); }

/* ---------- フォーム ---------- */
.field { display: block; margin: 0 0 14px; min-width: 0; }
.lbl { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.inp {
  display: block; width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; margin: 0;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); font-size: 16px;
}
.inp:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.inp:disabled { background: var(--soft); color: var(--ink-2); }
textarea.inp { min-height: 96px; resize: vertical; }
.mt-s { margin-top: 6px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.fs { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.fs > legend { padding: 0; }
.form-err {
  margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: var(--red-soft); color: var(--red-ink);
  border: 1px solid #f3b9b3; font-size: 14px;
}
.date-wrap { display: flex; align-items: center; gap: 8px; }
.date-wrap .inp { flex: 1 1 auto; }
.dow-hint { flex: 0 0 auto; font-size: 14px; color: var(--ink-2); min-width: 2.2em; }
.sdays { display: grid; gap: 6px; }
.sday { display: grid; grid-template-columns: 52px minmax(0, 1fr) 2.4em; align-items: center; gap: 8px; }
.sday-no { font-size: 13px; font-weight: 700; }

/* ---------- 詳細シート ---------- */
.d-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.d-ttl { margin: 8px 0 4px; font-size: 18px; }
.d-ttl.is-cancelled { text-decoration: line-through; color: var(--muted); }
.kv { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px 10px; margin: 12px 0; }
.kv dt { font-size: 13px; color: var(--muted); padding-top: 1px; }
.kv dd { margin: 0; min-width: 0; }
.pre { white-space: pre-wrap; }
.sec-ttl { margin: 18px 0 8px; font-size: 14px; font-weight: 700; }
.slot-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.slot-list li { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.slot-list li:last-child { border-bottom: 0; }
.slot-open { color: var(--red); font-weight: 700; }
.actions { display: grid; gap: 8px; }
.actions .help { margin: -2px 0 4px; }
.dup-row { display: flex; gap: 8px; }
.dup-row .inp { flex: 1 1 auto; }
.dup-row .btn { flex: 0 0 auto; }

/* ---------- ログイン ---------- */
.login { max-width: 460px; margin: 4px auto 12px; }
.login-logos { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 16px 8px 14px; }
.login-logos .logo-host { height: 92px; }
.login-logos .logo-partner { height: 24px; }
.login-logos .logo-x { font-size: 16px; }
.login-app { margin: 0; text-align: center; font-size: 22px; }
.login-lead { margin: 4px 0 18px; text-align: center; font-size: 14px; color: var(--ink-2); }
.login-note { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.login h2 { margin: 18px 0 8px; font-size: 14px; color: var(--ink-2); }
.login-list { display: grid; gap: 8px; }
.login-btn {
  width: 100%; min-height: 56px; padding: 0 14px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); text-align: left; font-size: 16px; font-weight: 600;
}
.login-btn:hover { border-color: var(--ink); }
.login-btn .role-tag { margin-left: auto; }
.login-name { min-width: 0; }
.login-foot { margin: 22px 0 0; text-align: center; font-size: 13px; }
.login-foot a { display: inline-block; padding: 12px 4px; color: var(--ink-2); text-underline-offset: 3px; }

/* ---------- シート（スマホは全画面・PC は中央に最大 560px） ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: none; }
.sheet.is-on { display: block; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); }
.sheet-panel { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); outline: none; }
.sheet-hd {
  display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 16px; border-bottom: 1px solid var(--line);
  padding-top: calc(4px + env(safe-area-inset-top));
}
.sheet-ttl { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 16px; }
.sheet-bd {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(28px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .sheet-panel {
    inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: calc(100% - 48px); max-width: 560px; max-height: 88vh; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  }
}

/* ---------- トースト（下部中央・アクション1つ・カウントダウン） ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60;
  width: max-content; max-width: calc(100% - 24px); min-height: 48px; padding: 6px 6px 6px 16px;
  display: flex; align-items: center; gap: 10px; border-radius: 12px; background: var(--ink); color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast:empty { display: none; }
body.has-bar .toast { bottom: calc(132px + env(safe-area-inset-bottom)); }
.toast-msg { font-size: 14px; padding: 6px 0; }
.toast-msg:last-child { padding-right: 10px; }
.toast-act {
  flex: 0 0 auto; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255, 255, 255, .55); border-radius: 8px; background: transparent; color: #fff; font-weight: 700; white-space: nowrap;
}
.toast-sec {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid #fff; font-size: 12px; font-variant-numeric: tabular-nums;
}

/* ---------- 選んだ回の枠（PC でチップ・行から選んだとき） ---------- */
.is-hl { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- チップ（PC の月グリッドのマス・凡例）の色。状態ごと＝スマホの印と同じ決まり ---------- */
.ck-unfilled { border: 1.5px solid var(--red); background: var(--bg); color: var(--red-ink); }
.ck-filled, .ck-mine, .ck-org { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.ck-draft { border: 1.5px dotted var(--ink-2); background: var(--bg); color: var(--ink-2); }
.ck-cancelled { border: 1px solid var(--line-2); background: var(--soft); color: var(--muted); text-decoration: line-through; }
.ck-free { border: 1.5px solid var(--accent); background: var(--bg); color: var(--accent); }

/* ---------- 表（PC の下書き・稼働・マスタ） ---------- */
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; background: var(--bg); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--soft);
  text-align: left; font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .num-l { font-variant-numeric: tabular-nums; }
.tbl .tc-nw { white-space: nowrap; }
.tbl .tg { text-align: center; border-left: 1px solid var(--line); }
.tbl .tg-l { border-left: 1px solid var(--line); }
.tbl .tc-go { width: 1%; white-space: nowrap; text-align: right; color: var(--muted); }
.tbl .tc-go .tag { margin-right: 6px; }
.tbl .tc-chk { width: 48px; padding: 0; }
.tbl .tc-chk .dchk { min-height: 44px; }
.tbl-click tbody tr[data-act] { cursor: pointer; }
.tbl-click tbody tr[data-act]:hover { background: var(--soft); }
.tbl-click tbody tr[data-act]:hover .ico-chev { color: var(--ink); }
.tbl tr.is-past td, .tbl tr.is-off td { color: var(--muted); }
.tlink {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; margin: -4px 0; padding: 0; border: 0; background: transparent;
  color: var(--ink); font-weight: 700; text-align: left;
}
.tlink:hover { text-decoration: underline; text-underline-offset: 3px; }
.tbl tr.is-past .tlink, .tbl tr.is-off .tlink { color: var(--ink-2); }
.tbl-work .tc-bar { width: 22%; min-width: 140px; }
.tbl-work .w-chev { color: var(--muted); }
.tbl-work .tlink[aria-expanded="true"] .w-chev { transform: rotate(90deg); }
.tbl-work tr.is-open td { background: var(--soft); }
.tbl-work tr.w-sub td { padding: 0 12px 4px 40px; background: var(--soft); }
.tbl-work tr.w-sub .w-items { border-top: 0; padding: 0 0 6px; }

/* =====================================================================
   P1〜P3（第2段階）の部品。スマホ幅が基準（PC の上書きは下の @media）
   ===================================================================== */

/* ヘッダーのメニュー（利用者名の右・下に開く） */
.who-box { position: relative; }
.menu {
  position: absolute; right: 4px; top: calc(100% + 4px); z-index: 40; min-width: 250px; max-width: calc(100vw - 16px);
  padding: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
}
.menu-item {
  width: 100%; min-height: 44px; padding: 0 10px; display: flex; align-items: center; gap: 10px;
  border: 0; border-radius: 8px; background: transparent; text-align: left; font-size: 14px; color: var(--ink);
}
.menu-item:hover, .menu-item[aria-current="page"] { background: var(--soft); }
.menu-item .ico { color: var(--ink-2); }

/* ログイン（メールのリンク・Google・開発用）・送信メール */
.login-mail { margin: 8px 0 4px; }
.login-mail .field { margin-bottom: 10px; }
/* 2026-09-28: Google を先頭に全員向け・メールのリンクは「Google を使えないとき」の予備（区切り線の下） */
.login-google > h2 { margin-top: 4px; }
.login-google > .help { margin: 0 0 10px; }
.login-alt { margin-top: 22px; padding-top: 6px; border-top: 1px solid var(--line); }
.login-alt > .help { margin: 0 0 10px; }
.login-err { margin: 0 0 12px; }
.ok-msg { color: var(--ink); font-weight: 700; }
.dev-box { margin-top: 26px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.ob-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 8px; }
.ob-head h2, .ob-head .page-ttl { margin: 0; }
.ob-list { display: grid; gap: 6px; }
.ob { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.ob > summary { min-height: 44px; padding: 8px 10px; display: grid; gap: 2px; cursor: pointer; list-style: none; }
.ob > summary::-webkit-details-marker { display: none; }
.ob[open] > summary { border-bottom: 1px solid var(--line); }
.ob-sub { font-weight: 700; font-size: 14px; }
.ob-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ob-body { margin: 0; padding: 10px 12px; white-space: pre-wrap; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.ob-body a { color: var(--accent); font-weight: 700; text-underline-offset: 2px; }
.ob-err { margin: 0 12px 10px; color: var(--red-ink); }
.tag-err { border-color: var(--red); color: var(--red-ink); }
.tag-warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn-ink); }
.tag-sup { border-color: var(--accent); color: var(--accent); }
.tag-pri { border-style: dashed; border-color: var(--accent); color: var(--accent); }
.tag-pend { margin-left: 6px; border-color: var(--accent); color: var(--accent); background: repeating-linear-gradient(135deg, var(--accent-soft) 0 3px, var(--bg) 3px 6px); }

/* 設定・登録の完了 */
.set-sec { margin: 0 0 22px; }
.set-sec > .sec-ttl, fieldset.set-sec > legend.sec-ttl { margin: 6px 0 8px; }
.copy-row { display: flex; gap: 8px; margin: 0 0 8px; }
.copy-row .inp { flex: 1 1 auto; min-width: 0; font-size: 14px; }
.copy-row .btn { flex: 0 0 auto; }
.line-box { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.line-box h3 { margin: 0 0 6px; }
.steps { margin: 0 0 8px; padding-left: 20px; font-size: 14px; }
.line-code { font-size: 15px; }
.line-code b { font-size: 22px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
/* AI（Claude Code・Codex）から使う鍵（P1-P3_仕様.md 21-2）: いま発行した鍵の箱・コマンドは折り返す（375px で横にはみ出さない） */
.key-new { margin: 0 0 16px; padding: 12px; border: 1.5px solid var(--accent); border-radius: 10px; background: var(--bg); }
.key-new .field { margin-bottom: 10px; }
.code-inp { font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; font-size: 13px; }
textarea.code.code-wrap { white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere; min-height: 0; field-sizing: content; max-height: 14em; }
.key-form { margin: 0 0 6px; }
.key-form-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 10px; }
.seg-wrap { flex-wrap: wrap; }
.seg-wrap > button { flex: 1 1 auto; }
.seg-wrap > button + button { border-left: 0; }
.seg-wrap > button:not(:first-child) { box-shadow: -1px 0 0 var(--ink); }
.is-bad .inp, .is-bad input { border-color: var(--red); outline: 2px solid var(--red); outline-offset: 0; }
.is-bad > .lbl, .is-bad > span { color: var(--red-ink); }

/* アプリの設定（P1-P3_仕様.md §22「何を変えるとどうなるか」）: いまの動き・項目のカード・選択肢の効果・オン／オフの2行・
   いまの値だと・既定に戻す・保存すると変わるところ。スマホ 375px で横にはみ出さない（長い文は折り返す・数字の欄は幅を決める） */
.set-now-box { margin: 0 0 18px; padding: 12px; border: 1.5px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
.set-now-box > .sec-ttl { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; }
.set-now-box > .help { margin-top: 8px; }
.set-sum { margin: 0; display: grid; gap: 8px; }
.set-sum > div { display: grid; gap: 1px; min-width: 0; }
.set-sum dt { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.set-sum dd { margin: 0; font-size: 14px; min-width: 0; }
.set-grp > .sec-ttl, .set-fold > summary { font-size: 15px; }
.set-grp > .sec-ttl { margin-bottom: 2px; }
.set-lead { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.set-item { display: block; min-width: 0; margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
/* fieldset の legend を枠の線の上に乗せない（カードの中の見出しにする） */
.set-item > legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; }
.set-item > legend + * { clear: both; }
.set-item.is-dirty { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.set-item.is-bad { border-color: var(--red); }
.set-hd { display: block; margin: 0 0 6px; }
.set-ttl { font-size: 14px; font-weight: 700; }
.set-sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.set-tag { margin-left: 2px; }
.tag-dirty { border-color: var(--accent); color: var(--accent); }
.is-bad .set-ttl { color: var(--red-ink); }
.set-opts { display: grid; gap: 6px; }
.set-opt {
  display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer; min-width: 0;
}
.set-opt input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.set-opt > span { display: grid; gap: 2px; min-width: 0; }
.set-opt-name { font-size: 14px; }
.set-eff { font-size: 13px; color: var(--ink-2); }
.set-opt.is-on { border-color: var(--accent); background: var(--accent-soft); }
.set-ck { align-items: flex-start; min-height: 32px; }
.set-ck input { margin-top: 1px; }
.set-ck .set-hd { margin: 0; }
.set-onoff { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.set-onoff li { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.set-onoff li.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.set-num, .set-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.set-num .inp { flex: 0 0 auto; width: 8em; }
.set-row .inp { flex: 1 1 auto; }
.set-unit { flex: 0 0 auto; font-size: 14px; color: var(--ink-2); }
.set-swatch { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line-2); }
.set-now { margin: 8px 0 0; font-size: 13px; }
.set-now-k { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; background: var(--soft); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.set-note { display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 0; padding: 6px 8px; border: 1px solid var(--warn-line); border-radius: 8px; background: var(--warn-soft); color: var(--warn-ink); font-size: 12.5px; }
.set-note .ico { margin-top: 2px; }
.set-item #orgWarnBox .warn-line { margin: 6px 0 0; }
.set-def { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); }
.set-fold > summary { min-height: 44px; margin: 6px 0 8px; display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.set-fold > summary::-webkit-details-marker { display: none; }
.set-fold-ico { transition: transform .15s; }
.set-fold[open] .set-fold-ico { transform: rotate(90deg); }
.set-diff { margin: 16px 0 10px; padding: 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--soft); }
.set-diff > .sec-ttl { margin: 0 0 6px; }
.set-diff-list { margin: 0; padding-left: 18px; font-size: 14px; }
.set-diff-list li + li { margin-top: 4px; }
.set-diff-none { margin: 0; font-size: 14px; color: var(--muted); }
.set-diff-bad { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; font-size: 13px; color: var(--red-ink); }
.set-diff-bad .ico { margin-top: 2px; flex: 0 0 auto; }
.is-bad .set-now { color: var(--red-ink); }
@media (min-width: 640px) {
  .set-sum > div { grid-template-columns: 9em minmax(0, 1fr); gap: 10px; }
  .set-sum dt { font-size: 13px; padding-top: 1px; }
}
.reg { max-width: 520px; }
.check a { color: var(--accent); }

/* admin: メールの送信元（Gmail）・接続切れの帯 */
.gm-alert {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 48px; margin: 0 0 12px; padding: 8px 12px;
  border: 1.5px solid var(--red); border-radius: 10px; background: var(--red-soft); color: var(--red-ink); font-weight: 700; text-align: left;
}
.gm-alert .grow { flex: 1 1 auto; min-width: 0; }
.gm-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.gm-card > .sec-ttl { margin-top: 0; display: flex; align-items: center; gap: 6px; }
.gm-state { margin: 0 0 8px; font-size: 14px; }
.gm-ok { color: var(--ink); }
.gm-bad { padding: 8px 10px; border: 1.5px solid var(--red); border-radius: 8px; background: var(--red-soft); color: var(--red-ink); font-weight: 700; }
.gm-btns { margin: 8px 0 6px; }

/* 講師: 依頼のお知らせ・◎×の入力 */
.req-banner {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 48px; margin: 0 0 10px; padding: 8px 12px;
  border: 1.5px solid var(--accent); border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-weight: 700; text-align: left;
}
.req-banner .grow { flex: 1 1 auto; min-width: 0; }
.btn-av { width: 100%; }
.btn-av[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.av-glyph { font-weight: 700; letter-spacing: .05em; }
.av-banner {
  display: flex; gap: 6px; align-items: flex-start; margin: 0 0 10px; padding: 8px 10px; border-radius: 8px;
  border: 1.5px dashed var(--ink); background: var(--soft); font-size: 13px;
}
.av { display: inline-block; font-weight: 700; line-height: 1; font-style: normal; }
.av-ok { color: var(--accent); }
.av-ng { color: var(--ink-2); }
.cell .av { position: absolute; top: 3px; right: 4px; font-size: 13px; }
.cell-top .av { position: static; font-size: 14px; margin-left: auto; }
.avn { display: inline-block; font-style: normal; font-size: 10px; font-weight: 700; line-height: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell > .avn { position: absolute; top: 4px; right: 3px; }
.cell-top .avn { margin-left: auto; font-size: 11.5px; }
.cell.is-av { border-style: dashed; border-color: var(--line-2); }
.cell.is-av:hover { border-color: var(--ink); }
.av-day { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--soft); font-size: 13px; }
.av-day p { margin: 2px 0; display: flex; gap: 6px; align-items: baseline; }
.legend .av, .legend .avn { min-width: 12px; text-align: center; }

/* 印・チップ: 手を挙げている回（破線）・サポート募集の印 */
.mk-raised { border: 1.5px dashed var(--accent); }
.ck-raised { border: 1.5px dashed var(--accent); background: var(--bg); color: var(--accent); }
.ck-sup {
  display: inline-block; margin-right: 3px; padding: 0 3px; border-radius: 3px; border: 1px solid currentColor;
  font-size: 10px; font-weight: 700; line-height: 13px; vertical-align: 1px;
}

/* 講師のカード: 承認待ち・手を挙げた・取消・運営への連絡 */
.icard.is-pending { border-color: var(--accent); border-style: dashed; box-shadow: inset 4px 0 0 var(--accent-soft); padding-left: 16px; }
.mine-badge.is-pending { color: var(--accent); }
.raised-note { margin: 0; font-size: 14px; font-weight: 700; color: var(--accent); }
.cancel-area { margin-top: 10px; display: grid; gap: 4px; justify-items: start; }
.contact-box { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--warn-line); background: var(--warn-soft); font-size: 14px; }
.contact-box p { margin: 0 0 6px; }
.contact-box .links { margin-top: 4px; }
.d-sum { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: var(--soft); font-size: 14px; }

/* 講師: 運営からの依頼 */
.req-sec { margin: 0 0 18px; }
.req-card { border-color: var(--accent); }
.req-from { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }

/* 窓口: 承認待ち */
.appr-sec { margin: 0 0 18px; padding: 12px; border: 1.5px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
.appr-sec > .sec-ttl { margin-top: 0; display: flex; align-items: center; gap: 6px; }
.appr-who { margin: 0 0 4px; font-size: 14px; display: flex; align-items: center; gap: 4px; }
.appr-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* 運営: 空き状況・依頼・担当の枠 */
.avail-box { margin: -4px 0 14px; }
.avail-box:empty { display: none; }
.avail-groups { display: grid; gap: 8px; }
.avail-g { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.avail-h { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.avail-h.av-ok { color: var(--accent); }
.avail-h.av-busy { color: var(--warn-ink); }
.avail-list { list-style: none; margin: 4px 0 0; padding: 0; }
.avail-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; padding: 4px 0; border-top: 1px dashed var(--line); }
.avail-list li:first-child { border-top: 0; }
.avail-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; font-size: 14px; }
.avail-btns { display: flex; gap: 6px; }
.avail-btns .btn { min-height: 36px; }
/* 枠の行: 役割｜名前（左寄せ・残りの幅）｜ボタン（右端） */
.slot-list li { align-items: center; flex-wrap: wrap; justify-content: flex-start; gap: 6px 10px; }
.slot-lbl { flex: 0 0 auto; min-width: 5.5em; color: var(--ink-2); font-size: 14px; }
.slot-who, .slot-list .slot-open { flex: 1 1 auto; min-width: 0; }
.slot-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.slot-list .btn-sm { min-height: 36px; }
.slot-list li.ask-li { display: block; background: var(--soft); }
.ask-panel .field { margin-bottom: 10px; }
.req-li .slot-who { justify-content: flex-start; text-align: left; }
.req-reason { flex-basis: 100%; color: var(--ink-2); }
.req-st { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-left: 6px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }
.req-pending { border-color: var(--accent); color: var(--accent); }
.req-accepted { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.req-declined, .req-expired, .req-cancelled { color: var(--muted); }
textarea.code { font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.5; white-space: pre; }
.pri-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; }

/* 講座の担当資格（担当しない／主講師も／サポートだけ） */
.lv-list { display: grid; gap: 4px; }
.lv-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 8px; min-height: 48px; border-bottom: 1px dashed var(--line); }
.lv-row:last-child { border-bottom: 0; }
.lv-name { font-size: 15px; }

/* 利用者の行のボタン */
.row-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.row.is-off .row-ttl { color: var(--muted); }
.tbl .row-btns { margin-top: 0; }

/* 協力会社の人の権限（P1-P3_仕様.md 20 章）: 一覧のチップ・利用者のフォームのひな形とチェック・承認できる人がいない警告 */
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag-perm { border-color: var(--accent); color: var(--accent); }
.tag-none { border-style: dashed; color: var(--muted); }
/* 送信の控えの「送信待ち」（queued＝Gmail へ1通ずつ送る順番待ち）。送らず記録（tag-none）・失敗（tag-err）と見分ける */
.tag-wait { border-color: var(--accent); color: var(--accent); }
.tbl .tc-role { min-width: 8em; }   /* 「管理者（FutureClock）」は折り返してよい（1024px で表が枠からはみ出さないように） */
.tbl .tc-role .perm-chips { margin-top: 3px; }
.perm-box { margin: 0 0 14px; padding: 12px 12px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.perm-box .fs { margin-bottom: 10px; }
.perm-presets { display: flex; flex-wrap: wrap; gap: 0 18px; }
.perm-radio { min-height: 44px; }
.perm-radio input { accent-color: var(--accent); }
.perm-check { align-items: flex-start; min-height: 0; padding: 6px 0; }
.perm-check input { margin-top: 3px; }
.perm-check > span { display: grid; gap: 1px; }
.warn-strong { border-width: 1.5px; font-size: 14px; margin-bottom: 12px; }
.warn-strong > .ico { margin-top: 3px; }
.org-add { max-width: 560px; }

/* 数字 */
.stat-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 0 0 16px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat-wide { grid-column: 1 / -1; }
.stat-alert { border-color: var(--red); }
.stat-lbl { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.stat-val { margin: 4px 0 0; font-size: 28px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-val small { margin-left: 2px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.stat-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.via-bars { display: grid; gap: 6px; margin-top: 8px; }
.via-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 32px; align-items: center; gap: 8px; font-size: 13px; }
.via-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* =====================================================================
   PC（幅 1024px 以上）。境目は app.js の WIDE_QUERY と同じ値にしておくこと（JS も幅で描き分ける）。
   スマホ（〜1023px）の見た目はこの上までで完結している＝ここは足すだけ
   ===================================================================== */
@media (min-width: 1024px) {
  :root {
    --page-w: 1280px;
    --side-w: clamp(300px, 28vw, 380px);   /* 右の列（選んだ日の一覧）の幅。1024px では狭めて月グリッドに幅を回す */
    --page-pad: 20px;
    --topbar-h: 53px;                /* 1行のヘッダー（52px＋線） */
    /* 右のパネル（開催回の詳細・フォーム）の幅＝右の列＋本文の外の余り＋8px（列の間 24px のうち）。
       左の月グリッドを隠さない。100vw はスクロールバーの幅（Windows で約 15px）を含むので、列の間の残り 16px がその分の逃げ。
       上限 640px（とても広い画面）で右の列が覗く分は、詳細を開いている間 .cal-side を隠して空白にする（下の body.sheet-side） */
    --panel-w: min(640px, calc(var(--side-w) + var(--page-pad) + 8px + max(0px, (100vw - var(--page-w)) / 2)));
  }

  /* ヘッダー・タブ・利用者を1行に（ロゴの帯はその上・スクロールで流れる） */
  .brandband-in { max-width: var(--page-w); padding: 4px var(--page-pad); }
  .topbar { background: var(--bg); }
  .topbar-in {
    max-width: var(--page-w); padding: 0 calc(var(--page-pad) - 8px);
    grid-template-columns: auto minmax(0, 1fr) minmax(0, auto); justify-content: stretch; column-gap: 24px;
  }
  .hdr { padding-left: 8px; max-width: 280px; }   /* アプリ名は設定で40字まで入る＝長ければ省略してタブの場所を残す */
  .who-box { max-width: 320px; }
  .tabs { grid-row: 1; grid-column: 2; padding-top: 0; min-width: 0; }
  /* タブが増えて入りきらないときは横に送る（利用者名に重ねない） */
  .tabs-in { height: 100%; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .tab { flex: 0 0 auto; min-height: 52px; padding: 0 16px; font-size: 14.5px; }
  .tab:hover { color: var(--ink); background: var(--soft); }
  .tab:focus-visible { outline-offset: -3px; }
  .who-box { grid-column: 3; }

  .main { max-width: var(--page-w); padding: 16px var(--page-pad) 56px; }
  .day-panel, .day-ttl, .list-day { scroll-margin-top: calc(var(--topbar-h) + 12px); }

  /* 上の1行: 左に未充足（運営）・地域（講師）・見出し（窓口）、右に表示の切り替えと「開催回」。運営はその下に絞り込みの行 */
  .cal-head { display: flex; align-items: center; gap: 12px 16px; margin: 0 0 12px; }
  .cal-head-l { flex: 1 1 auto; min-width: 0; }
  .cal-head-l > .unfilled, .cal-head-l > .unfilled-none, .cal-head-l > .chips { margin: 0; }
  .cal-head-l > .page-ttl { margin: 0 0 2px; }
  .cal-head-l > .help { margin: 0; }
  .unfilled { min-height: 44px; }
  .unfilled:hover { background: var(--red-soft); }
  .cal-tools-r { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
  .cal-tools-r .seg { width: 232px; }
  .cal-tools-r .seg > button { min-height: 42px; }
  .cal-tools-r .btn { min-height: 44px; }
  .cal-head .chip { min-height: 38px; }
  .seg > button:hover:not([aria-pressed="true"]) { background: var(--soft); }
  .chip:hover { border-color: var(--ink); }
  .filters-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin: 0 0 14px; padding: 10px 12px; }
  .filters-bar .field { flex: 1 1 150px; min-width: 130px; max-width: 260px; }
  .filters-bar .lbl { font-size: 12px; color: var(--ink-2); }
  .filters-bar .inp { min-height: 38px; padding: 6px 8px; font-size: 14px; }
  .filters-bar .check { min-height: 38px; flex: 0 0 auto; font-size: 14px; }
  .filters-bar .btn { flex: 0 0 auto; min-height: 38px; }
  .filters-bar > p { margin: 0; line-height: 38px; }

  /* 2段組: 左＝月グリッド／右＝選んだ日の一覧（sticky・中だけスクロール） */
  .cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 24px; align-items: start; }
  .cal-layout.is-list { display: block; max-width: 800px; }
  .cal-side {
    position: sticky; top: calc(var(--topbar-h) + 12px);
    max-height: calc(100vh - var(--topbar-h) - 24px); overflow-y: auto; overscroll-behavior: contain;
    padding: 2px 4px 12px 2px; scrollbar-gutter: stable;
  }
  .cal-side:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .cal-side .day-panel { margin-top: 0; }
  .side-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; min-height: 40px; }
  .side-hd .day-ttl { margin: 0; min-width: 0; }
  .side-hd .btn { flex: 0 0 auto; min-height: 36px; }
  .side-help { margin: 0 0 6px; }
  .cal-side .list-day { margin: 14px 0 6px; font-size: 14px; }
  .cal-side .hint { margin-top: 4px; }

  /* 月グリッド（PC は1マス 104px 以上・チップは3件まで） */
  .mbar { margin: 0 0 8px; }
  .mbar .icon-btn { width: 40px; height: 40px; }
  .mbar .icon-btn:hover { border-color: var(--ink); }
  .grid { gap: 4px; }
  .grid-head { margin-bottom: 4px; }
  .dow { font-size: 12.5px; }
  .cell-wide {
    min-height: 104px; padding: 4px; align-items: stretch; gap: 3px;
  }
  .cell-wide:hover { border-color: var(--line-2); background: var(--soft); }
  .cell-wide.is-past:hover { background: var(--soft); }
  .cell-wide.is-sel, .cell-wide.is-sel:hover { border-color: var(--ink); }
  .cell-hit {
    position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
    border: 0; border-radius: inherit; background: transparent;
  }
  .cell-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .cell-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 4px; pointer-events: none; }
  .cell-more { font-size: 11.5px; font-weight: 700; color: var(--ink-2); padding-right: 2px; font-variant-numeric: tabular-nums; }
  .cchips { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; pointer-events: none; }
  .cchip {
    display: block; width: 100%; min-width: 0; max-width: 100%; height: 20px; margin: 0; padding: 0 5px; border-radius: 4px;
    font-size: 12px; line-height: 17px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    pointer-events: auto;
  }
  .cchip b { font-weight: 700; font-variant-numeric: tabular-nums; }
  .cchip:hover { filter: brightness(.93); }
  .cchip.is-hl { outline: 2px solid var(--ink); outline-offset: 1px; }
  .legend { margin-top: 10px; }
  .lg-sw { display: inline-block; width: 22px; height: 12px; border-radius: 3px; }

  /* 一覧の行・カード */
  .row { min-height: 52px; }
  .pc-narrow { max-width: 800px; }   /* 講師の「自分の予定」: カードは1列で読みやすい幅に */
  .org-people { max-width: 1040px; }   /* 協力会社の人の「自社の講師」: 表に操作のボタンが3つ並ぶ分だけ広め */
  .btn-add { width: auto; min-width: 180px; }
  .cal-tools-r .btn-av { width: auto; }
  .req-banner, .appr-sec { max-width: 100%; }
  .appr-sec .cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-wide { grid-column: span 2; }
  .menu-item:focus-visible { outline-offset: -2px; }
  .main > .seg.mb { max-width: 360px; }   /* マスタの「講座｜施設」は画面の幅いっぱいにしない */

  /* 下書きの「公開する」バー: 右寄せで横に */
  .bar-in { max-width: var(--page-w); display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 0 calc(var(--page-pad) - 12px); }
  .bar-in .btn-big { width: auto; min-width: 340px; }
  .bar-note { order: -1; margin: 0; text-align: right; }
  body.has-bar .main { padding-bottom: 110px; }
  body.has-bar .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }

  /* シートは右のパネル（全高）。フォームは背景を薄く暗くし、開催回の詳細（is-side）は暗くせずカレンダーを触れるまま */
  .sheet-panel {
    inset: 0 0 0 auto; left: auto; top: 0; transform: none;
    width: var(--panel-w); max-width: 100%; max-height: none; border-radius: 0;
    border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(0, 0, 0, .12);
  }
  .sheet-bg { background: rgba(0, 0, 0, .22); }
  .sheet.is-side { pointer-events: none; }
  .sheet.is-side .sheet-bg { display: none; }
  .sheet.is-side .sheet-panel { pointer-events: auto; }
  body.sheet-open.sheet-side { overflow: visible; }
  body.sheet-side .cal-side { visibility: hidden; }   /* パネルの下で切れて覗く・押しても反応しない状態を作らない */
  .sheet-hd { padding-left: 20px; min-height: 56px; }
  .sheet-bd { padding: 16px 20px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .w-chev, .set-fold-ico { transition: none; }
}
