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

/* ===== 1. 色・フォントの変数 ===== */
:root {
  --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;     /* 青: トリの印 */
  --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; --cho: #6fa31a; --other: #6c6a75;
  --radius: 16px;
  --radius-sm: 10px;
  --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;
  --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; --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: 15px/1.65 var(--font);
  font-feature-settings: "palt"; /* 日本語の約物（、。「」）を詰める */
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
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: 6px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 16px 96px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: 12px; 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 .2s 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: 999px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.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; }
.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: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(--radius-sm);
  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: 8px; text-align: left; }
.usermenu__panel a:hover, .usermenu__panel .linkbtn:hover { background: var(--surface-2); color: var(--text); }
.usermenu__name { 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: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2); }
.usermenu__admin-label { padding: 2px 4px 4px; font-size: 11px; 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: 20px; }
h3 { font-size: 16px; }
.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: 12px; 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; }
.small { font-size: 13px; }
.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: 16px; 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(--radius-sm); padding: 6px 12px; min-width: 64px; }
.stats dt { font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: .06em; }
.stats dd { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; 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(--radius); 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: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: 700 14px/1 var(--font); cursor: pointer;
  transition: transform .12s ease, box-shadow .2s 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; }
.btn--danger { 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: 13px; }

/* 表の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: 8px; 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: 8px; 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 に拾わせる */ }

/* マウスを乗せる（キーボードならフォーカスする）と data-tooltip の文字を出す。
   表は横スクロールの箱（overflow）の中にあり上にはみ出すと切れるので、ボタンの左側に出す */
.tooltip { position: relative; display: inline-block; cursor: not-allowed; }
.tooltip::after { content: attr(data-tooltip); position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; padding: 6px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: var(--text); color: var(--surface); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transition: opacity .15s; pointer-events: none; z-index: 10; }
.tooltip:hover::after, .tooltip:focus-visible::after { opacity: 1; visibility: visible; }
.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: 999px; font-size: 12px; 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: 6px; font-size: 11px; 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; }
.tag--tori { font-size: 14px; 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(--radius-sm); margin-bottom: 12px; font-weight: 600; font-size: 14px; 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 .25s ease-out; transition: opacity .3s ease, transform .3s 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); } }
@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 の半分 */
.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(--radius-sm); 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: 0 0 0 3px var(--accent-soft); }
.year-slot__reel { position: relative; transition: transform .32s 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 20px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--muted);
  opacity: .3; transition: opacity .2s, color .2s; }
.year-slot__item small { font-size: 11px; 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 とは別のクラスで消す */
.year-slot--grade { width: 6.6em; }
.year-slot--grade .year-slot__item { font-size: 17px; }
.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(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 15px; 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: 0 0 0 3px var(--accent-soft); }

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

/* ===== 6-1. ライブ一覧 ===== */
.year { margin-bottom: 36px; }
.year__title { font-size: 28px; font-weight: 900; letter-spacing: -.03em; margin-bottom: 14px; display: flex; align-items: baseline; gap: 4px; }
.year__title small { font-size: 14px; color: var(--muted); font-weight: 700; }
.live-card { position: relative; display: flex; flex-direction: column; gap: 14px; transition: transform .18s ease, border-color .18s 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: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: 19px; font-weight: 800; }
.live-card__days { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.live-card__days li { display: grid; grid-template-columns: 5.5em auto 1fr; gap: 10px; align-items: center; }
.day-no { font-weight: 800; font-size: 12px; color: var(--accent); }
.live-card__foot { margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.live-card__foot strong { color: var(--text); font-size: 16px; }
.arrow { margin-left: auto; transition: transform .18s 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: 999px; width: max-content; max-width: 100%; position: sticky; top: 70px; z-index: 5; box-shadow: var(--shadow); }
.tab { padding: 8px 16px; border-radius: 999px; font-weight: 800; font-size: 13px; 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: 16px; }
.tabs--days .tab small { font-size: 13px; }
/* 日程を切り替えたとき、表示された日程をふわっと出す（hidden が外れて表示されるたびにアニメーションが最初から動く） */
.day:not([hidden]) { animation: day-fade .25s 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__info h2 { font-size: 24px; 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: 11px; 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; }
.tt-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.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 12px/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: 11px; }
/* 出演順の番号（時刻の上）。時刻が有っても無くても同じ大きさ。時刻はその下に小さく */
.slot__time .slot__no { font-size: 15px; 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: 11px; font-weight: 800; letter-spacing: .2em; color: var(--muted); }
.slot__body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); 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: 18px; 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; }
/* お気に入り（❤）: 吹き出し（数）＞ハート。タイムテーブルでは行の右端、バンドページではバンド名の右（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: 6px; background: var(--surface);
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; transition: color .15s, border-color .15s, background .15s; }
/* 吹き出しのしっぽ（右向き ＞ でハートを指す）。枠線の三角 + 中を塗る三角の2枚重ね */
.like__count::before, .like__count::after { content: ''; position: absolute; top: 50%; transform: translateY(-50%); border: 5px solid transparent; border-right: 0; }
.like__count::before { right: -6px; border-left-color: var(--border); }
.like__count::after  { right: -5px; border-left-color: var(--surface); }
.like__heart { font-size: 22px; transition: transform .15s, font-variation-settings .15s; } /* 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-left-color: var(--accent); }
.like.is-liked .like__count::after { border-left-color: color-mix(in srgb, var(--accent) 10%, var(--surface)); } /* 吹き出しの中と同じ色 */
.like.is-pop .like__heart { animation: like-pop .3s 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: 15px; 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: 12px; color: var(--muted); }
.keynote { color: var(--text); }
.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); }

.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: 6px; font: 800 11px/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); }
/* 兼任（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: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 500; }
.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: 11px; 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: 14px; }
.table th { text-align: left; font-size: 11px; 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: 999px; 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; }
/* メンバー一覧のマイアルバム上位5枚 */
.thumbs { display: flex; gap: 4px; }
.thumbs__img { width: 40px; height: 40px; flex: none; object-fit: cover; border-radius: 4px; 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(--radius-sm);
  background: var(--text); color: var(--bg); font-size: 12px; line-height: 1.4; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .12s; box-shadow: 0 8px 20px -6px rgb(0 0 0 / .35); }
.album-tip.is-visible { opacity: 1; visibility: visible; }
/* メンバー一覧の右端の名前列。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; }
.album-tip__title { font-size: 13px; 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: 3px; } }

.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; }
/* よく組むメンバーを全員開くと画面より高くなり、貼り付いたままだと下の方が見えない → 開いているあいだは貼り付けない */
.split aside:has(.partner-box.is-open) { position: static; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* 出演履歴の年度見出し（年度が変わるところだけ）と、上の検索・年度スロット・並び替えボタン */
.history-year + .history-year { margin-top: 22px; }
.history__year { font-size: 18px; font-weight: 900; letter-spacing: -.02em; margin: 0 0 12px; /* 下の余白: 右に重ねた並び替えボタンは見出しより 3px ほどはみ出すので、カードとの間は 9px ほど */ display: flex; align-items: baseline; gap: 3px; }
.history__year small { font-size: 12px; 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: 12px; font-weight: 700; }
.history__what { display: grid; min-width: 0; }
.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: 16px; 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; } /* 名前が長くても「出演」は縮めない。名前とのすき間は gap 6px + 6px = 12px */
/* トリの印: バンド名の横に小さな灰色の四角 + 🐔 */
.tori-badge { flex-shrink: 0; font-size: 12px; line-height: 1; padding: 2px 4px; border-radius: 4px; background: var(--surface-2); }
.history__tags { display: flex; align-items: center; gap: 6px; flex-shrink: 0; } /* セットリストの ✓ と楽器ラベルの高さをそろえる */
/* セットリスト登録済み（live.php のバンドカード / member.php の出演履歴） */
.setlist-badge { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; padding: 2px 7px 2px 5px;
  border-radius: 999px; font-size: 11px; 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: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: 11px; 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 12px 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）を出す */

/* ===== 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: 22px; font-weight: 800; }
.field { display: grid; align-content: start; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
/* align-content: start … 同じ行のほかの欄が高くなっても（下に注意文が出たときなど）、ラベルと入力欄は伸ばさず上に詰める */
.req { font-style: normal; font-size: 10px; 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: 16px; 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 .2s 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 [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: 14px; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

/* 取り込み: 「登録済みのライブと統合」トグルと、ライブを選ぶポップアップ */
.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: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 600 12px/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(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; 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(--radius-sm); box-shadow: var(--shadow); padding-bottom: 4px; }
.live-pop__year { position: sticky; top: 0; margin: 0; padding: 6px 12px; font-size: 12px; 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 14px/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: 13px; }
/* ---- 全部の <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--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: 12px; border-radius: 8px; 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: 13px; }
/* 入力候補（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: 12px; } /* ふりがなで当たった候補の右に出すふりがな */
.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 .2s ease, color .2s ease, border-color .2s ease, transform .15s ease; }
.merge-toggle:active { transform: scale(.96); }
.merge-toggle .icon { transition: transform .25s ease; }
.merge-toggle[aria-pressed="true"] .icon { transform: rotate(90deg); }
.live-pick__btn { transition: border-color .2s ease, box-shadow .2s ease; }
.live-pick__btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.live-pick__btn[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--accent-soft); }
.live-pick__btn .icon { transition: transform .2s 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 .2s ease; }
.live-pop { animation: live-pop-in .16s 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 .12s ease; }
[data-merge] > .live-pick:not([hidden]), [data-live-name]:not([hidden]) { animation: soft-in .2s ease-out; }
.merge-note:not(:empty), [data-exists-flash]:not([hidden]) { animation: soft-in .25s ease-out; }
@keyframes soft-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
/* 右下の「やり直す / 登録する」のバー */
.sticky-actions { animation: bar-in .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes bar-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sticky-actions .btn { transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease, background-color .2s ease, color .2s ease; }
.sticky-actions .btn:active { transform: scale(.97); }
.sticky-actions__note:not([hidden]) { animation: soft-in .25s 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(--radius);
  border: 2px dashed var(--border); background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.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: 16px; 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: 17px; }
.dropzone__list { position: relative; z-index: 1; list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: 13px; 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: 0 0 0 3px var(--accent-soft); } }
@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 12px 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: 20px; }
.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: 12px; font-weight: 600; overflow-wrap: anywhere; }
.import-day__title { font-size: 20px; 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: 14px; border-radius: 8px; }
.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 .2s 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: 6px; background: none; color: var(--muted); font-size: 18px; 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: 0 8px 18px -6px rgb(0 0 0 / .25); }
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: 6px; color: var(--muted);
  transition: color .15s 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-band-name { display: flex; align-items: center; gap: 4px; } /* タイムテーブル編集: バンド名の横に旗 */
.check-list ul { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 4px; }
.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: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 12px; font-weight: 700; cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s 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 .25s ease, background-color .3s ease, border-color .3s 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 .2s ease, transform .25s 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 .15s ease, transform .25s ease, visibility 0s .25s;
}
@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: 8px; 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: 6px; cursor: pointer;
  font-size: 11px; font-weight: 700; white-space: nowrap; color: var(--muted); transition: background .15s, color .15s; }
@media (hover: hover) { .pick span:hover { color: var(--text); } } /* スマホはタップ後に :hover が残って色が戻らないので、マウスの端末だけ */
.pick input:checked + span { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / .14); }
.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: 6px; background: none; cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 700; white-space: nowrap; color: var(--muted);
  transition: background .15s, color .15s, box-shadow .15s; }
.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: 0 1px 3px rgb(0 0 0 / .14); }
.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: 8px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 6px 18px rgb(0 0 0 / .18);
  opacity: 0; transform: translateX(-8px) scale(.94); transform-origin: left center;
  transition: opacity .16s ease, transform .2s cubic-bezier(.2, .9, .3, 1.2), display .2s 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(--radius);
  background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgb(0 0 0 / .3);
  opacity: 0; transform: translateY(8px) scale(.97);
  transition: opacity .18s ease, transform .2s ease, overlay .2s allow-discrete, display .2s allow-discrete; }
.modal[open] { opacity: 1; transform: none; }
@starting-style { .modal[open] { opacity: 0; transform: translateY(8px) scale(.97); } }
.modal::backdrop { background: rgb(0 0 0 / 0); transition: background .2s ease, overlay .2s allow-discrete, display .2s 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: 17px; }
.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; } }
/* 横にはみ出す表はマウスでつかんで左右に動かせる（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: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.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 .3s ease, border-color .3s 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: 13px; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; 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: 12px; 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: 8px; padding: 6px 8px; max-width: 280px;
  box-shadow: 0 6px 18px rgb(0 0 0 / .18); pointer-events: none; /* 下の入力欄をそのままクリックできるように */
  animation: hint-pop-in .15s 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: 12px; 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: 8px; padding: 6px 8px; max-width: 320px;
  box-shadow: 0 6px 18px rgb(0 0 0 / .18); animation: hint-pop-in .15s 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: 999px;
  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: 12px; font-weight: 600; color: var(--warn); }
.sticky-actions__note[hidden] { display: none; }

/* ===== 8.5 追加ページ（検索・集計・設定・管理） ===== */
.hero__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.add-band { margin: 14px 0 0 72px; }
.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: 14px; 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: 999px; 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; }
.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: 12px; font-weight: 800; color: var(--muted); }
.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; }
.stats-filter__extra { display: flex; align-items: center; gap: 6px; }
.stats-filter__extra select { padding: 7px 10px; border-radius: 999px; 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; }
.stats-scope { margin: 0 0 14px; font-size: 15px; } /* 今どの範囲を見ているかは大事なので、.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: 999px;
  border: 1px solid var(--border); color: var(--muted); font: 600 11px/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 .2s ease, border-color .2s ease, opacity .2s ease; }
[data-vo-view].is-switched { animation: day-fade .25s ease; }
[data-vo-view].is-switched .bar { transform-origin: left; animation: bar-grow .45s cubic-bezier(.2, .8, .2, 1); }
@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: 13px; }
.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: 6px; 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 .22s ease-out; }
.song-card.is-dragging { position: relative; z-index: 2; box-shadow: 0 10px 28px rgba(0, 0, 0, .18); } /* ≡ でつかんでいる曲を少し浮かせる */
[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: 12px; color: var(--muted); font-weight: 700; }
.song-card__no [data-song-no] { font-size: 18px; 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(--radius-sm); 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: 16px; } /* 伸ばしすぎない（余った幅は右へ） */
.song-card__artist { flex: 0 1 220px; min-width: 140px; font-size: 14px; transition: opacity .2s ease; }
/* オムニバスでないとき: バンドのアーティストで固定。薄くして「ここは変えられない」と分かるように */
.song-card__artist[readonly] { opacity: .45; cursor: not-allowed; }
.song-omnibus { margin: 0 0 14px; font-weight: 700; }
/* 曲の編集: 紐付けた曲のジャケット（紐付けていなければ ♪） */
.song-thumb { position: relative; width: 40px; height: 40px; flex: none; border-radius: 6px; overflow: hidden;
  background: var(--surface-2); color: var(--muted); font-size: 16px; }
.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 .15s 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: 6px 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: 8px; 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 .18s 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(--radius-sm);
  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); gap: 10px; align-items: center; width: 100%; padding: 6px 8px;
  border: 0; border-radius: 6px; 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: 4px; object-fit: cover; }
.track-option__title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-option__sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-results__msg { color: var(--muted); font-size: 13px; padding: 6px 8px; }
/* 検索結果の窓: 開くときに上からふわっと出す。候補は1件ずつ少しずらして出す（最初の8件まで。それ以降はまとめて） */
.track-results:not([hidden]) { animation: track-results-in .22s ease-out; transform-origin: top; }
.track-option { animation: track-option-in .25s 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 .2s ease-out both; }
/* 閉じるとき（JS の closeResults が is-closing を付け、終わったら hidden にする） */
.track-results.is-closing { animation: track-results-out .18s 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: 8px; 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: 6px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; }
.performer__name { font-size: 14px; font-weight: 600; min-width: 0; }
/* バンド詳細（band.php）のセットリスト */
.setlist { margin-top: 10px; font-size: 13px; }
.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__who { color: var(--muted); font-size: 12px; 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: 4px; object-fit: cover; background: var(--surface-2); }
.setlist__art--none { display: inline-grid; place-items: center; color: var(--muted); font-size: 12px; }
.setlist__artist { color: var(--muted); font-size: 12px; 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: 13px; }
/* バンド詳細: 日付・ライブ名・日程・出演順・会場を1行に。eyebrow より大きく、本文と同じ色ではっきり */
.band-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 12px 0 0; font-size: 15px; 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: 13px; 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(--radius); 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: 11px; 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: 19px; }
.band-section .setlist ol { gap: 10px; padding-left: 1.8em; }
.band-section .setlist li { line-height: 56px; }
.band-section .setlist li::marker { font-size: 16px; }
.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: 6px; font-size: 18px; }
.band-section .setlist__artist, .band-section .setlist__who { font-size: 13px; 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; }
/* 「聴く」アイコン: ジャケットにマウスを乗せると、ジャケットが暗くなって真ん中にアプリのアイコンが出る。押すと音楽アプリへ
 *  .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: 6px;
  background: rgba(0, 0, 0, .3); opacity: 0; transition: opacity .15s 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; }
/* アプリの色。: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 .15s 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: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: 17px; }
  .band-section .setlist li { line-height: 44px; }
  .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(--radius-sm); background: var(--surface-2); box-shadow: var(--shadow); }
.album__meta { display: grid; gap: 2px; min-width: 0; }
/* 長いアルバム名は2行で「…」にする */
.album__title { font-size: 13px; line-height: 1.35; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* 削除ボタンはジャケットの右上に重ねる */
.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: 0 2px 6px rgb(0 0 0 / .18); }
/* ↑ で 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: 14px; }
.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 .25s 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 16px/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 .2s 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: 14px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .album-box__chevron { transition: none; } }
/* よく組むメンバー（member.php の右の欄）。見た目はマイアルバムのカードを使い回す。閉じているときは上位5人だけ */
.partner-box { margin: 32px 0 0; }
.partner-box.js-collapsible:not(.is-open) .ranking > li:nth-child(n+6) { display: none; }
.partner-box .ranking { margin-bottom: 10px; }
/* よく組むメンバーの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: 10px; min-width: 0; padding: 1px 6px; }
.partner summary a { min-width: 0; overflow-wrap: anywhere; }
.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: 13px; }
.partner__bands dt { margin-top: 4px; font-size: 11px; 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: 10px; min-width: 0; padding: 0 6px; }
.partner-box.js-collapsible:not(.is-open) .ranking > li:nth-child(5) { border-bottom: 0; } /* 5人目の下の線は「すべて表示」との間で要らない */
/* よく演奏するアーティスト（member.php）: よく組むメンバーのカードを使い回し、閉じているときは上位3位だけ（app.js の data-shown="3" と合わせる） */
.top-artists.js-collapsible:not(.is-open) .ranking > li:nth-child(n+4) { display: none; }
.top-artists.js-collapsible:not(.is-open) .ranking > li:nth-child(3) { 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 .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: 13px; }
.kings__top li { padding: 5px 4px; }
.kings .kings__top li[data-rank]::before { content: attr(data-rank); } /* 外側の .ranking--plain が番号を消すので、中の一覧だけ出し直す */
.album-sort__status { transition: opacity .3s; }
.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: 999px; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 800; box-shadow: var(--shadow); opacity: 0; transform: scale(.6);
  transition: opacity .2s, transform .2s; 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); }
.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(--radius-sm); }
/* ドラッグ中は削除ボタンを隠す（誤って押さないように） */
.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: 0 18px 36px -10px rgb(0 0 0 / .45); }
.album .album__art { transition: transform .15s ease-out, box-shadow .15s 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 .25s 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: 999px;
  background: #dfe9fb; color: #1d3766; border: 1px solid #c3d4f2; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: transform .12s ease, opacity .25s ease; }
[data-theme="dark"] .back-fab { background: var(--text); color: var(--bg); border-color: transparent; }
.back-fab.is-entering { animation: back-fab-in .25s ease both; }
.back-fab.is-leaving { animation: back-fab-out .25s 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: 15px; }
  .back-fab .icon { font-size: 22px; }
}
/* 左の余白にボタンが入る幅では、余白の右端（本文のすぐ左）に寄せる
   本文は幅 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); }
}
@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 .2s ease both; }
::view-transition-new(root) { animation: page-in .2s ease both; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; } }
@supports not (view-transition-name: none) {
  .container { animation: page-in .2s 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: 11px; }
  .slot__body { padding: 8px 12px; }
}

/* ===== 9. スマホ対応（画面幅で切り替え） ===== */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split aside { position: static; order: -1; } /* 1列になったら、右の欄（よく組むメンバー）を出演履歴より上に出す */
  .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); }
  .nav__link { flex: 1; text-align: center; padding: 10px 6px; font-size: 13px; border-radius: 12px; }
  .footer { padding-bottom: 84px; }
  .sticky-actions { bottom: 76px; } /* 下に固定の保存ボタンは、タブバーの上に出す */
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .brand__logo { height: 28px; }
  .hero { margin: 8px 0 20px; }
  .pc-only { display: none; } /* スマホでは出さない文字（live.php の「ライブを編集」の「を」など） */
  .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: 16px; }
  .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: 11px; padding-top: 11px; }
  .slot__time span { font-size: 10px; }
  .slot__time .slot__no { font-size: 13px; }
  .slot__body { padding: 14px; }
  .slot__name { font-size: 16px; }
  .slot__name--long { font-size: 14px; }  /* 長い名前は小さくして1行に収める（live.php で幅を見て付ける） */
  .slot__name--xlong { font-size: 13px; }
  .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; }
  .table td, .table th { padding: 10px 12px; }
  /* アーティスト一覧・メンバー一覧（.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 .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 と同じ強さにして後ろに書くことで上書きする */
  .member-row-edit > :first-child, .member-row-edit > :nth-child(3) { width: 100%; } /* 名前と楽器は左の列いっぱい */
  .member-row-edit:last-child { border-bottom: 0; padding-bottom: 0; }
  .sticky-actions { width: 100%; }
  .sticky-actions .btn { flex: 1; }
  .sticky-actions:has(.sticky-actions__note:not([hidden])) { flex-wrap: wrap; border-radius: var(--radius); }
  .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: 15px;
    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, 8em) 1fr 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: 11px; line-height: 1.3; }
  .albums:not(.albums--pick) .album__meta .small { font-size: 10px; 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: 12px; }
  .albums:not(.albums--pick) .album__rank { top: 2px; left: 2px; min-width: 18px; height: 18px; padding: 0 4px; font-size: 10px; }
}

/* アーティストページ: メンバー（楽器ラベル + 名前）とセットリストを縦に並べる */
.artist-lineup { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.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: 13px; }
.artist-setlist li::marker { color: var(--muted); font-weight: 700; }
/* オムニバスのバンドでは、このアーティストの曲だけ少し強調する */
.artist-setlist li.is-mine { font-weight: 700; color: var(--accent); }
.artist-setlist li.is-mine::marker { color: var(--accent); }

/* 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%; }
