/* 플레이리스트 패널 (화면 스타일은 public/css/의 파일 여러 개를 index.html이 이 순서로 불러온다: theme.css → base.css → stage.css → playlist.css → side.css → dialogs.css → misc.css) */
/* ---------- 플레이리스트 패널 ---------- */
/* 아래쪽에 붙어 있고, 높이는 --pl-frac(0.35~1, 손잡이로 조절)만큼. 1이면 예전처럼 칸을 꽉 채운다 */
.pl-panel {
  position: absolute;
  inset: auto var(--gutter) var(--gutter);
  height: calc((100% - 2 * var(--gutter)) * var(--pl-frac, 1));
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  min-height: 0;
}
.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* 창 높이 손잡이: 창 위쪽 가장자리에 걸친 막대. 잡는 영역은 넉넉히 */
.pl-resize {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 20px;
  cursor: row-resize;
  touch-action: none;
  z-index: 1;
}
.pl-resize::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background 0.12s;
}
.pl-resize:hover::after, .pl-resize.is-active::after, .pl-resize:focus-visible::after { background: var(--accent); }
.pl-resize:focus-visible { outline: none; }
body.is-resizing-pl, body.is-resizing-pl * { cursor: row-resize !important; user-select: none; }
.pl-head h2 { margin: 0; font-size: 16px; }
.pl-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; flex: none; }
.pl-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.pl-tab:hover { color: var(--fg); }
.pl-tab[aria-selected="true"] { background: var(--panel-2); border-color: var(--accent); color: var(--fg); }
.pl-tab-play { color: var(--woot); font-size: 10px; }
.pl-tab-n { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--muted); }
.pl-tab-new { border-style: dashed; }
.pl-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pl-bar-info { margin: 0; font-size: 12px; color: var(--muted); }
.pl-bar-info .on { color: var(--woot); font-weight: 600; }
.pl-bar-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.pl-panel .row-form { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-form { display: flex; gap: 8px; align-items: stretch; }
.pl-form .input { min-height: 44px; }
.pl-note { margin: 0; font-size: 12px; color: var(--muted); }
.pl-quota {
  margin: 0;
  padding: 7px 10px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--warn-text);
  font-size: 12px;
}
.pl-quota b { color: var(--warn); font-weight: 700; margin-right: 6px; }
.pl-quota-n { color: var(--warn-strong); font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-quota.is-empty {
  background: color-mix(in srgb, var(--meh) 12%, transparent);
  border-color: color-mix(in srgb, var(--meh) 40%, transparent);
  color: var(--danger-text);
}
.pl-quota.is-empty b { color: var(--meh); }
.pl-quota.is-empty .pl-quota-n { color: var(--danger-strong); }
.pl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pl-item {
  display: grid;
  grid-template-columns: 14px 2.2em 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius);
  background: var(--panel);
  transition: transform 0.15s ease;
}
.pl-list { position: relative; }

/* 드래그 손잡이: 점 6개 */
.pl-grip {
  width: 14px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: radial-gradient(circle, var(--muted) 1.2px, transparent 1.6px) 1px 2px / 6px 6px;
  opacity: 0.55;
  cursor: grab;
  touch-action: none;
}
.pl-item:hover .pl-grip, .pl-grip:focus-visible { opacity: 1; }
.pl-list.is-sorting { user-select: none; }
.pl-list.is-sorting .pl-grip { cursor: grabbing; }
.pl-item.is-dragging {
  position: relative;
  z-index: 2;
  transition: none;
  background: var(--panel-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--line);
}
.pl-item:hover { background: var(--panel-2); }
.pl-item.is-next { background: var(--accent-soft); }
.pl-num { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.pl-item.is-next .pl-num { color: var(--accent); }
.pl-item.is-bad .pl-thumb, .pl-item.is-bad .pl-title { opacity: 0.45; }
.pl-item.is-bad .pl-sub { color: var(--danger-text); }
.pl-thumb { width: 64px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; background: #000; }
.pl-text { min-width: 0; }
.pl-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-tools { display: flex; gap: 4px; }
.pl-empty { margin: 8px 0 0; color: var(--muted); }

.search-box { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1 1 auto; }
.search-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.search-title { margin: 0; font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-title b { color: var(--fg); font-weight: 600; }
.pl-item.search-item { grid-template-columns: 64px minmax(0, 1fr) auto; }
.search-item .is-added { color: var(--woot); border-color: transparent; }
@media (max-width: 520px) {
  .pl-item.search-item { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .pl-item.search-item .pl-tools { grid-column: auto; }
}
