/* ── Boston Scientific Case Library ──────────────────────────── */
:root {
  --bg: #f0f4f8;
  --panel: #ffffff;
  --text: #1a2e44;
  --muted: #61737B;
  --border: #d8e2ea;
  --shadow: 0 10px 30px rgba(0,60,113,0.10);
  --radius: 14px;
  --bsc-blue: #003C71;
  --bsc-blue-dark: #002a52;
  --bsc-blue-light: #e6eef6;
  --caribbean: #00EEFF;
  --caribbean-dark: #00BECC;
  --plum: #BB33FF;
  --plum-dark: #8800CC;
  --raven: #61737B;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  min-height: 100vh;
  background: var(--bg);
}

body {
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  zoom: 1.2;
}

a { color: var(--bsc-blue); text-decoration: none; }
a:hover { color: var(--bsc-blue-dark); }

/* ── App Navigation ──────────────────────────────────────────── */
.app-nav {
  background: white;
  border-bottom: 3px solid var(--bsc-blue);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,60,113,0.08);
}
.app-nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  height: 75px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.app-nav-brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.app-nav-logo { height: 70px; width: auto; display: block;margin-top: 10px; }

.app-nav-links { display: flex; gap: 4px; flex: 1; }
.app-nav-link {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--raven);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.app-nav-link:hover { background: var(--bsc-blue-light); color: var(--bsc-blue); }
.app-nav-link.active { background: var(--bsc-blue-light); color: var(--bsc-blue); font-weight: 600; }

.app-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.app-nav-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bsc-blue), var(--caribbean-dark));
  color: white; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ── Container ───────────────────────────────────────────────── */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* ── Rainbow divider ─────────────────────────────────────────── */
.rainbow-bar {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--bsc-blue), var(--plum), var(--caribbean), var(--caribbean-dark), var(--bsc-blue));
  margin: 10px 0 18px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid var(--bsc-blue);
  border-radius: 10px;
  background: var(--bsc-blue);
  color: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.button:hover { background: var(--bsc-blue-dark); border-color: var(--bsc-blue-dark); color: white; }

.button.secondary {
  background: white;
  color: var(--bsc-blue);
  border-color: var(--border);
}
.button.secondary:hover { background: var(--bsc-blue-light); border-color: var(--bsc-blue); }

.button.danger {
  background: #dc2626;
  border-color: #dc2626;
}
.button.danger:hover { background: #b91c1c; border-color: #b91c1c; }

.button.success {
  background: #16a34a;
  border-color: #16a34a;
}
.button.success:hover { background: #15803d; border-color: #15803d; }

/* ── Cards grid ──────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
@media (max-width: 1200px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px)  { .card-grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}
.card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.card-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.card-thumb-0 { background: linear-gradient(135deg, #003C71, #012a52, #001f3a); }
.card-thumb-1 { background: linear-gradient(135deg, #003C71, #005a96, #00BECC); }
.card-thumb-2 { background: linear-gradient(135deg, #003C71 0%, #005a96 60%, #00BECC 100%); }
.card-thumb-3 { background: linear-gradient(135deg, #003C71, #61737B, #3a5060); }

.card-badge {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.65);
  color: white;
  font-size: 12px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  z-index: 1;
}
.card-badge--assigned {
  right: auto;
  left: 8px;
  background: #16a34a;
}


.card-body {
  padding: 16px 12px 40px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.card-title {
  font-size: 13px; font-weight: 700; line-height: 1.35;
  margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-subtitle { font-size: 12px; color: var(--muted); margin: 0; }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

/* ── Thumbnail action buttons (play, download) ─────────────── */
.thumb-actions {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.thumb-action {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
  /* reset button defaults */
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.thumb-action.inactive{
  pointer-events: none;
  opacity: 0.4; /* Visual indication of being inactive */
  cursor: default;
}
.thumb-action:hover {
  background: rgba(0, 0, 0, 0.78);
  transform: scale(1.12);
  color: white;
}
.thumb-action svg {
  width: 14px;
  height: 14px;
}
.thumb-action--play svg {
  margin-left: 1px;
}
.thumb-actions--lg .thumb-action {
  width: 36px;
  height: 36px;
}
.thumb-actions--lg .thumb-action svg {
  width: 18px;
  height: 18px;
}
.thumb-actions--lg .thumb-action--play svg {
  margin-left: 2px;
}

/* ── Stretched link (covers parent for click-anywhere navigation) */
.stretched-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* ── Tile list (streams index) ──────────────────────────────── */
.tile-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tile-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s;
}
.tile-item:last-child { border-bottom: none; }
.tile-item:hover { background: var(--bsc-blue-light); }
.tile-thumb {
  flex-shrink: 0;
  width: 160px;
  height: 90px;
  border-radius: 8px;
  position: relative;
}
.tile-thumb-0 { background: linear-gradient(135deg, #003C71 0%, #00053e 100%); }
.tile-thumb-1 { background: linear-gradient(135deg, #003C71 0%, #00EEFF 100%); }
.tile-thumb-2 { background: linear-gradient(135deg, #003C71 0%, #005a96 60%, #00BECC 100%); }
.tile-thumb-3 { background: linear-gradient(135deg, #002a52 0%, #61737B 100%); }
.tile-corner {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.tile-corner--live {
  background: rgb(255 0 0 / 0.85);
}
.tile-corner--assigned {
  background: #16a34a;
  bottom: auto;
  top: 6px;
  right: auto;
  left: 8px;
}
.tile-body {
  flex: 1;
  min-width: 0;
}
.tile-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-subtitle {
  font-size: 13px;
  color: var(--bsc-blue);
  margin: 0 0 8px;
}
.tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tile-tag {
  display: inline-block;
  padding: 2px 15px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid var(--bsc-blue-dark);
  color: var(--bsc-blue);
  background: transparent;
  margin-top: 22px;
}
.tile-tag--case { border-color: #2e7d32; color: #2e7d32; }
.tile-tag--no-case { border-color: #dc2626; color: #dc2626; }
.tile-date {
  flex-shrink: 0;
  font-size: 13px;
  color: black;
  white-space: nowrap;
  align-self: flex-end;
  padding-bottom: 4px;
}

/* ── Show page layout ────────────────────────────────────────── */
.show-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: flex-start;
}
@media (max-width: 720px) { .show-layout { grid-template-columns: 1fr; } }

.show-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.show-thumb {
  border-radius: var(--radius);
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
}
.show-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.show-actions .button {
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}
.show-action-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  font-size: 14px; font-weight: 500;
  color: var(--text); text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.show-action-btn:hover { border-color: var(--caribbean-dark); background: var(--bsc-blue-light); color: var(--bsc-blue); }
.show-action-btn.danger { color: #dc2626; }
.show-action-btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }

.show-main {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 28px;
}
.show-title { font-size: 22px; font-weight: 700; margin: 12px 0 4px; line-height: 1.3; }
.show-subtitle { font-size: 14px; color: var(--muted); margin: 0 0 16px; }

.show-meta-grid {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.show-meta-item { display: flex; flex-direction: column; gap: 2px; }
.show-meta-label {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); font-weight: 600;
}
.show-meta-value { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── Stream detail grid ──────────────────────────────────────── */
.stream-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 800px) { .stream-detail-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stream-detail-grid { grid-template-columns: 1fr; } }

.stream-detail-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stream-detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.stream-detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

/* ── Section title ───────────────────────────────────────────── */
.section-title {
  font-size: 18px; font-weight: 700; margin: 0 0 12px;
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
  margin-bottom: 20px;
}
.breadcrumb a {
  font-size: 14px; font-weight: 500;
  color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  transition: color 0.15s;
}
.breadcrumb a:hover { color: var(--bsc-blue); }

/* ── Forms ────────────────────────────────────────────────────── */
.form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 640px;
  margin: 0 auto;
}
.form-group { display: flex; flex-direction: column; gap: 18px; }
.form-field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  font-size: 14px;
  background: var(--panel);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--bsc-blue);
  box-shadow: 0 0 0 3px rgba(0,60,113,0.12);
}
.form-field textarea { min-height: 90px; resize: vertical; }

.form-actions {
  display: flex; gap: 12px; justify-content: flex-end;
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px 16px;
  color: #b91c1c;
  font-size: 14px;
  margin-bottom: 20px;
  list-style: none;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-state p { font-size: 16px; }

/* ── Login page ──────────────────────────────────────────────── */
.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bsc-blue-dark) 0%, var(--bsc-blue) 50%, #005a96 100%);
  padding: 24px;
  overflow: auto;
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.login-logo {
  margin-bottom: 24px;
}
.login-logo-img {
  height: 100px;
  width: auto;
  display: block;
}
.login-card .rainbow-bar {
  width: 100%;
  margin: 0 0 24px;
}
.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  text-align: center;
}
.login-subtitle {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin: 0 0 32px;
  line-height: 1.5;
}
.login-form {
  width: 100%;
}
.login-form button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--bsc-blue);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(0, 60, 113, 0.35);
}
.login-form button:hover {
  background: var(--bsc-blue-dark);
  box-shadow: 0 6px 20px rgba(0, 60, 113, 0.45);
  transform: translateY(-1px);
}
.login-form button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 60, 113, 0.3);
}
.login-btn-icon {
  display: flex;
  align-items: center;
  opacity: 0.9;
}

/* ── Search bar (cases index) ────────────────────────────────── */
.cl-toolbar {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.cl-toolbar form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 800px;
}
.cl-search-wrap {
  flex: 1;
  position: relative;
  display: flex;
}
.cl-search-input {
  width: 100%;
  padding: 10px 46px 10px 18px;
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cl-search-input:focus {
  border-color: var(--bsc-blue);
  box-shadow: 0 0 0 3px rgba(0,60,113,0.10);
}
.cl-search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bsc-blue);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.cl-search-btn:hover { background: var(--bsc-blue-dark); }


/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--bsc-blue);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pagination-btn:hover {
  background: var(--bsc-blue-light);
  border-color: var(--bsc-blue);
  color: var(--bsc-blue);
}
.pagination-btn--disabled {
  color: var(--muted);
  cursor: default;
  pointer-events: none;
}
.pagination-btn--disabled:hover {
  background: white;
  border-color: var(--border);
}
.pagination-info {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Playlist-specific ───────────────────────────────────────── */

/* Cover gradients (shared by index cards + show hero) */
.pl-cover-0 { background: linear-gradient(145deg, #003C71 0%, #00BECC 100%); }
.pl-cover-1 { background: linear-gradient(145deg, #8800CC 0%, #003C71 100%); }
.pl-cover-2 { background: linear-gradient(145deg, #003C71 0%, #BB33FF 60%, #00EEFF 100%); }
.pl-cover-3 { background: linear-gradient(145deg, #002a52 0%, #61737B 100%); }
.pl-cover-4 { background: linear-gradient(145deg, #00BECC 0%, #003C71 50%, #8800CC 100%); }
.pl-cover-5 { background: linear-gradient(145deg, #003C71 0%, #005a96 40%, #00EEFF 100%); }

/* Card grid */
.pl-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1100px) { .pl-cards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px)  { .pl-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px)  { .pl-cards-grid { grid-template-columns: 1fr; } }

.pl-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.pl-card:hover {
  box-shadow: 0 10px 32px rgba(0,0,0,0.14);
  transform: translateY(-3px);
}

/* Thumbnail */
.pl-card-thumb {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 16 / 10;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.pl-card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.05) 55%);
  pointer-events: none;
}

/* Info panel */
.pl-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.pl-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pl-card-name:hover { color: var(--bsc-blue); }
.pl-card-creator {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pl-card-footer {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ── Tracklist ───────────────────────────────────────────────── */
.pl-tracklist {
  margin-top: 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pl-track {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.pl-track:hover { background: var(--bsc-blue-light); }
.pl-track-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.pl-track-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  color: white;
  opacity: 1;
  text-decoration: none;
}
.pl-track-play svg { width: 18px; height: 18px; }
.pl-track-play:hover { color: white; }
.pl-track-info { flex: 1; min-width: 0; }
.pl-track-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-track-name:hover { color: var(--bsc-blue); text-decoration: underline; }
.pl-track-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}
.pl-track-date {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.pl-track-menu {
  position: relative;
  flex-shrink: 0;
}
.pl-track-menu summary { list-style: none; }
.pl-track-menu summary::-webkit-details-marker { display: none; }
.pl-track-menu-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.pl-track-menu-btn:hover { background: var(--border); color: var(--text); }
.pl-track-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  z-index: 20;
  min-width: 180px;
  overflow: hidden;
}

.pl-track-menu-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}
.pl-track-menu-item:hover { background: var(--bsc-blue-light); }
.pl-track-menu-item.danger { color: #dc2626; }
.pl-track-menu-item.danger:hover { background: #fee2e2; }
.pl-seen-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: #16a34a;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* ── Add Cases modal ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-backdrop-close {
  position: fixed;
  inset: 0;
  z-index: 101;
}
.modal-panel {
  position: relative;
  z-index: 102;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  width: 540px;
  max-width: 95vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.modal-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s;
}
.modal-close-btn:hover { background: var(--border); color: var(--text); }
.modal-search-bar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-results {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}
.modal-case-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}
.modal-case-row:last-child { border-bottom: none; }
.modal-case-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-added-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #16a34a;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.modal-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #16a34a;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
}
.modal-add-btn:hover { background: #15803d; transform: scale(1.1); }
.modal-state {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
}

/* ── Slim playlist header (replaces big hero) ────────────────── */
.pl-slim-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.pl-slim-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.pl-slim-info { flex: 1; min-width: 0; }
.pl-slim-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.pl-slim-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.pl-slim-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

