/*
 * =====================================================================
 *  app.css — AbbeyRoad.online v2 のデザイン
 * =====================================================================
 *  色はすべて「CSS 変数（--名前）」で管理している。
 *    :root                → ライト（白基調。標準）
 *    [data-theme="dark"]  → ダーク（右上のボタンで切り替え）
 *  色を変えたいときは、下の変数の値だけ変えれば全ページに反映される。
 *
 *  目次
 *    1. 色・フォントの変数
 *    2. 全体の基本
 *    3. ヘッダー・ナビ
 *    4. 文字・見出し
 *    5. 部品（カード・ボタン・タグ・入力欄…）
 *    6. ライブ一覧 / ライブ詳細 / メンバー
 *    7. フォーム・ログイン
 *    8. 取り込み（プレビューの色分けなど）
 *    9. スマホ対応
 * =====================================================================
 */

/* ===== 1. 色・フォントの変数 ===== */
:root {
  --ease-out: cubic-bezier(.2, .8, .2, 1);  /* 動きの共通イージング（出る・動くときはこれ）。時間は .15s（小）/ .2s（標準）/ .3s（大） */
  --bg: #f6f5f1;            /* ページの背景（真っ白より少し温かい白） */
  --surface: #ffffff;       /* カードの背景 */
  --surface-2: #f1efea;     /* 少し沈んだ面（表の見出し、チップなど） */
  --border: #e5e2da;
  --text: #1b1a1f;
  --muted: #6c6a75;         /* 補足の文字 */
  --accent: #d90f0f;        /* アクセント（ロゴの赤に合わせた） */
  --accent-2: #f39a3d;
  --accent-soft: rgba(217, 15, 15, .08);
  --headliner: #2563eb;     /* 青: トリの印 */
  --se: #3f6b8e;  --se-bg: rgba(63, 107, 142, .14); /* くすんだ青: SE ありの印（薄い地に青い文字） */
  --on-accent: #ffffff;
  --ok: #148a55;      --ok-bg: #e3f5ea;      /* 緑: DB に登録済み */
  --warn: #9a6a00;    --warn-bg: #fff3cf;    /* 黄: 似た人がいる */
  --danger: #c62f3e;  --danger-bg: #fde6e8;  /* 赤: 新しく登録される */
  /* 楽器の色 */
  --vo: #13915c; --gt: #c58a00; --ba: #7653d6; --dr: #d90f0f; --key: #d6338a; --vn: #e8590c; --sax: #9c7a2e; --prog: #1d6f96; --harm: #4a6b85; --cho: #6fa31a; --other: #6c6a75;
  /* 角丸（border-radius）: 値は直接書かず、必ずこの5段階から選ぶ。円形は 50% */
  --r-xs: 4px;     /* 小画像・小バッジ */
  --r-sm: 6px;     /* タグ・楽器ラベル・フォーカス枠 */
  --r-md: 10px;    /* 入力欄・ボタン類・メニュー・ポップアップ */
  --r-lg: 16px;    /* カード・モーダル */
  --r-full: 999px; /* ピル・タブ・チップ */
  /* 文字サイズ: 値は直接書かず、必ずこの8段階から選ぶ（アイコンの大きさは対象外） */
  --fs-2xs: 11px;  /* タグ・楽器ラベル・注記 */
  --fs-xs: 12px;   /* ピル・補足 */
  --fs-sm: 13px;   /* 小ボタン・チップ・メタ情報 */
  --fs-md: 15px;   /* 本文・入力欄・ボタン */
  --fs-lg: 16px;   /* 小見出し */
  --fs-xl: 18px;   /* バンド名・モーダル見出し */
  --fs-2xl: 22px;  /* 見出し */
  --fs-3xl: 28px;  /* 大見出し */
  /* ラベルの高さ（楽器ラベル・タグ・ピル・チップ・✓バッジ共通。末尾の「ラベルの規格」で使う） */
  --label-h-sm: 16px; --label-h: 20px; --label-h-lg: 24px;
  /* 動きの時間 */
  --t-fast: .15s;
  --t-base: .2s;
  --t-slow: .3s;
  /* 影（--shadow はカード用。ダークで値が変わる） */
  --shadow-sm: 0 1px 3px rgb(0 0 0 / .14);
  --shadow-pop: 0 8px 24px rgb(0 0 0 / .18);
  --shadow-modal: 0 24px 60px rgb(0 0 0 / .3);
  --ring: 0 0 0 3px var(--accent-soft);
  --shadow: 0 1px 2px rgba(20, 18, 30, .04), 0 6px 20px rgba(20, 18, 30, .05);
  --glow: radial-gradient(1100px 520px at 90% -12%, rgba(229, 67, 42, .08), transparent 60%);
  --font: "Inter", "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  color-scheme: light;      /* フォームの部品（日付選択など）もライト用にする */
}

[data-theme="dark"] {
  --bg: #0d0d11;
  --surface: #16161c;
  --surface-2: #1e1e26;
  --border: #2b2b36;
  --text: #f1f0f5;
  --muted: #9d9cad;
  --accent: #ff4d4d;
  --accent-2: #ffb347;
  --accent-soft: rgba(255, 77, 77, .14);
  --headliner: #60a5fa;
  --se: #8fb8d8;  --se-bg: rgba(106, 160, 200, .2);
  --ok: #49dc9a;      --ok-bg: rgba(73, 220, 154, .13);
  --warn: #ffcf5c;    --warn-bg: rgba(255, 207, 92, .14);
  --danger: #ff6b7d;  --danger-bg: rgba(255, 107, 125, .14);
  --vo: #3ddc97; --gt: #ffc857; --ba: #a78bfa; --dr: #ff6b6b; --key: #ff7eb6; --vn: #ff9f43; --sax: #d4b26a; --prog: #74c4e6; --harm: #9fbad0; --cho: #b5e655; --other: #9d9cad;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .3);
  --glow: radial-gradient(1100px 520px at 90% -12%, rgba(255, 92, 61, .16), transparent 60%);
  color-scheme: dark;
}

/* ===== 2. 全体の基本 ===== */
*, *::before, *::after { box-sizing: border-box; } /* width に padding と border を含める */
html { -webkit-text-size-adjust: 100%; }
/* スマホで押したとき・長押ししたときに出る水色の四角（タップハイライト）を消す */
html { -webkit-tap-highlight-color: transparent; }
/* 指の端末だけ: リンクやボタンを長押ししても文字が選択されて水色にならないようにし、iPhone のリンクのメニューも出さない
   （入力欄・本文の文字は今までどおり長押しで選択・コピーできる） */
@media (hover: none) {
  a, button, label, summary, select, [role="button"], .btn { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--glow), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: var(--fs-md)/1.65 var(--font);
  font-feature-settings: "palt"; /* 日本語の約物（、。「」）を詰める */
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--t-base) ease, color var(--t-base) ease;
  /* iPhone を横にしたとき、左右の切り欠き（カメラの所）に文字が隠れないようにする。
     viewport-fit=cover（partials/header.php）のときだけ値が入る。縦向き・PC では 0 */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 16px 96px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: var(--fs-xs); padding: 32px 16px; border-top: 1px solid var(--border); }

/* ===== 3. ヘッダー・ナビ ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;     /* スクロールしても上に残る */
  backdrop-filter: saturate(160%) blur(14px);  /* 後ろをすりガラス風にぼかす */
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar__inner { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; margin-right: auto; flex: none; }
.brand__logo { height: 34px; width: auto; display: block; transition: transform var(--t-base) ease; }
.brand:hover .brand__logo { transform: translateY(-1px) rotate(-1deg); }
.brand__logo--dark { display: none; }                         /* ダーク用は普段隠す */
[data-theme="dark"] .brand__logo--light { display: none; }
[data-theme="dark"] .brand__logo--dark { display: block; }
.nav { display: flex; gap: 4px; }
.nav__link { padding: 8px 14px; border-radius: var(--r-full); color: var(--muted); font-weight: 600; font-size: var(--fs-md); white-space: nowrap; }
.nav__link { transition: color var(--t-fast) ease, background-color var(--t-fast) ease, box-shadow var(--t-fast) ease; }
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.nav__link.is-active { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }

/* アイコン（Google Fonts の Material Symbols Rounded。HTML は lib/bootstrap.php の icon()、JS は iconEl()）
   大きさは周りの文字に合わせる（1.2em = 文字より少し大きめ）。vertical-align で文字の真ん中にそろえる */
.icon { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 1.2em; line-height: 1;
  display: inline-block; vertical-align: -.22em; letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr;
  -webkit-font-smoothing: antialiased; font-feature-settings: "liga"; user-select: none;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24; }
.icon--sm { font-size: 1em; }
.tab-icon { display: inline-block; font-size: .8em; font-weight: 800; letter-spacing: .04em; line-height: 1; flex: none; opacity: .75; } /* TAB 譜の印（lib/bootstrap.php の tab_icon） */
.tab-icon.is-fill { opacity: 1; }
.icon--fill { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.icon-btn .icon { font-size: 20px; vertical-align: 0; }
.dropzone__icon .icon { font-size: 30px; vertical-align: 0; }
.song-thumb__clear .icon, .song-card__delete .icon, .drag-handle .icon { vertical-align: 0; }

/* 丸いアイコンボタン（検索・テーマ切り替え） */
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.icon-btn { transition: color var(--t-fast) ease, border-color var(--t-fast) ease, background-color var(--t-fast) ease; }
.icon-btn:hover, .icon-btn.is-active { color: var(--accent); border-color: var(--accent); }
/* テーマ切り替え: ライトのときは月、ダークのときは太陽を出す */
[data-theme-toggle] .icon-sun { display: none; }
[data-theme="dark"] [data-theme-toggle] .icon-sun { display: block; }
[data-theme="dark"] [data-theme-toggle] .icon-moon { display: none; }

.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
/* メニューを開いている間は、検索ボタンの「今いるページ」と同じく赤く光らせる */
.usermenu[open] summary { color: var(--accent); border-color: var(--accent); }
.usermenu__panel { position: absolute; right: 0; top: 46px; min-width: 210px; padding: 8px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; gap: 2px; }
/* 開いたときのふわっと出る動きは app.js（setupSmallThings）。CSS の animation だと、<details> を閉じても
   中身は「描画を止める」だけで消えないブラウザがあり、2回目からは「もう終わった」まま動かないため */
.usermenu__panel { transform-origin: top right; }
.usermenu__panel a, .usermenu__panel .linkbtn { padding: 8px 10px; border-radius: var(--r-md); text-align: left; }
.usermenu__panel a:hover, .usermenu__panel .linkbtn:hover { background: var(--surface-2); color: var(--text); }
.usermenu__name { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; font-weight: 700; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
/* 管理者専用メニュー: ログアウトの下に、単色の背景で区切って一般メニューと見分けられるようにする */
.usermenu__admin { display: grid; gap: 2px; margin-top: 6px; padding: 6px; border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2); }
.usermenu__admin-label { padding: 2px 4px 4px; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.usermenu__panel .usermenu__admin a:hover { background: var(--surface); }
.linkbtn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; width: 100%; }

/* ===== 4. 文字・見出し ===== */
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
.display { font-size: clamp(32px, 7vw, 54px); font-weight: 900; letter-spacing: -.035em; line-height: 1.08; } /* clamp(最小, 画面幅に比例, 最大) */
.display--sm { font-size: clamp(26px, 5vw, 36px); margin-bottom: 20px; }
.eyebrow { margin: 0 0 8px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.meta-link { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.meta-link:hover { color: var(--accent); text-decoration-style: solid; }
.member-bio { margin: .5rem 0; white-space: pre-line; overflow-wrap: anywhere; }
.small { font-size: var(--fs-sm); }
.strong { font-weight: 700; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; } /* 数字の幅をそろえる */
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-title { font-size: var(--fs-lg); font-weight: 800; margin: 32px 0 12px; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin: 16px 0 28px; }
.hero .muted { margin: 12px 0 0; max-width: 600px; }
.stats { display: flex; gap: 8px; margin: 0; }
/* ページ上部の小さな数字（ライブ数・出演者数など）。主役は下の一覧なので控えめにしている。集計ページ（stats.php）では使っていない */
.stats div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px 12px; min-width: 64px; }
.stats dt { font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; letter-spacing: .06em; }
.stats dd { margin: 0; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); margin-top: 8px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 30px; } /* 指で押しやすい高さ（文字だけだと 20px くらいしかない） */

/* ===== 5. 部品 ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; } /* 幅に合わせて列数が自動で変わる */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: var(--r-full); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: 700 var(--fs-md)/1 var(--font); cursor: pointer;
  transition: transform var(--t-fast) ease, box-shadow var(--t-base) ease; white-space: nowrap;
}
.btn:hover { color: var(--text); transform: translateY(-1px); }
.btn--primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2))); border-color: transparent; color: var(--on-accent); box-shadow: 0 6px 18px -8px var(--accent); }
.btn--primary:hover { color: var(--on-accent); box-shadow: 0 10px 24px -8px var(--accent); }
.btn--ghost { background: transparent; }
/* 削除などの危険ボタン: 「枠と文字だけ赤」で統一。
   background: transparent を入れて、btn--ghost を付け忘れても同じ見た目になるようにした
   （付けないと .btn の背景 = var(--surface) が出て、背景色の上で白く浮いてしまう）。
   押した（hover）ときだけ下の行で赤く塗りつぶす。 */
.btn--danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn--danger:hover { color: #fff; background: var(--danger); }
.btn--sm { padding: 7px 12px; font-size: var(--fs-sm); }

/* 表の1セルの中の「入力欄 + ボタン」を横に並べるフォーム（venues.php の名前変更・統合） */
.row-form { display: flex; gap: 6px; align-items: center; }
/* form. を付けて強くする: 後ろにある「.table--edit input { min-width: 0 }」と強さが同じだと後ろが勝ち、
   スマホで表が狭くなると入力欄が 20px まで潰れて名前が見えなくなる（会場・係の管理） */
form.row-form input, form.row-form select { flex: 1; min-width: 10em; }
.row-form .btn { flex: none; white-space: nowrap; }
.row-form .input-short { flex: 0 0 6em; min-width: 0; } /* 楽器の略称（Tp など）は短いので狭くする */

/* ゴミ箱マークの削除ボタン（venues.php）。消せないときは disabled でグレーアウト */
.btn-trash { width: 32px; height: 32px; border-radius: var(--r-md); display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); background: transparent; color: var(--danger); }
.btn-trash .icon { font-size: 20px; }
/* 会場・係の並び替えの ↑↓（masters.php）。ゴミ箱と同じ大きさの四角 */
.move-btns { display: flex; gap: 4px; }
.btn-move { width: 32px; height: 32px; border-radius: var(--r-md); display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.btn-move .icon { font-size: 18px; }
.btn-move:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-move:disabled { opacity: .3; cursor: default; }
[id^="row-"] { scroll-margin-top: 140px; } /* ↑↓ のあと #row-ID に戻ったとき、上のヘッダーに隠れないように */
.btn-trash:hover:not(:disabled) { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-trash:disabled { color: var(--muted); border-color: var(--border); opacity: .5; cursor: not-allowed;
  pointer-events: none; /* マウスは外側の .tooltip に拾わせる */ }

/* 消せないゴミ箱を包む span。ポップアップ本体は app.js の setupTip（data-tip）が .album-tip として出す。
   以前は ::after（CSS だけのツールチップ）で出していたが、スマホで出たまま残り、フェードも効かなかったので共通のポップアップに統一した */
.tooltip { position: relative; display: inline-block; cursor: not-allowed; }
.btn--block { width: 100%; }
/* ライブページの YouTube ボタン: ボタンの背景・枠は付けずロゴだけ見せる（高さはほかのボタンとそろえる） */
.btn--youtube { background: none; border-color: transparent; padding: 5px 2px; }
.btn--youtube svg { display: block; width: 34px; height: 24px; } /* viewBox をロゴの形ぴったりに切ってあるので、高さいっぱいに大きく出る */
.btn[disabled] { opacity: .5; pointer-events: none; }

.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.pill:empty { display: none; }
.pill--warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill--ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.tag { display: inline-flex; padding: 2px 8px; border-radius: var(--r-sm); font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .04em;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); white-space: nowrap; }
.tag--accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
/* 「出演」: 見ている人が出たバンド。is-mine の赤枠と同じアクセントの赤にそろえる */
.tag--mine { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
/* 「予定」: まだ来ていないライブ（upcoming_tag()）。出演タグと同じ形で、青（トリの線と同じ色）にして見分ける */
.tag--plan { color: var(--headliner); border-color: color-mix(in srgb, var(--headliner) 40%, transparent); background: color-mix(in srgb, var(--headliner) 10%, transparent); }
.tag--tori { font-size: var(--fs-md); line-height: 1; padding: 2px 6px; } /* トリの🐔は大きめに */
.tag--flag { padding: 0 2px; background: none; border: 0; color: var(--warn); text-decoration: none; } /* 楽器の確認待ちの旗（live.php） */
.tag--flag .icon { font-size: 18px; vertical-align: 0; }

.flash { padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 12px; font-weight: 600; font-size: var(--fs-md); border: 1px solid transparent; }
.flash--success { background: var(--ok-bg); color: var(--ok); }
.flash--error { background: var(--danger-bg); color: var(--danger); }
.flash--warn { background: var(--warn-bg); color: var(--warn); }
.flash--info { background: var(--surface-2); color: var(--muted); }
/* お知らせのポップアップ（トースト）: ヘッダー（高さ60px）のすぐ下に固定。どこまでスクロールしていても見える
   入れ物は透明 + pointer-events: none なので、下にあるボタンなどのクリックを邪魔しない */
.toasts { position: fixed; top: 68px; left: 0; right: 0; z-index: 40; /* ヘッダー(20)・スマホの下ナビ(30)より手前 */
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast { margin: 0; max-width: min(560px, 100%); pointer-events: auto; cursor: pointer; box-shadow: var(--shadow);
  animation: toast-in var(--t-base) ease-out; transition: opacity var(--t-slow) ease, transform var(--t-slow) ease; }
.toast.is-leaving { opacity: 0; transform: translateY(-8px); }
/* .flash--info の背景（--surface-2）は薄いので、浮かせたときに背景と混ざらないよう枠線を付ける */
.toast.flash--info { border-color: var(--border); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
/* 初回のチュートリアルが自動で開いている間はお知らせを隠す（閉じると data-tutorial-auto が外れて出てくる。JS: setupToasts） */
body:has([data-tutorial-auto]) .toasts { display: none; }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; transition: none; } }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; align-items: center; }
.toolbar .search { min-width: 12em; } /* 狭い画面ではボタンが次の行に回る */
/* 年度スロットがあるツールバー（ライブ一覧・メンバーの出演履歴）: [年度スロット][検索欄 …… 残りの幅いっぱい] */
.toolbar:has(.year-slot) .search { flex: 1 1 10em; min-width: 0; }
/* 並び替えボタンを、一番上の年度の見出しの右端に重ねる。
   見出しは並び替え・年度スロットで入れ替わるが、いつも一覧の一番上にあるので、一覧の右上に置けば必ずその横に来る。
   上の端どうしでそろえると、見出しより背の高いボタンの方が真ん中が下に来る → 真ん中どうしでそろえる:
   top に「見出しの高さの半分」を入れ、translate で自分の高さの半分だけ上げる。
   transform を使わないのは、.btn:hover の transform（1px 浮く）に上書きされて、マウスを乗せるとずれるから。
   translate と transform は別の設定なので、両方かかる（足し算になる） */
.sorted-list { position: relative; }
.sorted-list__btn { position: absolute; right: 0; z-index: 1; translate: 0 -50%; }
.sorted-list--history .sorted-list__btn { top: 11.25px; } /* 出演履歴の見出し: 18px × 行の高さ 1.25 = 22.5px の半分 */
.inst-filter { position: absolute; right: 100px; top: 11.25px; translate: 0 -50%; z-index: 2; }
.inst-filter__btn { height: 32px; } /* 中身（漏斗・楽器ラベル・🐔）で高さが変わらないよう固定 */
.inst-filter__btn .part { margin: 0; }
.th-inst { display: inline-flex; align-items: center; gap: 4px; }
.th-inst .inst-filter { position: static; translate: none; display: inline-flex; align-items: center; height: 0; } /* 高さ 0 で、ボタンがあっても見出しの文字の高さが他と揃う */
.th-inst .inst-filter__btn { padding: 0 4px; min-height: 0; height: 24px; }
.inst-filter__menu { position: fixed; z-index: 50; display: grid; grid-template-columns: repeat(var(--cols, 4), auto); justify-items: center; align-items: center; gap: 4px;
  padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-pop);
  transform-origin: top left; animation: inst-menu-in var(--t-fast) ease-out; }
.inst-filter__menu[hidden] { display: none; }
.inst-filter__group { display: contents; } /* 楽器ごとに1行（単体・兼任・All）。中のボタンは .inst-filter__menu の列に並ぶ */
.inst-filter__group > * { grid-row: var(--row); } /* 楽器ごとに決まった行に置く */
.inst-filter__group > :first-child { grid-column: 1; }
.inst-filter__group.is-no-solo > :first-child { grid-column: 2; }
.inst-filter__group > [data-inst]:last-child:not(:first-child):has(.part--all) { grid-column: -2; } /* All は右端の列 */
.inst-filter__group.is-no-solo > :only-child { grid-column: -2; } /* All だけの行（単体も兼任もない Vo など）も右端 */
.part.part--all { min-width: 0; width: 51px; padding-inline: 0; letter-spacing: -.04em; } /* Key/Cho（.part--split）と同じくらいの幅 */
@keyframes inst-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .inst-filter__menu { animation: none; } }
.inst-filter__menu button { background: none; border: 0; padding: 2px; cursor: pointer; }
.inst-filter__menu .tori-badge { font-size: var(--fs-md); } /* 🐔と解除はラベルより小さく見えるので少し大きく */
.inst-filter__menu [data-inst=""] .icon { font-size: 20px; vertical-align: 0; }
.sorted-list--live .sorted-list__btn { top: 17.5px; }     /* ライブ一覧の見出し: 高さ 35px の半分 */

/* 年度スロット（ライブ一覧）: 真ん中の1段（26px）が選択中。上下に12pxずつ前後の年度の文字が半分ほど覗いて「回せる」とわかる */
.year-slot { position: relative; flex: none; width: 6.6em; height: 52px; overflow: hidden;
  border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface);
  cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
.year-slot:focus-visible, .year-slot.is-filtered { border-color: var(--accent); }
.year-slot.is-filtered { box-shadow: var(--ring); }
.year-slot__reel { position: relative; transition: transform var(--t-slow) cubic-bezier(.2, 1.4, .4, 1); will-change: transform; }
.year-slot__reel.is-dragging { transition: none; }
.year-slot__item { height: 26px; display: flex; align-items: center; justify-content: center; gap: 2px;
  font: 600 var(--fs-2xl)/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--muted);
  opacity: .3; transition: opacity var(--t-base), color var(--t-base); }
.year-slot__item small { font-size: var(--fs-2xs); font-weight: 500; }
/* 前後の段は同じ大きさのまま薄くするだけ。選択中だけ濃くする */
.year-slot__item.is-current { color: var(--text); opacity: 1; }
.year-slot.is-filtered .year-slot__item.is-current { color: var(--accent); }
/* 学年スロット（メンバー一覧の「学年別」）: 「OB2'21」が入る幅。隠した行は名前検索の hidden とは別のクラスで消す */
:root { --grade-slot-w: 5.8em; --grade-slot-h: 44px; } /* 学年スロットの大きさ（.grade-slot-wrap が広がる大きさと同じ） */
.year-slot--grade { width: var(--grade-slot-w); height: var(--grade-slot-h); } /* ライブ一覧の年度スロットより少し小さく */
.year-slot--grade .year-slot__item { height: 22px; font-size: var(--fs-md); }
.year-slot--fy .year-slot__item { font-size: var(--fs-xl); } /* 集計の単年度: 「'26」だけなので大きめ */
/* 集計の年度スロット: 幅を詰める。▼（左 6px・幅 8px）の左右と、字の左右の余白をそれぞれ同じにする */
.year-slot--fy { width: 66px; }
.year-slot--fy::before { left: 6px; width: 8px; text-align: center; }
.year-slot--fy .year-slot__item { padding: 0 4px 0 20px; } /* 右だけ 4px 多めに空ける */
.year-slot::before { content: '▼'; position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  font-size: 8px; color: var(--muted); pointer-events: none; z-index: 1; }
.year-slot__item { padding-left: 14px; }
.year-slot__full { display: none; }
.year-slot--live { width: 6.4em; } /* ライブ一覧: 高さは検索バーに合わせる（app.js） */
.year-slot--live .year-slot__item { font-size: var(--fs-2xl); }
.year-slot--live .year-slot__item[data-value=""] { font-size: var(--fs-xl); } /* 「すべて」は小さめ */
.slot-menu { position: fixed; z-index: 1000; overflow-y: auto; overscroll-behavior: contain; padding: 6px;
  display: flex; flex-direction: column; gap: 2px; max-height: min(60vh, 340px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); animation: slot-menu-in var(--t-fast) ease-out; }
@keyframes slot-menu-in { from { opacity: 0; transform: translateY(-4px); } }
/* 1行ずつ大きめ・中央揃え。選択中はアクセント色の淡い背景＋太字、指を乗せた行は薄いグレー */
.slot-menu__item { all: unset; box-sizing: border-box; min-height: 40px; padding: 0 20px; border-radius: var(--r-md); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font: 600 var(--fs-lg)/1 var(--font); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.slot-menu__item:hover, .slot-menu__item:focus-visible { background: color-mix(in srgb, var(--text) 7%, transparent); }
.slot-menu__item.is-current { background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.member-row.is-grade-hidden { display: none; }
input, select, textarea { font: inherit; color: inherit; }
/* プルダウンの中身（option）は背景が透明のままだと、Windows の Chrome などで「白い背景に白い文字」になり
   ダークモードで読めなくなる。文字色と背景色を両方テーマの色で指定しておく */
option, optgroup { background-color: var(--surface); color: var(--text); }
.search, .field input, .field select, .field textarea, .member-row-edit input, .member-row-edit select, .table--edit input, .table--edit select {
  width: 100%; padding: 10px 13px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: var(--fs-md); min-width: 0;
}
.search { flex: 1; padding-left: 38px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a8894' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 14px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

.empty { text-align: center; padding: 48px 20px; display: grid; gap: 12px; justify-items: center; }
.empty__title { font-size: var(--fs-xl); font-weight: 800; margin: 0; }
.empty .muted { margin: 0; }

/* ===== 6-1. ライブ一覧 ===== */
.year { margin-bottom: 36px; }
.year__title { font-size: var(--fs-3xl); font-weight: 900; letter-spacing: -.03em; margin-bottom: 14px; display: flex; align-items: baseline; gap: 4px; }
.year__title small { font-size: var(--fs-md); color: var(--muted); font-weight: 700; }
.live-card { position: relative; display: flex; flex-direction: column; gap: 14px; transition: transform var(--t-base) ease, border-color var(--t-base) ease; }
/* ライブ名のリンクをカード全体に広げる（カードのどこを押してもライブページへ） */
.live-card__link { color: inherit; }
.live-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.live-card__link:focus-visible { outline: none; }
.live-card:has(.live-card__link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* YouTube ロゴ（ライブにプレイリストがあるときだけ）。全面リンクより上に出して、こっちを押せば YouTube へ */
.live-card__yt { position: relative; z-index: 1; display: inline-flex; align-items: center; line-height: 0; margin-left: 6px; }
.live-card__yt svg { width: 23px; height: 16px; }
.live-card__yt:hover svg { opacity: .8; }
.live-card__venue, .live-card__date { position: relative; z-index: 1; color: inherit; }
.live-card__venue:hover, .live-card__date:hover { color: var(--accent); }
.live-card__date.day-no:hover { text-decoration: underline; }
.live-card:hover { color: inherit; transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.live-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.live-card__head h3 { font-size: var(--fs-xl); font-weight: 800; }
.live-card__title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; } /* ライブ名と「予定」を上下中央でそろえる（長い名前ならタグは次の行へ） */
.live-card__days { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); }
.live-card__days li { display: grid; grid-template-columns: 5.5em auto minmax(0, 1fr) auto; gap: 10px; align-items: center; white-space: nowrap; }
/* 名簿・タイムテーブル未登録のアイコン（index.php）。カード全体のリンク（::after）より上に出して、title のポップアップを出せるようにする */
.day-missing { position: relative; z-index: 1; display: inline-flex; gap: 2px; color: var(--warn); line-height: 0; }
.day-missing .icon { font-size: 16px; }
/* セットリストが全部入っている日程の ✓。ライブ詳細のバッジ（.setlist-badge）と同じ緑の丸で、文字なしのアイコンだけ */
.day-missing .setlist-badge--icon { padding: 3px; cursor: default; line-height: 1; }
.day-no { font-weight: 800; font-size: var(--fs-xs); color: var(--accent); }
.live-card__foot { margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--muted); display: flex; align-items: center; gap: 4px; }
.live-card__foot strong { color: var(--text); font-size: var(--fs-lg); }
.arrow { margin-left: auto; transition: transform var(--t-base) ease; }
.live-card:hover .arrow { transform: translateX(4px); color: var(--accent); }

/* ===== 6-2. ライブ詳細 ===== */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 18px; padding: 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-full); width: max-content; max-width: 100%; position: sticky; top: 70px; z-index: 5; box-shadow: var(--shadow); }
.tab { padding: 8px 16px; border-radius: var(--r-full); font-weight: 800; font-size: var(--fs-sm); color: var(--muted); display: flex; gap: 8px; align-items: baseline; white-space: nowrap; }
.tab small { font-weight: 500; }
.tab.is-active, .tab.is-active:hover { background: var(--accent); color: var(--on-accent); }
/* ライブ詳細の日程タブは押しやすいよう大きめに */
.tabs--days { gap: 6px; padding: 6px; }
.tabs--days .tab { padding: 12px 24px; font-size: var(--fs-lg); }
.tabs--days .tab small { font-size: var(--fs-sm); }
/* 日程を切り替えたとき、表示された日程をふわっと出す（hidden が外れて表示されるたびにアニメーションが最初から動く） */
.day:not([hidden]) { animation: day-fade var(--t-base) ease; }
@keyframes day-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .day:not([hidden]) { animation: none; } }

.day__info { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; margin-bottom: 18px; }
/* 日付と「予定」タグを上下中央でそろえる */
.day__date { display: flex; align-items: center; gap: 10px; }
.day__info h2 { font-size: var(--fs-2xl); font-weight: 900; font-variant-numeric: tabular-nums; min-width: 6.5em; } /* 「1/5（月）」でも「12/31（水）」でも幅を固定して、右の会場などがずれないようにする */
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.facts dt { font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; letter-spacing: .06em; }
.facts dd { margin: 0; font-weight: 700; }
.day-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tt-form { display: grid; gap: 16px; margin-top: 16px; }
/* タイムテーブル編集の表（名簿と同じ .table--roster の見た目。1セル1人で横に並ぶ）。≡ と「順」の列は細いまま */
.table--tt td:nth-child(2) { min-width: 0; }
.table--tt td[data-time] { min-width: 0; }
/* 楽器はボタン風の部品（JS: setupSelectPick）になるので、その高さに合わせて畳む量も変える */
.table--tt { --inst-shift: 17px; }
.table--tt .cell-instrument { height: 30px; }
/* 休憩の行: バンドの行と見分けが付くように、背景を薄く塗って点線で区切る */
.table--tt tr.tt-break td { background: var(--surface-2); border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); }
.table--tt tr.tt-break .icon { font-size: 18px; vertical-align: middle; }
.table--tt tr .drag-handle .icon { font-size: 1.2em; vertical-align: 0; } /* ≡ は休憩の行もバンドの行と同じ大きさ */
.tt-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
/* 追随のトグル（「開始」の見出しの中の小さいアイコンボタン）。ON は色付き、OFF（aria-pressed="false"）は薄く */
.tt-follow { display: inline-flex; align-items: center; margin-left: 4px; padding: 2px; border: 0; border-radius: var(--r-sm); background: none; color: var(--accent); cursor: pointer; vertical-align: middle; }
.tt-follow .icon { font-size: 16px; }
.tt-follow[aria-pressed="false"] { color: var(--muted); opacity: .45; }
.tt-follow:hover { background: var(--accent-soft); opacity: 1; }
/* 時刻のエラー（重なり・終了が開始以前）の入力欄。変えただけでは色を付けない（追随で全行が動くので、全部が塗られてしまう） */
.table--tt input.is-error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.slot { display: grid; grid-template-columns: 60px 1fr; gap: 12px; }
/* 左の時刻（開始 / 終了）。時刻が無いバンドは出演順の番号を出す */
.slot__time { font: 700 var(--fs-xs)/1.2 var(--font); font-variant-numeric: tabular-nums; padding-top: 12px; text-align: right; display: grid; gap: 2px; align-content: start;
  justify-self: end; } /* 列の幅ではなく中身（時刻）の幅にする → 番号の下の線が時刻の幅になる（線は margin-left: -4px で少しはみ出す） */
.slot__time span { color: var(--muted); font-weight: 500; font-size: var(--fs-2xs); }
/* 出演順の番号（時刻の上）。時刻が有っても無くても同じ大きさ。時刻はその下に小さく */
.slot__time .slot__no { font-size: var(--fs-md); font-weight: 800; color: inherit; }
/* 番号と時刻のあいだに線（時刻があるときだけ。番号だけのバンドは線なし） */
.slot__time .slot__no:not(:only-child) { margin-left: -4px; padding-bottom: 1px; margin-bottom: 7px; border-bottom: 1px solid var(--border); }
.slot--break .slot__time { padding-top: 6px; opacity: .7; }
.slot--break .slot__body { background: transparent; border-style: dashed; padding: 8px 18px; box-shadow: none; }
.break-label { font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .2em; color: var(--muted); }
.slot__body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; min-width: 0; box-shadow: var(--shadow); }
/* バンド名をなるべく1行に: 左（.slot__title = 名前 + タグ）と右（❤）の2つに分ける。
   名前が長いときはタグ（トリ・出演・YouTube）のほうを次の行へ回して、名前には ❤ 以外の横幅を全部使わせる */
.slot__head { display: flex; align-items: center; gap: 8px; }
.slot__title { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.slot__like { flex: none; }
.slot__name { font-size: var(--fs-xl); font-weight: 800; overflow-wrap: anywhere; min-width: 0; line-height: 1.3; }
.slot__name a { color: inherit; text-decoration: none; }  /* バンド名 → バンド詳細（band.php） */
.slot__name a:hover { color: var(--accent); text-decoration: underline; }
/* タイムテーブルの YouTube ロゴ（band.youtube_url があるときだけ）。バンド名・トリ🐔・出演のタグのすぐ右
   すき間は .slot__head の gap 10px + 8px = 18px */
.slot__yt { display: inline-flex; align-items: center; line-height: 0; margin-left: 8px; }
.slot__yt svg { width: 23px; height: 16px; }
.slot__yt:hover svg { opacity: .8; }
/* コメントアイコン: 自前 SVG の吹き出し（lib/repository.php の comment_bubble_svg）の真ん中に件数を重ねる。
   コメントが付いたバンドだけ出る（lib/repository.php の comment_badge）。ライブ詳細の行とメンバーページの出演履歴で共通。
   重ねかた: 親を position: relative にして、数字は position: absolute で中央へ（アイコンと数字を同じ箱に入れて座標を共有する）。
   吹き出しのしっぽ（下）の分だけ、数字は少し上に置くと「本体の真ん中」に見える。
   位置は「％ ＋ translateY(-50%)」ではなく整数 px の固定位置にしている。
   理由: 桁数で文字の大きさ（9px / 7.5px）が変わると、％と半分ずらしの計算が小数になり、端末の丸め方で桁ごとに
   0.5px ほど上下がずれて見える（「桁が少ないほど上に寄る」）。行の高さを 9px に固定し top も整数にすれば、どの桁数も同じ基準で並ぶ */
.cmt-badge { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; line-height: 1;
  color: var(--muted); text-decoration: none; transition: transform var(--t-fast) ease, color var(--t-fast); } /* 灰色（補足の文字と同じ --muted）。目立たせすぎない */
/* 吹き出し SVG（.cmt-ico）。コメントの一覧アイコンとコメント欄の見出しで共通。
   大きさは周りの文字に合わせる（.icon と同じ 1.2em）。vertical-align も .icon と同じ -.22em で文字の真ん中にそろえる。
   線の太さ・角の半径は SVG 側で決めている（太さ = stroke-width 1.5、角 = PHP の COMMENT_BUBBLE_RADIUS）。
   フォントのアイコンと違い、本番の Google Fonts の読み込み範囲（wght 400〜）に縛られない */
.cmt-ico { display: inline-block; width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.cmt-badge .cmt-ico { width: 24px; height: 24px; vertical-align: 0; } /* 一覧のアイコンは 24px 固定（数字の位置はこの大きさが前提） */
.togglecard summary .cmt-ico { stroke-width: 2; }                       /* コメント欄の見出し: 隣のフォントアイコン（展開の ⌄）と線の太さをそろえる */
.cmt-badge__n { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); /* 横だけ半分ずらす。縦は整数 px で固定 */
  font-size: 9px; font-weight: 800; line-height: 9px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } /* tabular-nums: 数字の幅をそろえてガタつかせない */
.cmt-badge--long .cmt-badge__n { font-size: 7.5px; letter-spacing: -.06em; } /* 「99+」: 3文字は枠に収まるよう小さく（line-height は 9px のままなので縦の基準は同じ） */
.cmt-badge:hover { transform: scale(1.1); color: var(--accent); } /* 触れたときだけアクセントの赤 */
.cmt-badge:active { transform: scale(.94); }
/* ライブ詳細の行: ❤（.slot__like）のすぐ左に置く。auto の余白で右端へ寄せ、❤ のボタンとの間は 2px（8px → 2px に近づけた）。
   コメントが無い行は .slot__like 自身の margin-left: auto のまま（下の + の指定は「バッジの直後の ❤」だけ余白を 0 にする） */
.slot__head > .cmt-badge { margin-left: auto; margin-right: 2px; }
.slot__head > .cmt-badge + .slot__like { margin-left: 0; }
.timeline--compact .slot__head > .cmt-badge { display: none; } /* 縮小表示ではバンド名だけ残す */
.history__name .cmt-badge .cmt-ico { width: 22px; height: 22px; } /* メンバーページの履歴は文字が小さめなので少しだけ小さく */
.history__name .cmt-badge__n { top: 5px; }            /* アイコンが 24→22px に縮む分、数字の位置も 1px 上げる */
/* お気に入り（❤）: 吹き出し（数）＞ハート。タイムテーブルでは行の右端、バンドページではバンド名の右（lib/repository.php の like_button）
   押すとハートと吹き出しが赤くなる（.is-liked）。誰が押したかは出さない */
.like { display: inline-flex; align-items: center; gap: 8px; padding: 2px; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; line-height: 1; }
.like__count { position: relative; min-width: 2.2em; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
  font-size: var(--fs-xs); font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
/* 吹き出しのしっぽ（右向き ＞ でハートを指す）。45°回した正方形の右上の2辺だけに枠線を付ける。
   本体と同じ 1px の枠線・同じ背景なので、線の太さと色がそろい、本体との継ぎ目も消える（三角2枚重ねだと斜めの線だけ細く見えた） */
.like__count::before { content: ''; position: absolute; top: 50%; right: -5px; width: 8px; height: 8px; box-sizing: border-box;
  background: var(--surface); border: solid var(--border); border-width: 1px 1px 0 0; transform: translateY(-50%) rotate(45deg); transition: border-color var(--t-fast), background var(--t-fast); }
.like__heart { font-size: 22px; transition: transform var(--t-fast), font-variation-settings var(--t-fast); } /* Material Symbols の favorite（枠線だけ） */
.like:hover { color: var(--accent); }
.like:hover .like__heart { transform: scale(1.12); }
.like.is-liked { color: var(--accent); }
.like.is-liked .like__heart { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; } /* 塗りつぶし（.icon--fill と同じ） */
.like.is-liked .like__count { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.like.is-liked .like__count::before { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-width: 1px 1px 0 0; } /* 吹き出しの中と同じ色 */
.like.is-pop .like__heart { animation: like-pop var(--t-slow) ease; }
@keyframes like-pop { 50% { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .like.is-pop .like__heart { animation: none; } }
.slot__like { margin-left: auto; }             /* タイムテーブルの行の右端に寄せる */
.like--lg .like__count { font-size: var(--fs-md); padding: 6px 12px; }
.like--lg .like__heart { font-size: 30px; }
.band-title { display: flex; align-items: center; gap: 12px 48px; flex-wrap: wrap; } /* band.php: バンド名とその右の ❤ */
/* live_youtube.php: プレイリストの動画をバンドに割り当てる表 */
.table-scroll--yt { margin: -20px -20px 0; border-top: 0; }
.table--yt select { width: 100%; min-width: 220px; max-width: 420px; }
.table--yt td:nth-child(5) { white-space: nowrap; }
.table--yt tr.is-warn td { background: var(--warn-bg); }
.yt-assign { margin: 0; }
.yt-assign .youtube-icon { width: 20px; height: 14px; }
.yt-leftover { margin: 0 0 8px; padding-left: 20px; line-height: 1.9; }
.slot__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.band-note { color: var(--text); } /* バンドのメモ（band.note）。鍵盤の貸出だけでなく何でも書く */
.slot--mine .slot__body { border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); } /* 単色: カードの白にアクセントの赤を 7% だけ混ぜる */
.slot--mine .slot__time .slot__no { color: var(--accent); }
.slot--headliner .slot__body { box-shadow: inset 4px 0 0 var(--headliner), var(--shadow); }

/* 縮小（live.php の [data-timeline-compact]）: 左の順番・時刻はそのまま、カードの中はバンド名だけ
   ボタンは画面の右下に浮かせる（左下は戻るボタン .back-fabs）。スマホは下のナビの上
   開け閉めの高さのアニメーションは JS（setupTimelineCompact）。ここは「縮小したあとの形」だけ */
.compact-fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 26; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer;
  transition: transform var(--t-fast) ease, color var(--t-fast), border-color var(--t-fast); }
.compact-fab, .compact-btn { width: 40px; height: 40px; }
.compact-fab .icon, .compact-btn .icon { font-size: 26px; }
.compact-fab:hover, .compact-btn:hover { color: var(--accent); border-color: var(--accent); }
.compact-fab:active, .compact-btn:active { transform: scale(.92); }
.compact-fab[aria-pressed="true"], .compact-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
/* PC: 日程タブの横に置くボタン（タブと一緒に上へ貼り付く）。スマホではこのボタンを隠して、右下に浮かせたほうを出す */
.day-bar { position: sticky; top: 70px; z-index: 5; display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.day-bar .tabs { position: static; margin: 0; }
.compact-btn { display: grid; place-items: center; flex: none; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer;
  transition: transform var(--t-fast) ease, color var(--t-fast), border-color var(--t-fast); }
.compact-fab { display: none; }
@media (max-width: 760px) {
  .compact-btn { display: none; }
  .compact-fab { display: grid; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .day-bar:not(:has(.tabs)) { display: none; }
}
.timeline--compact .slot:not(.slot--break) .slot__body { display: flex; align-items: center; padding-block: 8px; }
.timeline--compact .slot__head { flex: 1; min-width: 0; }
.timeline--compact .slot__title > :not(.slot__name):not(.slot__yt),
.timeline--compact .slot__like,
.timeline--compact .lineup,
.timeline--compact .slot__body > p.muted { display: none; }
/* 縮小中も SE と セットリスト登録済のラベルだけは残す（バンド名の右）。それ以外の曲数・名前などは隠す。
   font-size: 0 は、タグに包まれていない文字（アーティスト名の区切りなど）を見えなくするため */
.timeline--compact .slot__meta { margin: 0 0 0 8px; flex-wrap: nowrap; gap: 6px; font-size: 0; }
.timeline--compact .slot__meta > :not(.se-mark):not(.setlist-badge) { display: none; }

.lineup { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.lineup li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* 楽器ラベル。--part-c に楽器の色を入れて、文字色と薄い背景色の両方に使う */
.part { display: inline-grid; place-items: center; min-width: 40px; padding: 2px 7px; border-radius: var(--r-sm); font: 800 var(--fs-2xs)/1.6 var(--font);
  color: var(--part-c, var(--other)); background: color-mix(in srgb, var(--part-c, var(--other)) 13%, transparent); white-space: nowrap; }
.part--vo { --part-c: var(--vo); } .part--gt { --part-c: var(--gt); } .part--ba { --part-c: var(--ba); }
.part--dr { --part-c: var(--dr); } .part--key { --part-c: var(--key); } .part--other { --part-c: var(--other); }
.part--vn { --part-c: var(--vn); } .part--sax { --part-c: var(--sax); } .part--cho { --part-c: var(--cho); } .part--prog { --part-c: var(--prog); } .part--harm { --part-c: var(--harm); }
/* 兼任（Vo/Gt）: 1つのラベルに「Vo/Gt」。文字はそれぞれの楽器の色、背景は左右の色をグラデーションでつなぐ（lib/repository.php の part_badge）。
   横幅は 46px に収める（左右の余白と字間を詰める） */
.part--split { display: inline-flex; justify-content: center; align-items: center; width: 46px; padding: 2px 0; letter-spacing: -.04em; }
.part--split.part--key-cho { width: 51px; } /* Key/Cho は文字が多いので 5px 広く（× 3 付きの .part--auto は下の行で auto に戻る） */
.part__seg { color: var(--part-c); }
.part__slash { color: var(--muted); font-weight: 600; margin: 0 .5px; }
/* 後ろに「 × 5」を付けたとき（個人ページ）は、40px に詰めずに中身に合わせる */
.part--split.part--auto { width: auto; padding: 2px 7px; letter-spacing: normal; }
.part__suffix { color: var(--muted); margin-left: .3em; }
.chip { padding: 3px 10px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 500; }
.chip { transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease; }
.chip:hover { border-color: var(--accent); }
.chip--me { background: var(--accent-soft); border-color: var(--accent); }
/* サポート（セトリで1曲だけ出た人）: 通常メンバーのあとに区切り線を入れて「サポート」枠にまとめる（lib/repository.php の lineup_html） */
.lineup__support { padding-left: 16px; border-left: 1px solid var(--border); }
.support-label { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.chip--support { border-style: dashed; background: transparent; }

/* ===== 6-3. メンバー ===== */
.table-card { padding: 0; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; } /* 横にはみ出す表はカードの中だけ左右にスクロール */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th { text-align: left; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .06em; color: var(--muted); padding: 11px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; vertical-align: bottom; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
/* 表は縮めて折り返さず、入りきらなければカード（.table-card）の中で左右にスクロールさせる。
   スマホだけにすると、タブレットや狭いウィンドウ（600〜1000px くらい）で名前が折り返される */
.table:not(.table--edit) th, .table:not(.table--edit) td { white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
.table tr.is-me td { background: var(--accent-soft); }
.bar-cell { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.bar-track { flex: 1; min-width: 48px; }
.bar { display: block; height: 8px; width: var(--w); min-width: 4px; border-radius: var(--r-full); background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar-num { min-width: 1.5em; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
/* 並べ替えできる列の見出し（members.php の sort_th） */
.table th.sortable a { color: inherit; text-decoration: none; display: inline-flex; align-items: baseline; }
.table th.sortable a:hover { color: var(--accent); }
.table th[aria-sort] { color: var(--accent); }
.sortable__arrow { font-size: 9px; margin-left: 2px; }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: baseline; }
.th-sort:hover { color: var(--accent); }
.th-sort:focus-visible { outline: 2px solid var(--accent); }
/* ▲▼ が出ても列の幅が変わらないよう、矢印のぶんの幅をいつも空けておく */
.th-sort .sortable__arrow { display: inline-block; width: 1em; }
/* ユーザー管理: 入学年（左端）と名前の間を詰める */
.table--users th:first-child, .table--users td:first-child { padding-right: 4px; }
/* メンバー一覧: 入学（名前の右）を左寄せにして、名前との間を詰める */
.table--members th:nth-child(3), .table--members td:nth-child(3) { text-align: left; padding-left: 0; }
/* メンバー一覧のマイアルバム上位5枚 */
.thumbs { display: flex; gap: 4px; }
.thumbs__img { width: 40px; height: 40px; flex: none; object-fit: cover; border-radius: var(--r-xs); background: var(--surface-2); }
.thumbs__img:hover, .thumbs__img:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.album-tip { position: fixed; z-index: 100; display: grid; gap: 2px; max-width: 260px; padding: 8px 10px; border-radius: var(--r-md);
  background: var(--text); color: var(--bg); font-size: var(--fs-xs); line-height: 1.4; pointer-events: none;
  opacity: 0; visibility: hidden; box-shadow: var(--shadow-pop);
  /* 消えるとき: 透明になる間（.2s）は visibility を hidden にしない。
     visibility は「だんだん」変えられないので、transition の遅延（第3引数 .2s）で切り替えを後ろにずらす。
     これを入れないと opacity が下がり始める前に hidden になり、フェードが見えない */
  transition: opacity var(--t-fast) ease, visibility 0s linear var(--t-fast); }
/* 出るとき: visibility はすぐ visible（遅延 0）。opacity だけフェードで出す */
.album-tip.is-visible { opacity: 1; visibility: visible; transition: opacity var(--t-fast) ease, visibility 0s linear 0s; }
/* メンバー一覧の右端の名前列。PC は表が画面に収まるので出さない（スマホは下の @media で出す） */
.table--members .name-end, .table--members .rank-end { display: none; }
/* メンバー一覧の担当楽器「ほか」: 楽器のバッジは色が薄いので、黒い背景ではなくカードと同じ白い背景に出す */
.album-tip--parts { background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 8px; }
.album-tip--parts .partbar { margin: 0; gap: 4px; }
/* 中にリンクがあるポップアップ（バンド編集の ⚠）: 押せるようにして、リンクだけ青字＋下線 */
.part[data-tip] { cursor: default; } /* iOS は cursor 指定のある要素でないとタップ（click）が届かないことがある */
.album-tip--link { pointer-events: auto; font-size: var(--fs-sm); }
.tip-link { color: #1a6fd6; text-decoration: underline; text-underline-offset: 2px; }
.tip-link:hover { color: #0b4fa6; }
[data-theme="dark"] .tip-link { color: #7ab4ff; }
[data-theme="dark"] .tip-link:hover { color: #a9cdff; }
.album-tip__title { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.album-tip__artist { opacity: .75; overflow-wrap: anywhere; }
/* スマホでも5枚とも出す（はみ出した分は表ごと横にスクロールする）。ジャケットの間を詰めて、そのぶん少しだけ小さくするのにとどめる */
@media (max-width: 600px) { .thumbs { gap: 2px; } .thumbs__img { width: 36px; height: 36px; border-radius: var(--r-xs); } }

.partbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.partbar--cell { margin-top: 0; gap: 4px; flex-wrap: nowrap; } /* 表のセルの中（メンバー一覧の担当楽器）。折り返さずに横一列に並べる */
.split { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 40%, 420px);
  /* 右の欄（よく組むメンバー）: 広い画面では名前・楽器・ライブ名が1行に入る 420px。狭い画面では出演履歴に幅を譲って 300px まで縮む */ gap: 28px; align-items: start; }
.split aside { position: sticky; top: 80px; } /* PC: 欄が画面より高いときは top を assets/app.js が「画面の高さ − 欄の高さ」（マイナス）にする → 下の学年区分が見えるところで止まる */
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* 出演履歴の年度見出し（年度が変わるところだけ）と、上の検索・年度スロット・並び替えボタン */
.history-year:not(.is-inst-hidden) ~ .history-year { margin-top: 22px; } /* 前に見えている年度があるときだけ（楽器フィルターで先頭の年度が隠れても余白が残らない） */
.history__year { font-size: var(--fs-xl); font-weight: 900; letter-spacing: -.02em; margin: 0 0 12px; /* 下の余白: 右に重ねた並び替えボタンは見出しより 3px ほどはみ出すので、カードとの間は 9px ほど */ display: flex; align-items: baseline; gap: 3px; }
.history__year small { font-size: var(--fs-xs); color: var(--muted); font-weight: 700; }
.history-toolbar { margin-bottom: 14px; }
.history-toolbar .search { flex: 1; min-width: 8em; }
.history__item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px 18px; }
/* 出演履歴のカードの印は live.php のバンドカード（.slot--headliner / .slot--mine）と同じ:
   トリ = 左に青い線、見ている人も一緒に出た = 赤枠と薄い赤の単色の背景（赤枠だけだと「自分が出た」と混同するので、トリは青） */
.history__item.is-last { box-shadow: inset 4px 0 0 var(--headliner), var(--shadow); }
.history__item.is-mine { border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); } /* 単色: カードの白にアクセントの赤を 7% だけ混ぜる */
.history__when { display: grid; font-size: var(--fs-xs); font-weight: 700; }
.history__when .tag { justify-self: start; margin-top: 4px; } /* grid の中だと横いっぱいに伸びるので、中身の幅にする */
.history__what { display: grid; min-width: 0; }
.history__place { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* ライブ名 · 会場名は折り返さず1行（はみ出したら …） */
.history__bands { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.history__band { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.history__name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.history__name > a { font-size: var(--fs-lg); font-weight: 700; color: inherit; overflow-wrap: anywhere; min-width: 0; }
.history__name > a:hover { color: var(--accent); }
.history__mine { flex: none; margin-left: 6px; }
td .tag--plan { margin-top: 4px; } /* アーティストの演奏履歴: 日付の下に出す「予定」 */ /* 名前が長くても「出演」は縮めない。名前とのすき間は gap 6px + 6px = 12px */
/* トリの印: バンド名の横に小さな灰色の四角 + 🐔 */
.tori-badge { flex-shrink: 0; font-size: var(--fs-xs); line-height: 1; padding: 2px 4px; border-radius: var(--r-xs); background: var(--surface-2); }
/* ❤ はバンド名の左の固定幅の枠に入れる（なくても枠は残る）。形・色は ❤ ボタン（.like.is-liked）と同じ塗りつぶし */
.history__fav { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; width: 18px; color: var(--accent); }
.history__fav .like__heart { font-size: 18px; font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
[data-inst="fav"] { color: var(--accent); } /* 絞り込みの ❤ */
[data-inst="fav"] .icon { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.history__tags { display: flex; align-items: center; gap: 6px; flex-shrink: 0; } /* セットリストの ✓ と楽器ラベルの高さをそろえる */
/* SE ありのマーク（live.php のバンドカード）。透け感のある青地（登録済バッジと同じ作り） */
.se-mark { display: inline-flex; align-items: center; flex-shrink: 0; padding: 3px 7px; border-radius: var(--r-xs); font-size: var(--fs-2xs); font-weight: 800; line-height: 1; letter-spacing: .03em; color: var(--se); background: var(--se-bg); }
@media print { .se-mark { background: none; border: 1px solid currentColor; } }
/* セットリスト登録済み（live.php のバンドカード / member.php の出演履歴） */
.setlist-badge { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; padding: 2px 7px 2px 5px;
  border-radius: var(--r-full); font-size: var(--fs-2xs); font-weight: 700; line-height: 1.4; white-space: nowrap;
  color: var(--ok); background: var(--ok-bg); }
/* 文字が上にずれないように: アイコンと文字の行の高さを両方 1 にして、flex の中央揃えだけで縦位置を合わせる
 *  （.icon の vertical-align: -.22em は文章中のアイコン用。flex の中では効かないので 0 に戻しておく） */
.setlist-badge { line-height: 1; padding: 4px 8px 4px 5px; }
.setlist-badge .icon { font-size: 14px; vertical-align: 0; }
@media print { .setlist-badge { background: none; border: 1px solid currentColor; } }
/* <button> になったので、ボタンの枠線・文字の大きさの初期値を消す */
.setlist-badge { border: 0; font-family: inherit; cursor: pointer; }
/* サブスク連携済みの曲が半分未満: くすんだ色（緑と補足の灰色の中間。ライト/ダーク両対応） */
.setlist-badge.is-dim { color: color-mix(in srgb, var(--ok) 20%, var(--muted)); background: color-mix(in srgb, var(--ok-bg) 15%, var(--surface-2)); }
.setlist-badge:focus-visible { outline: 2px solid var(--ok); outline-offset: 2px; }
/* スマホでは「セットリスト」の文字を隠して緑の丸に ✓ だけ（バンド名の幅を取らないように）。
 *  文字は display: none ではなく画面の外に逃がして、読み上げでは「セットリスト」と読まれるようにする */
@media (max-width: 600px) {
  .setlist-badge { padding: 3px; }
  .setlist-badge__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* アーティスト一覧の最多演奏の「ほか◯人」（乗せる・押すと残りの名前をポップアップ） */
.more-names { margin-left: 2px; padding: 0 2px; border: 0; background: none; font: inherit; font-size: var(--fs-2xs); color: var(--muted);
  text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; white-space: nowrap; }
.more-names:hover { color: var(--text); }
.partbar--cell .more-names { align-self: center; padding: 8px 6px; margin: -8px -6px -8px 0; } /* 担当楽器の「ほか」: 指で押せるよう押せる範囲だけ広げる（負の margin で行の高さは変えない） */
.ranking { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.ranking li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; counter-increment: r; border-bottom: 1px solid var(--border); }
.ranking li:last-child { border-bottom: 0; }
.ranking li::before { content: counter(r); width: 22px; font: 800 var(--fs-xs) var(--font); color: var(--muted); } /* 1,2,3…を CSS で自動で振る */
.ranking li .pill { margin-left: auto; }
.ranking li[data-rank]::before { content: attr(data-rank); } /* PHP が同率を同じ順位にした数字（tie_ranks）を出す */
/* 集計ページ: ログイン中の人が入っている行（stats.php が is-me を付ける）。
   メンバー一覧の自分の行（.table tr.is-me）と同じ「背景だけ」にそろえる */
.ranking li.is-me { background: var(--accent-soft); }
/* 楽器別ランキング: 開いている間は外側の行の背景を消す（中の上位5位にも自分の行があり、そちらが光るので二重に塗らない）。
   :has(…) = 「中に〇〇を持っている要素」を選ぶ。ここでは「開いた details を持つ li」 */
.kings > li.is-me:has(> details[open]) { background: none; }
.ranking li.is-outside { margin-top: 6px; } /* 圏外の自分（上位の下に1行だけ足す）。少し離して別枠だとわかるように */

/* ===== 7. フォーム・ログイン ===== */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; min-height: calc(100vh - 220px); }
.auth__hero .muted { margin-top: 16px; }
.auth__logo { margin: 0; }
.auth__logo img { width: 100%; max-width: 440px; height: auto; } /* ログイン画面はキャッチコピーの代わりにロゴを大きく出す */
.auth__logo .brand__logo--dark { display: none; }
[data-theme="dark"] .auth__logo .brand__logo--light { display: none; }
[data-theme="dark"] .auth__logo .brand__logo--dark { display: block; }
.auth__card { display: grid; gap: 14px; padding: 28px; }
.auth__card h2 { font-size: var(--fs-2xl); font-weight: 800; }
.field { display: grid; align-content: start; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
/* align-content: start … 同じ行のほかの欄が高くなっても（下に注意文が出たときなど）、ラベルと入力欄は伸ばさず上に詰める */
.field__hint { font-size: var(--fs-2xs); font-weight: 400; } /* 見出しの下の薄い説明（.field の太字・13px より細く小さく） */
.text-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; } /* 文中のリンク（password_reset.php の「こちら」） */
.field__hint a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; } /* 説明の中のリンクは色と下線でリンクとわかるように */
.req { font-style: normal; font-size: var(--fs-2xs); color: var(--accent); margin-left: 4px; }
.form-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
/* minmax(0, 1fr) … 列の幅を指定しないと中身の最小幅（折り返さないボタンの列など）に合わせて広がり、スマホで入力欄ごと右にはみ出す */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
/* ライブ編集の「＋ 日程を追加」チェックボックス（見出しと同じ大きさ） */
.new-day-toggle { display: inline-flex; align-items: center; gap: 8px; width: fit-content; margin-top: 24px; font-size: var(--fs-lg); font-weight: 800; color: var(--text); cursor: pointer; }
.new-day-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
[data-new-day-fields]:not([hidden]), [data-extra-day] { animation: soft-in var(--t-base) ease-out; }
.field--wide { grid-column: span 2; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; } /* ボタンが多いとスマホで横に入りきらないので折り返す */
.member-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.member-row-edit { display: grid; grid-template-columns: 232px auto minmax(0, 260px) auto; /* 楽器 / Cho のトグル / 名前 / ✕ */ /* 232px =「Key.Vo キーボードボーカル」が切れない幅 / 名前は 260px まで（人名にそれ以上はいらない） */ gap: 8px; align-items: center;
  justify-content: center; /* 行をカードの中央に置く。これがないと余った幅が auto の列（✕ボタン）に配られて、ボタンが横に伸びる */ }
/* HTML の並びは「名前 / ✕ / 楽器 / Cho」（スマホの2段用）。PC の1段では order で「楽器 / Cho / 名前 / ✕」に並べ替える */
.member-row-edit > :nth-child(3) { order: 1; }
.member-row-edit > :nth-child(4) { order: 2; }
.member-row-edit > :nth-child(1) { order: 3; }
.member-row-edit > :nth-child(2) { order: 4; }
.member-row-edit > .inst-tools { display: flex; align-items: center; gap: 6px; }
.inst2-toggle { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1; cursor: pointer; transition: transform var(--t-base) ease, background var(--t-base); }
.inst2-toggle.is-open { background: rgba(46, 158, 91, .15); color: #2e9e5b; border-color: rgba(46, 158, 91, .5); } /* 緑 = 開いている（赤い ✕ の削除と区別するため回転もしない） */
/* 2つ目の楽器: 1つ目の楽器の下（1列目）に、高さ 0 → 中身の高さでにゅっと出す */
.member-row-edit > .inst2-slot { order: 5; grid-column: 1; display: grid; grid-template-rows: 0fr; opacity: 0; margin-top: -8px;
  transition: grid-template-rows var(--t-base) ease, opacity var(--t-base) ease, margin-top var(--t-base) ease; }
.inst2-slot > div { overflow: hidden; min-height: 0; }
.member-row-edit > .inst2-slot.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }
.member-row-edit [data-remove-row] { width: 32px; height: 32px; padding: 0; border-radius: 50%; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0 4px; }
.check { display: flex; gap: 8px; align-items: center; font-size: var(--fs-md); cursor: pointer; }
.form-card .check + .muted.small { margin: -6px 0 0 24px; } /* チェックの下の説明（account.php）: 余白を詰めて、チェックの文字の位置にそろえる */
/* アプリ通知（account.php）: チェックを均等な間隔で縦に並べる */
.push-card, .push-card form { display: grid; gap: 14px; }
.push-card .section-title { margin: 0; }
.push-card .check { transition: opacity var(--t-fast); }
.push-card .check[inert] { opacity: .45; } /* アプリ通知オンが外れている間のグレーアウト */
@media (display-mode: standalone) { .push-card__hint { display: none; } } /* インストール済み（ホーム画面から開いたとき）は案内不要 */
input[type="checkbox"], .field input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; padding: 0; flex: none; }
.field .check { color: var(--text); font-weight: 400; } /* .field の中のラジオ（contact.php の匿名の選択）は、ラベルの見出しより普通の文字に */

/* 取り込み: 「登録済みのライブと統合」トグルと、ライブを選ぶポップアップ */
.live-name-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.merge-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-full); cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 600 var(--fs-xs)/1.4 var(--font); }
.merge-toggle .icon { font-size: 16px; }
.merge-toggle:hover { color: var(--text); }
.merge-toggle[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: var(--on-accent); }
/* z-index: 出てくるときのアニメーション（transform）で .live-pick が「重なりの箱」（スタッキングコンテキスト）になると、
   中のポップアップの z-index: 50 は箱の外に効かず、後ろの欄や表の下に隠れる → 箱そのものを手前に出しておく */
/* ただし会場の選択も同じ .live-pick で z-index が同じだと、後ろ（下）に書かれた会場のボタンが上に重なる
   → ふだんは 1、ポップアップを開いている箱だけ 40 にして、他の .live-pick より必ず手前にする */
.live-pick { position: relative; z-index: 1; }
.live-pick:has(> .live-pop) { z-index: 40; }
.live-pick__btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; text-align: left;
  padding: 10px 13px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-md); font-weight: 400; }
/* 高さを入力欄（.field input）とそろえる: input と同じく body の font（15px/1.65）を継ぐ、アイコンは行の高さに数えない（line-height: 0） */
.live-pick__btn .icon { font-size: 20px; line-height: 0; }
.live-pick__btn[aria-expanded="true"] { border-color: var(--accent); }
.live-pick__btn .is-placeholder { color: var(--muted); opacity: .8; font-weight: 400; } /* 未選択の「ライブを選択」は薄く（placeholder と同じ扱い） */
.live-pop { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); padding-bottom: 4px; }
.live-pop__year { position: sticky; top: 0; margin: 0; padding: 6px 12px; font-size: var(--fs-xs); font-weight: 700; color: var(--accent);
  background: var(--surface-2); border-bottom: 1px solid var(--border); }
.live-pop__item { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 12px; cursor: pointer;
  border: 0; background: none; color: var(--text); font: 400 var(--fs-md)/1.4 var(--font); text-align: left; }
.live-pop__item:hover, .live-pop__item:focus-visible { background: var(--accent-soft); }
.live-pop__item[aria-selected="true"] .live-pop__name { color: var(--accent); font-weight: 700; }
.live-pop__item.is-empty .live-pop__name { color: var(--muted); font-weight: 400; } /* 値が空の「なし」「— 未設定 —」 */
.live-pop__empty { margin: 0; padding: 12px; color: var(--muted); font-size: var(--fs-sm); }
/* ---- 全部の <select> を上の見た目にする（assets/app.js の setupSelectPick） ---- */
/* 元の select は値の入れ物。hidden ではなく「見えないだけ」にして、required の吹き出しはボタンの位置に出す */
.select-native { position: absolute !important; left: 50%; bottom: 0; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important;
  opacity: 0; pointer-events: none; border: 0 !important; }
.live-pick[data-select-pick] { z-index: auto; }
.live-pick__btn:disabled { opacity: .5; cursor: not-allowed; }
.live-pick__btn > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-pick__btn > span:first-child:empty::before { content: "\200b"; } /* 文字が空でも1行分の高さを保つ（\200b = 幅のない空白） */
.live-pick--inline { display: inline-block; vertical-align: middle; }
.live-pick--inline .live-pick__btn { width: auto; min-width: 6em; padding: 7px 10px 7px 13px; font-weight: 700; }
.live-pick--sm .live-pick__btn { min-width: 4.5em; padding: 4px 6px 4px 9px; font-size: var(--fs-xs); border-radius: var(--r-md); gap: 4px; }
.live-pick--sm .live-pick__btn .icon { font-size: 16px; }
.live-pop--float { position: fixed; top: auto; right: auto; z-index: 1000; max-width: calc(100vw - 16px); padding-bottom: 0; padding-block: 4px; }
.live-pop--float .live-pop__item { white-space: nowrap; }
.live-pop--float .live-pop__item:disabled { opacity: .45; cursor: not-allowed; }
.live-pop--sm .live-pop__item { padding: 6px 10px; font-size: var(--fs-sm); }
/* 入力候補（setupSuggest）: ↑↓ で選んでいる候補、打った文字と一致した部分 */
.suggest-pop .live-pop__item.is-active { background: var(--accent-soft); }
.suggest-pop mark { background: none; color: var(--accent); font-weight: 700; }
.suggest-pop__kana { color: var(--muted); font-size: var(--fs-xs); } /* ふりがなで当たった候補の右に出すふりがな */
.merge-note { font-weight: 400; white-space: pre-line; }
.merge-note:empty { display: none; }
.merge-note--warn { color: var(--warn); }

/* ---- 薄いアニメーション（統合トグル・ライブ/会場の選択・注意文・登録済みの帯） ---- */
.merge-toggle { transition: background-color var(--t-base) ease, color var(--t-base) ease, border-color var(--t-base) ease, transform var(--t-fast) ease; }
.merge-toggle:active { transform: scale(.96); }
.merge-toggle .icon { transition: transform var(--t-base) ease; }
.merge-toggle[aria-pressed="true"] .icon { transform: rotate(90deg); }
.live-pick__btn { transition: border-color var(--t-base) ease, box-shadow var(--t-base) ease; }
.live-pick__btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.live-pick__btn[aria-expanded="true"] { box-shadow: var(--ring); }
.live-pick__btn .icon { transition: transform var(--t-base) ease; }
.live-pick__btn[aria-expanded="true"] .icon { transform: rotate(180deg); }
.live-pick__btn [data-live-pick-text], .live-pick__btn > span:first-child { transition: color var(--t-base) ease; }
.live-pop { animation: live-pop-in var(--t-fast) ease-out; transform-origin: top; }
@keyframes live-pop-in { from { opacity: 0; transform: translateY(-4px) scaleY(.97); } to { opacity: 1; transform: none; } }
.live-pop__item { transition: background-color var(--t-fast) ease; }
[data-merge] > .live-pick:not([hidden]), [data-live-name]:not([hidden]) { animation: soft-in var(--t-base) ease-out; }
.merge-note:not(:empty), [data-exists-flash]:not([hidden]) { animation: soft-in var(--t-base) ease-out; }
@keyframes soft-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
/* 右下の「やり直す / 登録する」のバー */
.sticky-actions { animation: bar-in var(--t-slow) var(--ease-out); }
@keyframes bar-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sticky-actions .btn { transition: transform var(--t-fast) ease, box-shadow var(--t-base) ease, opacity var(--t-base) ease, background-color var(--t-base) ease, color var(--t-base) ease; }
.sticky-actions .btn:active { transform: scale(.97); }
.sticky-actions__note:not([hidden]) { animation: soft-in var(--t-base) ease-out; }
.sticky-actions__note .icon { display: inline-block; animation: note-nudge .5s ease-out; }
@keyframes note-nudge { 0%, 100% { transform: none; } 30% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) {
  .sticky-actions, .sticky-actions__note, .sticky-actions__note .icon { animation: none !important; }
  .sticky-actions .btn { transition: none; }
  .merge-toggle, .merge-toggle .icon, .live-pick__btn, .live-pick__btn .icon, .live-pop__item { transition: none; }
  .live-pop, [data-merge] > .live-pick, [data-live-name], .merge-note, [data-exists-flash] { animation: none !important; }
}

/* ===== 8. 取り込み ===== */
.upload { display: grid; gap: 16px; }
.dropzone { position: relative; display: grid; justify-items: center; gap: 6px; padding: 48px 20px; border-radius: var(--r-lg);
  border: 2px dashed var(--border); background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color var(--t-base), background var(--t-base); }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; } /* 透明なファイル選択欄を全面に重ねる */
/* 取り込みの送信後に出す「読み込み中」（画面全体を覆って、二重送信も防ぐ） */
.loading { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 16px;
  text-align: center; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(2px); }
.loading[hidden] { display: none; }
.loading__spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--accent); animation: spin .9s linear infinite; }
.loading__title { font-weight: 700; font-size: var(--fs-lg); margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading__spinner { animation-duration: 3s; } }
.ai-notes p { margin: 0 0 6px; }
.ai-notes ul { margin: 0; padding-left: 1.2em; font-weight: 500; }
.dropzone__icon { font-size: 26px; font-weight: 800; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); margin-bottom: 6px; }
.dropzone__title { font-weight: 800; font-size: var(--fs-xl); }
.dropzone__list { position: relative; z-index: 1; list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: var(--fs-sm); font-weight: 600; } /* × を押せるように透明な input より上に出す */
/* 別の日程の年を直したとき、合わせて変わった開催日の欄を一瞬光らせる（JS の syncYears） */
.is-synced { animation: synced-flash 1.2s ease-out; }
@keyframes synced-flash { from { background: var(--accent-soft); box-shadow: var(--ring); } }
@media (prefers-reduced-motion: reduce) { .is-synced { animation: none; } }
.dropzone__file { display: flex; align-items: center; gap: 8px; }
.dropzone__remove { border: 0; background: var(--border); color: inherit; width: 22px; height: 22px; border-radius: 50%; padding: 0; display: grid; place-items: center; cursor: pointer; }
.dropzone__remove .icon { font-size: 16px; vertical-align: 0; }
.dropzone__remove:hover { background: var(--accent); color: var(--on-accent); }
.guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.guide h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.guide p { margin: 0; }
.step { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 800 var(--fs-xs) var(--font); background: var(--accent-soft); color: var(--accent); }

.import-form { display: grid; gap: 18px; }
.import-form > .section-title { margin: 12px 0 -4px; font-size: var(--fs-2xl); }
.import-day { display: grid; gap: 14px; }
.import-day__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.file-name { margin: 0 0 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; overflow-wrap: anywhere; }
.import-day__title { font-size: var(--fs-2xl); font-weight: 900; }
.import-day__badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* 編集できる表 */
.table-scroll { overflow-x: auto; margin: 0 -20px -20px; border-top: 1px solid var(--border); } /* 横にはみ出す表は表だけスクロール */
.table--edit td { padding: 6px 8px; }
.table--edit th { padding: 10px 8px; }
.table--edit input, .table--edit select { padding: 7px 9px; font-size: var(--fs-md); border-radius: var(--r-md); }
.table--edit td:first-child, .table--edit th:first-child { padding-left: 20px; }
.table--edit input[type="checkbox"] { width: 18px; height: 18px; padding: 0; }
.input-num { width: 64px !important; }
.input-year { width: 110px !important; }
.entry-actions { padding: 0 20px 18px; flex-wrap: wrap; }
.table--edit tr.is-excluded td { opacity: .45; }
/* 「この日程は取り込まない」: JS が inert にした部分（入力できない）を薄くする */
.import-day > *, .import-day .checks > * { transition: opacity var(--t-base) ease; } /* 戻すときもふわっと */
.import-day [inert] { opacity: .45; user-select: none; }
/* opacity は子要素ごと薄くなり、子で 1 に戻せない → バンド名の列だけはセルではなく名前の span を薄くし、⚠ はそのままの濃さで出す */
.table--edit tr.is-excluded td.roster-band-cell { opacity: 1; }
.table--edit tr.is-excluded .roster-band-name { opacity: .45; }
/* タイムテーブルの行の並び替え（JS: setupSlotSort）。≡ を押している間は行を浮かせる */
.drag-handle { padding: 4px 6px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font-size: var(--fs-xl); line-height: 1;
  cursor: grab; touch-action: none; /* 指で押したとき、ページのスクロールではなくドラッグにする */ }
.drag-handle:hover, .drag-handle:focus-visible { color: var(--text); background: var(--surface-2); }
/* つかんだ行（時間以外のセル）は浮かせて、ほかの行より手前に描く。時間のセルは動かないので普段どおり */
.table--edit tr.is-dragging td:not([data-time]), .table--edit tr.is-dragging[data-free-time] td { position: relative; z-index: 2; opacity: 1; background: var(--surface-2);
  box-shadow: var(--shadow-pop); }
body.is-row-dragging, body.is-row-dragging * { cursor: grabbing !important; user-select: none; }
.table--edit td:has(input[data-band-name]) { min-width: 200px; }
.table--roster td { min-width: 130px; }
.table--roster td:first-child { min-width: 0; text-align: center; } /* 🚩（楽器の確認）の列 */
/* 旗（楽器の確認待ち）の切り替え: チェックボックスは隠して旗のアイコンだけ見せる。
   OFF = 枠線だけの灰色 / ON = 塗りつぶしの warn 色（.icon--fill と同じ FILL 1） */
.flag-toggle { position: relative; display: inline-flex; cursor: pointer; padding: 4px; border-radius: var(--r-sm); color: var(--muted);
  transition: color var(--t-fast) ease; }
.flag-toggle .icon { font-size: 20px; vertical-align: 0; }
.flag-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.flag-toggle:hover { color: var(--text); }
.flag-toggle:has(input:checked) { color: var(--warn); }
.flag-toggle:has(input:checked) .icon { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.flag-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); }
@media (prefers-reduced-motion: reduce) { .flag-toggle { transition: none; } }
.flag-icon { color: var(--warn); } /* 表示だけの旗（注意の帯・見出し・凡例） */
/* 旗の注意（band.php / band_edit.php）: 文とボタンを横に並べる */
.check-flag { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tt-omnibus { display: inline-flex; align-items: center; gap: 2px; cursor: pointer; }
.tt-band-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; } /* タイムテーブル編集: バンド名の横に旗 */
/* 🚩 の入力部品（check_picker）: 旗を立てたときだけ「理由」「誰について」のトグルボタンを出す。中身はチェックボックス */
.check-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.check-picker__body { display: none; flex-basis: 100%; flex-wrap: wrap; align-items: center; gap: 6px; }
.check-picker:has(.flag-toggle input:checked) .check-picker__body { display: flex; }
.check-picker__sep { margin-left: 4px; }
.table--roster .check-picker__body { min-width: 180px; } /* 取り込みの名簿: 細い列でも読めるように */
.table--tt .check-picker__body { min-width: 320px; } /* タイムテーブル編集: チップが1つずつ縦に並ばないように */
/* バンド編集: セトリに出ている人の行の ⚠（押すとポップアップ） */
.lock-warn { display: inline-flex; padding: 4px; border: 0; border-radius: var(--r-sm); background: none; color: var(--warn); cursor: pointer; }
.lock-warn .icon { font-size: 20px; vertical-align: 0; }
.lock-warn:focus-visible { outline: 2px solid var(--accent); }
.info-tip { display: inline-flex; padding: 2px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); cursor: pointer; }
.info-tip .icon { font-size: 18px; vertical-align: 0; }
.info-tip:focus-visible { outline: 2px solid var(--accent); }
.pick-chip { position: relative; display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: var(--fs-xs); font-weight: 500;
  white-space: nowrap; cursor: pointer; transition: background var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease; }
.pick-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick-chip:hover { color: var(--text); border-color: var(--warn); }
.pick-chip:has(input:checked) { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); border-color: var(--warn); color: var(--text); }
.pick-chip--who:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.pick-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .pick-chip { transition: none; } }
.check-flag__text p { margin: 0 0 6px; }
.chip--warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.chip .icon { font-size: 15px; vertical-align: -2px; margin-right: 2px; }
.chip--xs { display: inline-block; padding: 0 8px; font-size: var(--fs-2xs); white-space: nowrap; }
/* 変更履歴（history.php）: 1件 = 1枚のカード。戻し済みは少し薄く */
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.history-item { display: grid; gap: 6px; }
.history-item.is-restored { opacity: .7; }
.history-item__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.history-item__head .icon { font-size: 16px; vertical-align: -3px; margin-right: 2px; }
.history-item__summary { margin: 0; overflow-wrap: anywhere; }
.history-item__units ul { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 2px; }
.history-item__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.history-item__foot .muted .icon { font-size: 16px; vertical-align: -3px; }
.history-pager { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
/* 戻す前の確認（history.php?op=ID）: 変わるもの1つ = 1枚。「今」は赤、「戻した後」は緑の薄い背景 */
.history-preview { display: grid; gap: 10px; }
.history-unit { display: grid; gap: 8px; }
.history-unit__title { margin: 0; font-size: var(--fs-md); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.history-unit--delete { border-color: var(--danger); }
.tag--delete { color: var(--danger); background: var(--danger-bg); }
.tag--revive { color: var(--ok); background: var(--ok-bg); }
.history-diff { table-layout: fixed; } /* 「今」と「戻した後」を同じ幅に */
.history-diff thead th:first-child { width: 10em; }
/* .table の nowrap を打ち消して折り返す（列の幅が決まっているので、折り返さないと右の列にかぶる） */
.table.history-diff th, .table.history-diff td { white-space: normal; overflow-wrap: anywhere; line-break: strict; } /* strict: 「ー」で始まる行を作らない */
.history-diff__now { background: var(--danger-bg); }
.history-diff__after { background: var(--ok-bg); }
.history-confirm { margin-top: 16px; justify-content: flex-end; }
.check-list { margin-bottom: 14px; } /* トップのお知らせカードと、下の検索・絞り込みの間 */
.check-list ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
/* トップの確認依頼: 1件ごとに右端に ✕。消すときは右へすべらせながら薄くして、高さを 0 にして詰める（app.js の setupCheckDismiss） */
.check-list li { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; overflow: hidden;
  transition: opacity var(--t-base) ease, transform var(--t-base) ease, height var(--t-base) ease .15s, padding var(--t-base) ease .15s; }
.check-list__text { flex: 1; min-width: 0; }
.check-list__close { flex: none; display: inline-flex; padding: 4px; border: 0; border-radius: var(--r-full); background: none; color: var(--muted); cursor: pointer; }
.check-list__close .icon { font-size: 18px; vertical-align: 0; }
.check-list__close:hover { background: var(--surface-2); color: var(--text); }
.check-list__close:focus-visible { outline: 2px solid var(--accent); }
.check-list li.is-leaving { opacity: 0; transform: translateX(24px); height: 0 !important; padding-top: 0; padding-bottom: 0; }
/* 最後の1件を消すときはカードごと */
.check-list.is-leaving { opacity: 0; transform: translateX(24px); height: 0 !important; padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0;
  overflow: hidden; border-width: 0; transition: opacity var(--t-base) ease, transform var(--t-base) ease, height var(--t-slow) ease .15s, padding var(--t-slow) ease .15s, margin var(--t-slow) ease .15s; }
@media (prefers-reduced-motion: reduce) { .check-list li, .check-list.is-leaving { transition: none; } }
.table--roster [data-roster-missing] { display: block; width: fit-content; margin-top: 4px; font-weight: 400; }
.table--roster [data-roster-missing][hidden] { display: none; }
.modal__list { margin: 12px 0 0; padding-left: 1.2em; max-height: 40vh; overflow: auto; }
.col-head { margin-bottom: 4px; color: var(--text); }
.select-sm { font-size: 12px !important; padding: 5px 6px !important; }
.cell-instrument { margin-top: 4px; }
/* タイムテーブル編集: 楽器の横に Cho のトグル */
.table--tt .cell-instrument { display: flex; gap: 4px; align-items: center; }
.table--tt .cell-instrument > .live-pick, .table--tt .cell-instrument > select { flex: 1; min-width: 0; }
/* 「Cho」トグル（chorus_toggle）。ON でコーラスの色。ボーカルを選んでいるときは押せない */
.cho-toggle-wrap { display: inline-flex; }
.cho-toggle { height: 26px; padding: 0 8px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: var(--fs-xs); font-weight: 700; cursor: pointer; transition: background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease; }
.cho-toggle { white-space: nowrap; }
.cho-toggle[aria-pressed="true"] { /* ON: パステルの黄緑（白を多めに混ぜる）＋濃い緑の文字。ライト・ダークどちらも同じ見た目 */
  background: color-mix(in srgb, var(--cho) 30%, #fff); border-color: color-mix(in srgb, var(--cho) 50%, #fff); color: color-mix(in srgb, var(--cho) 55%, #1f2a10); }
.cho-toggle:disabled { opacity: .35; cursor: not-allowed; }
/* 名簿の Key./Other 欄: 名前が空のあいだ楽器のプルダウンを隠し、名前の欄をセルの上下中央に置く。
   名前が入ったら、名前の欄が上へスライドし、その下からプルダウンが出てくる。
   高さは縮めずに「場所だけ確保して透明にする」ので、プルダウンが出ている行と出ていない行で上下の余白が揃う。
   --inst-shift = (切り替えボタンの高さ 26px + 間の 4px) ÷ 2 … 名前の欄を下げればちょうどセルの中央に来る量 */
.table--roster { --inst-shift: 15px; }
.table--roster td > .name-input, .table--roster td > .cell-instrument { display: block; }
.table--roster td > .name-input { position: relative; z-index: 1; /* プルダウンより手前 */
  transition: transform var(--t-base) ease, background-color var(--t-slow) ease, border-color var(--t-slow) ease; } /* 下の .name-input の transition を上書きしてしまうので、色のフェードもここに書く */
.table--roster td > .name-input:has(+ .cell-instrument.is-collapsed) { transform: translateY(var(--inst-shift)); }
.table--roster .cell-instrument {
  height: 26px;
  transition: opacity var(--t-base) ease, transform var(--t-base) ease, visibility 0s;
}
.table--roster .cell-instrument.is-collapsed {
  opacity: 0; transform: translateY(calc(var(--inst-shift) * -1)); /* 名前の欄の裏に隠れている位置 */
  visibility: hidden; pointer-events: none; /* 見えない間はクリックも Tab キーのフォーカスもさせない */
  transition: opacity var(--t-fast) ease, transform var(--t-base) ease, visibility 0s var(--t-base);
}
@media (prefers-reduced-motion: reduce) {
  .table--roster td > .name-input, .table--roster .cell-instrument, .table--roster .cell-instrument.is-collapsed { transition: none; }
}
/* 名簿の Vo. 欄: 「Vo / Vo/Gt / …」の切り替えボタン（中身はラジオボタン。見た目だけボタン風にしている）
   class="cell-instrument" も付けているので、名前が空のあいだ畳む動きはプルダウンと同じ */
/* width: 0 + min-width: 100% … このボタンは列の幅を決めない（名前の欄の幅にぴったり合わせる）。ほかの列と同じ幅にするため */
.table--roster td > .pick { display: flex; gap: 1px; padding: 2px; border-radius: var(--r-md); width: 0; min-width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); }
.pick label { position: relative; flex: 1 1 auto; min-width: 0; display: flex; } /* 文字の長さに合わせて配分（「Vo/Gt」が窮屈にならない） */
.pick input { position: absolute; inset: 0; opacity: 0; margin: 0; pointer-events: none; } /* 本物のラジオは隠す（キーボード操作はそのまま効く） */
.pick span { flex: 1; display: grid; place-items: center; padding: 0 2px; border-radius: var(--r-sm); cursor: pointer;
  font-size: var(--fs-2xs); font-weight: 700; white-space: nowrap; color: var(--muted); transition: background var(--t-fast), color var(--t-fast); }
@media (hover: hover) { .pick span:hover { color: var(--text); } } /* スマホはタップ後に :hover が残って色が戻らないので、マウスの端末だけ */
.pick input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 「⋯」ボタンと、そこから右に出る残りの選択肢（Vo/Ba / Vo/Key / Vo/Dr、Cho / Perc / Sax / etc …）。開け閉めは JS: setupPicks */
.pick__more { position: relative; flex: 1 1 auto; display: flex; }
.pick__toggle { flex: 1; padding: 0 6px; border: 0; border-radius: var(--r-sm); background: none; cursor: pointer;
  font: inherit; font-size: var(--fs-2xs); font-weight: 700; white-space: nowrap; color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.pick__more.is-open .pick__toggle { color: var(--text); }
@media (hover: hover) { .pick__toggle:hover { color: var(--text); } }
/* 中身が空（しまってある選択肢を選んでいない）ときは「⋯」を CSS で描く。
   文字の「…」は下寄りで点が小さいので、丸を3つ並べて上下中央に置いている（currentColor = 文字色と同じ色） */
.pick__toggle:empty::before { content: ""; display: block; width: 18px; height: 4px; margin: auto;
  background: radial-gradient(circle, currentColor 1.8px, transparent 2.2px) 0 0 / 6px 4px repeat-x; }
/* しまってある選択肢を選んでいるときは、「⋯」の場所を選択中の見た目にする */
.pick__more:has(.pick__menu input:checked) .pick__toggle { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.pick__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 行の高さの中で右へ出す（下に出すと、最後の行で表のスクロール枠に切られるため） */
/* 開け閉めのアニメーション: 「⋯」の位置から右へすべり出てくる。
   display: none は普通アニメーションできないが、transition-behavior: allow-discrete（閉じるとき）と
   @starting-style（開くときの最初の見た目）を使うと、出る・消えるの両方をなめらかにできる（対応していないブラウザではパッと出るだけ） */
.pick__menu { display: none; position: absolute; z-index: 5; left: calc(100% + 6px); top: -3px; height: 26px; gap: 1px; padding: 2px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateX(-8px) scale(.94); transform-origin: left center;
  transition: opacity var(--t-fast) ease, transform var(--t-base) cubic-bezier(.2, .9, .3, 1.2), display var(--t-base) allow-discrete; }
.pick__menu::before { content: ""; position: absolute; right: 100%; top: 0; bottom: 0; width: 8px; } /* 「⋯」から右へマウスを動かす途中で閉じないための透明な橋 */
.pick__menu { scroll-margin: 8px 16px; } /* JS で見える所へスクロールしたとき、画面の端にぴったり付かないように */
.pick__menu span { padding: 0 8px; }
.pick__more.is-open .pick__menu,
.pick__more:has(:focus-visible) .pick__menu { display: flex; opacity: 1; transform: none; } /* タップ・クリックで開く / キーボードで中に入ったとき */
@media (hover: hover) { .pick__more:hover .pick__menu { display: flex; opacity: 1; transform: none; } } /* マウスがある端末だけ、乗せたら開く（スマホはタップ） */
@starting-style { /* 開いた瞬間はこの見た目から始める */
  .pick__more.is-open .pick__menu,
  .pick__more:has(:focus-visible) .pick__menu { opacity: 0; transform: translateX(-8px) scale(.94); }
}
@media (hover: hover) { @starting-style { .pick__more:hover .pick__menu { opacity: 0; transform: translateX(-8px) scale(.94); } } }
@media (prefers-reduced-motion: reduce) { .pick__menu, .pick__toggle { transition: none; } }
/* モーダル（<dialog>）: 楽器の「etc」を選んだときの「ここに無い楽器を追加」。開け閉めは JS: setupPicks
   ふわっと出る・消えるのは、選択肢のメニューと同じ allow-discrete + @starting-style の仕組み */
.modal { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-modal);
  opacity: 0; transform: translateY(8px) scale(.97);
  transition: opacity var(--t-base) ease, transform var(--t-base) ease, overlay var(--t-base) allow-discrete, display var(--t-base) allow-discrete; }
.modal[open] { opacity: 1; transform: none; }
@starting-style { .modal[open] { opacity: 0; transform: translateY(8px) scale(.97); } }
.yts { opacity: 0; transform: translateY(8px) scale(.97);
  transition: opacity var(--t-base) ease, transform var(--t-base) var(--ease-out), overlay var(--t-base) allow-discrete, display var(--t-base) allow-discrete; }
.yts[open] { opacity: 1; transform: none; }
@starting-style { .yts[open] { opacity: 0; transform: translateY(8px) scale(.97); } }
.yts::backdrop { background: rgb(0 0 0 / 0); transition: background var(--t-base) ease, overlay var(--t-base) allow-discrete, display var(--t-base) allow-discrete; }
.yts[open]::backdrop { background: rgb(0 0 0 / .45); }
@starting-style { .yts[open]::backdrop { background: rgb(0 0 0 / 0); } }
@media (prefers-reduced-motion: reduce) { .yts, .yts::backdrop { transition: none; } }
/* アルバムのモーダル: 曲モーダルのジャケット拡大（songs.css の songs-zoom）と同じ動き。開く: ジャケットがふわっと拡大・下の文字とボタンが少し遅れて浮かぶ。閉じる: 縮みながら消える（app.js が is-closing を付ける） */
.album-modal[open] .album-modal__art { animation: album-modal-in var(--t-base) var(--ease-out); }
.album-modal[open] .album-modal__name, .album-modal[open] .album-modal__year, .album-modal[open] .album-modal__bar { animation: album-modal-rise var(--t-base) .08s ease-out backwards; }
.album-modal[open]::backdrop { animation: album-modal-fade var(--t-base) ease-out; }
.album-modal.is-closing { animation: album-modal-out var(--t-fast) ease-in forwards; }
.album-modal.is-closing::backdrop { animation: album-modal-fade var(--t-fast) ease-in reverse forwards; }
@keyframes album-modal-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes album-modal-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes album-modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes album-modal-out { to { opacity: 0; transform: scale(.9); } }
@media (prefers-reduced-motion: reduce) { .album-modal[open] .album-modal__art, .album-modal[open] .album-modal__name, .album-modal[open] .album-modal__year, .album-modal[open] .album-modal__bar, .album-modal[open]::backdrop, .album-modal.is-closing { animation: none; } }
.modal::backdrop { background: rgb(0 0 0 / 0); transition: background var(--t-base) ease, overlay var(--t-base) allow-discrete, display var(--t-base) allow-discrete; }
.modal[open]::backdrop { background: rgb(0 0 0 / .45); }
@starting-style { .modal[open]::backdrop { background: rgb(0 0 0 / 0); } }
.modal__body { padding: 22px; }
.modal__title { margin: 0 0 6px; font-size: var(--fs-xl); }
.modal .form-grid { grid-template-columns: 1fr 1.6fr; margin-top: 14px; }
.modal .flash { margin: 12px 0 0; }
.modal .form-actions { flex-wrap: wrap; }
@media (max-width: 480px) { .modal .form-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .modal, .modal::backdrop { transition: none; } }
/* 初回ログインのチュートリアル（partials/tutorial.php、JS: setupTutorial）。上に画像、下に説明とページ送り */
.tutorial { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: hidden auto; }
.tutorial__img { aspect-ratio: 16 / 10; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow: hidden; }
.tutorial__img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.tutorial__slide { animation: tutorial-in var(--t-base) ease; }
@keyframes tutorial-in { from { opacity: 0; transform: translateX(12px); } }
.tutorial__text { padding: 18px 22px 4px; }
.tutorial__text p { margin: 0; line-height: 1.7; }
.tutorial__step { font-size: var(--fs-xs); font-weight: 700; color: var(--accent); letter-spacing: .06em; margin-bottom: 4px !important; }
/* 左右を同じ幅（1fr）にして点を真ん中に固定する。flex の space-between だと、1枚目は「戻る」が無いぶん右が狭くなって点がずれる */
.tutorial__nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 14px 22px 20px; }
.tutorial__nav > [data-tutorial-skip] { justify-self: start; }
.tutorial__btns { display: flex; gap: 8px; justify-self: end; }
.tutorial__dots { display: flex; gap: 6px; }
.tutorial__dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: var(--r-full); background: var(--border); cursor: pointer; transition: width var(--t-base) ease, background var(--t-base) ease; }
.tutorial__dot[aria-current] { width: 22px; background: var(--accent); }
@media (max-width: 480px) {
  .tutorial__nav { grid-template-columns: auto 1fr; }
  .tutorial__dots { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .tutorial__slide { animation: none; } .tutorial__dot { transition: none; } }
/* 「ホーム画面に追加する」の説明（partials/add_to_home.php、JS: setupAddToHome）。Safari / Chrome を上の切り替えで出し分ける */
.a2hs { max-height: calc(100dvh - 32px); overflow: hidden auto; }
.a2hs__switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 16px 0 4px; padding: 4px;
  border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border); }
.a2hs__tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 12px; border: 0; border-radius: var(--r-full);
  background: none; color: var(--muted); font: 800 var(--fs-md)/1.3 var(--font); cursor: pointer; transition: background var(--t-fast) ease, color var(--t-fast) ease; }
.a2hs__tab small { font-size: var(--fs-2xs); font-weight: 500; }
.a2hs__tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.a2hs__panel:not([hidden]) { animation: day-fade var(--t-base) ease; }
/* 手順の番号は CSS の counter で付ける（ol の「1.」だと番号と文の頭がそろわない） */
.a2hs__steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.a2hs__steps > li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--border); line-height: 1.9; }
.a2hs__steps > li:last-child { border-bottom: 0; }
.a2hs__steps > li::before { content: counter(step); width: 28px; height: 28px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: var(--fs-md); line-height: 1; }
/* 画面のボタンの名前は、押す物だと分かるように小さな札にする */
/*   inline-flex の札は「最初の中身（アイコン）の下端」を文字の線に合わせるので、アイコンから始まる札・アイコンだけの札（…）が上にずれる
     → 高さを決めて、札の真ん中を文字の真ん中にそろえる（vertical-align: middle）。中のアイコンと文字は align-items で上下中央 */
.a2hs__key { display: inline-flex; align-items: center; gap: 3px; height: 1.8em; padding: 0 8px; border-radius: var(--r-sm); vertical-align: middle; position: relative; top: -.09em; /* middle は欧文の高さ基準なので、和文の真ん中まで少し上げる */
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; line-height: 1; white-space: nowrap; }
.a2hs__key .icon { display: block; font-size: 1.15em; vertical-align: 0; }
.a2hs__sub { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--muted); }
.a2hs__note { margin: 4px 0 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.a2hs__note .icon { vertical-align: -3px; }
.a2hs__install { width: 100%; margin: 12px 0 2px; }
@media (prefers-reduced-motion: reduce) { .a2hs__tab { transition: none; } .a2hs__panel:not([hidden]) { animation: none; } }
/* スマホ・タブレット（指で触る端末）だけに出す物。ホーム画面から開いているとき（standalone）は出さない
   not all and (…) = 「指で触る端末」ではないとき */
@media not all and (hover: none) and (pointer: coarse) { .touch-only { display: none; } }
@media (display-mode: standalone) { .touch-only { display: none; } }
/* 横にはみ出す表はマウスでつかんで左右に動かせる（JS: setupDragScroll） */
/* PC でマウスをつかんで左右に動かせる表（JS: setupDragScroll）。はみ出しているときだけ is-draggable が付く */
.table-scroll.is-draggable, .table-card.is-draggable { cursor: grab; }
.table-scroll.is-dragging, .table-card.is-dragging { cursor: grabbing; user-select: none; }
.ranking--plain li::before { content: none; }
.status { font-size: var(--fs-xs); font-weight: 700; padding: 3px 9px; border-radius: var(--r-full); }
.status--ok { color: var(--ok); background: var(--ok-bg); }
.status--new { color: var(--danger); background: var(--danger-bg); }
.status--warn { color: var(--warn); background: var(--warn-bg); }

/* 名前の色分け（元の m6 の valid / invalid と同じ考え方） */
/* DB 照合の色（緑・黄・赤）が変わるときは、パッと変えずにフェードさせる */
.name-input, .slot-select { transition: background-color var(--t-slow) ease, border-color var(--t-slow) ease; }
@media (prefers-reduced-motion: reduce) { .name-input, .slot-select { transition: none; } }
.name-input.is-ok, .slot-select.is-ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.name-input.is-similar { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.name-input.is-new, .slot-select.is-new { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: var(--fs-sm); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: var(--r-xs); display: inline-block; border: 1px solid; }
.swatch--ok { background: var(--ok-bg); border-color: var(--ok); }
.swatch--similar { background: var(--warn-bg); border-color: var(--warn); }
.swatch--new { background: var(--danger-bg); border-color: var(--danger); }
/* 名前欄の注意書き: body 直下に浮かせる半透明のポップアップ（表の行の幅・高さを変えない。位置は JS が入力欄の真下に合わせる） */
.hint-pop { position: absolute; z-index: 50; font-size: var(--fs-xs); line-height: 1.5; white-space: pre-line; color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 78%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px 8px; max-width: 280px;
  box-shadow: var(--shadow-pop); pointer-events: none; /* 下の入力欄をそのままクリックできるように */
  animation: hint-pop-in var(--t-fast) ease-out; }
@keyframes hint-pop-in { from { opacity: 0; transform: translateY(-4px); } }
/* 黄色の名前欄の「もしかして ◯◯？」: 候補の名前は押せる（下の入力欄ではなく、ポップアップ自体をクリックできるようにする） */
.hint-pop--suggest { pointer-events: auto; }
.hint-pop__pick { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--accent);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.hint-pop__pick:hover { text-decoration-thickness: 2px; }
@media (prefers-reduced-motion: reduce) { .hint-pop { animation: none; } }
/* 会場の「もしかして ◯◯？」（JS の setupVenueSuggest）。見た目は .hint-pop と同じで、× で閉じるまで出しておく。
   クラスを分けているのは、名前欄の showHint が .hint-pop を全部消すので巻き込まれないように */
.venue-pop { position: absolute; z-index: 50; font-size: var(--fs-xs); line-height: 1.5; color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 78%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px 8px; max-width: 320px;
  box-shadow: var(--shadow-pop); animation: hint-pop-in var(--t-fast) ease-out; }
.venue-pop__close { margin-left: 6px; padding: 0 4px; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; }
.venue-pop__close:hover { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .venue-pop { animation: none; } }

.sticky-actions { position: sticky; bottom: 16px; z-index: 10; display: flex; justify-content: flex-end; gap: 10px; padding: 10px; border-radius: var(--r-full);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); box-shadow: var(--shadow); width: max-content; margin: 20px 0 0 auto; } /* 上: 直前の「＋ 曲を追加」などのボタンとくっつかないように */
.sticky-actions__note { align-self: center; padding: 0 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--warn); }
.sticky-actions__note[hidden] { display: none; }

/* ===== 8.5 追加ページ（検索・集計・設定・管理） ===== */
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero__actions .btn.is-active { color: var(--accent); border-color: var(--accent); } /* アビーボード: 開いているパネルのボタン */
.add-band { margin: 14px 0 0 72px; display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { margin-top: 16px; display: flex; justify-content: flex-end; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip--lg { padding: 6px 14px; font-size: var(--fs-md); background: var(--surface); }
.search-results section + section { margin-top: 8px; }
.more-link { margin-top: 12px; text-align: center; }
[id^="band-n"] { scroll-margin-top: 80px; } /* 「もっと見る」で飛んだ行が上のヘッダーに隠れないように */
.year-filter select { padding: 9px 12px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); font-weight: 700; }
/* 集計ページの絞り込み（メンバー × 期間）
   ラジオボタンを隠して、選ばれている label を .tab.is-active と同じ見た目にする。
   :has() は「中に〇〇を持っている要素」を選ぶセレクタ（最近のブラウザは全部対応） */
.stats-filter { display: grid; gap: 14px; margin-bottom: 10px; position: sticky; top: 70px; z-index: 15; } /* スクロールしてもヘッダーの下に浮いて残る */
.stats-filter__row { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.stats-filter__row legend { float: left; width: 4.5em; padding: 0; font-size: var(--fs-xs); font-weight: 800; color: var(--muted); }
.stats-filter__line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; } /* メンバー一覧: タブ・スロット・退会者を1行に（スマホは2段） */
.stats-filter__sub { display: flex; align-items: center; gap: 12px; }
.stats-filter__sub label { display: inline-flex; align-items: center; gap: 4px; } /* チェックボックスを文字の上下の真ん中に（そのままだと少し上に寄る） */
/* 学年スロットの入れ物: 学年別のときだけ幅を広げて出す → 後ろの「退会者を非表示」が横にすべる。
   幅は max-width ではなく width をスロットと同じ幅（--grade-slot-w）まで動かす
   （max-width を大きめの値まで動かすと、途中で止まって見えてチェックの動きがカクつくため）。
   padding 3px = スロットの光る枠（box-shadow 3px）が overflow で切れないように。同じだけ margin を引いて見た目の位置は変えない */
.grade-slot-wrap { --ease: cubic-bezier(.25, .8, .25, 1); box-sizing: content-box; flex: none; display: flex; overflow: hidden;
  width: 0; height: 0; padding: 3px; margin: -3px; margin-right: calc(-3px - 12px); opacity: 0; visibility: hidden;
  transition: width var(--t-slow) var(--ease), height var(--t-slow) var(--ease), margin-right var(--t-slow) var(--ease), opacity var(--t-slow) ease, visibility var(--t-slow); }
.grade-slot-wrap .year-slot { transform: scale(.85); opacity: 0; transition: transform var(--t-slow) var(--ease), opacity var(--t-slow) ease; }
/* 学年別以外は幅も高さも0 → 下の段（カード）がスロットの分だけ詰まる。学年別にすると今の高さまでアニメーションで広がる
   学年別のときだけ広げる。margin-right（閉じているとき）= 枠の3px + 段の gap 12px を引いて、チェックが左端までつめる
   .is-grade は PHP の初期値と app.js の setupGradeSlot で付ける
   （:has(input:checked) だと Chrome がタブの切り替えで見た目を更新しないことがあったのでクラスにしている） */
.stats-filter.is-grade .grade-slot-wrap { width: var(--grade-slot-w); height: var(--grade-slot-h); margin-right: -3px; opacity: 1; visibility: visible; }
.stats-filter.is-grade .grade-slot-wrap .year-slot { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .grade-slot-wrap, .grade-slot-wrap .year-slot { transition: none; }
}
.tabs--filter { position: static; margin: 0; box-shadow: none; }
.tabs--static { position: static; box-shadow: none; } /* 新規追加ページのタブ（スクロールで追いかけてこない） */
.tabs--filter .tab { cursor: pointer; }
.tabs--filter .tab input { position: absolute; opacity: 0; pointer-events: none; }
.tabs--filter .tab:has(input:checked) { background: var(--accent); color: var(--on-accent); }
.tabs--filter .tab:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs--filter .tab.is-disabled { opacity: .4; cursor: not-allowed; }
/* 集計の「よく組む学年区分」: ラジオで選んだ区分の表だけ出す（JS なし） */
.grade-mix__tabs { display: inline-flex; margin-bottom: 10px; }
/* % と「〇/〇回」は幅を固定して右寄せ（数字の桁数で % の列がずれないように） */
.grade-mix .ranking .pill { justify-content: flex-end; min-width: 3.6em; font-variant-numeric: tabular-nums; }
.grade-mix__count { flex: none; width: 5.5em; text-align: right; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.grade-mix:not(:has(input[value="junior"]:checked)) [data-grade-view="junior"],
.grade-mix:not(:has(input[value="same"]:checked)) [data-grade-view="same"],
.grade-mix:not(:has(input[value="senior"]:checked)) [data-grade-view="senior"] { display: none; }
/* 切り替えたとき、出てきた表をふわっと出す（display: none から戻るたびに再生される） */
[data-grade-view] { animation: grade-mix-in var(--t-base) ease-out; }
@keyframes grade-mix-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { [data-grade-view] { animation: none; } }
.section-title__note { margin-left: 8px; font-size: .7em; font-weight: 400; color: var(--muted); opacity: .8; }
/* メンバーページの「よく組む学年区分」: 左に円グラフ、右に割合 */
.grade-mix-card { --mix-pct: 40%; --mix-junior: color-mix(in srgb, var(--dr) var(--mix-pct), var(--surface)); --mix-same: color-mix(in srgb, var(--vo) var(--mix-pct), var(--surface)); --mix-senior: color-mix(in srgb, var(--gt) var(--mix-pct), var(--surface)); }
[data-theme="dark"] .grade-mix-card { --mix-pct: 75%; } /* 暗い背景に混ぜると暗く沈むので、元の色を多めに */
.grade-mix-card__link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: inherit; }
.grade-mix-card__link:hover { color: var(--accent); }
#grade-mix { scroll-margin-top: 220px; } /* 集計ページの浮いている絞り込みに隠れないように */
.grade-mix-card__body { display: flex; align-items: center; gap: 20px; }
.grade-mix-card__pie { flex: none; width: 110px; aspect-ratio: 1; border-radius: 50%; }
.grade-mix-card__legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; }
.grade-mix-card__legend li { display: flex; align-items: baseline; gap: 6px; }
.grade-mix-card__legend b { margin-left: auto; font-size: 1.1em; }
.grade-mix-card__dot { width: 10px; height: 10px; border-radius: 50%; align-self: center; }
.stats-filter__extra { display: flex; align-items: center; gap: 6px; }
.stats-filter__extra select { padding: 7px 10px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; }
/* 該当するタブが選ばれていないときは、年度セレクトを隠す */
.stats-filter:not(:has(input[name="who"][value="custom"]:checked)) [data-show-when="who=custom"],
.stats-filter:not(:has(input[name="period"][value="year"]:checked)) [data-show-when="period=year"],
.stats-filter:not(:has(input[name="period"][value="range"]:checked)) [data-show-when="period=range"],
.stats-filter:not(:has(input[name="who"][value="grade"]:checked)) [data-show-when="who=grade"],
.stats-filter:not(:has(input[name="who"][value="near"]:checked)) [data-show-when="who=near"],
.stats-filter:has(input[name="who"][value="all"]:checked) [data-hide-when="who=all"] { display: none; }
/* スマホ: 浮かせたまま高さを詰める（見出しを消して、各段を1行の横スクロールに） */
@media (max-width: 600px) {
  /* .card のスマホ用 padding より強く。上下の余白は浮く前は 14px、浮くと（--stuck）8px まで詰める */
  .card.stats-filter { gap: 6px; padding: calc(14px - 6px * var(--stuck, 0)) 8px; top: 66px; }
  .stats-filter__row { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-inline: 3px; scrollbar-width: none; } /* 3px = スロットの光る枠が切れないように */
  .stats-filter__row::-webkit-scrollbar { display: none; }
  /* 見出し（メンバー・集計期間）: トグルの上の段に出す（float をやめると fieldset のいつもの見出し = 上に乗る）。
     浮く位置に近づくほど高さごと縮めて薄くする。--stuck = 0（離れている）〜 1（浮いている）を app.js がスクロールに合わせて書く */
  .stats-filter__row legend { float: none; width: auto; line-height: 18px; height: calc(18px * (1 - var(--stuck, 0)));
    margin-bottom: calc(2px * (1 - var(--stuck, 0))); opacity: calc(1 - var(--stuck, 0)); overflow: hidden; white-space: nowrap; }
  .stats-filter__row + .stats-filter__row { margin-top: calc(6px * (1 - var(--stuck, 0))); } /* 集計期間の見出しの上: 浮く前だけ少し空ける */
  .stats-filter__line { gap: 6px; }
  .stats-filter__line > .stats-filter__row { flex-basis: 100%; } /* タブの段を1行まるごと使う → スロットと退会者は下の段 */
  /* 下の段: スロット・上下3学年の範囲・退会者。範囲の文字は長いので、はみ出すときはその中で折り返す（退会者は1行のまま） */
  .stats-filter__sub { padding-left: 3px; min-width: 0; }
  .stats-filter__sub > * { flex: none; white-space: nowrap; }
  /* 学年別以外: 浮く位置に近づくほど（--stuck、app.js）下の段（退会者チェック）の高さを 25px → 22px に詰める。
     チェックの上（タブとの間）と下（カードの下端）の余白がほぼ同じになる高さ。学年別はスロットがあるので詰めない */
  .stats-filter:not(.is-grade) .stats-filter__sub { height: calc(25px - 3px * var(--stuck, 0)); }
  .stats-filter .tabs--filter { flex-shrink: 0; max-width: none; overflow: visible; padding: 2px; } /* タブではなく段ごと横スクロール */
  .stats-filter .tab { padding: 5px 8px; font-size: var(--fs-xs); }
  .stats-filter__extra { flex-shrink: 0; }
  .stats-filter__extra select { padding: 4px 8px; font-size: var(--fs-xs); }
}
.stats-scope { margin: 0 0 14px; font-size: var(--fs-md); } /* 今どの範囲を見ているかは大事なので、.small（13px）より大きく */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; }
.section-title--card { margin: 0 0 12px; }
/* 見出しの右端に小さな切り替え（統計の「Voを合算する」）を置く */
.section-title--tool { display: flex; align-items: center; gap: 6px; scroll-margin-top: 80px; } /* 切り替えて戻ってきたとき上のヘッダーに隠れないように */
.vo-sum-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: var(--r-full);
  border: 1px solid var(--border); color: var(--muted); font: 600 var(--fs-2xs)/1.4 var(--font); opacity: .75; white-space: nowrap; }
.vo-sum-toggle .icon { font-size: 15px; }
.vo-sum-toggle:hover { opacity: 1; color: var(--text); text-decoration: none; }
.vo-sum-toggle.is-on { opacity: 1; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
/* 切り替えたとき: 表をふわっと出し、棒グラフは左から伸ばす（JS の setupVoSum が is-switched を付け直す） */
.vo-sum-toggle { transition: color var(--t-base) ease, border-color var(--t-base) ease, opacity var(--t-base) ease; }
[data-vo-view].is-switched { animation: day-fade var(--t-base) ease; }
[data-vo-view].is-switched .bar { transform-origin: left; animation: bar-grow .45s var(--ease-out); }
@keyframes bar-grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .vo-sum-toggle { transition: none; }
  [data-vo-view].is-switched, [data-vo-view].is-switched .bar { animation: none; }
}
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(0, 11em) 1fr auto; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.bars__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ranking li > span:first-child { min-width: 0; }
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.edit-box { margin-bottom: 18px; padding: 14px 20px; }
.edit-box summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.edit-box[open] summary { margin-bottom: 14px; color: var(--text); }
/* 自分のページ: 開け閉めの代わりにアカウント設定へのリンク（summary と同じ見た目） */
.edit-box--link { display: block; font-weight: 700; color: var(--muted); text-decoration: none; }
.edit-box--link:hover { color: var(--text); }
.merge-list { display: grid; gap: 10px; }
.merge-item { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 18px; }
.merge-item__names { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.merge-item__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form { display: inline; }
.table-scroll--flush { margin: 0; border-top: 0; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: var(--r-sm); font-size: .9em; }

/* ===== 曲（セットリスト） ===== */
.song-list { display: grid; gap: 12px; margin-bottom: 12px; }
.song-card { display: grid; gap: 12px; padding: 16px 18px; }
.song-card--new { border-style: dashed; }
/* 「＋ 曲を追加」で出てきたカード: 上からふわっと出す（JS の setupSongs が is-entering を付け、終わったら外す）。
   追加したばかりのカードを🗑で消すときの「縮んで消える」動きは、高さがカードごとに違うので JS（animate）でやっている */
.song-card.is-entering { animation: song-card-in var(--t-base) ease-out; }
.song-card.is-dragging { position: relative; z-index: 2; box-shadow: var(--shadow-pop); } /* ≡ でつかんでいる曲を少し浮かせる */
/* ドラッグ中（JS が .song-list に is-sorting を付ける）: 担当・検索結果を縮めて、曲の並びを見渡しやすくする */
.song-card, .performers, .track-results { transition: gap var(--t-base) ease, max-height var(--t-base) ease, opacity var(--t-fast) ease, padding var(--t-base) ease; }
.performers { max-height: 1200px; }
.song-list.is-sorting .song-card { gap: 0; }
.song-list.is-sorting .performers, .song-list.is-sorting .track-results { max-height: 0; opacity: 0; padding-block: 0; overflow: hidden; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .song-card, .performers, .track-results { transition: none; } }
[data-song-handle] { cursor: grab; touch-action: none; } /* touch-action: スマホでドラッグ中に画面がスクロールしないように */
.song-card.is-dragging [data-song-handle] { cursor: grabbing; }
@keyframes song-card-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .song-card.is-entering { animation: none; } }
.song-card__head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.song-card__no { display: flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--muted); font-weight: 700; }
.song-card__se-sp { font-size: var(--fs-xl); font-weight: 800; min-width: 1.4em; visibility: hidden; } /* 他の曲の番号と同じ幅だけ空ける */
.song-card__se { display: flex; justify-content: flex-end; width: 24px; white-space: nowrap; font-size: var(--fs-xl); font-weight: 800; color: var(--accent); } /* 「曲目」の位置に右寄せ（大きさは番号と同じ。はみ出す分は左へ） */
.song-add-se { margin: 0 0 14px; }
.song-card__no [data-song-no] { font-size: var(--fs-xl); color: var(--text); font-weight: 800; min-width: 1.4em; text-align: right; }
.song-card__title, .song-card__artist { padding: 9px 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.song-card__title { flex: 0 1 320px; min-width: 160px; font-weight: 700; font-size: var(--fs-lg); } /* 伸ばしすぎない（余った幅は右へ） */
.song-card__artist { flex: 0 1 220px; min-width: 140px; font-size: var(--fs-md); transition: opacity var(--t-base) ease; }
/* オムニバスでないとき: バンドのアーティストで固定。薄くして「ここは変えられない」と分かるように */
.song-card__artist[readonly] { opacity: .45; cursor: not-allowed; }
.song-omnibus { margin: 0 0 14px; font-weight: 700; }
/* 曲の編集の「曲を探す」: 曲を紐付けるときに必ず使うボタンなので、枠だけアクセント色（赤）にして少し目立たせる */
.song-search-btn { border-color: var(--accent); }
/* ドラッグ中（.song-list.is-sorting）: アーティスト欄・検索ボタンも横に縮めて消す（行の隙間ぶんは負の margin で詰める） */
.song-card__artist, .song-search-btn, .song-card__delete { transition: flex-basis var(--t-base) ease, width var(--t-base) ease, min-width var(--t-base) ease, padding var(--t-base) ease, margin var(--t-base) ease, opacity var(--t-fast) ease, border-width var(--t-base) ease; }
.song-list.is-sorting .song-card__artist, .song-list.is-sorting .song-search-btn, .song-list.is-sorting .song-card__delete { flex: 0 0 0; min-width: 0; width: 0; padding-inline: 0; border-width: 0; margin-left: -10px; opacity: 0; overflow: hidden; white-space: nowrap; pointer-events: none; }
/* スマホ: ドラッグ中は「1行目 ≡・番号・ジャケット / 2行目 曲名だけ」。縮んだ欄は行を作らないよう消す */
@media (max-width: 600px) {
  .song-list.is-sorting .song-card__title { flex: 1 0 100%; }
  .song-list.is-sorting .song-card__artist, .song-list.is-sorting .song-search-btn, .song-list.is-sorting .song-card__delete { display: none; }
}
@media (prefers-reduced-motion: reduce) { .song-card__artist, .song-search-btn, .song-card__delete { transition: none; } }
/* 曲の編集: 紐付けた曲のジャケット（紐付けていなければ ♪） */
.song-thumb { position: relative; width: 40px; height: 40px; flex: none; border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-2); color: var(--muted); font-size: var(--fs-lg); }
.song-thumb__art { width: 100%; height: 100%; display: grid; place-items: center; }
.song-thumb__art img { width: 100%; height: 100%; object-fit: cover; }
/* 紐付けを外すボタン: ジャケットにぴったり重ねて、普段は透明。マウスを乗せる（キーボードで選ぶ）と、リンクが切れるマークが出る */
.song-thumb__clear { position: absolute; inset: 0; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; transition: opacity var(--t-fast) ease; }
.song-thumb__clear[hidden] { display: none; }
/* マークはジャケットの真ん中に大きく（40px の枠に対して 30px）。線も太めにして、小さいジャケットの上でもひと目で分かるように */
.song-thumb__clear .icon { font-size: 30px; font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 48; }
.song-thumb:hover .song-thumb__clear, .song-thumb__clear:focus-visible { opacity: 1; }
.song-thumb__clear:hover { background: color-mix(in srgb, var(--danger) 80%, transparent); }
/* スマホなどマウスが無い端末では「乗せる」ができないので、右下に小さく常に出しておく */
@media (hover: none) {
  .song-thumb__clear { inset: auto 0 0 auto; width: 18px; height: 18px; border-radius: var(--r-sm) 0 0 0; opacity: 1; }
  .song-thumb__clear .icon { font-size: 14px; }
}
/* 曲の削除（ゴミ箱アイコン）。押すとカードが薄くなり（保存で消える）、ボタンだけ赤く残す */
.song-card__delete { width: 36px; height: 36px; flex: none; margin-left: auto; display: grid; place-items: center; padding: 0; cursor: pointer;
  border-radius: var(--r-md); border: 1px solid transparent; background: transparent; color: var(--muted); }
.song-card__delete:hover, .song-card__delete:focus-visible { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.song-card__delete[aria-pressed="true"] { color: #fff; background: var(--danger); }
.song-card.is-deleted { border-color: var(--danger); }
.song-card.is-deleted > :not(.song-card__head), .song-card.is-deleted .song-card__head > :not(.song-card__delete) { opacity: .35; }
/* 削除の印を付けた・外したときに、薄くなるのをパッと切り替えずに少しだけなめらかに */
.song-card > :not(.song-card__head), .song-card__head > * { transition: opacity var(--t-base) ease; }
@media (prefers-reduced-motion: reduce) { .song-card > :not(.song-card__head), .song-card__head > * { transition: none; } }
/* 🔍 の検索結果。押すとその曲を紐付ける */
.track-results { display: grid; gap: 4px; max-height: 360px; overflow-y: auto; padding: 6px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface-2); }
.track-results[hidden] { display: none; }
.track-option { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 6px 8px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.track-option:hover, .track-option:focus-visible { background: var(--surface); }
.track-option img { width: 40px; height: 40px; border-radius: var(--r-xs); object-fit: cover; }
.track-option__title { font-weight: 700; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-option__sub { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-results__msg { color: var(--muted); font-size: var(--fs-sm); padding: 6px 8px; }
/* 候補の右の「試聴可」の印（app.js の optionButton。試聴がある曲だけ） */
.track-option__preview { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-2xs); font-weight: 700; color: var(--accent); white-space: nowrap; }
.track-option__preview .icon { font-size: 16px; }
/* 検索結果の窓: 開くときに上からふわっと出す。候補は1件ずつ少しずらして出す（最初の8件まで。それ以降はまとめて） */
.track-results:not([hidden]) { animation: track-results-in var(--t-base) ease-out; transform-origin: top; }
.track-option { animation: track-option-in var(--t-base) ease-out both; }
.track-option:nth-child(2) { animation-delay: 30ms; } .track-option:nth-child(3) { animation-delay: 60ms; }
.track-option:nth-child(4) { animation-delay: 90ms; } .track-option:nth-child(5) { animation-delay: 120ms; }
.track-option:nth-child(6) { animation-delay: 150ms; } .track-option:nth-child(7) { animation-delay: 180ms; }
.track-option:nth-child(n+8) { animation-delay: 210ms; }
.track-results__msg { animation: track-option-in var(--t-base) ease-out both; }
/* 閉じるとき（JS の closeResults が is-closing を付け、終わったら hidden にする） */
.track-results.is-closing { animation: track-results-out var(--t-base) ease-in forwards; pointer-events: none; }
@keyframes track-results-in { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } }
@keyframes track-results-out { to { opacity: 0; transform: translateY(-6px) scaleY(.96); } }
@keyframes track-option-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .track-results:not([hidden]), .track-results.is-closing, .track-option, .track-results__msg { animation: none; } }
.performers { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 14px; }
.performers__tools { grid-column: 1 / -1; }
/* 1段目に名前、2段目に楽器1・楽器2（横並びだと、カードが細い PC で名前が折り返して崩れるため） */
.performer { display: grid; grid-template-columns: minmax(0, 1fr) auto; /* 1段目: 名前 / コーラスあり、2段目: 楽器1 ＋、3段目: 楽器2 */ align-content: start; /* 隣のカードが2段でも、中身は上に詰める */ gap: 6px; align-items: center; padding: 6px 8px; border-radius: var(--r-md); background: var(--surface-2); }
.performer > .cho-toggle-wrap { justify-self: end; } /* 楽器の段に置くと、楽器のボタンが縮みきれずに重なる */
.performer__inst { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; min-width: 0; }
.performer__inst[hidden] { display: none; }
.performer__add { flex: none; display: inline-grid; place-items: center; /* ＋ を丸の真ん中に（文字の「＋」はフォントで上下がずれるのでアイコンにした） */
  width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.performer__add .icon { font-size: 18px; vertical-align: 0; }
.performer__add:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.performer__add[hidden] { display: none; }
/* 楽器のボタンはマスの幅に収める（長い「Vo/Gt ギターボーカル」は … で切る。はみ出して隣と重ならないように） */
.performer__inst > .live-pick { display: block; flex: 1; min-width: 0; }
.performer .live-pick__btn { width: 100%; min-width: 0; }
.performer.is-off { opacity: .45; }
.performer select { padding: 4px 6px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-xs); }
.performer__name { font-size: var(--fs-md); font-weight: 600; min-width: 0; }
/* バンド詳細（band.php）のセットリスト */
.setlist { margin-top: 10px; font-size: var(--fs-sm); }
.setlist summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.setlist ol { margin: 8px 0 0; padding-left: 1.6em; display: grid; gap: 4px; }
.setlist li::marker { color: var(--muted); font-weight: 700; }
.setlist li.setlist__se { list-style: decimal; } /* SE は番号の代わりに「SE」を、番号と同じ位置（::marker）に出す */
.setlist li.setlist__se::marker { content: "SE  "; color: var(--muted); }
/* 演奏曲との間に区切り線。線は SE の文字（番号の位置）の下から始め、右は少し手前で止める。
   線は上下の余白の真ん中に来るよう、上下の余白（padding）を同じにする。先頭・末尾の SE は外側の線なし、SE が続くときは間の線なし */
.setlist { --gutter: 1.6em; }
.band-section .setlist { --gutter: 1.8em; }
.setlist li.setlist__se { position: relative; padding: 10px 0; }
.setlist li.setlist__se::before { content: ""; position: absolute; left: calc(-1 * var(--gutter)); right: 24px; top: 0; bottom: 0;
  border-block: 1px solid var(--border); pointer-events: none; }
.setlist li.setlist__se:first-child::before { border-top: 0; }
.setlist li.setlist__se:last-child::before { border-bottom: 0; }
.setlist li.setlist__se + li.setlist__se::before { border-top: 0; }
.setlist__who { color: var(--muted); font-size: var(--fs-xs); margin-left: 6px; }
.setlist__note { white-space: nowrap; } /* 「Cho. 山田・田中」の途中では折り返さない */
.setlist__note + .setlist__note { margin-left: .9em; } /* 「、」の代わりのすき間 */
/* 曲名の左の小さいジャケット。紐付けた曲は曲名ごとリンク（見ている人の音楽アプリで開く） */
.setlist li { line-height: 28px; }
.setlist__song { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; color: inherit; text-decoration: none; }
a.setlist__song:hover { color: var(--accent); text-decoration: underline; }
.setlist__art { width: 28px; height: 28px; flex: none; border-radius: var(--r-xs); object-fit: cover; background: var(--surface-2); }
.setlist__art--none { display: inline-grid; place-items: center; color: var(--muted); font-size: var(--fs-xs); }
.setlist__artist { color: var(--muted); font-size: var(--fs-xs); margin-left: 4px; }
/* バンド詳細ページ */
.band-section { margin-top: 16px; }
.band-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0 0; font-size: var(--fs-sm); }
/* バンド詳細: 日付・ライブ名・日程・出演順・会場を1行に。eyebrow より大きく、本文と同じ色ではっきり */
.band-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 12px 0 0; font-size: var(--fs-md); font-weight: 600; color: color-mix(in srgb, var(--text) 75%, var(--muted)); } /* 本文と muted の間くらい */
.band-meta > * { display: inline-flex; align-items: center; gap: 4px; }
.band-meta .icon { font-size: 18px; color: var(--muted); }
.band-meta__live { font-weight: 800; color: inherit; }
.band-meta__order { color: var(--muted); font-weight: 500; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; opacity: .7; }
/* 前のバンド / 次のバンド（band.php の下）。2列で、片方しかないときも左右の位置は変えない（空の span で1マス埋める） */
.band-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.band-pager__link { display: flex; align-items: center; gap: 6px; padding: 12px 14px; min-height: 64px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.band-pager__link:hover { border-color: var(--accent); }
.band-pager__link--next { flex-direction: row-reverse; text-align: right; } /* 次は矢印を右に */
.band-pager__link .icon { flex: none; font-size: 22px; color: var(--muted); }
.band-pager__text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.band-pager__label { font-size: var(--fs-2xs); font-weight: 600; color: var(--muted); }
.band-pager__name { font-weight: 800; line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; } /* スマホは幅が半分なので2行まで出して、それより長ければ … */
/* バンド詳細のセットリストは主役なので大きく（stats.php の小さい一覧はそのまま） */
.band-section .setlist { font-size: var(--fs-xl); }
.band-section .setlist ol { gap: 10px; padding-left: 1.8em; }
.band-section .setlist li { line-height: 56px; }
.band-section .setlist li::marker { font-size: var(--fs-lg); }
.band-section .setlist__song { gap: 18px; font-weight: 700; } /* ジャケットと曲名の間 */
.band-section .setlist__song > :first-child { margin-left: 6px; } /* 番号とジャケットの間（ジャケットが番号にくっつかないように） */
.band-section .setlist__art { width: 56px; height: 56px; border-radius: var(--r-sm); font-size: var(--fs-xl); }
.band-section .setlist__artist, .band-section .setlist__who { font-size: var(--fs-sm); margin-left: 8px; }
/* オムニバス: 曲名の下にアーティスト（band.php の $songText）。行の高さ（line-height 56px）を2段で分け合う */
.setlist__text { display: inline-flex; flex-direction: column; line-height: 1.3; }
.band-section .setlist__text .setlist__artist { margin-left: 0; font-weight: 500; }
/* 曲名が折り返したら少し小さく、行の間も詰める（.is-wrapped は app.js の setupSetlistNames が付ける） */
.band-section .setlist__name.is-wrapped { font-size: .85em; line-height: 1.3; }
/* 「聴く」アイコン: ジャケットにマウスを乗せると、ジャケットが暗くなって真ん中にアプリのアイコンが出る。押すと音楽アプリへ
 *  .setlist__artwrap を position: relative にして、リンクを position: absolute; inset: 0 でジャケットにぴったり重ねている */
.setlist__artwrap { position: relative; display: inline-flex; flex: none; }
.setlist__listen { position: absolute; inset: 0; display: grid; place-items: center; border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .3); opacity: 0; transition: opacity var(--t-fast) ease; }
/* アイコンはジャケットの 70% の大きさに（svg の width/height 属性を CSS で上書き） */
.setlist__listen svg { display: block; width: 70%; height: 70%; border-radius: 50%; background: #fff; }
/* Spotify のロゴは波線の部分が「穴」なので、後ろの色が透けて見える。白だと目立つので公式ロゴと同じ黒で塗りつぶす */
/*   丸ごと黒にするとふちから黒がはみ出すので、radial-gradient で半径の 90% までだけ黒く塗る */
.setlist__listen--spotify svg { background: radial-gradient(circle closest-side, #000 90%, transparent 91%); }
/* YouTube Music も同じ作り（輪と再生マークが穴）なので、白を半径の 90% までにしてはみ出しを防ぐ */
.setlist__listen--youtube_music svg { background: radial-gradient(circle closest-side, #fff 90%, transparent 91%); }
/* Apple Music は公式アプリのアイコンに寄せて角丸の四角（色とグラデーションは svg の中で塗っている） */
.setlist__listen--apple_music svg, .setlist__listen--line_music svg { border-radius: 22%; background: none; } /* LINE MUSIC も同じ */
.setlist__artwrap:hover .setlist__listen, .setlist__listen:focus-visible { opacity: 1; }
/* いまは「詳細」ボタン（<button>）。押すとアルバムのモーダル。アプリのアイコンはモーダルの中に出す */
button.setlist__listen { padding: 0; border: 0; cursor: pointer; color: #fff; }
.setlist__listen .icon { font-size: 26px; }
/* アプリの色。:hover も並べるのは、全体の a:hover（赤くする）の方が強くて、乗せたときにロゴが赤く塗られてしまうため */
.setlist__listen--spotify, .setlist__listen--spotify:hover { color: #1db954; }
.setlist__listen--apple_music, .setlist__listen--apple_music:hover { color: #fa243c; }
.setlist__listen--youtube_music, .setlist__listen--youtube_music:hover { color: #ff0000; }
.setlist__listen--line_music, .setlist__listen--line_music:hover { color: #0ee071; } /* 公式ロゴの緑 */
@media (prefers-reduced-motion: reduce) { .setlist__listen { transition: none; } }
/* 30秒試聴の ▶（app.js の setupPreview）。曲名の右に丸いボタン。押すと ⏸ になる
 *  --p（0〜1）= どこまで聴いたか。conic-gradient で丸い枠を時計回りに塗っていく（::before で真ん中をくり抜いて枠だけ見せる） */
.setlist__play { --p: 0; position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; margin-left: 20px;
  padding: 0; border: 0; border-radius: 50%; vertical-align: middle; cursor: pointer; color: var(--muted);
  opacity: .55; transition: opacity var(--t-fast) ease; /* 鳴らしていないときは控えめに。乗せる・鳴らすとはっきり */
  background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--border) 0); }
.setlist__play::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.setlist__play .icon { position: relative; font-size: 22px; }
.setlist__play .tab-icon { position: relative; top: 1px; font-size: var(--fs-2xs); } /* top: 英字は行の中で上に寄って見えるので、丸の真ん中に下げる */
.setlist__play:hover, .setlist__play:focus-visible, .setlist__play.is-playing, .setlist__play.is-loading { opacity: 1; }
.setlist__play:hover .icon, .setlist__play.is-playing .icon { color: var(--accent); }
.setlist__play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.setlist__play.is-loading { animation: preview-wait .7s ease-in-out infinite alternate; } /* 音源を探している・読み込み中 */
@keyframes preview-wait { to { opacity: .35; } }
.setlist__play.is-none { cursor: default; opacity: .3; } /* 試聴が無かった */
.setlist__play.is-none .icon { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .setlist__play.is-loading { animation: none; opacity: .5; } }
.setlist-hint { margin: 2px 0 0; }
.setlist-hint .icon { font-size: 16px; vertical-align: -3px; }
@media (max-width: 640px) {
  .band-section .setlist { font-size: var(--fs-xl); }
  .band-section .setlist { --gutter: 1.2em; }
  .band-section .setlist ol { padding-left: 1.2em; margin-right: -10px; } /* 番号の左の余白を詰め、右はカードの余白に少しはみ出させて、試聴ボタンの場所をあける */
  .band-section .setlist li { line-height: 1.3; } /* 長い曲名が折り返したとき、行と行の間が空きすぎないように（行の高さはジャケットの 44px で決まる） */
  .band-section .setlist li::marker { font-size: var(--fs-md); } /* 余白を詰めても「10.」がはみ出さないように */
  .band-section .setlist__song { gap: 12px; max-width: calc(100% - 52px); overflow-wrap: anywhere; } /* 52px = ▶ の幅 34px + margin 8px + HTML の改行（空白1文字分）。曲名が長くても ▶ が次の行に落ちない */
  .band-section .setlist__play { margin-left: 8px; }
  .band-section .setlist li:has(.setlist__play + .setlist__play) .setlist__song { max-width: calc(100% - 100px); } /* ▶ と TAB の2つ並ぶ曲: 2つぶん（52px × 2 − 4px）あけて、TAB が次の行に落ちないように */
  /* 備考（Cho. 山田 など）: 曲名の下に、曲名と行頭をそろえて置く（62px = ジャケットの左 6px + ジャケット 44px + すき間 12px）。
     flex + column-gap にすると、折り返した2行目以降も同じ位置から始まる（margin-left だと行頭にすき間が残る） */
  .band-section .setlist__who { display: flex; flex-wrap: wrap; column-gap: .9em; margin: 2px 0 0 62px; line-height: 1.5; }
  .band-section .setlist__note + .setlist__note { margin-left: 0; }
  .band-section .setlist__note { white-space: normal; } /* 1つの備考が1行に入り切らないときだけ、その中で折り返す */
  .band-section .setlist__art { width: 44px; height: 44px; }
}

/* ===== 印刷（ライブ詳細の「印刷」ボタン） ===== */
/* ===== 好きなアルバム（member.php） =====
 *  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr))
 *    → 「140px 以上の列を、入るだけ並べる」。画面幅に合わせて列の数が勝手に変わるので、
 *      スマホ用の @media を書かなくても 2列〜6列くらいに自動で収まる。
 */
.albums { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.album { position: relative; display: grid; gap: 6px; align-content: start; }
/* aspect-ratio: 1 → 幅に合わせて高さも同じにする（正方形）。画像の読み込み前でもレイアウトがガタつかない */
.album__art { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block;
  border-radius: var(--r-md); background: var(--surface-2); box-shadow: var(--shadow); }
.album__meta { display: grid; gap: 2px; min-width: 0; }
/* 長いアルバム名は2行で「…」にする */
.album__title { font-size: var(--fs-sm); line-height: 1.35; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* アルバムを入れているメンバーの名前（lib/albums.php の fan_albums_html）。
   名前は inline-block で1かたまりにして、名前の途中で折り返さず名前ごと次の行へ送る。
   区切りの「・」は各名前の前（::before・幅1em）に付け、中身を左に1emずらして外側で overflow: hidden →
   行の頭に来た名前の「・」だけが外にはみ出して見えなくなる（1人目も同じ理屈で消える） */
.album__fans { display: block; overflow: hidden; }
.album__fans > span { display: block; margin-left: -1em; }
.album__fan { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.album__fan::before { content: "・"; display: inline-block; width: 1em; color: var(--text); }
/* 削除ボタンはジャケットの右上に重ねる */
.album__delete { position: absolute; top: 6px; right: 6px; margin: 0; }
/* 幅と高さを同じにして border-radius: 50% → まん丸。padding は 0 にして、中の × は .btn の flex で真ん中に置く */
.album__delete .btn { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--surface);
  box-shadow: var(--shadow-sm); }
/* ↑ で background を上書きしているので、ホバーで赤くなる .btn--danger:hover も書き直す（後に書いた方が勝つため） */
.album__delete .btn:hover { background: var(--danger); color: #fff; }
/* × はアイコンの文字ではなく、線2本を CSS で描く。文字の × は端末（フォントの描き方）によって少し上にずれるため。
   線は丸の真ん中（top/left 50% + translate(-50%, -50%)）に置いてから 45度・-45度に回すので、どの端末でもぴったり真ん中 */
.album__delete .btn { position: relative; }
.album__delete .btn .icon { display: none; }
.album__delete .btn::before, .album__delete .btn::after { content: ""; position: absolute; top: 50%; left: 50%;
  width: 52%; height: 2px; border-radius: 1px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.album__delete .btn::after { transform: translate(-50%, -50%) rotate(-45deg); }
/* max-width: 広い画面でも検索欄が横に伸びすぎないようにする（狭い画面では今までどおり横いっぱい） */
.album-search__form { display: flex; gap: 8px; margin: 12px 0; max-width: 420px; }
/* 縦幅を詰める。flex の中の子は高さがそろう（align-items: stretch が初期値）ので、
   検索欄を低くすれば、横の検索ボタンも同じ高さまで低くなる */
.album-search__form .search { flex: 1; min-width: 0; padding-top: 6px; padding-bottom: 6px; font-size: var(--fs-md); }
.albums--pick { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); margin-top: 6px; }
/* 本人のページの空の一覧（0枚のとき）は隠す。:empty = 中に何も入っていない要素 */
.albums:empty { display: none; }
/* ページ移動なしで差し替えた検索結果（JS: setupAlbumSearch）を、下からふわっと出す */
[data-album-results].is-fresh { animation: album-results-in var(--t-base) ease-out; }
@keyframes album-results-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { [data-album-results].is-fresh { animation: none; } }
.albums--pick .btn, .albums--pick .pill { justify-self: start; }

/* ---- 好きなアルバムの並び替え（JS: setupAlbumSort） ---- */
/* ---- マイアルバムのカード（JS: setupAlbumBox）。プロフィール編集の欄（.edit-box）と同じ雰囲気に ---- */
.album-box { margin: 18px 0; padding: 14px 20px; }
.album-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
/* 見出しボタン: ボタンの見た目（枠・背景）を消して、見出しの文字のように見せる */
.album-box__toggle { margin-right: auto; display: inline-flex; align-items: baseline; gap: 8px; padding: 0; border: 0;
  background: none; color: var(--text); font: 800 var(--fs-lg)/1.4 var(--font); cursor: pointer; }
.album-box__toggle:hover { color: var(--accent); }
.album-box__toggle:disabled { cursor: default; color: var(--text); } /* 開け閉めするものが無いとき（よく組むメンバーが5人以下）はただの見出し */
/* ▸ の文字は小さく見えるので、文字は消して（font-size: 0）枠線で三角を描く。
   左の枠線だけ色を付け、上下の枠線を透明にすると右向きの三角になる */
.album-box__chevron, .partner__chevron { display: inline-block; flex: none; width: 0; height: 0; font-size: 0;
  border-style: solid; border-width: 6px 0 6px 9px; border-color: transparent transparent transparent var(--muted);
  transition: transform var(--t-base) ease; }
/* 見出しの文字は baseline でそろえているが、三角は中身の無い箱なので下に寄る → 三角だけ上下の真ん中に置く */
.album-box__chevron { align-self: center; }
.album-box.is-open .album-box__chevron { transform: rotate(90deg); } /* ▸ を90度回して ▾ にする */
/* 閉じているとき: 6枚目以降と「アルバムを追加」を隠す。
   js-collapsible は JS が付けるクラス → JS が動かないときは何も隠れない（全部見える） */
.album-box.js-collapsible:not(.is-open) .albums > li:nth-child(n+6),
.album-box.js-collapsible:not(.is-open) .album-search { display: none; }
.album-box__more { display: flex; margin: 0 auto 4px; }
/* 「アルバムを追加」: 一覧との間に線を引いて区切る */
.album-search { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.album-search__title { margin: 0; font-size: var(--fs-md); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .album-box__chevron { transition: none; } }
/* よく組むメンバー（member.php の右の欄）。見た目はマイアルバムのカードを使い回す。閉じているときは上位5人だけ */
.partner-box { margin: 32px 0 0; }
/* 閉じているときの 6 人目以降は、JS（setupOnePartnerBox）が付ける is-extra で隠す。
   nth-child だと、退会者の行（hidden）も数えてしまって上位 5 人がずれるため */
.partner-box.js-collapsible:not(.is-open):not(.is-closing) .ranking > li.is-extra { display: none; } /* is-closing: 閉じる動きの間だけ見せておく（JS: setOpen） */
.partner-box .ranking > li[hidden] { display: none; } /* .ranking li の display: flex が hidden 属性に勝ってしまうので、明示的に隠す */
.partner-box .ranking { margin-bottom: 10px; }
/* 「退会者を非表示」: 見出しの下。開いたときだけ出す（JS が動かないときは出さない = 全員そのまま見える）。
   出る動きは JS（setOpen の animate） */
.partner-filter { display: none; margin: -4px 0 12px; font-size: var(--fs-sm); color: var(--muted); }
.partner-box.js-collapsible:is(.is-open, .is-closing) .partner-filter { display: flex; } /* 閉じる動きの間（is-closing）も見せておく */
/* よく組むメンバーの1行:「1 ▸ 3回 名前」。順位の数字は .ranking li::before のまま、右に <details> を置く。
   数字と summary を同じ高さ（28px）の行にして上でそろえる → 開いても数字は1行目の横に残る。開いた中身は数字の列の右に入る */
.partner-box .ranking li { align-items: flex-start; gap: 0; }
.partner-box .ranking li::before { line-height: 28px; }
.partner { flex: 1; min-width: 0; }
.partner summary { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-height: 28px; list-style: none; cursor: pointer; }
.partner summary::-webkit-details-marker { display: none; }
/* [▸ 3回]: 三角は回数の背景の中に、少し小さく */
.partner summary .pill { margin-left: 0; gap: 5px; padding-left: 8px; }
.partner .partner__chevron { border-width: 4px 0 4px 6px; }
/* 名前の行の右端の「Dr × 3」。入りきらなければ次の行の右に回る */
.partbar--partner { margin: 0 0 0 auto; gap: 4px; justify-content: flex-end; }
.partbar--partner .part { font-size: var(--fs-2xs); min-width: 0; padding: 1px 6px; }
.partner summary a { min-width: 0; overflow-wrap: anywhere; }
/* よく組むメンバーのメダル（相手から見て上位3位）: 名前のすぐ右。色は金・銀・銅を --m-light（明るい）/ --m-dark（暗い）で渡す（lib/repository.php の partner_medal） */
.medal { display: block; width: 12px; height: 15px; } /* 名前より控えめな大きさ（viewBox 16×20 を縮小） */
/* メダルを包むボタン: 見た目はメダルだけ。押せる範囲は周りに少し広げる（負の margin で行の高さ・並びは変えない） */
.medal-btn { flex: none; display: grid; place-items: center; padding: 6px; margin: -6px -6px -6px -11px; /* 左 -11px = 名前との間（gap 10px）を少し詰める */
  border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.medal--1 { --m-light: #f7d774; --m-dark: #c2920a; }
.medal--2 { --m-light: #e3e7ec; --m-dark: #8d97a2; }
.medal--3 { --m-light: #eeb07e; --m-dark: #a8622c; }
.partner[open] .partner__chevron { transform: rotate(90deg); }
/* 名前の ▸ を開いたときのふわっと出る動きは JS（setupPartnerBox）。
   CSS の animation だと、閉じた <details> の中身が display: none にならないブラウザ（今の Chrome）で2回目から動かない */
@media (prefers-reduced-motion: reduce) { .partner__chevron { transition: none; } }
/* 開いた中身: 年度の見出しと「バンド名 … ◯月ライブ ◯日目」 */
.partner__bands { margin: 8px 0 4px 24px; display: grid; gap: 4px; font-size: var(--fs-sm); }
.partner__bands dt { margin-top: 4px; font-size: var(--fs-2xs); font-weight: 800; color: var(--muted); }
.partner__bands dd { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.partner__bands dd a:first-child { min-width: 0; overflow-wrap: anywhere; }
/* 開いた中身の右側:「12月ライブ 1日目 [Dr]」 */
.partner__live { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.partner__live .part { font-size: var(--fs-2xs); min-width: 0; padding: 0 6px; }
.partner-box.js-collapsible:not(.is-open) .ranking > li.is-edge:not(.is-extra) { border-bottom: 0; } /* 5人目（最後に見せる行）の下の線は「すべて表示」との間で要らない */
/* よく演奏するアーティスト（member.php）: よく組むメンバーのカードを使い回し、閉じているときは上位3位だけ（app.js の data-shown="3" と合わせる） */
.top-artists.js-collapsible:not(.is-open):not(.is-closing) .ranking > li.is-extra { display: none; }
.top-artists.js-collapsible:not(.is-open) .ranking > li.is-edge { border-bottom: 0; }
/* よく演奏するアーティスト・よく演奏するメンバー（artist.php。閉じているときは上位5人 = .partner-box のまま）: 1行だけなので、よく組むメンバーの「上でそろえる」はやめて真ん中に */
:is(.top-artists, .top-players) .ranking li { align-items: center; gap: 0 10px; }
:is(.top-artists, .top-players) .ranking li::before { line-height: inherit; }
:is(.top-artists, .top-players) .ranking a { min-width: 0; overflow-wrap: anywhere; }
.top-players .songs-row__art { width: 44px; height: 44px; border-radius: var(--r-md); object-fit: cover; flex: none; } /* よく演奏される曲のジャケット（songs.css と同じ見た目） */
.top-players .songs-row__art--none { display: inline-grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.top-players .ranking li .pill { margin-left: 0; } /* 右に寄せるのは「Gt × 3」（.partbar--partner の margin-left: auto）にまかせ、回数はそのすぐ右に */
.partner-box.top-players { margin: 18px 0; } /* artist.php ではマイアルバムのカードと同じ間隔（.partner-box の上32px・スマホの0 より強く）*/
/* 楽器別出演数ランキング（stats.php）:「[Dr] [▸ 12組] 1位の名前」。▸ を開くと上位5位（同率含む）。開け閉めはよく組むメンバーの .partner を使い回す */
.kings > li { align-items: flex-start; }
.kings__first { min-width: 0; overflow-wrap: anywhere; }
.kings__top { margin: 6px 0 2px 8px; font-size: var(--fs-sm); }
.kings__top li { padding: 5px 4px; }
.kings .kings__top li[data-rank]::before { content: attr(data-rank); } /* 外側の .ranking--plain が番号を消すので、中の一覧だけ出し直す */
.album-sort__status { transition: opacity var(--t-slow); }
.album-sort__status:empty { opacity: 0; }
/* position: relative … カードの offsetLeft / offsetTop を「この ul の左上から」の距離にするため */
.albums[data-album-sort] { position: relative; }
/* 順位バッジ。ドラッグ中だけ出す */
.album__rank { position: absolute; top: 6px; left: 6px; z-index: 1; min-width: 24px; height: 24px; padding: 0 6px;
  display: grid; place-items: center; border-radius: var(--r-full); background: var(--accent); color: #fff;
  font-size: var(--fs-xs); font-weight: 800; box-shadow: var(--shadow); opacity: 0; transform: scale(.6);
  transition: opacity var(--t-base), transform var(--t-base); pointer-events: none; }
.albums.is-sorting .album__rank { opacity: 1; transform: none; }
/* 本人のページでは、いつでもカードをつかめる（JS: マウスは動かしたら、指は長押しでドラッグ開始） */
.albums[data-album-sort] .album { cursor: grab; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; /* iPhone で長押ししたとき「画像を保存」メニューを出さない */ }
/* つかめるのはジャケットだけなので、浮く動きもジャケットに乗せたときだけ */
.albums[data-album-sort] .album__art:hover { transform: translateY(-2px); }
/* 文字の部分はリンク（JS はここではドラッグを始めない）。指マークのカーソルにして、乗せたらタイトルに下線 */
.albums[data-album-sort] .album__meta { cursor: pointer; }
a.album__title { color: inherit; text-decoration: none; }
a.album__title:hover { text-decoration: underline; }
.album__artist { color: inherit; text-decoration: none; } /* 押すとその名前で検索 */
.album__artist:hover { color: var(--text); text-decoration: underline; }
/* 他の人のページ: ジャケットもリンク。乗せたら少し浮かせて、押せることを見せる */
.album__art-link { display: block; }
.album__art-link:hover .album__art { transform: translateY(-2px); }
[data-album-open] { cursor: pointer; }
/* アルバムのモーダル（partials/album_modal.php）: 暗転した背景に アルバム名・発売年 → アプリ・検索・閉じる */
.album-modal { position: fixed; inset: 0; margin: auto; width: min(700px, calc(100vw - 16px)); max-height: calc(100vh - 16px); padding: 8px;
  overflow: visible; border: 0; background: transparent; color: #fff; text-align: center;
  justify-items: center; gap: 6px; } /* 閉じる動きの間は [open] が外れているので、中央揃えは [open] でなく常時の指定に（でないとジャケットが左に寄る） */
.album-modal[open] { display: grid; }
.album-modal::backdrop { background: rgba(0, 0, 0, .8); }
.album-modal__art { width: min(600px, 100%, calc(100vh - 190px)); /* 600px = iTunes の画像の元の大きさ（Spotify は640）。これ以上は引き伸ばしでぼやける */ aspect-ratio: 1; border-radius: var(--r-md); object-fit: cover; box-shadow: var(--shadow-modal); margin-bottom: 10px; }
.album-modal__name { font-size: var(--fs-2xl); line-height: 1.35; overflow-wrap: anywhere; }
.album-modal__year { font-size: var(--fs-md); color: rgba(255, 255, 255, .7); }
.album-modal__year:empty { display: none; }
.album-modal__bar { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }
.album-modal__app { display: block; width: 48px; height: 48px; }
.album-modal__app svg { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; }
.album-modal__app.setlist__listen--spotify svg { background: radial-gradient(circle closest-side, #000 90%, transparent 91%); }
.album-modal__app.setlist__listen--youtube_music svg { background: radial-gradient(circle closest-side, #fff 90%, transparent 91%); }
.album-modal__app.setlist__listen--apple_music svg, .album-modal__app.setlist__listen--line_music svg { border-radius: 22%; background: none; }
.album-modal__btn { color: #fff; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.album-modal__btn:hover { color: #fff; background: rgba(255, 255, 255, .28); }

.album__art-link:hover + .album__meta .album__title { text-decoration: underline; }
.albums[data-album-sort] .album:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--r-md); }
/* ドラッグ中は削除ボタンを隠す（誤って押さないように） */
.albums.is-sorting .album__delete { display: none; }
/* 指で長押ししている間: 少し沈ませて「つかもうとしている」ことを見せる */
.album.is-pressing .album__art { transform: scale(.96); }
/* つかんでいるカード: 少し大きく、影を濃くして浮かせる */
.album.is-dragging { z-index: 5; }
.album.is-dragging .album__art { transform: scale(1.06); box-shadow: var(--shadow-modal); }
.album .album__art { transition: transform var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out; }
body.is-album-dragging, body.is-album-dragging * { cursor: grabbing !important; }
@media (prefers-reduced-motion: reduce) {
  .album__rank, .album .album__art { transition: none; }
}

/* ===== 「← ページ名」ボタン（assets/app.js の setupBackButton） =====
   上: 前に見ていたページ / 下: パンくずの1つ上。
   色: ライトモードは薄い青（白・灰色のカードに重なっても埋もれず、赤い「保存」・黄色の注意とも見分けがつく）、
       ダークモードは文字色と背景色を反対にした明るいボタン
   ページを移ってボタンが変わったときは、その場でフェードする（ボタンは動かさない）。JS が付ける:
     新しいボタン .is-entering = 今の位置でふわっと出る / 前のページのボタン .back-fabs--ghost の .is-leaving = 前の位置でふわっと消える
   マウスが使える端末では、乗っていないときは半透明（本文に重なっても読める）、乗ったら不透明
   スクロール中は透明度 70%（うっすら見える。.is-scrolling。JS が付け外し）。ただし PC で左の余白に入っているときは読む邪魔にならないので消さない */
.back-fabs { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 25; /* ヘッダー(20)より手前、スマホの下ナビ(30)より奥 */
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  transition: opacity var(--t-base) ease; } /* スクロールで消える・戻る、ボタンが出る・消えるは全部同じ 0.25 秒の ease */
.back-fab { display: inline-flex; align-items: center; gap: 4px; max-width: min(50vw, 260px); padding: 8px 14px 8px 10px; border-radius: var(--r-full);
  background: #dfe9fb; color: #1d3766; border: 1px solid #c3d4f2; box-shadow: var(--shadow); font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  transition: transform var(--t-fast) ease, opacity var(--t-base) ease; }
[data-theme="dark"] .back-fab { background: var(--text); color: var(--bg); border-color: transparent; }
.back-fab.is-entering { animation: back-fab-in var(--t-base) ease both; }
.back-fab.is-leaving { animation: back-fab-out var(--t-base) ease both; }
@keyframes back-fab-in { from { opacity: 0; } } /* to を書かない = いつもの透明度（PC の半透明）まで */
@keyframes back-fab-out { to { opacity: 0; } }
.back-fabs--ghost { z-index: 24; pointer-events: none; } /* 前のページのボタン（消えるだけ）。今のボタンの後ろ */
/* スマホ（指で操作する画面）で文字を入力中（= キーボードが出ている）は、戻るボタンと下のナビを隠す（入力欄や候補に重なって邪魔なので）
   :has() = 「中にフォーカス中の入力欄がある body」。チェックボックスやボタンはキーボードが出ないので除く */
@media (hover: none) and (pointer: coarse) {
  body:has(:is(textarea, input:not([type="checkbox"], [type="radio"], [type="button"], [type="submit"], [type="reset"], [type="file"], [type="range"], [type="color"], [readonly])):focus) :is(.back-fabs, .nav) { display: none; } /* 戻るボタンと、一番下のナビ（.nav） */
}
.back-fab:hover { text-decoration: none; color: #1d3766; } /* リンク共通の a:hover の赤にしない */
@media (any-hover: hover) {
  .back-fab { opacity: .45; }
  .back-fab:hover, .back-fab:focus-visible { opacity: 1; }
}
[data-theme="dark"] .back-fab:hover { color: var(--bg); }
.back-fab:active { transform: scale(.97); }
.back-fab .icon { flex: none; font-size: 18px; }
.back-fab__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* 長いページ名は「…」 */
@media (max-width: 760px) {
  .back-fabs { left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); } /* 画面下のタブバーの上 */
  .back-fabs--lift { bottom: calc(150px + env(safe-area-inset-bottom)); }      /* 下に固定の保存ボタン（.sticky-actions）のさらに上 */
}
/* スクロール中は透明度 70%（opacity .3）にする: スマホと、左の余白にボタンが入らない幅の PC（本文に重なるので）。余白に入る幅（下の 1560px 以上）では消さない
   消すときも戻すときも同じ 0.25 秒の ease */
@media (max-width: 1559px) {
  .back-fabs.is-scrolling { opacity: .3; }
}
/* PC: 大きめにして、画面の上下のまん中より下に出す（余白が無く本文に重なる幅なので、読んでいる所から離す） */
@media (min-width: 761px) {
  .back-fabs { left: 20px; top: calc(50% + 180px); bottom: auto; gap: 10px; }
  .back-fab { max-width: 320px; padding: 11px 20px 11px 14px; gap: 6px; font-size: var(--fs-md); }
  .back-fab .icon { font-size: 22px; }
}
/* 曲の編集: 左の余白にボタンが入らない幅（1560px 未満）の PC は、スマホと同じく左下に積む
   PC の保存ボタン（.sticky-actions）は右に寄った小さい枠で、左下は空いている → 左下の端に詰めて、下から 元に戻す / やり直す → 「← 前のページ」 */
@media (min-width: 761px) and (max-width: 1559px) {
  body:has(.songs-form) .songs-form .ttb-float.ttb-float { left: 20px; top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); }
  body:has(.songs-form) .back-fabs { top: auto; bottom: calc(64px + env(safe-area-inset-bottom)); }
}
/* 左の余白にボタンが入る幅では、余白の右端（本文のすぐ左）に寄せる
   本文は幅 1120px の中央寄せ（.container）で、中に 16px の余白がある → 本文の左端は 50% - 560px + 16px。
   right = 100% - (本文の左端 - 16px) = 50% + 560px。幅は余白から左右 16px ずつ引いたぶんまで */
@media (min-width: 1560px) {
  .back-fabs { left: auto; right: calc(50% + 560px); top: calc(50% + 80px); align-items: flex-end; } /* 余白の中なので、まん中の少し下 */
  .back-fab { max-width: calc(50vw - 576px); }
  body:has(.songs-form) .songs-form .ttb-float.ttb-float { left: auto; right: calc(50% + 560px); top: calc(50% + 80px + 54px); bottom: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .back-fabs, .back-fab { transition: none; }
  .back-fab.is-entering { animation: none; }
  .back-fab.is-leaving { display: none; }
}

/* ===== ページを移るときの軽いアニメーション =====
   View Transitions（ブラウザの機能）で、前のページと新しいページを同時にフェードで入れ替える（普通のクロスフェード）。
   CSS だけで動く（JS 不要）。対応していないブラウザ（Firefox など）は、新しいページの本文だけふわっと出す。
   ヘッダー・スマホの下のナビは動かさない（毎ページ同じなので、動くとちらついて見える）。
   左下の戻るボタンは自分でフェードする（setupBackButton）ので、ここでは動かさない */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
.nav { view-transition-name: main-nav; }
.back-fabs { view-transition-name: back-fabs; }
.back-fabs--ghost { view-transition-name: back-fabs-ghost; }
::view-transition-group(topbar), ::view-transition-group(main-nav), ::view-transition-group(back-fabs), ::view-transition-group(back-fabs-ghost),
::view-transition-new(topbar), ::view-transition-new(main-nav), ::view-transition-new(back-fabs), ::view-transition-new(back-fabs-ghost) { animation: none; }
::view-transition-old(topbar), ::view-transition-old(main-nav), ::view-transition-old(back-fabs), ::view-transition-old(back-fabs-ghost) { display: none; }
::view-transition-old(root) { animation: page-out var(--t-base) ease both; }
::view-transition-new(root) { animation: page-in var(--t-base) ease both; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; } }
@supports not (view-transition-name: none) {
  .container { animation: page-in var(--t-base) ease; } /* both を付けない: 終わった後も transform が残ると、中の position: fixed の基準が変わる */
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .container { animation: none; }
}

@media print {
  :root, [data-theme="dark"] { --bg: #fff; --surface: #fff; --text: #000; --muted: #555; --border: #ccc; --shadow: none; --glow: none; }
  .topbar, .footer, .no-print, .flash, .back-fabs { display: none !important; }
  .day[hidden] { display: block !important; }   /* タブで隠している日程も全部印刷する */
  .day + .day { break-before: page; }          /* 日程ごとに改ページ */
  .slot { break-inside: avoid; }               /* バンドの途中で改ページしない */
  .container { padding: 0; max-width: none; }
  body { font-size: var(--fs-2xs); }
  .slot__body { padding: 8px 12px; }
}

/* ===== 9. スマホ対応（画面幅で切り替え） ===== */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split aside { display: contents; } /* 1列になったら、右の欄（絞り込み・よく組むメンバー）を出演履歴より上に出す。絞り込みが .split 全体で浮くように、aside の箱は消して中身を並べる */
  .split aside > * { order: -1; }
  .split aside > .stats-filter { position: sticky; order: -2; margin: 18px 0 0; } /* 1列表示は浮かせる */
  .split aside > .stats-filter + .partner-box { margin-top: 4px; }
  .partner-box { margin-top: 0; }
  .partner-box + .partner-box { margin-top: 18px; } /* よく組むメンバーとよく演奏するアーティストが続くときは、マイアルバムのカードと同じだけ空ける */
  .auth { grid-template-columns: 1fr; gap: 24px; min-height: 0; }
  .guide { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 画面下のタブバー: ロゴ・ナビ5つ・アイコン3つが横に入りきらない幅（760px 以下）では、ナビを画面下に移す。
   スマホ用（600px 以下）と同じ幅にすると、601〜760px でヘッダーの右端（ユーザーメニュー）がはみ出して隠れる */
@media (max-width: 760px) {
  /* backdrop-filter があると、中の position: fixed（下のナビ）の基準がヘッダーになってしまうので外す */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  /* ナビを画面下のタブバーにする（スマホでは親指で押しやすい） */
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border); }
  /* タブは5つ。「アーティスト」が入りきるよう、左右の余白を小さめにする */
  .nav__link { flex: 1; text-align: center; padding: 10px 2px; font-size: var(--fs-sm); border-radius: var(--r-md); }
  .footer { padding-bottom: 84px; }
  .sticky-actions { bottom: 76px; } /* 下に固定の保存ボタンは、タブバーの上に出す */
}
@media (max-width: 600px) {
  body { font-size: var(--fs-md); }
  .brand__logo { height: 28px; }
  .hero { margin: 8px 0 20px; }
  .pc-only { display: none; } /* スマホでは出さない文字（live.php の「ライブを編集」の「を」など） */
  /* 曲の編集の「出演まで非公開（終演30分後に公開：…）」: かっこの中は長いので2行目へ。
     .check は横並び（flex）なので <br> では改行できない。折り返しを許して、かっこの部分を横いっぱい（100%）にする
     左の余白はチェックボックスの幅＋すき間の分（1行目の文字の頭にそろえる） */
  .song-private { flex-wrap: wrap; row-gap: 2px; }
  .song-private__note { flex-basis: 100%; padding-left: 26px; }
  .hero__actions { gap: 6px; }
  .hero__actions .btn--sm:not(.btn--youtube) { padding-inline: 10px; white-space: nowrap; } /* YouTube はロゴだけで余白 2px のまま */
  .stats { width: 100%; }
  .stats div { flex: 1; min-width: 0; padding: 5px 10px; }
  .stats dd { font-size: var(--fs-lg); }
  .card { padding: 16px; }
  .table-scroll { margin: 0 -16px -16px; }
  .table--edit td:first-child, .table--edit th:first-child { padding-left: 16px; }
  .slot { grid-template-columns: 36px 1fr; gap: 6px; } /* 36px =「13:00」がちょうど入る幅。カードを広くして名前を折り返しにくくする */
  .slot__time { font-size: var(--fs-2xs); padding-top: 11px; }
  .slot__time span { font-size: var(--fs-2xs); }
  .slot__time .slot__no { font-size: var(--fs-sm); }
  .slot__body { padding: 14px; }
  .slot__name { font-size: var(--fs-lg); }
  .slot__name--long { font-size: var(--fs-md); }  /* 長い名前は小さくして1行に収める（live.php で幅を見て付ける） */
  .slot__name--xlong { font-size: var(--fs-sm); }
  .slot__head { gap: 6px; }
  .slot__title { column-gap: 6px; }
  .slot__yt { margin-left: 2px; }
  .slot__like { gap: 5px; }
  .slot__like .like__count { min-width: 1.8em; padding: 3px 6px; }
  .slot__like .like__heart { font-size: 20px; }
  .history__item { grid-template-columns: 1fr; }
  .history__when { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
  .history__when .tag { margin-top: 0; } /* スマホは日付と横並びなので、上の余白は要らない */
  .table td, .table th { padding: 10px 12px; }
  .history-diff thead th:first-child { width: 7.5em; } /* スマホでは「今」「戻した後」に幅を回す */
  /* アーティスト一覧・メンバー一覧（.table--list）: スマホは幅が足りないので、大事な数字（演奏回数・出演）が画面に入るよう余白を詰める */
  .table-card:has(.table--list) { margin-inline: -10px; } /* 表の外側: 画面の端から 16px → 6px */
  .table--list td, .table--list th { padding-inline: 6px; }  /* 列と列のあいだ: 24px → 12px（名前 ↔ 回数・入学） */
  .table--list td:first-child, .table--list th:first-child { padding-inline: 10px 4px; } /* # の列 */
  .table--members td:first-child, .table--members th:first-child { padding-left: 4px; } /* メンバー一覧は列が多いので # の左をさらに詰める */
  .table--members .name-end { display: table-cell; padding-left: 12px; } /* 横にスクロールして右端まで来たとき、数字の右に名前 */
  .table--members.is-ranking .rank-end { display: table-cell; padding-right: 10px; text-align: left; } /* ランキングのときは、右端の名前のさらに右に #（名前に寄せて左寄せ） */
  .table--list .plays { text-align: left; } /* 見出し「演奏回数 ▼」が数字より広いので、右寄せだと名前との間が空く。左に寄せて名前の近くに */
  .card.table-card { padding: 0; }
  .table-scroll--flush { margin: 0; }
  /* スマホは2段: 上の段に名前 / ✕、下の段に楽器 / Cho（HTML の並びのまま。order を戻す） */
  .member-row-edit { grid-template-columns: minmax(0, 1fr) auto; justify-content: stretch; justify-items: start; gap: 6px 8px;
    padding-bottom: 10px; border-bottom: 1px dashed var(--border); } /* 1人分（2段）の区切り */
  .member-row-edit > :nth-child(n) { order: 0; } /* :nth-child(n) = 全部の子。上の order と同じ強さにして後ろに書くことで上書きする */
  /* スマホは開閉なし: ＋ は隠して、2つ目の楽器は常に表示 */
  .inst2-toggle { display: none; }
  .inst2-slot .live-pick__btn .is-placeholder { font-size: 0; } /* 未選択は「—」の代わりに「＋」を出す（PC は ＋ ボタンと重なるので「—」のまま） */
  .inst2-slot .live-pick__btn .is-placeholder::after { content: '＋'; font-size: var(--fs-md); }
  .member-row-edit > .inst2-slot { order: 0; grid-template-rows: 1fr; opacity: 1; margin-top: 0; transition: none; }
  .member-row-edit > :first-child, .member-row-edit > :nth-child(3), .member-row-edit > .inst2-slot { width: 100%; } /* 名前と楽器は左の列いっぱい */
  .member-row-edit:last-child { border-bottom: 0; padding-bottom: 0; }
  .sticky-actions { width: 100%; flex-wrap: wrap; } /* ボタンが3つ（やり直す / 書き直す / 登録）だと1行に入らずはみ出すので折り返す */
  .sticky-actions .btn { flex: 1 1 auto; min-width: 0; }
  .sticky-actions:has(.btn:nth-of-type(3)), .sticky-actions:has(.sticky-actions__note:not([hidden])) { border-radius: var(--r-lg); }
  .sticky-actions__note { flex-basis: 100%; text-align: center; }
  .tabs { top: 66px; }
  /* ライブ詳細の日程タブ（3日程以上）: 横スクロールさせず、画面の幅に全部の日程を等分に並べる（スクロールできると気づきにくいので）。
     日付は消して「1日目」などの名前だけ（日付はタブの下の日程の見出しに出ている）。長い名前（教室ライブなど）は … で切る。
     display: block にするのは、flex のままだと文字（「1日目」）に … が付かないため。
     2日程までは今までの横並びのままで画面に収まるので変えない（:has(.tab:nth-child(3)) = 3つ目のタブがあるときだけ） */
  .tabs--days:has(.tab:nth-child(3)) { width: 100%; overflow: visible; gap: 4px; padding: 4px; } /* 角の丸みは2日程と同じカプセル型のまま */
  .tabs--days:has(.tab:nth-child(3)) .tab { display: block; flex: 1 1 0; min-width: 0; padding: 10px 6px; font-size: var(--fs-md);
    text-align: center; overflow: hidden; text-overflow: ellipsis; }
  .tabs--days:has(.tab:nth-child(3)) .tab small { display: none; }
  /* 4日程以上: 等分だと「教室…」「UNI…」と切れて読めないので、名前を全部出して横スクロールにする */
  .tabs--days:has(.tab:nth-child(4)) { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .tabs--days:has(.tab:nth-child(4))::-webkit-scrollbar { display: none; }
  .tabs--days:has(.tab:nth-child(4)) .tab { flex: none; padding: 10px 14px; overflow: visible; }
  .add-band { margin-left: 54px; }
  .bars li { grid-template-columns: minmax(0, 1fr) 28% auto; }
  .stats-grid { grid-template-columns: 1fr; }
  /* アーティストページの表: 「2025年度」のあとで改行して、ライブ名の列を細くする */
  .live-year { display: block; }
  /* 個人ページのマイアルバム: スマホでは横に3枚並べる（検索結果の .albums--pick は今までどおり）。
     アーティスト名がなるべく切れないように、カードの間と枠の左右の余白を詰めて1枚の幅を広げる */
  /* 詰めるのはジャケットの並びだけ。見出し（▸ マイアルバム）は今までどおり左に余白を取る。
     よく組むメンバー（同じ .album-box）は今までどおりの余白なので、[data-album-box] で絞る */
  [data-album-box] { padding: 14px 10px; }
  [data-album-box] .album-head { padding-inline: 12px; } /* 右の「長押しで並び替え」も同じだけ内側へ */
  [data-partner-box] .album-head { padding-left: 6px; } /* 2つの見出しの ▸ を、カードの左端から同じくらい（22px）の所にそろえる */
  .albums:not(.albums--pick) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 6px; }
  /* 閉じているときは1行（3枚）だけ見せる。app.js の setupAlbumBox の枚数と合わせる */
  .album-box.js-collapsible:not(.is-open) .albums > li:nth-child(n+4) { display: none; }
  .albums:not(.albums--pick) .album { gap: 4px; }
  .albums:not(.albums--pick) .album__title { font-size: var(--fs-2xs); line-height: 1.3; }
  .albums:not(.albums--pick) .album__meta .small { font-size: var(--fs-2xs); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* アーティストは1行で「…」 */
  .albums:not(.albums--pick) .album__year { display: none; } /* 年は消して、アーティスト名に幅を全部使う */
  .albums:not(.albums--pick) .album__delete { top: 2px; right: 2px; }
  .albums:not(.albums--pick) .album__delete .btn { width: 20px; height: 20px; font-size: var(--fs-xs); }
  .albums:not(.albums--pick) .album__rank { top: 2px; left: 2px; min-width: 18px; height: 18px; padding: 0 4px; font-size: var(--fs-2xs); }
}

/* アーティストページ: メンバー（楽器ラベル + 名前）とセットリストを縦に並べる */
.artist-lineup { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.artist-lineup li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
/* ラベルの幅を全部そろえる（Vo / Gt/Vo / Key/Cho で幅が違うと名前の頭がズレる）。いちばん広い Key/Cho の 51px に合わせ、文字は中央 */
.artist-lineup .part { flex: none; width: 52px; min-width: 0; padding-left: 0; padding-right: 0; justify-content: center; }
.artist-setlist { margin: 0; padding-left: 1.8em; display: grid; gap: 4px; font-size: var(--fs-sm); }
.artist-setlist li::marker { color: var(--muted); font-weight: 700; }
/* オムニバスのバンドでは、別のアーティストの曲をグレーで目立たなくする */
.artist-setlist li.is-se { list-style: decimal; } /* SE は番号の位置に「SE」（band.php のセットリストと同じ） */
.artist-setlist li.is-se::marker { content: "SE  "; color: var(--muted); }
.artist-setlist li.is-other, .artist-setlist li.is-other a { color: var(--muted); opacity: .7; }

/* import.php のタイムテーブル手入力 */
.manual-tt .table-scroll { margin-bottom: 12px; }
.manual-tt ul { margin: 0 0 12px; padding-left: 1.2em; }
/* 日程の区切りの行（この行より下のバンドがその日程）。≡ で動かせる */
.manual-divider td { background: var(--surface-2); }
.manual-divider__inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.manual-divider__label { font-weight: 800; color: var(--accent); }
.manual-divider__input { flex: 1; max-width: 320px; font-weight: 800; color: var(--accent); }
.manual-tt [data-manual-no] { width: 2.5em; text-align: right; font-weight: 700; color: var(--muted); }
.manual-tt__add { display: flex; flex-wrap: wrap; gap: 8px; }

/* プロフィールの「係」: 今ある係のチェックボックスを横に並べ、その下に新しい係の入力欄（lib/repository.php の profile_faculty_role_fields） */
/* field--wide（span 2）にしないのは、account.php の .form-card が1列のグリッドで、span 2 だと2列目ができてフォーム全体が崩れるため。
   4列の .form-grid（member.php）のときだけ広げる */
.form-grid .role-checks { grid-column: span 2; }
.role-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; border: 0; min-width: 0; }
.role-checks legend { padding: 0; margin-bottom: 6px; }
.role-checks__item { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 600; cursor: pointer; }
.role-checks input[name="new_role"] { flex-basis: 100%; }

/* セットリストが「出演まで非公開」のとき（band.php） */
.setlist-locked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; font-weight: 700; color: var(--muted); }
.setlist-locked .icon { font-size: 18px; }

/* ツール（tools.php）のカード。アイコン＋名前＋説明を横に並べ、カード全体を1つのリンクにする */
.tool-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 16px 0; }
.tool-card { display: flex; gap: 14px; align-items: flex-start; color: var(--text); }
.tool-card { transition: transform var(--t-base) ease, border-color var(--t-base) ease; }
.tool-card:hover { color: var(--text); transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); } /* ライブ一覧（.live-card:hover）と同じ */
.tool-card__icon { font-size: 28px; line-height: 1; }
.tool-card__body { display: flex; flex-direction: column; gap: 4px; }
.tool-card__name { font-weight: 700; font-size: var(--fs-lg); }

/* ---- セッティングシートの型紙の管理（sheet_templates.php）---- */
.sheet-tpl-form { display: grid; gap: 14px; margin-bottom: 16px; }
.sheet-tpl-form .chip__x { border: 0; background: none; padding: 0 0 0 4px; color: var(--muted); cursor: pointer; font-size: var(--fs-md); line-height: 1; }
.sheet-tpl-form .chip__x:hover { color: var(--danger, #d33); }
.sheet-tpl-form textarea.mono { font-size: var(--fs-xs); line-height: 1.5; tab-size: 2; }
/* 枠の配置エディタ（assets/sheet_editor.js）。PDF の canvas の上に、同じ大きさの SVG を重ねる */
.sheet-ed { display: grid; gap: 8px; }
.sheet-ed__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sheet-ed__cursor { margin-left: auto; font-variant-numeric: tabular-nums; }
/* 要素の一覧（ツールバーの ☰ で開くポップアップ）。.ed-pop-anchor は高さ 0 の目印で、その真下に浮かせる */
.ed-pop-anchor { position: relative; height: 0; }
.ed-pop { position: absolute; z-index: 20; top: 0; left: 0; width: min(420px, 100%); max-height: 60vh; overflow: auto; display: grid; gap: 8px;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); }
.ed-pop[hidden] { display: none; }
.ed-pop:not([hidden]) { animation: live-pop-in var(--t-fast) ease-out; transform-origin: top left; }
@media (prefers-reduced-motion: reduce) { .ed-pop:not([hidden]), .nav__link, .icon-btn, .chip { animation: none; transition: none; } }
.ed-pop__head { font-weight: 700; }
.ed-amps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; } .ed-amps input { width: 140px; }
.ed-amps__chip { --c: var(--text); display: inline-flex; align-items: center; gap: 2px; } .ed-amps__chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; }
.ed-amps__head { font-size: var(--fs-xs); margin-top: 6px; color: var(--muted, #888); }
.ed-row--heading { --c: var(--text); border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; }
.ed-row--heading input { flex: 1; min-width: 0; font-weight: 700; }
.ed-row__del { border: 0; background: none; color: var(--danger, #dc2626); cursor: pointer; display: inline-flex; }
.ed-pop__chips { display: flex; flex-wrap: wrap; gap: 4px; }
[data-ed-list-btn][aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.ed-tree { display: grid; gap: 2px; }
.ed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 2px 6px 2px calc(6px + var(--depth, 0) * 18px);
  border-radius: var(--r-sm); border: 1px solid transparent; color: var(--c); }
.ed-row.is-selected { background: color-mix(in srgb, var(--c) 14%, transparent); }
.ed-row.is-dragging { opacity: .4; }
.ed-row.is-drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.ed-row.is-drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.ed-row.is-drop-into { border-color: var(--accent); background: var(--accent-soft); }
.ed-row__handle { cursor: grab; touch-action: none; display: inline-flex; color: var(--muted, #888); }
.ed-row__name { border: 0; background: none; padding: 2px 0; color: inherit; font: inherit; font-size: var(--fs-sm); cursor: pointer; text-align: left; }
.ed-row--group .ed-row__name { font-weight: 700; }
.ed-row--opt .ed-row__name::before { content: "○ "; opacity: .6; }
.ed-row__opts { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; font-size: var(--fs-xs); color: var(--text); }
.sheet-ed__panel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 34px; }
.ed-num { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); }
.ed-num input { width: 84px; }
/* 詳細設定（印刷済みのアンプ・パート）。バーの下に開く */
.ed-sec { display: grid; gap: 6px; justify-items: start; }
.ed-sec + .ed-sec { padding-top: 10px; border-top: 1px solid var(--border); }
.ed-sec__head { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.ed-set { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.ed-adv .check { font-size: var(--fs-sm); }
.ed-adv .ed-set select, .ed-adv .ed-set input[type="text"] { width: auto; min-width: 0; padding: 4px 8px; font-size: var(--fs-sm); }
.ed-adv .ed-short { width: 80px !important; }
.ed-adv { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.ed-adv[hidden] { display: none; }
.ed-adv__head { margin: 4px 0 0; }
.ed-adv__rows { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ed-adv__rows .ed-num input { width: 56px; }
[data-ed-adv][aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.ed-text input { width: 160px; }
.sheet-ed__bar select[data-ed-add] { width: auto; }
.sheet-ed__scroll { overflow: auto; max-height: 80vh; border: 1px solid var(--border); border-radius: var(--r-md); background: #fff; }
.sheet-ed__wrap { position: relative; width: 100%; aspect-ratio: 595 / 842; }
.sheet-ed__wrap canvas, .sheet-ed__wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet-ed__wrap svg { touch-action: none; user-select: none; }
.sheet-ed__json textarea { width: 100%; margin-top: 6px; }
/* 枠の色は種類ごと（--c）。中は薄く塗って、PDF の文字が透けて見えるように */
.ed-k-fields { --c: #2563eb; } .ed-k-members { --c: #16a34a; } .ed-k-setlist { --c: #9333ea; }
.ed-k-stage { --c: #ea580c; } .ed-k-drum { --c: #64748b; } .ed-k-choices { --c: #db2777; } .ed-k-texts { --c: #0d9488; }
.ed-k-stamps { --c: #854d0e; } .ed-k-stage_auto { --c: #ca8a04; }
.ed-k-stage_auto .ed-body { stroke-dasharray: 4 3; } /* 自動配置の範囲は点線（セット図の枠と見分ける） */
/* 型紙のプレビュー: ボタンは枠の下の行（.tpl-under）の右。開いている間は「閉じる」が右下に浮き、その上に枠が浮く（中は setting_sheet?tpl_preview=1 の iframe）。
 * 見た目はセッティングシート作成の画面のプレビュー（setting_sheet.css の .sheet-preview）に合わせる */
.tpl-under { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.tpl-preview-btn { gap: 4px; box-shadow: var(--shadow); }
.tpl-preview-btn[aria-expanded="true"] { position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 26;
  background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.tpl-preview { position: fixed; z-index: 25; right: 24px; bottom: 84px; top: 72px; width: min(640px, calc(100vw - 48px));
  border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface-2); box-shadow: var(--shadow); overflow: hidden; }
.tpl-preview iframe { display: block; width: 100%; height: 100%; border: 0; }
/* 動かせるプレビュー（app.js の floatWin）: PC だけ上のバーでつかんで移動・右下の角で大きさを変える */
.float-win__bar { display: none; }
@media (min-width: 761px) {
  .float-win { resize: both; min-width: 260px; min-height: 200px; }
  .float-win__bar { display: flex; justify-content: center; align-items: center; position: sticky; top: 0; z-index: 1; height: 22px;
    background: var(--surface-2); color: var(--muted); cursor: move; touch-action: none; user-select: none; }
  .float-win__bar:hover { color: var(--text); }
  .float-win__bar .icon { font-size: 18px; transform: rotate(90deg); }
  .float-win.is-moving iframe { pointer-events: none; }
  .tpl-preview iframe { height: calc(100% - 22px); }
}
/* 1つ戻す・やり直す: PC は枠のすぐ下。スマホは左下に浮かせる（「← 前のページ」（.back-fabs）が出ているときはその上に積む） */
.tpl-history { display: flex; gap: 6px; }
.tpl-history .btn { background: color-mix(in srgb, rgb(59 130 246) 14%, var(--surface)); color: rgb(37 99 235); border-color: rgb(59 130 246 / .3); box-shadow: var(--shadow); }
.tpl-history .btn:disabled { opacity: .4; }
[data-theme="dark"] .tpl-history .btn { background: color-mix(in srgb, rgb(96 165 250) 16%, var(--surface)); color: rgb(147 197 253); border-color: rgb(96 165 250 / .3); }
@media (max-width: 760px) {
  .tpl-preview-btn, .tpl-preview-btn[aria-expanded="true"] { position: fixed; z-index: 26; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); } /* 画面下のタブバーの上 */
  .tpl-preview { left: 8px; right: 8px; width: auto; bottom: calc(136px + env(safe-area-inset-bottom)); }
  .tpl-history { position: fixed; z-index: 26; margin: 0; left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  body:has(.back-fabs:not(.back-fabs--ghost) .back-fab) .tpl-history { bottom: calc(128px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) {
  .tpl-preview:not([hidden]) { animation: tpl-preview-in var(--t-base) var(--ease-out); transform-origin: right bottom; }
  @keyframes tpl-preview-in { from { opacity: 0; transform: scale(.96) translateY(8px); } }
}
.ed-body { fill: var(--c); fill-opacity: .1; stroke: var(--c); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: move; }
.ed-item.is-selected .ed-body { fill-opacity: .22; stroke-width: 2; }
.ed-edge { stroke: transparent; stroke-width: 10; }
.ed-line { stroke: var(--c); stroke-width: 1.5; pointer-events: none; }
.ed-edge:hover { stroke: var(--c); stroke-opacity: .45; }
.ed-edge--v { cursor: ew-resize; } .ed-edge--h { cursor: ns-resize; }
.ed-inner { stroke: var(--c); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; pointer-events: none; }
.ed-stack { stroke-dasharray: 1 3; } /* 同じ列に積んだ段（コーラス/CD と分数など）の境目 */
.ed-fixed { fill: #6b7280; opacity: .7; font-weight: 700; pointer-events: none; } /* パートが印刷済みの行（詳細設定）の薄い文字 */
.ed-label { fill: var(--c); font-weight: 700; pointer-events: none; paint-order: stroke; stroke: #fff; stroke-linejoin: round; } /* 縁の太さは JS が表示の倍率に合わせて付ける（stroke-width） */
.ed-chip { border: 1px solid var(--c); color: var(--c); background: transparent; border-radius: var(--r-full); padding: 2px 10px; font-size: var(--fs-xs); cursor: pointer; }
.ed-chip.is-selected { background: var(--c); color: #fff; }
/* 変更履歴の一覧: 「変わったもの」を開くと出る比べる表（history.php）。カードの中なので影は消して詰める */
.history-item__compare { margin-top: 10px; display: grid; gap: 6px; }
.history-item__compare[hidden] { display: none; }
.history-item__compare > p { margin: 0; }
.history-item__compare .history-unit { box-shadow: none; padding: 12px; }
.history-item__compare .history-unit__title { font-size: var(--fs-md); }
.ed-check { display: flex; align-items: center; gap: 4px; font-size: var(--fs-sm); }
.is-inst-hidden { display: none !important; }

/* ベルの未読数バッジ（partials/header.php） */
.icon-btn { position: relative; }
.badge-dot { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-md);
  background: var(--danger, #d93025); color: #fff; font: 700 var(--fs-2xs)/16px var(--font); text-align: center; }

/* ベルのポップアップ（直近3件＋すべて見る） */
.icon-btn--sm { width: 30px; height: 30px; padding: 0; } /* button の初期の左右余白(6px)で中身の入る幅が足りず、アイコンが右に寄っていた */
.notifmenu__panel { width: 300px; max-width: calc(100vw - 24px); grid-template-columns: minmax(0, 1fr); } /* 列を幅いっぱいに（auto だとタブの max-content に縮んで、右の文字や区切り線が欠けた） */
@media (max-width: 760px) { .notifmenu__panel { position: fixed; right: 12px; top: 56px; } } /* スマホ: ベルの真下だと左にはみ出すので、画面の右端に出す。PCはベルの真下 */
.notifmenu__item { display: grid; gap: 2px; }
.notifmenu__title { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; } /* 最大2段、超過は… */
.notifmenu__empty { padding: 8px 10px; margin: 0; }
.notifmenu__tabs { margin: 0 0 6px; padding: 3px; width: 100%; box-sizing: border-box; overflow: hidden; } /* .tabs の width: max-content だと、パネルより狭く縮んで右の文字が欠ける */
.notifmenu__tabs .tab { flex: 1 1 auto; justify-content: center; align-items: center; min-width: 0; padding: 6px 6px; cursor: pointer; border: 0; font: inherit; font-weight: 800; font-size: var(--fs-sm); }
.notifmenu__tabs .tab:not(.is-active) { background: none; }
.notifmenu__count { position: static; }
.notifmenu__all { display: block; margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 !important; text-align: center !important; color: var(--accent); font-size: var(--fs-sm); font-weight: 600; }

/* お知らせの重要・カテゴリ管理・ホームのバナー */
.notice__mark { color: var(--danger, #d93025); }
.notice-item { padding: 0; margin-bottom: 12px; font-size: var(--fs-md); }
.notice-item > summary { align-items: center; padding: 14px 16px; font-weight: 400; }
.notice-summary { flex: 1; min-width: 0; display: grid; gap: 4px; }
.notice-item .section-title--card.notice-title { font-size: var(--fs-md); font-weight: 680; }
.notice-item .notice-meta { font-size: var(--fs-xs); }
.notice-body { padding: 0 16px 14px; display: grid; gap: 4px; }
@media (max-width: 760px) { /* スマホ: お知らせのカテゴリタブをコンパクトに（5つ並んでも横スクロールしにくい） */
  [data-notice-tabs] { gap: 2px; padding: 3px; margin-bottom: 12px; }
  [data-notice-tabs] .tab { padding: 5px 10px; font-size: var(--fs-xs); }
  /* 閉じているカードを低くして、1画面に出る件数を増やす */
  .notice-item { margin-bottom: 7px; }
  .togglecard.notice-item > summary { padding: 8px 12px; gap: 6px; }
  .notice-summary { gap: 1px; }
  .notice-item .section-title--card.notice-title { font-size: var(--fs-md); gap: 2px 6px; line-height: 1.35; margin-bottom: 0; }
  .notice-item .notice-meta { font-size: var(--fs-2xs); gap: 4px; }
  .notice-item .tag { padding-block: 0; font-size: var(--fs-2xs); }
  .notice-body { padding: 0 12px 10px; }
}
.notice-item .section-title--card { margin-bottom: 4px; }
.notice-item p { margin-block: 6px; }
.notice-item p a:not(.btn) { text-decoration: underline dotted; text-underline-offset: 3px; } /* 本文中のリンク（コメント通知のライブ名・バンド名・名前）をリンクとわかるように */
.notice--important { border: 2px solid var(--danger); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.notice-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border: 2px solid var(--danger); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.notice-banner__text { flex: 1; min-width: 0; display: grid; font-weight: 600; font-size: var(--fs-md); }
.notice-banner__text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-cat { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.notice-cat__rename { display: flex; align-items: center; gap: 6px; flex: 1; }
.notice-cat__rename input { flex: 1; min-width: 0; }

/* お知らせ: カテゴリ切り替えのふわっと表示（hidden が外れるたびに動く）と、管理者用のトグルカード */
/* 切り替えの動きは JS（setupNotice のタブ）。CSS の animation だと、切り替え前後で表示されたままの記事が動かない */
/* 記事の数でページの高さが変わっても、スクロールバーの出入りで画面が左右にずれないよう、場所を空けておく */
html:has([data-notice-tabs]) { scrollbar-gutter: stable; }
.togglecard { padding: 0; margin-bottom: 16px; }
.togglecard summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; cursor: pointer; list-style: none; font-weight: 700; }
.togglecard summary::-webkit-details-marker { display: none; }
.togglecard__title { flex: 1; }
.togglecard__chevron { transition: transform var(--t-base) ease; }
.togglecard[open] .togglecard__chevron { transform: rotate(180deg); }
.togglecard__body { display: grid; gap: 14px; padding: 4px 16px 16px; }
@media (prefers-reduced-motion: reduce) { .togglecard__chevron { transition: none; } }
#categories { margin-top: 16px; }

/* お知らせのカテゴリ色（notices.php の NOTICE_COLORS。.tag--plan と同じ作りで色だけ変える） */
.tag--c-gray   { --c: var(--other); }
.tag--c-blue   { --c: var(--headliner); }
.tag--c-green  { --c: var(--ok); }
.tag--c-yellow { --c: var(--warn); }
.tag--c-red    { --c: var(--danger); }
.tag--c-purple { --c: var(--ba); }
.tag--c-pink   { --c: var(--key); }
[class*="tag--c-"] { color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }

/* 文字・タグ・アイコンの上下中央をそろえる（inline のままだと、タグが文字の基準線に乗って数px ずれる） */
.notice-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.notice-meta { display: flex; align-items: center; gap: 6px; }
.usermenu__who { display: inline-flex; align-items: center; gap: 6px; }
.icon-btn--sm .icon-moon { transform: translateX(1px); } /* 三日月は図形の重心が左に寄っているので、見た目の中心に合わせて少し右へ */

/* 予約のチェック＋日時入力（チェックを入れたときだけ日時が出る。assets/app.js） */
.notice-schedule { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.notice-schedule input[type="datetime-local"] { flex: 1; min-width: 200px; }

/* 記事カードの中に置く、予約の編集用トグル（枠は記事カードのものを使う） */
.togglecard--inline { margin: 0 0 12px; border-top: 1px solid var(--border); }
.togglecard--inline summary { padding: 12px 0; font-size: var(--fs-md); }
.togglecard--inline .togglecard__body { padding: 0 0 8px; }

/* 掲示板（board.php・board_thread.php） */
.board-list { padding: 4px 0; margin-bottom: 16px; }
.board-list--in { margin-bottom: 0; border-top: 1px solid var(--border); } /* トグルの中（他の年度） */
.board-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: inherit; text-decoration: none; }
.board-row + .board-row { border-top: 1px solid var(--border); }
.board-row:hover { background: var(--surface-2); }
.board-row.is-deleted { opacity: .55; }
.board-row__icon { color: var(--muted); }
.board-row__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.board-row__title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-weight: 600; }
.board-row__count { display: inline-flex; align-items: center; gap: 4px; }
.board-row__count .icon { font-size: 16px; }
/* 参加できる学年を絞る: チェックで軽く展開（grid の行を 0fr → 1fr） */
.restrict__panel { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--t-base) ease, opacity var(--t-base) ease; }
.restrict:has([data-board-restrict-toggle]:checked) .restrict__panel { grid-template-rows: 1fr; opacity: 1; }
.restrict__inner { overflow: hidden; min-height: 0; display: grid; gap: 10px; }
.restrict:has([data-board-restrict-toggle]:checked) .restrict__inner { padding-top: 10px; }
.restrict .check:has(input:disabled), .restrict__range:has(select:disabled) { opacity: .4; cursor: not-allowed; }
.restrict__range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.restrict__range select { max-width: 100%; }
.restrict__to { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; } /* 〜 は下（2つ目）のプルダウンと一緒に折り返す */
@media (prefers-reduced-motion: reduce) { .restrict__panel { transition: none; } }
.board-row__lock { font-size: var(--fs-lg); color: var(--muted, #888); vertical-align: middle; }
.board-posts { display: grid; gap: 10px; margin-bottom: 16px; }
.board-pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.board-pager .is-disabled { opacity: .35; pointer-events: none; }
.board-post { padding: 12px 16px; }
.board-post.is-mine { border-left: 3px solid var(--accent); }
.board-post.is-deleted { opacity: .7; border-style: dashed; }
.board-post__meta { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.board-post__no { font-variant-numeric: tabular-nums; }
.board-post__del { margin-left: 4px; } /* 返信ボタンのすぐ右 */
.board-post__del .icon-btn { color: var(--danger); }
.board-post__del .icon-btn:hover { background: var(--danger-bg); }
.board-post__body { margin: 0; overflow-wrap: anywhere; }
.board-post__deleted { color: var(--danger); margin: 0 0 4px; display: flex; align-items: center; gap: 4px; }
textarea.board-textarea { width: 100%; padding: 10px 14px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: var(--fs-md); resize: vertical; } /* 角丸・縦方向のみリサイズ */
textarea.board-textarea:focus { border-color: var(--accent); } /* 上の border が共通の textarea:focus より後勝ちなので、枠色を戻す */
@media (min-width: 761px) { .board-posts, .board-reply { max-width: 720px; margin-inline: auto; } } /* PC: 書き込みのカードと返信欄は幅を狭くして中央に（長い行は読みにくい） */
[data-board-panel] .togglecard__body { padding-top: 12px; } /* スレッド作成・通知設定とも、カードの上端に余白 */
.tag.board-title-tag { padding: 5px 10px; } /* スレ名の横のカテゴリラベル: 上下の余白を広めに */
[data-board-free].is-entering { animation: board-slide var(--t-base) ease-out; } /* カテゴリを切り替えたとき */
.board-row__name { line-height: 1.4; }
.board-row__title .tag { line-height: 1; padding: 4px 8px; } /* 文字と上下中央がそろうように、行の高さを 1 にして余白で調整 */
@media (prefers-reduced-motion: reduce) { [data-board-free].is-entering { animation: none; } }
.board-panel__title { margin-top: 0; color: var(--muted); font-weight: 600; } /* 見出しはやや薄く */
.board-panel__sub { margin: 4px 0 -6px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); } /* 小見出し */
[data-board-panel]:not([hidden]) { animation: board-slide var(--t-base) ease-out; } /* スレッド作成・通知設定のカードが開くとき */
@media (prefers-reduced-motion: reduce) { [data-board-panel]:not([hidden]) { animation: none; } }
.board-mute { margin-left: 10px; }
.board-mute.is-active { background: var(--accent-soft); color: var(--accent); }
.board-mute.is-pop .icon { animation: like-pop var(--t-slow) ease; } /* ❤ と同じ、ぽんと弾む動き */
.board-reply__to:not([hidden]) { animation: board-slide var(--t-base) ease-out; } /* 返信先の行が最初に出るとき */
.board-reply__chip.is-entering { animation: board-chip var(--t-base) ease-out; }
@keyframes board-slide { from { opacity: 0; transform: translateY(-6px); } }
@keyframes board-chip { from { opacity: 0; transform: scale(.6); } 60% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .board-mute.is-pop .icon, .board-reply__to:not([hidden]), .board-reply__chip.is-entering { animation: none; } }
.board-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.board-head h1 { flex: 1; margin: 0; }
.board-head .icon-btn.is-active { background: var(--accent-soft); color: var(--accent); }
.board-post__reply { margin-left: 10px; }
.board-post__foot { display: flex; justify-content: flex-end; margin-top: 6px; }
/* 返信先（>>N）へ飛ぶとき: ゆっくりスクロールして、上のヘッダーに隠れない位置で止め、飛んだ先を一瞬光らせる */
html:has(.board-posts) { scroll-behavior: smooth; }
.board-post { scroll-margin-top: 110px; }
.board-post:target { animation: board-flash 1.6s ease-out; }
@keyframes board-flash { 0%, 35% { background: var(--accent-soft); box-shadow: var(--ring); } 100% { background: var(--surface); box-shadow: var(--shadow); } }
@media (prefers-reduced-motion: reduce) { html:has(.board-posts) { scroll-behavior: auto; } .board-post:target { animation: none; } }
.board-post__reply.is-active { background: var(--accent-soft); color: var(--accent); }
.board-post__to { margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); }
.board-post__to .icon { font-size: 16px; }
.board-reply__to { display: flex; flex-wrap: wrap; gap: 6px; }
.board-reply__to[hidden] { display: none; }
.board-reply__chip { cursor: pointer; border: 0; font: inherit; }
.board-reply { display: grid; gap: 10px; padding: 12px 16px; margin-bottom: 16px; }

/* ライブ・バンドのコメント（lib/comments.php）。書き込みのカードは掲示板の .board-post を流用 */
.comments { margin-top: 18px; }
.comments .board-posts, .comments .board-reply { max-width: none; margin: 0; width: 100%; } /* 親が grid なので、auto の余白があると中身の幅に縮む */
.comments .board-post { box-shadow: none; background: var(--bg, var(--surface)); }
.comments__body { padding-top: 12px; }

/* ---- スマホ幅でコメントが枠の右にはみ出す問題の修正（2026-10-30）----
   原因① grid の「列」は、何も指定しないと中身の最小幅（min-content）より狭くならない（grid blowout という有名な落とし穴）。
         コメントのカードや入力欄が広いと、列ごと広がって外側の枠（.comments）を突き破る。
         → 列を minmax(0, 1fr) にする。「最小 0 まで縮んでよい・余りは全部使う」という意味で、業界標準の対処法。
   対象は togglecard の中身・コメント一覧・入力欄の3つ（それぞれが別の grid なので、全部に必要） */
.comments__body, .comments .board-posts, .comments .board-reply { grid-template-columns: minmax(0, 1fr); }
.comments .board-post__meta strong { min-width: 0; overflow-wrap: anywhere; } /* 長い名義は枠の幅で折り返す（flex の子はこれが無いと縮まない） */
.comments .board-post__date { white-space: nowrap; } /* 日付を「2026-10-29 / 21:15」のように途中で折り返さない */

/* 原因② 名前・日付・返信・削除を1行（flex）に詰めていて、狭いと全部が窮屈になる。
   スマホ（600px 以下）だけ、grid で 2 行にする:
     1行目: 番号 ／ 名前（長ければ折り返す） ／ 返信ボタン ／ 削除ボタン
     2行目: （番号の下は空き） ／ 日付
   「auto minmax(0,1fr) auto auto」= 番号・ボタンは中身の幅、名前の列が余りを全部使う */
@media (max-width: 600px) {
  .comments .board-post__meta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: start; column-gap: 8px; row-gap: 0; }
  .comments .board-post__meta .board-post__no { padding-top: 2px; }
  .comments .board-post__meta strong { grid-column: 2; grid-row: 1; padding-top: 2px; }
  .comments .board-post__meta .board-post__date { grid-column: 2; grid-row: 2; }
  /* 返信・削除は 1 行目の右上に固定（PC 用の左マージンは打ち消す）。コメントが削除済みでボタンが無くても列は崩れない */
  .comments .board-post__meta .board-post__reply { grid-column: 3; grid-row: 1; margin-left: 0; }
  .comments .board-post__meta .board-post__del { grid-column: 4; grid-row: 1; margin-left: 0; }
}

/* 通知一覧（notifications.php）: カード全体がリンク */
.notif-item { display: grid; gap: 2px; color: inherit; text-decoration: none; }
.notif-item:hover { border-color: var(--accent); }

/* ライブの添付画像: ライブページのサムネイル・モーダル / 編集画面の一覧（assets/app.js の setupLiveImages） */
.live-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.live-thumbs__btn { display: block; width: 48px; height: 48px; padding: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; cursor: pointer; background: var(--surface-2); }
.live-thumbs__btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-modal { width: min(920px, calc(100vw - 24px)); background: var(--surface); }
.live-modal img { display: block; width: 100%; max-height: 78vh; object-fit: contain; background: #000; }
.live-modal iframe { display: block; width: 100%; height: 78vh; border: 0; background: #fff; }
.live-modal iframe[hidden], .live-modal img[hidden] { display: none; }
.live-modal__bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0; padding: 10px 14px; }
.live-modal__bar .muted { margin-right: auto; }
.live-img-edit__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.live-img-edit__item { position: relative; width: 56px; height: 56px; padding: 0; background: none; border-radius: var(--r-md); overflow: clip; cursor: pointer; border: 1px solid var(--border); }
.live-img-edit__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-img-edit__item input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; } /* .field の input の大きさ指定が当たって枠からはみ出すと、タッチでフォーカスしたとき枠の中が勝手にスクロールして画像がずれる */
.live-img-edit__x { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgb(0 0 0 / .45); opacity: 0; transition: opacity var(--t-fast); }
.live-img-edit__item:has(input:checked) .live-img-edit__x { opacity: 1; }
@media (hover: hover) { .live-img-edit__item:hover .live-img-edit__x { opacity: 1; } } /* タッチでは :hover がタップ後も残り、選択を解除してもゴミ箱が消えないので、マウスのときだけ */
.live-img-edit__item:has(input:checked) { outline: 2px solid #d33; }
.live-img-edit__item:has(input:checked) img { filter: grayscale(1) blur(1px); }
.live-img-edit__add { width: fit-content; cursor: pointer; }
.live-img-edit__add.is-disabled { opacity: .4; pointer-events: none; }
.live-img-edit__item--new { outline: 2px dashed var(--border); outline-offset: -2px; }
/* 画像の追加欄（掲示板・お知らせ・バンド）: サムネイルは追加ボタンの左。投稿ボタンと上下中央にそろえる */
.live-img-edit:not(.field) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-img-edit:not(.field) .live-img-edit__list { margin: 0; flex-wrap: nowrap; }
.form-actions:has(.live-img-edit) { align-items: center; }
.form-actions:has(.live-img-edit) > .btn { align-self: center; height: auto; }
/* 画像を足したときの、ふわっと出るアニメーション */
@keyframes live-img-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.live-img-edit__item.is-pop { animation: live-img-pop var(--t-base) cubic-bezier(.2, .9, .3, 1.3); }
@media (prefers-reduced-motion: reduce) { .live-img-edit__item.is-pop { animation: none; } }
.hero__thumbs { flex: 0 0 100%; } /* ボタンの行の上に1行ぶん */
.hero__thumbs .live-thumbs { margin: 0 0 12px; justify-content: flex-start; } /* 上は少し、下は編集ボタンとのすき間 */

/* ===== タイムテーブル作成ツール（tt_builder.php / assets/tt_builder.js） ===== */
/* スマホで13バンドほど見えるよう、1バンド = 2行（約44px）に詰める */
.ttb { max-width: 720px; margin: 0 auto; }
.ttb-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ttb-title { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-xl); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttb-iconbtn { padding: 6px; line-height: 0; }
.ttb-people { display: flex; gap: 2px; }
.ttb-person { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 800;
  color: #fff; background: hsl(var(--h) 60% 45%); }
.ttb-status { line-height: 0; color: var(--muted); }
.ttb-status.is-saving .icon { animation: ttb-spin 1s linear infinite; }
.ttb-status.is-error { color: var(--danger); }
@keyframes ttb-spin { to { transform: rotate(360deg); } }
.ttb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.ttb-bar .btn .icon { font-size: 18px; }
/* 元に戻す / やり直す: 画面の下に浮かせる */
/* セッティングシート編集の 1つ戻す・やり直す（.tpl-history）と同じ青系。スマホでは「← 前のページ」の上に積む */
.ttb-float { position: fixed; z-index: 26; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 6px; }
.ttb-float .btn { background: color-mix(in srgb, rgb(59 130 246) 14%, var(--surface)); color: rgb(37 99 235); border-color: rgb(59 130 246 / .3); box-shadow: var(--shadow); }
.ttb-float .btn .icon { font-size: 18px; }
.ttb-float .btn:disabled { opacity: .4; }
[data-theme="dark"] .ttb-float .btn { background: color-mix(in srgb, rgb(96 165 250) 16%, var(--surface)); color: rgb(147 197 253); border-color: rgb(96 165 250 / .3); }
@media (max-width: 760px) {
  .ttb-float { left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  body:has(.back-fabs:not(.back-fabs--ghost) .back-fab) .ttb-float { bottom: calc(128px + env(safe-area-inset-bottom)); }
  /* 曲の編集（songs_edit）: 保存ボタン（.sticky-actions）のすぐ上に 元に戻す / やり直す、その上に「← 前のページ」 */
  body:has(.songs-form) .songs-form .ttb-float.ttb-float { bottom: calc(150px + env(safe-area-inset-bottom)); }
  body:has(.songs-form) .back-fabs { bottom: calc(200px + env(safe-area-inset-bottom)); }
}
.ttb-avail__title { margin: 0 0 8px; font-size: var(--fs-lg); font-weight: 800; }
.ttb-suggest { margin: 0 0 6px; }
.ttb-suggest__pick { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent); text-decoration: underline; cursor: pointer; }
.ttb-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.ttb-seg button { border: 0; background: transparent; color: var(--text); padding: 6px 14px; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.ttb-seg button.is-on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.ttb-views { display: flex; width: 100%; margin-bottom: 8px; }
.ttb-views button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 4px; white-space: nowrap; }
.ttb-views .icon { font-size: 18px; }
.ttb.is-enter .ttb-views { animation: ttb-in var(--t-slow) ease-out backwards; }

/* 日程タブ */
.ttb-tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; padding: 4px 0; margin-bottom: 6px; background: var(--bg); }
.ttb-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 4px; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
.ttb-tab.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ttb-tab.is-drop { outline: 2px dashed var(--accent); outline-offset: 2px; }
.ttb-tab__n { font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; }
.ttb-dot { width: 8px; height: 8px; border-radius: 50%; }
.ttb-dot.is-red { background: var(--danger); }
.ttb-dot.is-yellow { background: var(--warn); }

/* 行 */
.ttb-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.ttb-row { position: relative; display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 2px 4px 2px 0;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--r-md); }
.ttb-row.is-yellow { border-left-color: var(--warn); }
.ttb-row.is-red { border-left-color: var(--danger); }
.ttb-row.is-other { box-shadow: 0 0 0 2px hsl(var(--h) 60% 50%); }
.ttb-row.is-dragging { z-index: 10; box-shadow: var(--shadow), 0 8px 24px rgba(0, 0, 0, .18); opacity: .95; }
.ttb-list > .ttb-row:not(.is-dragging) { transition: transform var(--t-fast) ease; }
.ttb-handle { align-self: stretch; display: grid; place-items: center; width: 22px; padding: 0; border: 0; background: none;
  color: var(--muted); cursor: grab; touch-action: none; }
.ttb-handle:active { cursor: grabbing; }
.ttb-no { width: 16px; flex: none; text-align: right; font-size: var(--fs-xs); font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.ttb-no .icon { font-size: 16px; }
.ttb-main { flex: 1; min-width: 0; }
.ttb-l1row { display: flex; align-items: center; gap: 4px; }
.ttb-l1 { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; }
.ttb-l1 .icon { font-size: 14px; color: var(--muted); }
.ttb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); font-weight: 700; }
.ttb-score { flex: none; padding: 0 5px; border-radius: var(--r-xs); background: var(--surface-2); color: var(--muted); font-size: var(--fs-2xs);
  font-weight: 700; font-variant-numeric: tabular-nums; }
.ttb-l2 { display: flex; flex-wrap: wrap; gap: 0 5px; font-size: var(--fs-2xs); line-height: 1.5; color: var(--muted); }
.ttb-m { display: inline-grid; grid-template-columns: auto auto; justify-items: center; align-items: baseline; padding: 0 2px; border-radius: var(--r-xs); border: 0; background: none; color: inherit; font: inherit; white-space: nowrap; }
.ttb-dots { grid-column: 2; justify-self: center; --dot: color-mix(in srgb, var(--text) 65%, var(--surface)); display: flex; gap: 2px; line-height: 0; padding: 1px 0 2px; }
.ttb-dots i { width: 5px; height: 5px; box-sizing: border-box; border-radius: 50%; border: 1px solid var(--dot); }
.ttb-dots i.is-on { background: var(--dot); }
.ttb-dots i.is-last { background: var(--accent); border-color: var(--accent); } /* その人の最後の出演（最後の丸だけ赤） */
button.ttb-m { cursor: pointer; text-decoration: underline dotted; }
.ttb-m.is-yellow { background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.ttb-m.is-red { background: var(--danger-bg); color: var(--danger); font-weight: 700; }
.ttb-g { font-weight: 800; color: var(--text); margin-right: 1px; font-variant-numeric: tabular-nums; }
/* 学年バッジ: 楽器ラベル（.part）と同じく、色の文字 + その色の薄い地 */
.ttb-g.has-c { display: inline-block; min-width: 14px; padding: 0 3px; margin-right: 2px; border-radius: var(--r-xs); color: var(--gc); background: color-mix(in srgb, var(--gc) 13%, transparent); text-align: center; font-size: var(--fs-2xs); }
.ttb-m.is-unknown .ttb-g:not(.has-c) { color: var(--danger); }
.ttb-days { display: flex; gap: 3px; flex: none; }
.ttb-day { width: 22px; height: 20px; padding: 0; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
  color: var(--text); font: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.ttb-day.is-cur { background: var(--accent); border-color: var(--accent); color: var(--on-accent); opacity: 1; }
.ttb-day:disabled:not(.is-cur) { opacity: .3; cursor: not-allowed; text-decoration: line-through; }
.ttb-row--extra { min-height: 36px; background: var(--surface-2); }
.ttb-extra-text { flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent;
  color: var(--text); font: inherit; font-size: var(--fs-sm); }
.ttb-extra-text:focus { border-color: var(--border); background: var(--surface); }
.ttb-time { display: flex; align-items: center; gap: 4px; flex: none; }
.ttb-start { font-size: var(--fs-xs); font-weight: 700; }
.ttb-min { width: 52px; padding: 4px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: right; }
.ttb-call { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 700; }
.ttb-call input { padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; }
.ttb-empty, .ttb-end { text-align: center; margin: 8px 0; }

/* 日程希望 */
.ttb-avail__table { padding: 4px 8px; margin-bottom: 12px; }
.ttb-avail__row { display: grid; grid-template-columns: 1fr repeat(var(--dc), 52px) 32px; align-items: center; gap: 4px; padding: 4px 0;
  border-bottom: 1px solid var(--border); }
.ttb-avail__row:last-child { border-bottom: 0; }
.ttb-avail__headrow { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.ttb-avail__row.is-limited { background: var(--accent-soft); }
.ttb-avail__name { min-width: 0; display: grid; font-size: var(--fs-md); }
.ttb-avail__name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttb-avail__members { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: var(--fs-2xs); color: var(--muted); }
.ttb-avail__col { padding: 6px 0; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.ttb-avail__check { display: grid; place-items: center; height: 36px; cursor: pointer; }
.ttb-avail__check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ポップアップ・メニュー・トースト */
.ttb-pop { position: absolute; z-index: 60; max-width: min(320px, calc(100vw - 16px)); padding: 10px; }
.ttb-menu { display: grid; min-width: 200px; }
.ttb-menu__item { display: flex; align-items: center; gap: 8px; padding: 9px 6px; border: 0; border-radius: var(--r-sm); background: none;
  color: var(--text); font: inherit; font-size: var(--fs-md); text-align: left; text-decoration: none; cursor: pointer; }
.ttb-menu__item:hover { background: var(--surface-2); }
.ttb-menu__item[data-danger] { color: var(--danger); }
.ttb-grades { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ttb-grades .small { width: 100%; font-weight: 700; }
.ttb-bandmenu { display: grid; gap: 8px; min-width: 220px; }
.ttb-bandmenu p { margin: 0; }
.ttb-settings { display: grid; gap: 6px; min-width: 260px; }
.ttb-mix { display: flex; align-items: center; gap: 8px; }
.ttb-mix input { flex: 1; min-width: 0; }
.ttb-bandmenu__days { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.ttb-bandmenu__hist { margin: 0; padding-left: 16px; }
.ttb-legend p { display: flex; align-items: center; gap: 4px; margin: 4px 0; }
.ttb-toast { position: fixed; left: 50%; bottom: 20px; z-index: 70; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: var(--r-md); background: var(--text); color: var(--bg); font-size: var(--fs-sm); box-shadow: var(--shadow); }
.ttb-toast .btn { color: var(--bg); }

/* 本文欄の上の名義入力 + 匿名チェック（alias_field_html） */
.alias-field { display: flex; align-items: center; gap: 12px; }
.alias-field .check { flex: none; }
.alias-field input[type="text"] { flex: 0 1 240px; min-width: 0; padding: 10px 14px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: var(--fs-md); } /* 本文欄（.board-textarea）と同じ見た目 */
.alias-field input[type="text"]:focus { border-color: var(--accent); }
.alias-field input[type="text"]:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; } /* 匿名のあいだはグレーアウト */
.alias-field__info { position: relative; flex: none; display: inline-flex; }
.alias-field__pop { position: absolute; right: 0; bottom: calc(100% + 6px); width: max-content; max-width: min(260px, 80vw); padding: 8px 12px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.5; background: var(--text); color: var(--surface); box-shadow: var(--shadow); z-index: 10; }
.alias-field__pop[hidden] { display: none; }
.alias-field__pop:not([hidden]) { animation: alias-pop var(--t-fast) ease-out; transform-origin: bottom right; }
@keyframes alias-pop { from { opacity: 0; transform: translateY(4px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .alias-field__pop:not([hidden]) { animation: none; } }
.alias-field__icon { color: var(--muted); font-size: 20px; cursor: pointer; user-select: none; }
.alias-field__icon:hover, .alias-field__icon:focus-visible { color: var(--text); }

/* ---------------------------------------------------------------------
 * タイムテーブル編集（timetable_edit.php）のスマホ表示
 *   左の5列（≡ / 順 / 開始 / 終了 / バンド名）が横スクロールなしで画面に収まる幅にし、出演者は右へ寄せる
 *   （出演者の列は表の右側。横にスクロールして編集する。送信は今までどおり）。
 *   ドラッグ中にバンド名が見えなくなるのを防ぐため、並び替えを始めたら JS が表を左端へ戻す（setupSlotSort）。
 *   幅は列ごとに固定して左の5列だけで画面を使い切る
 * ------------------------------------------------------------------- */
@media (max-width: 600px) {
  .tt-form { margin-inline: -12px; gap: 10px; } /* ページの左右の余白 16px → 4px */
  .tt-form .import-day { padding: 12px 0 0; gap: 10px; }
  .tt-form .import-day__head { padding-inline: 12px; gap: 8px; }
  .tt-form .import-day__title { font-size: var(--fs-xl); }
  .tt-form .legend { font-size: var(--fs-2xs); gap: 2px 10px; margin-top: 4px; }
  .tt-form .legend span { gap: 4px; }
  .tt-form .swatch { width: 11px; height: 11px; }
  .tt-form .legend .icon { font-size: 14px; }
  .tt-form .table-scroll { margin: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); }

  .table--tt {
    --tt-w1: 28px; --tt-w2: 20px; --tt-wt: 62px; /* ≡ / 順 / 開始・終了 */
    --tt-name: max(150px, calc(100vw - 8px - var(--tt-w1) - var(--tt-w2) - 2 * var(--tt-wt))); /* バンド名 = 残り全部（画面幅 - 表の外の余白 8px） */
  }
  .table--tt th, .table--tt td { padding: 6px 3px; box-sizing: border-box; }
  .table--tt th { padding-block: 8px; white-space: nowrap; }
  .table--tt th:nth-child(1), .table--tt td:nth-child(1) { width: var(--tt-w1); min-width: var(--tt-w1); max-width: var(--tt-w1); padding-inline: 0; text-align: center; }
  .table--tt th:nth-child(2), .table--tt td:nth-child(2) { width: var(--tt-w2); min-width: var(--tt-w2); max-width: var(--tt-w2); padding-inline: 0; text-align: center; }
  .table--tt th:nth-child(3), .table--tt th:nth-child(4), .table--tt td[data-time] { width: var(--tt-wt); min-width: var(--tt-wt); max-width: var(--tt-wt); }
  .table--tt th:nth-child(5), .table--tt td:nth-child(5) { width: var(--tt-name); min-width: var(--tt-name); }
  .table--tt td:nth-child(n+6) { min-width: 120px; } /* 出演者（右へスクロール） */
  .table--tt .drag-handle { padding: 8px 2px; font-size: var(--fs-2xl); } /* 指で押しやすい高さ */
  .table--tt .tt-follow { margin-left: 0; padding: 0; }
  .table--tt .tt-follow .icon { font-size: 14px; }

  /* 入力欄の文字と余白は他の編集の表（.table--edit input）と同じ。時刻だけは列が細いので左右の余白を詰める */
  .table--tt td[data-time] { padding-inline: 2px; }
  /* iOS の時刻欄は独自の最小幅と内側の余白を持っていて枠からはみ出すので、見た目を外して幅いっぱいに収める */
  .table--tt td[data-time] input { -webkit-appearance: none; appearance: none; width: 100%; min-width: 0; padding-inline: 2px; text-align: center; font-variant-numeric: tabular-nums; }
  .table--tt td[data-time] input::-webkit-date-and-time-value { text-align: center; margin: 0; }
  .table--tt input[type="time"]::-webkit-calendar-picker-indicator { display: none; }

  /* バンド名: 入力欄 + 旗。旗を立てて理由などが出たときは次の行へ */
  .table--tt .tt-band-name { flex-wrap: wrap; gap: 2px; }
  .table--tt .tt-band-name > input { flex: 1 1 6em; width: auto; }
  .table--tt .tt-band-name > .check-picker { flex: 0 0 auto; gap: 2px 4px; }
  .table--tt .tt-band-name > .check-picker:has(.flag-toggle input:checked) { flex-basis: 100%; }
  .table--tt .check-picker__body { min-width: 0; }

  /* 休憩の「この行を消す」: アイコンだけ */
  .table--tt [data-break-fill] .btn { font-size: 0; padding: 6px; gap: 0; }
  .table--tt [data-break-fill] .btn .icon { font-size: 20px; }
}

/* タイムテーブル作成: 登場・ポップアップ・操作のアニメーション */
@keyframes ttb-in { from { opacity: 0; transform: translate(calc(var(--ttb-dir, 0) * 12px), 4px); } to { opacity: 1; transform: none; } }
@keyframes ttb-pop-in { from { opacity: 0; transform: translateY(-2px) scale(.98); } to { opacity: 1; transform: none; } }
.ttb.is-enter .ttb-list > .ttb-row, .ttb.is-enter .ttb-avail__title { animation: ttb-in var(--t-base) ease-out backwards; }
.ttb-pop { position: absolute; z-index: 60; max-width: min(320px, calc(100vw - 16px)); padding: 10px; }
.ttb-menu { display: grid; min-width: 200px; }
.ttb-menu__item { display: flex; align-items: center; gap: 8px; padding: 9px 6px; border: 0; border-radius: var(--r-sm); background: none;
  color: var(--text); font: inherit; font-size: var(--fs-md); text-align: left; text-decoration: none; cursor: pointer; }
.ttb-menu__item:hover { background: var(--surface-2); }
.ttb-menu__item[data-danger] { color: var(--danger); }
.ttb-grades { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ttb-grades .small { width: 100%; font-weight: 700; }
.ttb-bandmenu { display: grid; gap: 8px; min-width: 220px; }
.ttb-bandmenu p { margin: 0; }
.ttb-settings { display: grid; gap: 6px; min-width: 260px; }
.ttb-mix { display: flex; align-items: center; gap: 8px; }
.ttb-mix input { flex: 1; min-width: 0; }
.ttb-bandmenu__days { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.ttb-bandmenu__hist { margin: 0; padding-left: 16px; }
.ttb-legend p { display: flex; align-items: center; gap: 4px; margin: 4px 0; }
.ttb-toast { position: fixed; left: 50%; bottom: 20px; z-index: 70; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: var(--r-md); background: var(--text); color: var(--bg); font-size: var(--fs-sm); box-shadow: var(--shadow); }
.ttb-toast .btn { color: var(--bg); }

/* 本文欄の上の名義入力 + 匿名チェック（alias_field_html） */
.alias-field { display: flex; align-items: center; gap: 12px; }
.alias-field .check { flex: none; }
.alias-field input[type="text"] { flex: 0 1 240px; min-width: 0; padding: 10px 14px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: var(--fs-md); } /* 本文欄（.board-textarea）と同じ見た目 */
.alias-field input[type="text"]:focus { border-color: var(--accent); }
.alias-field input[type="text"]:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; } /* 匿名のあいだはグレーアウト */
.alias-field__info { position: relative; flex: none; display: inline-flex; }
.alias-field__pop { position: absolute; right: 0; bottom: calc(100% + 6px); width: max-content; max-width: min(260px, 80vw); padding: 8px 12px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.5; background: var(--text); color: var(--surface); box-shadow: var(--shadow); z-index: 10; }
.alias-field__pop[hidden] { display: none; }
.alias-field__pop:not([hidden]) { animation: alias-pop var(--t-fast) ease-out; transform-origin: bottom right; }
@keyframes alias-pop { from { opacity: 0; transform: translateY(4px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .alias-field__pop:not([hidden]) { animation: none; } }
.alias-field__icon { color: var(--muted); font-size: 20px; cursor: pointer; user-select: none; }
.alias-field__icon:hover, .alias-field__icon:focus-visible { color: var(--text); }

/* ---------------------------------------------------------------------
 * タイムテーブル編集（timetable_edit.php）のスマホ表示
 *   左の5列（≡ / 順 / 開始 / 終了 / バンド名）が横スクロールなしで画面に収まる幅にし、出演者は右へ寄せる
 *   （出演者の列は表の右側。横にスクロールして編集する。送信は今までどおり）。
 *   ドラッグ中にバンド名が見えなくなるのを防ぐため、並び替えを始めたら JS が表を左端へ戻す（setupSlotSort）。
 *   幅は列ごとに固定して左の5列だけで画面を使い切る
 * ------------------------------------------------------------------- */
@media (max-width: 600px) {
  .tt-form { margin-inline: -12px; gap: 10px; } /* ページの左右の余白 16px → 4px */
  .tt-form .import-day { padding: 12px 0 0; gap: 10px; }
  .tt-form .import-day__head { padding-inline: 12px; gap: 8px; }
  .tt-form .import-day__title { font-size: var(--fs-xl); }
  .tt-form .legend { font-size: var(--fs-2xs); gap: 2px 10px; margin-top: 4px; }
  .tt-form .legend span { gap: 4px; }
  .tt-form .swatch { width: 11px; height: 11px; }
  .tt-form .legend .icon { font-size: 14px; }
  .tt-form .table-scroll { margin: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); }

  .table--tt {
    --tt-w1: 28px; --tt-w2: 20px; --tt-wt: 62px; /* ≡ / 順 / 開始・終了 */
    --tt-name: max(150px, calc(100vw - 8px - var(--tt-w1) - var(--tt-w2) - 2 * var(--tt-wt))); /* バンド名 = 残り全部（画面幅 - 表の外の余白 8px） */
  }
  .table--tt th, .table--tt td { padding: 6px 3px; box-sizing: border-box; }
  .table--tt th { padding-block: 8px; white-space: nowrap; }
  .table--tt th:nth-child(1), .table--tt td:nth-child(1) { width: var(--tt-w1); min-width: var(--tt-w1); max-width: var(--tt-w1); padding-inline: 0; text-align: center; }
  .table--tt th:nth-child(2), .table--tt td:nth-child(2) { width: var(--tt-w2); min-width: var(--tt-w2); max-width: var(--tt-w2); padding-inline: 0; text-align: center; }
  .table--tt th:nth-child(3), .table--tt th:nth-child(4), .table--tt td[data-time] { width: var(--tt-wt); min-width: var(--tt-wt); max-width: var(--tt-wt); }
  .table--tt th:nth-child(5), .table--tt td:nth-child(5) { width: var(--tt-name); min-width: var(--tt-name); }
  .table--tt td:nth-child(n+6) { min-width: 120px; } /* 出演者（右へスクロール） */
  .table--tt .drag-handle { padding: 8px 2px; font-size: var(--fs-2xl); } /* 指で押しやすい高さ */
  .table--tt .tt-follow { margin-left: 0; padding: 0; }
  .table--tt .tt-follow .icon { font-size: 14px; }

  /* 入力欄の文字と余白は他の編集の表（.table--edit input）と同じ。時刻だけは列が細いので左右の余白を詰める */
  .table--tt td[data-time] { padding-inline: 2px; }
  /* iOS の時刻欄は独自の最小幅と内側の余白を持っていて枠からはみ出すので、見た目を外して幅いっぱいに収める */
  .table--tt td[data-time] input { -webkit-appearance: none; appearance: none; width: 100%; min-width: 0; padding-inline: 2px; text-align: center; font-variant-numeric: tabular-nums; }
  .table--tt td[data-time] input::-webkit-date-and-time-value { text-align: center; margin: 0; }
  .table--tt input[type="time"]::-webkit-calendar-picker-indicator { display: none; }

  /* バンド名: 入力欄 + 旗。旗を立てて理由などが出たときは次の行へ */
  .table--tt .tt-band-name { flex-wrap: wrap; gap: 2px; }
  .table--tt .tt-band-name > input { flex: 1 1 6em; width: auto; }
  .table--tt .tt-band-name > .check-picker { flex: 0 0 auto; gap: 2px 4px; }
  .table--tt .tt-band-name > .check-picker:has(.flag-toggle input:checked) { flex-basis: 100%; }
  .table--tt .check-picker__body { min-width: 0; }

  /* 休憩の「この行を消す」: アイコンだけ */
  .table--tt [data-break-fill] .btn { font-size: 0; padding: 6px; gap: 0; }
  .table--tt [data-break-fill] .btn .icon { font-size: 20px; }
}

/* タイムテーブル作成: 登場・ポップアップ・操作のアニメーション */
@keyframes ttb-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ttb-pop-in { from { opacity: 0; transform: translateY(-4px) scale(.96); } to { opacity: 1; transform: none; } }
.ttb.is-enter .ttb-head, .ttb.is-enter .ttb-bar, .ttb.is-enter .ttb-tabs, .ttb.is-enter .ttb-avail__title { animation: ttb-in var(--t-slow) ease-out backwards; }
.ttb.is-enter .ttb-list > .ttb-row { animation: ttb-in var(--t-slow) ease-out backwards; }
.ttb.is-enter .ttb-list > .ttb-row:nth-child(2) { animation-delay: .03s; }
.ttb.is-enter .ttb-list > .ttb-row:nth-child(3) { animation-delay: .06s; }
.ttb.is-enter .ttb-list > .ttb-row:nth-child(4) { animation-delay: .09s; }
.ttb.is-enter .ttb-list > .ttb-row:nth-child(5) { animation-delay: .12s; }
.ttb.is-enter .ttb-list > .ttb-row:nth-child(6) { animation-delay: .15s; }
.ttb.is-enter .ttb-list > .ttb-row:nth-child(7) { animation-delay: .18s; }
.ttb.is-enter .ttb-list > .ttb-row:nth-child(8) { animation-delay: .21s; }
.ttb.is-enter .ttb-list > .ttb-row:nth-child(n+9) { animation-delay: .24s; }
.ttb-pop { animation: ttb-pop-in var(--t-fast) ease-out; transform-origin: top left; }
.ttb-row, .ttb-tab, .ttb-day, .ttb-m, .ttb-score { transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, opacity var(--t-fast) ease; }
.ttb-list > .ttb-row:not(.is-dragging) { transition: transform var(--t-fast) ease, background-color var(--t-base) ease, border-color var(--t-base) ease, box-shadow var(--t-base) ease; }
.ttb-tab:active, .ttb-day:active, .ttb-float .btn:active { transform: scale(.96); }
.ttb-row.is-dragging { transform-origin: center; }
.ttb-float .btn { transition: transform var(--t-fast) ease, opacity var(--t-base) ease; }
@media (prefers-reduced-motion: reduce) {
  .ttb.is-enter .ttb-avail__title, .ttb.is-enter .ttb-list > .ttb-row, .ttb-pop { animation: none; }
  .ttb-row, .ttb-tab, .ttb-day, .ttb-m, .ttb-score, .ttb-float .btn { transition: none; }
}
.ttb-row.is-dragging { transform-origin: center; transition: box-shadow var(--t-fast) ease, opacity var(--t-fast) ease; }
.ttb.is-tswitch .ttb-time, .ttb.is-tswitch .ttb-days { animation: ttb-in var(--t-base) ease-out backwards; --ttb-dir: 0; }
@media (prefers-reduced-motion: reduce) { .ttb.is-tswitch .ttb-time, .ttb.is-tswitch .ttb-days { animation: none; } }
/* タイムテーブル作成: プレビュー（完成形の表と同じ形。セルがそのまま入力欄） */
/* 表の最小幅 652px。列の幅: バンド名 269px・key 115px（全角1文字分ずつ、広げて・狭めた。実ブラウザで測った値）。入力欄の min-width は指定より大きく広がるので使わず、セルの幅で決める */
.ttb-pv__c-name { width: 269px; }
.ttb-pv__c-key { width: 115px; }
.ttb-pv__scroll { padding: 0; overflow-x: auto; }
.ttb-pv__table { width: 100%; min-width: 652px; border-collapse: collapse; font-size: var(--fs-sm); text-align: center; }
.ttb-pv__table td, .ttb-pv__table th { padding: 0; border: 1px solid var(--border); height: 30px; white-space: nowrap; }
.ttb-pv__table td.mono { padding: 0 6px; font-variant-numeric: tabular-nums; }
.ttb-pv__top td { border: 0; font-weight: 800; }
.ttb-pv__head th { background: color-mix(in srgb, var(--text) 22%, var(--surface)); color: var(--text); font-weight: 800; }
.ttb-pv__b { font-weight: 700; }
.ttb-pv__n { width: 52px; }
.ttb-pv__title { white-space: nowrap; }
.ttb-pv__title .ttb-pv__in { display: inline-block; vertical-align: middle; width: auto; field-sizing: content; min-width: 4em; text-align: right; }
.ttb-pv__title span { vertical-align: middle; }
.ttb-pv__table td { vertical-align: middle; }
.ttb-pv__in { width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid transparent; border-radius: var(--r-xs);
  background: transparent; color: var(--text); font: inherit; text-align: center; }
.ttb-pv__in:hover { background: var(--surface-2); }
.ttb-pv__in:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.ttb-pv__num { width: 56px; -moz-appearance: textfield; }
.ttb-pv__num::-webkit-inner-spin-button, .ttb-pv__num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ttb-pv__table input[type=date] { min-width: 130px; }
.ttb-hidden { padding: 8px; }
.ttb-hidden p { margin: 0 0 4px; }
.ttb-hidden__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0; font-size: var(--fs-md); color: var(--muted); }
.ttb-hidden__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: line-through; }
.ttb-pv__top select.ttb-pv__in { min-width: 12em; text-align-last: center; }

/* トップ: 予定ライブのカウントダウン（index.php） */
.countdown { display: grid; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border: 2px solid var(--accent); }
.countdown__main { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.countdown__name { flex: 1; min-width: 0; font-size: var(--fs-2xl); font-weight: 900; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.countdown__days { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; color: var(--accent); font-weight: 700; }
.countdown__days strong { font-size: var(--fs-3xl); line-height: 1; }
.countdown__days small { font-size: var(--fs-sm); color: var(--muted); }
.countdown__bands { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.countdown__practice { justify-self: start; }
.countdown__band { display: flex; align-items: baseline; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.countdown__band strong { font-size: var(--fs-lg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.countdown__when { flex: none; min-width: 7.5em; font-size: var(--fs-xs); font-weight: 700; color: color-mix(in srgb, var(--text) 65%, var(--surface)); } /* 黒より少し薄く */

/* <details> の開け閉めをなめらかに（高さを 0 ⇔ auto へ。::details-content 対応のブラウザだけ。非対応は今までどおり即時）
 *   右上のメニュー（usermenu・notifmenu）は別の動きがあるので対象外
 *   .togglecard（お知らせ・掲示板・コメント・会場の編集など）は対象。開くときの中身のふわっと（app.js の .togglecard）と一緒に動く（閉じるときはこの高さだけ）
 *   ※ <div class="togglecard" data-board-panel> は <details> ではないので、::details-content は効かない（対象外のまま） */
@supports selector(::details-content) {
  @media (prefers-reduced-motion: no-preference) {
    :root { interpolate-size: allow-keywords; }
    /* overflow（はみ出しの扱い）は「動いている間だけ clip」にする:
         clip のままだと、開いたあともカードの外へ出る物（コメント欄のⓘの説明ポップ・入力欄のフォーカスの枠）が切れてしまう。
         ・閉じる側（下の指定）: overflow を 0s で即 clip に（縮み始めから切る）
         ・開く側（[open] の指定）: overflow を .25s 遅らせて visible に（伸び終わってから戻す）
         allow-discrete = 「途中の値が無いプロパティ（clip / visible）も transition の対象にする」指定 */
    :is(.edit-box, .songs-add, .prac-new, .tab-new-wrap, .tab-new__more, .partner, .sheet-ed__json, .togglecard, .venue-edit)::details-content {
      block-size: 0; overflow: clip;
      transition: block-size var(--t-base) var(--ease-out), content-visibility var(--t-base) allow-discrete, overflow 0s allow-discrete; }
    :is(.edit-box, .songs-add, .prac-new, .tab-new-wrap, .tab-new__more, .partner, .sheet-ed__json, .togglecard, .venue-edit)[open]::details-content {
      block-size: auto; overflow: visible;
      transition: block-size var(--t-base) var(--ease-out), content-visibility var(--t-base) allow-discrete, overflow 0s var(--t-base) allow-discrete; }
    /* #c12 や #categories のリンクで来て、JS が自動で開くときだけ動きを止める（app.js の openWithoutAnimation が .is-instant を付ける）。
       高さが 0 から伸びている途中でスクロールすると、飛び先の位置がズレる（コメントへ飛べなくなる）ため。
       上の [open] の指定は詳細度（優先度）が高いので、こちらも [open] 付きで書いて transition: none を勝たせる */
    details.is-instant::details-content, details.is-instant[open]::details-content { transition: none; }
  }
}

/* ---- ちょっとリッチな動き（動きを減らす設定の人には出さない） ---- */
@media (prefers-reduced-motion: no-preference) {
  /* 1. 押した感触: 押している間だけ少し縮む */
  .btn, button.chip, a.chip, .icon-btn { transition-property: color, border-color, background-color, box-shadow, transform; }
  .btn:active, button.chip:active, a.chip:active, .icon-btn:active { transform: scale(.96); }
  /* 3. ジャケット: ホバーで浮いて、影が濃くなる */
  .album__art-link:hover .album__art, .albums[data-album-sort] .album__art:hover { box-shadow: var(--shadow-pop); }
  .setlist__art { transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) ease; }
  .setlist__artwrap:hover .setlist__art { transform: scale(1.05); box-shadow: var(--shadow-pop); }
}
/* PC: 右の欄の先頭の絞り込みカード。見出しを消して縦幅を詰め、スクロールで浮く（欄が画面より高く上へ送られているときも、浮く位置に残る）。
   マイアルバムからは離し（カードと同じ上32px）、下の集計カードに寄せる */
@media (min-width: 861px) {
  .split aside > .stats-filter { position: sticky; top: 70px; z-index: 15; margin: 32px 0 0; gap: 6px; padding: 10px 8px; }
  .split aside > .stats-filter .stats-filter__row { gap: 6px; padding-inline: 3px; }
  .split aside > .stats-filter .stats-filter__row legend { display: none; }
  .split aside > .stats-filter .tabs--filter { max-width: none; overflow: visible; padding: 2px; }
  .split aside > .stats-filter .tab { padding: 5px 8px; font-size: var(--fs-xs); }
  .split aside > .stats-filter .stats-filter__extra select { padding: 4px 8px; font-size: var(--fs-xs); }
}
@media (min-width: 861px) { .split aside > .stats-filter + .partner-box { margin-top: 12px; } }
.split aside > .stats-filter.is-faded { pointer-events: none; } /* 出演履歴が近づくと絞り込みが薄くなって消える（opacity はスクロールに合わせて app.js が付ける） */
:root.live-vt .hero { view-transition-name: member-hero; } /* liveFilter の間だけ（ページ移動の切り替えには影響させない） */
/* 右の欄: 1列表示だと aside は箱を持たない（display: contents）ので、中のカードに1枚ずつ名前を付ける（1番目は絞り込みカード） */
:root.live-vt .split aside > :nth-child(2) { view-transition-name: member-aside-2; }
:root.live-vt .split aside > :nth-child(3) { view-transition-name: member-aside-3; }
:root.live-vt .split aside > :nth-child(4) { view-transition-name: member-aside-4; }
:root.live-vt .split aside > :nth-child(5) { view-transition-name: member-aside-5; }
/* 絞り込みカード（浮いているカード）にも名前を付ける。
 *   理由: 名前が付いた要素は「ページ本体（root）の絵」から切り離されて、ページより手前の専用レイヤーに描かれる。
 *   → 下のカード（2〜5番目）だけ名前付きで、浮いているカードが名前なしだと、切り替え中に下のカードが浮いているカードの上に出てしまう。
 *   → 浮いているカードも名前付きにすると、重なり順（z-index: 15）がそのまま守られる */
:root.live-vt .split aside > .stats-filter { view-transition-name: member-filter; }
/* 絞り込みカードは差し替えない（同じ要素のまま）ので、クロスフェードはせず、今の見た目をそのまま出し続ける */
:root.live-vt::view-transition-group(member-filter) { animation: none; }
:root.live-vt::view-transition-old(member-filter) { display: none; }
:root.live-vt::view-transition-new(member-filter) { animation: none; }
:root.live-vt::view-transition-old(root), :root.live-vt::view-transition-new(root) { animation: none; } /* 絞り込みの切り替え（liveFilter）: ページ全体は動かさず、上の数字と右の欄だけクロスフェード */
:root.live-vt::view-transition-group(member-hero), :root.live-vt::view-transition-group(member-aside-2), :root.live-vt::view-transition-group(member-aside-3), :root.live-vt::view-transition-group(member-aside-4), :root.live-vt::view-transition-group(member-aside-5) { animation-duration: var(--t-base); }
.is-updating { opacity: .45; transition: opacity var(--t-fast) ease; } /* 絞り込みを変えて読み込み中（assets/app.js の liveFilter） */
/* 2. 一覧のふわっと表示: 画面に入るとき、下から少し浮いて現れる（スクロール連動。対応ブラウザだけ）
 *    fill を backwards にして、表示後は元の transform（ホバーなど）を邪魔しない。並び替えのカードは対象外 */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .live-card, .songs-row { animation: reveal-up linear backwards; animation-timeline: view(); animation-range: entry 0% entry 40%; }
    /* メンバーページの集計カード（.partner-box）は、スクロールで透明になる（じわじわ現れる）演出をやめた。
       以前はここで「.split aside .partner-box { animation: reveal-up ...; animation-timeline: view(); }」を指定していた。
         animation-timeline: view() … 要素が画面に入る・出る位置に合わせてアニメを進める CSS（スクロール連動アニメーション）
         reveal-up                   … opacity: 0（透明）→ 1 と translateY(14px) → 0 の動きを定義した @keyframes（下）
       → この指定を消せば、集計カードは最初から opacity: 1（不透明）のまま表示される。
       絞り込みカード（.stats-filter）の薄くなる処理は app.js の checkFade が別でやっているので、ここでは触らない */
    @keyframes reveal-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  }
}

/* 楽器ラベルの名前ポップアップ（app.js） */

/* deploy cache bust */

/* 登録済みの日程への追加（import.php?day=◯）のプレビューで、ライブ名などの入力欄の代わりに出す追加先 */
.attach-target { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 12px; }
.attach-target .icon { color: var(--accent); }

/* 登録済みのメンバーと名簿の見比べ（import.php の追加プレビュー）。違う人は色を付ける */
.member-compare { margin-top: 6px; display: grid; gap: 4px; font-size: var(--fs-sm); }
.member-compare .check { display: inline-flex; align-items: center; gap: 6px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.compare-grid ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.compare-grid li.is-diff { color: var(--warn); background: var(--warn-bg); border-radius: var(--r-xs); padding: 0 4px; }

/* ===== 楽器の管理（instruments.php） ===== */
.inst-admin .inst-admin__color { width: 40px; min-width: 40px; height: 32px; padding: 2px; cursor: pointer; } /* カラーピッカーは正方形に近く */
.inst-admin .inst-admin__short { width: 6em; min-width: 0; }
.inst-admin__colorbox { display: inline-flex; align-items: center; gap: 6px; } /* ピッカーと色コードの欄を横に並べる */
.inst-admin .inst-admin__hex { width: 6.5em; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; } /* 色コードは等幅（0 と o が見分けやすい） */
.inst-admin .inst-admin__hex.is-invalid { border-color: var(--danger); } /* 色コードの形が違うあいだは赤い枠 */
.inst-admin__merge select { min-width: 7em; }

/* =====================================================================
 * ラベルの規格（上下中央揃え）
 *   楽器ラベル・タグ・ピル・✓バッジは、ここで高さと中央揃えをそろえる。
 *   ・名前などのボタン状の .chip は余白を潰さない別枠（下の .chip ルール。padding・line-height は自前のまま）
 *   ・高さは min-height（--label-h-sm/--label-h/--label-h-lg）。複数行になったら伸びる
 *   ・inline-flex + align-items: center + line-height: 1 で、行高の違いによるずれを消す
 *   ・日本語は字面が枠の上に寄って見えるので、padding-top を max(1px, .1em) だけ足して下げる
 *     （小さいラベルでも最低 1px 下がる）。個別の padding に負けないよう !important で上書きする（上下だけ）
 *   ・横の余白・文字サイズ・色は各クラスのまま。新しいラベルを作るときは、このリストに足す
 *   ・文中に置くラベルは .label-inline を足す（周りの文字サイズに追従して、行の中央に揃う）
 * ===================================================================== */
:is(.part, .tag:not(.tag--flag), .se-mark, .setlist-badge, .pill) {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-height: var(--label-h); line-height: 1;
  padding-top: max(1px, .1em) !important; padding-bottom: 0 !important;
}
.pill { min-height: var(--label-h-lg); }
/* 名前などのボタン状の .chip: 余白（padding・line-height）は自前のまま、中央揃えと最小高さだけ規格に合わせる。
   inline-flex は文字と子要素の間の空白を消すので、gap で補う */
.chip:not(.chip--xs) {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-height: var(--label-h-lg); gap: .35em;
}
:is(.partbar--partner, .partner__live) .part { min-height: var(--label-h-sm); }
.pill:empty { display: none; } /* 上の display より後ろに書いて、空のピルを隠す動きを残す */
.label-inline { vertical-align: middle; margin-inline: .2em; font-size: .75em; min-height: 1.45em; }

/* ===== AIで入力の追加指示（studio_info.php / venue.php）。アイコンの summary で開閉 ===== */
.ai-extra > summary { list-style: none; display: inline-flex; cursor: pointer; }
.ai-extra > summary::-webkit-details-marker { display: none; }
.ai-extra[open] > summary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ai-extra > textarea { display: block; width: 100%; margin-top: 6px; padding: 8px 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: var(--fs-sm); resize: vertical; }
