/* Private Music Vault — 全画面テンプレート */
body.pmv-fullpage { margin: 0; background: #f6f7f9; }
.pmv-appbar {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 22px; background: #1f2329; color: #fff;
}
.pmv-appbar-title { color: #fff !important; font-weight: 700; font-size: 18px; text-decoration: none; }
.pmv-appbar-logout { color: #aab2bd !important; text-decoration: none; font-size: 13px; }
.pmv-appbar-logout:hover { color: #fff !important; }
.pmv-fullpage-main { padding: 24px 20px; }

/* Private Music Vault — フロント */
.pmv-app {
	max-width: 1100px;
	margin: 0 auto;
	padding-bottom: 96px; /* 常駐プレイヤーの高さ分 */
	font-size: 15px;
}

/* hidden 属性を常に最優先（モーダル/プレイヤー等の display 指定に負けないように） */
.pmv-app [hidden],
.pmv-modal[hidden],
.pmv-player[hidden],
.pmv-stage[hidden] { display: none !important; }

/* トップバー */
.pmv-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pmv-search {
	flex: 1 1 240px; max-width: 360px;
	padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 15px;
}
.pmv-newpl {
	padding: 8px 14px; border: 1px solid #2271b1; background: #fff; color: #2271b1;
	border-radius: 6px; cursor: pointer; font-size: 14px;
}
.pmv-newpl:hover { background: #eef4fb; }
.pmv-upload-link {
	padding: 8px 14px; background: #2271b1; color: #fff !important; border-radius: 6px;
	text-decoration: none; font-size: 14px;
}
.pmv-muted { color: #888; padding: 12px 0; }

/* 本体レイアウト */
.pmv-body { display: flex; gap: 18px; align-items: flex-start; }
.pmv-sidebar { flex: 0 0 210px; max-height: 70vh; overflow-y: auto; }
.pmv-main { flex: 1 1 auto; min-width: 0; }

/* サイドバー */
.pmv-nav-item {
	display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
	border: none; background: none;
	padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; color: #222;
}
.pmv-nav-item:hover { background: #f0f2f5; }
.pmv-nav-item.pmv-active { background: #e8f0fe; font-weight: 600; }
/* 長い名前は1行で省略 */
.pmv-nav-name {
	flex: 1 1 auto; min-width: 0; text-align: left;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pmv-nav-count { flex: 0 0 auto; color: #999; font-size: 12px; }
/* 折りたたみ見出し（プレイリスト／アーティスト…） */
.pmv-nav-head {
	display: flex; align-items: center; gap: 6px; width: 100%;
	border: none; background: none; cursor: pointer;
	margin-top: 10px; padding: 8px 10px; border-radius: 6px;
	font-size: 12px; color: #666; letter-spacing: .03em;
}
.pmv-nav-head:hover { background: #f0f2f5; }
.pmv-nav-head.pmv-open { color: #222; font-weight: 600; }
.pmv-nav-caret { flex: 0 0 auto; font-size: 10px; color: #999; }
.pmv-nav-items { padding-left: 8px; }

/* 件数表示と「もっと読み込む」 */
.pmv-count { color: #888; font-size: 12px; padding: 4px 2px 8px; }
.pmv-more { text-align: center; padding: 16px 0 8px; }
.pmv-more-btn {
	padding: 10px 24px; border: 1px solid #2271b1; background: #fff; color: #2271b1;
	border-radius: 20px; cursor: pointer; font-size: 14px;
}
.pmv-more-btn:hover { background: #eef4fb; }
.pmv-more-btn[disabled] { color: #999; border-color: #ccc; cursor: default; }

/* 動画ステージ */
.pmv-stage { margin-bottom: 16px; background: #000; border-radius: 8px; overflow: hidden; }
.pmv-video { width: 100%; max-height: 60vh; display: block; }

/* 一覧 */
.pmv-table { width: 100%; border-collapse: collapse; table-layout: auto; }
/* 文字は必ず1行。溢れたら「…」で省略（1文字ずつ縦積みになるのを防ぐ） */
.pmv-cell-title, .pmv-cell-artist, .pmv-cell-album {
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/*
 * タイトルに余った幅を全部与える定石（width:100% + max-width:0）。
 * これにより、アーティスト/アルバムが空のときは幅を取らず、
 * その分すべてタイトルに回る。
 */
.pmv-cell-title { width: 100%; max-width: 0; }
.pmv-cell-artist, .pmv-cell-album { max-width: 160px; }
.pmv-row { border-bottom: 1px solid #eee; cursor: pointer; }
.pmv-row:hover { background: #f5f7fa; }
.pmv-row.pmv-active { background: #e8f0fe; }
.pmv-row td { padding: 8px; vertical-align: middle; }
.pmv-cell-thumb { width: 44px; }
.pmv-thumb { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; display: block; background: #eee; }
.pmv-thumb-ph {
	display: flex; align-items: center; justify-content: center;
	color: #999; background: #f0f0f1; font-size: 18px;
}
.pmv-cell-title { font-weight: 600; }
.pmv-cell-artist, .pmv-cell-album { color: #666; }
.pmv-cell-dur { width: 56px; text-align: right; color: #888; white-space: nowrap; padding-right: 10px; }
/* 操作ボタン列は余白を詰めて、その分をタイトルに回す */
.pmv-cell-play, .pmv-cell-add, .pmv-cell-dl, .pmv-cell-rm, .pmv-cell-del {
	width: 34px; text-align: center; padding-left: 2px; padding-right: 2px;
}
.pmv-cell-sort { width: 28px; text-align: center; white-space: nowrap; padding-left: 0; padding-right: 2px; }

.pmv-btn {
	cursor: pointer; border: none; background: #2271b1; color: #fff;
	border-radius: 50%; width: 30px; height: 30px; font-size: 13px; line-height: 1;
}
.pmv-btn:hover { background: #135e96; }
.pmv-add-btn { background: #6b7280; }
.pmv-add-btn:hover { background: #4b5563; }
.pmv-dl-btn { background: #3a3f47; }
.pmv-dl-btn:hover { background: #22262c; }
.pmv-rm-btn { background: #c0392b; }
.pmv-rm-btn:hover { background: #96271a; }
.pmv-del-btn { background: #8b1a10; }
.pmv-del-btn:hover { background: #6b120a; }

/* 並び替えボタンは小さく角丸の縦2段（.pmv-btn の円形指定を上書きするため後段に置く） */
.pmv-btn.pmv-sort-btn {
	display: block; width: 24px; height: 16px; line-height: 1;
	font-size: 9px; border-radius: 3px; background: #9aa1ab; margin: 2px auto; padding: 0;
}
.pmv-btn.pmv-sort-btn:hover { background: #6b7280; }
.pmv-btn.pmv-sort-btn[disabled] { background: #e2e4e8; color: #b7bcc4; cursor: default; }

/* ポップオーバ（プレイリスト選択） */
.pmv-popover {
	position: absolute; z-index: 10000; background: #fff; border: 1px solid #d0d0d0;
	border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 6px; min-width: 180px;
}
.pmv-pop-item {
	display: block; width: 100%; text-align: left; border: none; background: none;
	padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.pmv-pop-item:hover { background: #f0f2f5; }
.pmv-pop-new { color: #2271b1; border-top: 1px solid #eee; margin-top: 4px; }
.pmv-pop-empty { padding: 8px 10px; color: #999; font-size: 13px; }

/* アップロードモーダル */
.pmv-modal {
	position: fixed; inset: 0; background: rgba(0,0,0,.45);
	display: flex; align-items: center; justify-content: center; z-index: 10001; padding: 16px;
}
.pmv-modal-box {
	background: #fff; border-radius: 10px; width: 100%; max-width: 520px;
	max-height: 80vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.pmv-modal-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 14px 18px; border-bottom: 1px solid #eee;
}
.pmv-modal-close { border: none; background: none; font-size: 18px; cursor: pointer; color: #666; }
.pmv-fu-drop {
	margin: 18px; padding: 28px; border: 2px dashed #c3c4c7; border-radius: 8px;
	text-align: center; color: #555;
}
.pmv-fu-drop.pmv-fu-over { background: #eef4fb; border-color: #2271b1; }
.pmv-fu-list { list-style: none; margin: 0 18px 18px; padding: 0; }
.pmv-fu-item { padding: 8px 10px; border: 1px solid #eee; border-radius: 6px; margin-bottom: 8px; }
.pmv-fu-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.pmv-fu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmv-fu-status { color: #666; flex: 0 0 auto; }
.pmv-fu-bar-wrap { background: #f0f0f1; border-radius: 3px; height: 8px; margin-top: 6px; overflow: hidden; }
.pmv-fu-bar { height: 100%; width: 0; background: #2271b1; transition: width .2s; }

/* 常駐プレイヤー */
.pmv-player {
	position: fixed; left: 0; right: 0; bottom: 0;
	background: #1f2329; color: #fff; display: flex; align-items: center; gap: 12px;
	padding: 10px 16px; box-shadow: 0 -2px 10px rgba(0,0,0,.25); z-index: 9999;
}
.pmv-now-art { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; flex: 0 0 auto; }
.pmv-player .pmv-playpause,
.pmv-player .pmv-ctrl { flex: 0 0 auto; }
.pmv-player .pmv-ctrl { background: #3a3f47; }
.pmv-player .pmv-ctrl:hover { background: #4b5563; }
.pmv-player .pmv-playpause { width: 34px; height: 34px; font-size: 15px; }
.pmv-now { flex: 0 1 200px; overflow: hidden; white-space: nowrap; }
.pmv-now-title { display: block; font-weight: 600; text-overflow: ellipsis; overflow: hidden; }
.pmv-now-artist { display: block; font-size: 12px; color: #aab; text-overflow: ellipsis; overflow: hidden; }
.pmv-time { font-variant-numeric: tabular-nums; font-size: 12px; color: #cdd; flex: 0 0 auto; }
.pmv-seek { flex: 1 1 auto; }
.pmv-vol-wrap { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.pmv-vol { width: 80px; }

/* ログイン誘導 */
.pmv-login-note { padding: 24px; text-align: center; }
.pmv-login-btn {
	display: inline-block; padding: 8px 20px; background: #2271b1; color: #fff !important;
	border-radius: 6px; text-decoration: none;
}

@media (max-width: 782px) {
	.pmv-body { flex-direction: column; }
	.pmv-sidebar { flex-basis: auto; width: 100%; max-height: 220px; }
	.pmv-cell-album { display: none; }
	.pmv-now { flex-basis: 120px; }
	.pmv-vol-wrap { display: none; }
}

/* ---- スマホ：表組みをやめてカード状に積む ---- */
@media (max-width: 600px) {
	.pmv-fullpage-main { padding: 14px 10px; }
	.pmv-app { padding-bottom: 110px; }

	.pmv-table, .pmv-table > tbody { display: block; width: 100%; }
	.pmv-row {
		display: flex; flex-wrap: wrap; align-items: center;
		gap: 6px 8px; padding: 10px 4px;
	}
	.pmv-row > td { display: block; padding: 0; border: none; }

	.pmv-cell-thumb { flex: 0 0 auto; width: auto; }
	/* タイトルは1行・残り幅いっぱい・溢れたら省略
	   （PC用の width:100%/max-width:0 をここで打ち消す） */
	.pmv-cell-title {
		flex: 1 1 auto; min-width: 0; width: auto; max-width: none; font-size: 14px;
	}
	/* アーティストは改行して2行目に単独表示（100%幅＋marginだと溢れるのでpaddingで内側に） */
	.pmv-cell-artist {
		flex: 1 1 100%; min-width: 0; width: auto; max-width: none; font-size: 12px;
		box-sizing: border-box; padding-left: 46px; margin-left: 0;
	}
	.pmv-cell-album { display: none; }
	/* 3行目：時間を左、操作ボタンを右へ */
	.pmv-cell-dur { flex: 0 0 auto; margin-left: 46px; text-align: left; }
	.pmv-cell-play { margin-left: auto; }
	.pmv-cell-play, .pmv-cell-add, .pmv-cell-dl, .pmv-cell-rm, .pmv-cell-del { flex: 0 0 auto; width: auto; }
	.pmv-cell-sort { flex: 0 0 auto; order: -1; width: auto; }
	.pmv-cell-sort .pmv-sort-btn { display: inline-block; }

	/* 下部プレイヤー：狭いので10秒送り/戻しは隠して曲送りを優先 */
	.pmv-player { gap: 8px; padding: 8px 10px; }
	.pmv-player #pmv-back, .pmv-player #pmv-fwd { display: none; }
	.pmv-now-art { width: 36px; height: 36px; }
	.pmv-now { flex: 1 1 auto; min-width: 0; }
	.pmv-time { display: none; }
	.pmv-seek { flex: 1 1 100%; order: 10; margin: 0; }
}
