:root {
  --bg: #000;
  --panel: #121212;
  --elev: #1f1f1f;
  --elev-2: #2a2a2a;
  --hover: #1a1a1a;
  --line: #2a2a2a;
  --text: #fff;
  --sub: #b3b3b3;
  --dim: #6a6a6a;
  --green: #1ed760;
  --red: #f15e6c;
  --blue: #6fa8ff;
  --radius: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--sub); }
.small { font-size: 12px; }
.spacer { flex: 1; }

/* ===== レイアウト：左 楽曲リスト ／ 右 動画＋歌詞 ／ 下 再生バー ===== */
.app {
  display: grid;
  grid-template-columns: var(--list-w, 360px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 80px;
  grid-template-areas: "list stage" "bar bar";
  gap: 8px;
  padding: 8px 8px 0;
  height: 100vh;
}
.app.list-hidden { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "bar"; }
.app.list-hidden .list-panel { display: none; }
.panel { background: var(--panel); border-radius: var(--radius); }
.list-panel { grid-area: list; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.stage { grid-area: stage; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.player-bar { grid-area: bar; }

/* 配信モード：動画と歌詞だけを表示 */
.app.stream { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: "stage"; padding: 0; gap: 0; }
.app.stream .list-panel, .app.stream .player-bar, .app.stream .stage-head, .app.stream .lyrics-bar { display: none; }
.app.stream .stage { border-radius: 0; }

/* ===== 共通ボタン ===== */
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  color: var(--sub); transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,.07); }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn.small svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--green); }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 18px; border-radius: 999px; flex: none;
  font-weight: 700; border: 1px solid #7c7c7c; color: var(--text); white-space: nowrap; transition: transform .1s, border-color .15s, background .15s;
}
.pill-btn:hover { border-color: var(--text); transform: scale(1.03); }
.pill-btn.small { height: 32px; padding: 0 14px; font-size: 13px; }
.pill-btn.small svg { width: 16px; height: 16px; }
.pill-btn.primary { background: var(--green); border-color: var(--green); color: #000; }
.pill-btn.primary:hover { background: #3be477; }
.pill-btn.danger { border-color: var(--red); color: var(--red); }
.link-btn { color: var(--sub); font-size: 12px; text-decoration: underline; margin: -4px 0 12px; }
.link-btn:hover { color: var(--text); }
.chip-toggle { height: 28px; padding: 0 10px; border-radius: 999px; background: var(--elev-2); font-size: 12px; font-weight: 500; flex: none; }
.chip-toggle:hover { background: #333; }

/* ===== 楽曲リスト ===== */
.list-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 16px; }
.brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 16px; white-space: nowrap; overflow: hidden; }
.brand svg { color: var(--green); width: 24px; height: 24px; }

.tabs { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 32px; padding: 0 12px; flex: none; border-radius: 999px; background: var(--elev-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.tab:hover { background: #333; }
.tab.active { background: var(--text); color: #000; }
.tab-count { font-variant-numeric: tabular-nums; }

.list-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.search {
  margin: 0 12px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; flex: none;
  background: var(--elev); border-radius: 999px; border: 1px solid transparent; color: var(--sub);
}
.search:focus-within { border-color: var(--text); background: var(--elev-2); }
.search input { flex: 1; background: none; border: 0; outline: none; color: var(--text); min-width: 0; }
.sort { display: flex; align-items: center; gap: 4px; padding: 8px 12px 4px; flex: none; }
.sort select { height: 30px; padding: 0 8px; background: var(--elev); border: 0; border-radius: 6px; color: var(--text); font-size: 13px; }
#sort-dir.desc svg { transform: scaleY(-1); }

/* 頭文字ジャンプ（横一列） */
.index-bar { display: flex; gap: 2px; padding: 4px 12px 6px; overflow-x: auto; scrollbar-width: none; flex: none; border-bottom: 1px solid var(--line); }
.index-bar::-webkit-scrollbar { display: none; }
.index-bar button { min-width: 22px; height: 22px; padding: 0 4px; border-radius: 4px; font-size: 11px; font-weight: 700; color: var(--dim); flex: none; }
.index-bar button.has { color: var(--sub); }
.index-bar button.has:hover { color: #000; background: var(--green); }
.index-bar button:disabled { cursor: default; opacity: .35; }
.index-bar .sep { width: 8px; flex: none; }

.song-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 6px 12px; }
.song-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 6px; border-radius: 6px; cursor: pointer; color: var(--sub);
}
.song-row:hover { background: var(--elev-2); }
.song-row.playing { background: rgba(30,215,96,.08); }
.song-row.playing .s-title { color: var(--green); }
.song-row img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--elev); }
.song-row .s-main { min-width: 0; }
.s-title, .s-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-title { color: var(--text); font-size: 14px; font-weight: 500; }
.s-sub { font-size: 12px; margin-top: 2px; }
.s-memo { color: var(--dim); margin-left: 6px; }
.tag { display: inline-block; font-size: 11px; padding: 0 7px; margin-left: 4px; border-radius: 999px; background: var(--elev-2); color: var(--sub); line-height: 18px; }
.song-row:hover .tag { background: #3a3a3a; }
.tag:hover { color: var(--text); }
.row-actions { display: flex; align-items: center; }
.row-actions .icon-btn { width: 28px; height: 28px; opacity: 0; }
.row-actions .icon-btn svg { width: 17px; height: 17px; }
.song-row:hover .row-actions .icon-btn, .row-actions .fav-btn.on, .row-actions .queued { opacity: 1; }
.row-actions .queued { color: var(--green); }
.fav-btn.on { color: var(--green); }
.fav-btn:not(.on) svg { fill: none; stroke: currentColor; stroke-width: 2; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 12px; height: 12px; margin-right: 6px; color: var(--green); vertical-align: -1px; }
.eq i { flex: 1; background: currentColor; border-radius: 1px; height: 30%; }
.eq.on i { animation: eq .9s ease-in-out infinite; }
.eq.on i:nth-child(2) { animation-delay: -.3s; }
.eq.on i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

.empty { text-align: center; padding: 40px 16px; color: var(--sub); line-height: 1.8; margin: 0; }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty .pill-btn { margin-top: 14px; }

/* 予約 */
.queue-head { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 6px 16px; }
.queue-list { list-style: none; margin: 0; padding: 0 6px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.queue-item { display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px; border-radius: 6px; cursor: grab; }
.queue-item:hover { background: var(--hover); }
.queue-item.dragging { opacity: .4; }
.queue-item.drop-before { box-shadow: inset 0 2px 0 var(--green); }
.queue-item .qn { color: var(--sub); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.queue-item:first-child .qn { color: var(--green); font-weight: 700; }
.queue-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; }
.queue-item .qt { min-width: 0; }
.queue-item .qt strong, .queue-item .qt span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item .qt strong { font-weight: 500; }
.queue-item .qt span { font-size: 12px; color: var(--sub); }
.queue-item .icon-btn { opacity: 0; }
.queue-item:hover .icon-btn { opacity: 1; }

/* 楽曲検索タブの下端（検索結果のスクロールに関係なく固定） */
.pane-footer { flex: none; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.pane-footer .pill-btn { width: 100%; justify-content: center; }

/* YouTube 検索 */
/* 「条件」のチェック群（ライブラリの絞り込みと YouTube 検索で共通） */
.filter-options { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.check-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--sub); cursor: pointer; white-space: nowrap; }
.check-inline:has(input:checked) { color: var(--text); }
.yt-query-note { margin: 4px 8px 6px; font-size: 12px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-query-note b { color: var(--text); font-weight: 500; }
.check-inline input { accent-color: var(--green); }
.yt-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px; border-radius: 6px; cursor: pointer; }
.yt-row:hover { background: var(--elev-2); }
.yt-row.previewing { background: rgba(30,215,96,.08); }
.yt-row.previewing .yt-title { color: var(--green); }
.yt-thumb { position: relative; width: 96px; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: var(--elev); }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-dur { position: absolute; right: 3px; bottom: 3px; padding: 0 4px; border-radius: 3px; background: rgba(0,0,0,.8); font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; }
.yt-info { min-width: 0; }
.yt-title { font-size: 13px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-channel { display: block; font-size: 12px; color: var(--sub); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-registered { display: inline-block; font-size: 11px; font-weight: 700; color: var(--green); margin-right: 6px; }
.yt-acts .pill-btn { height: 28px; padding: 0 12px; font-size: 12px; }
.yt-more { display: flex; justify-content: center; padding: 10px 0 4px; }
.yt-msg { margin: 12px 10px; padding: 14px 16px; border-radius: 8px; background: var(--elev); color: var(--sub); line-height: 1.7; font-size: 13px; }
.yt-msg strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.yt-msg ol { margin: 6px 0 10px; padding-left: 20px; }
.yt-msg code { background: #333; padding: 0 4px; border-radius: 3px; font-size: 12px; color: var(--text); }
.yt-msg .btn-row { margin-top: 10px; }
.yt-msg.error { border-left: 3px solid #ffa42b; border-radius: 0 8px 8px 0; }
.field .hint { font-weight: 400; line-height: 1.6; }

/* ===== 動画＋歌詞カード ===== */
.stage-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.stage-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.stage-title strong { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-tools { display: flex; align-items: center; gap: 12px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--sub); user-select: none; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #535353; transition: background .15s; flex: none; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked ~ .switch-track { background: var(--green); }
.switch input:checked ~ .switch-track .switch-thumb { transform: translateX(18px); }
.switch:has(input:checked) > span:first-child { color: var(--text); }
.switch input:focus-visible ~ .switch-track { outline: 2px solid var(--text); outline-offset: 2px; }

.stage-body {
  flex: 1; min-height: 0; display: grid; position: relative;
  grid-template-columns: minmax(0, var(--split-a, 58fr)) 8px minmax(0, var(--split-b, 42fr));
}
.stage-body[data-layout="video"] { grid-template-columns: minmax(0, 1fr); }
.stage-body[data-layout="video"] .splitter, .stage-body[data-layout="video"] .lyrics-pane { display: none; }

/* 表示エリアの幅・高さの両方に収まる最大の 16:9 で表示（はみ出さない） */
.video-pane { min-width: 0; min-height: 0; display: grid; place-items: center; background: #000; position: relative; container-type: size; overflow: hidden; }
.video-box { position: relative; width: min(100cqw, 100cqh * 16 / 9); aspect-ratio: 16 / 9; }
.video-box iframe, #yt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty, .video-error {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 12px; padding: 24px; line-height: 1.7;
}
.video-empty { background: #0a0a0a; color: var(--sub); }
.video-empty svg { width: 56px; height: 56px; color: #333; }
.video-empty p, .video-error p { margin: 0; }
.video-error { background: rgba(0,0,0,.85); }

.splitter { cursor: col-resize; background: var(--bg); position: relative; }
.splitter::after { content: ""; position: absolute; top: 50%; left: 3px; width: 2px; height: 40px; margin-top: -20px; border-radius: 2px; background: #444; }
.splitter:hover::after, .splitter.active::after { background: var(--green); }

.lyrics-pane { min-width: 0; display: flex; flex-direction: column; background: var(--panel); }
.lyrics-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.lyrics-bar input[type="url"] {
  flex: 1; min-width: 60px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid transparent; background: var(--elev); outline: none;
}
.lyrics-bar input[type="url"]:focus { border-color: var(--sub); }
.zoom { display: flex; align-items: center; gap: 4px; color: var(--sub); font-size: 12px; }
.zoom input { width: 70px; accent-color: var(--green); }
.zoom span { width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.lyrics-frame-wrap { flex: 1; position: relative; overflow: hidden; background: #fff; }
#lyrics-frame { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; }
.lyrics-placeholder {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px;
  background: var(--panel); color: var(--sub); line-height: 1.7;
}
.lyrics-placeholder p { margin: 0; max-width: 340px; }

.key-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 18px;
  background: rgba(30,215,96,.15); color: var(--green); font-variant-numeric: tabular-nums; vertical-align: 1px;
}
.key-badge.down { background: rgba(111,168,255,.15); color: var(--blue); }

/* ===== 再生バー ===== */
.player-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 16px; padding: 0 8px; }
.np { display: flex; align-items: center; gap: 12px; min-width: 0; }
.np img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
.np-text { min-width: 0; display: flex; flex-direction: column; }
.np-text strong, .np-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-text span { font-size: 12px; }
.controls { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ctrl-row { display: flex; align-items: center; gap: 16px; }
.play-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: #000; display: grid; place-items: center; transition: transform .1s; }
.play-btn:hover { transform: scale(1.06); }
.play-btn svg { width: 18px; height: 18px; }
.play-btn .i-pause, .play-btn.playing .i-play { display: none; }
.play-btn.playing .i-pause { display: block; }
.progress { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 600px; font-size: 11px; color: var(--sub); font-variant-numeric: tabular-nums; }
.progress span { width: 40px; text-align: center; }
.bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--sub); padding-right: 8px; min-width: 0; }
.next-up { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 8px; }
.vol-icon { width: 18px; height: 18px; }

input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; height: 12px; cursor: pointer; }
.progress input { flex: 1; }
#volume { width: 100px; flex: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--fill-c, #fff) var(--fill, 0%), #4d4d4d var(--fill, 0%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: #fff; opacity: 0; }
input[type="range"]:hover { --fill-c: var(--green); }
input[type="range"]:hover::-webkit-slider-thumb { opacity: 1; }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #4d4d4d; }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: #fff; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }

/* ===== ダイアログ ===== */
.dialog {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 28px; border: 0; border-radius: 12px;
  background: #282828; color: var(--text); box-shadow: 0 16px 48px rgba(0,0,0,.6);
}
.dialog::backdrop { background: rgba(0,0,0,.7); }
.dialog h2 { margin: 0 0 20px; font-size: 24px; font-weight: 900; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-size: 12px; font-weight: 700; color: var(--sub); }
.field legend { margin-bottom: 6px; }
.field input[type="text"], .field input[type="url"], .field input:not([type]) {
  height: 40px; padding: 0 12px; border-radius: 4px; border: 1px solid transparent; background: #3e3e3e; outline: none; width: 100%;
}
.field input:focus { border-color: var(--sub); background: #333; }
/* 新しいアーティストの作成欄（登録画面） */
.new-artist { margin: -4px 0 14px; padding: 12px 12px 4px; border-radius: 8px; background: #1f1f1f; border: 1px solid #3a3a3a; }
.new-artist .btn-row { margin-bottom: 10px; }

/* アーティストの編集（設定画面から） */
.artist-filter { margin: 0 0 12px; }
.artist-head, .artist-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 48px 32px; gap: 8px; align-items: center; }
.artist-head { font-size: 12px; font-weight: 700; color: var(--sub); padding: 0 2px 6px; }
.artist-table { max-height: 46vh; overflow-y: auto; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.artist-row input { height: 34px; padding: 0 10px; border-radius: 4px; border: 1px solid transparent; background: #3e3e3e; outline: none; width: 100%; min-width: 0; }
.artist-row input:focus { border-color: var(--sub); background: #333; }
.artist-row .a-count { font-size: 12px; color: var(--sub); text-align: right; font-variant-numeric: tabular-nums; }
.artist-row.deleted { opacity: .4; }
.artist-row.deleted input { text-decoration: line-through; }
.artist-row.changed input { border-color: #5a5a2a; }
.url-row { display: flex; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.preview { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 6px; background: #1f1f1f; margin-bottom: 14px; }
.preview img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; }
.preview div { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }

.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag-chip {
  height: 30px; padding: 0 14px; border-radius: 999px; background: #3e3e3e; color: var(--text); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px; transition: background .15s, color .15s;
}
.tag-chip:hover { background: #4a4a4a; }
.tag-chip.on { background: var(--green); color: #000; }
.tag-chip.on::before { content: "✓"; font-weight: 700; }
.tag-add { width: 30px; padding: 0; justify-content: center; border: 1px dashed #7c7c7c; background: none; color: var(--sub); }
.tag-add:hover { color: var(--text); border-color: var(--text); background: none; }
.tag-add svg { width: 16px; height: 16px; }
/* アーティストは数が増えやすいので、一定の高さでスクロール */
.artist-picker { max-height: 136px; overflow-y: auto; padding: 2px; }

.radio, .check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.radio input, .check input { accent-color: var(--green); width: 16px; height: 16px; }
.check { margin-bottom: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.form-msg { min-height: 1.2em; margin: 0 0 8px; font-size: 13px; color: #ffa42b; }
.dialog-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }

/* ===== トースト ===== */
.toast {
  position: fixed; left: 50%; bottom: 104px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; z-index: 10;
  background: #2e77d0; color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 500; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* スクロールバー */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border: 3px solid transparent; background-clip: padding-box; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.4); }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 狭い画面 ===== */
@media (max-width: 1100px) {
  .app { --list-w: 300px; }
  .zoom input { width: 50px; }
}
/* スマホ幅：上に動画、下に楽曲リスト（歌詞カードは別ウィンドウで） */
@media (max-width: 820px) {
  .app, .app.list-hidden {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) 64px;
    grid-template-areas: "stage" "list" "bar";
    padding: 0; gap: 0;
  }
  .app.list-hidden .list-panel { display: flex; }
  #list-toggle { display: none; }
  .panel { border-radius: 0; }
  .stage-body, .stage-body[data-layout] { grid-template-columns: minmax(0, 1fr); height: 56vw; flex: none; }
  .splitter, .lyrics-pane { display: none; }
  .stage-tools .switch { display: none; }
  .player-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .np img { width: 44px; height: 44px; }
  .bar-right, .progress { display: none; }
  .row-actions .icon-btn { opacity: 1; }
  .grid2 { grid-template-columns: 1fr; }
}
