:root {
  --bg: #f9f9f9;
  --panel: #ffffff;
  --line: #e5e5e5;
  --text: #0f0f0f;
  --muted: #606060;
  --primary: #ff0033;
  --primary-dark: #cc0029;
  --accent: #065fd4;
  --soft: #f2f2f2;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { text-decoration: none; }

.login-page, .install-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(37, 99, 235, .10), transparent 28%),
    linear-gradient(135deg, #f8fbff, #eef4f8);
}
.login-panel, .install-card {
  width: min(100%, 620px);
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 42px;
  box-shadow: 0 24px 70px rgba(23, 32, 51, .10);
  text-align: center;
}
.login-panel h1, .install-card h1 { font-size: clamp(2rem, 6vw, 4rem); letter-spacing: 0; line-height: 1; }
.login-panel p { color: var(--muted); font-size: 1.1rem; margin: 18px auto 28px; max-width: 500px; }
.cloud-mark {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-size: 1.8rem;
}

.landing-page {
  min-height: 100vh;
  padding: 28px clamp(18px, 4vw, 64px) 44px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.98)),
    radial-gradient(circle at 78% 16%, rgba(255,0,51,.10), transparent 28%),
    radial-gradient(circle at 18% 82%, rgba(6,95,212,.10), transparent 32%);
}
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(34px, 8vw, 88px);
}
.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0f0f0f;
  font-size: 1.55rem;
  font-weight: 900;
}
.landing-brand i { color: var(--primary); font-size: 2rem; }
.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.landing-nav-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 16px;
  color: #0f0f0f;
  background: #f2f2f2;
  font-weight: 750;
}
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .75fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}
.landing-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  background: #fff1f3;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 850;
  margin-bottom: 18px;
}
.landing-copy h1 {
  max-width: 760px;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: .96;
  letter-spacing: 0;
  margin: 0 0 20px;
}
.landing-copy p {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  line-height: 1.55;
  margin-bottom: 24px;
}
.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.landing-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.landing-status span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #3f3f46;
  background: #f5f5f5;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}
.landing-status .bi-check-circle-fill { color: #16a34a; }
.landing-status .bi-exclamation-circle-fill { color: #dc2626; }
.landing-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 24px 80px rgba(15,15,15,.12);
}
.preview-top {
  display: flex;
  gap: 8px;
  padding: 2px 4px 14px;
}
.preview-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e5e7eb;
}
.preview-player {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: #fff;
  background: #1f2937;
  border-radius: 16px;
  font-size: 4rem;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.preview-grid div {
  background: #f7f7f7;
  border-radius: 14px;
  padding: 14px;
}
.preview-grid strong { display: block; font-size: 1.4rem; }
.preview-grid span { color: var(--muted); font-weight: 700; }
.landing-features {
  max-width: 1280px;
  margin: clamp(34px, 6vw, 72px) auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.landing-features div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}
.landing-features i {
  color: var(--primary);
  font-size: 1.8rem;
}
.landing-features strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 1.1rem;
}
.landing-features span { color: var(--muted); }

.admin-login-page {
  min-height: 100vh;
  padding: clamp(22px, 4vw, 58px);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,0,51,.10), transparent 30%),
    radial-gradient(circle at 84% 80%, rgba(6,95,212,.10), transparent 34%),
    #f8f9fb;
}
.admin-login-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 28px;
  align-items: stretch;
}
.admin-login-info,
.admin-login-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(15,15,15,.10);
}
.admin-login-info {
  padding: clamp(28px, 5vw, 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.admin-login-info h1 {
  max-width: 740px;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: .98;
  margin: 0 0 18px;
}
.admin-login-info p {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
}
.admin-login-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.admin-login-grid div {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fafafa;
}
.admin-login-grid i {
  color: var(--primary);
  font-size: 1.45rem;
}
.admin-login-grid strong {
  display: block;
  margin-top: 8px;
}
.admin-login-grid span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
}
.admin-login-card {
  padding: 30px;
  align-self: center;
}
.admin-login-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #0f0f0f;
  font-size: 1.7rem;
  margin-bottom: 18px;
}
.admin-login-card h2 {
  font-size: 2rem;
  margin: 0 0 6px;
}
.admin-login-card p {
  color: var(--muted);
  margin-bottom: 22px;
}
.admin-login-card .input-group-text {
  background: #f7f7f7;
  border-color: var(--line);
}
.admin-login-card .form-control {
  min-height: 48px;
}
.admin-login-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-weight: 700;
}
.admin-default-note {
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  color: #52525b;
  background: #f7f7f7;
  font-size: .9rem;
}

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 228px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 14px 12px;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 18px;
}
.brand i { color: var(--primary); font-size: 1.65rem; }
.app-shell:not(.admin-shell) .sidebar .brand { display: none; }
.app-shell:not(.admin-shell) .sidebar {
  top: 72px;
  bottom: 0;
  padding-top: 12px;
}
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 650;
}
.sidebar nav a.active, .sidebar nav a:hover { background: var(--soft); color: var(--text); }
.sidebar nav a.active i { color: var(--primary); }
.content { margin-left: 228px; width: calc(100% - 228px); padding: 18px 24px 90px; }
.app-shell:not(.admin-shell) .content {
  padding-top: 104px;
  background: #fff;
}
body.sidebar-collapsed .app-shell:not(.admin-shell) .sidebar { display: none; }
body.sidebar-collapsed .app-shell:not(.admin-shell) .content {
  margin-left: 0;
  width: 100%;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(249,249,249,.94);
  backdrop-filter: blur(10px);
  padding: 8px 0;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.youtube-topbar {
  gap: 18px;
  min-height: 72px;
  position: fixed;
  inset: 0 0 auto 0;
  margin: 0;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid #f1f1f1;
  backdrop-filter: none;
  z-index: 40;
}
.topbar-left,
.topbar-center {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-left { min-width: 340px; }
.topbar-center {
  flex: 1;
  justify-content: center;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #0f0f0f;
  background: transparent;
  font-size: 1.35rem;
}
.icon-btn:hover,
.mic-btn { background: #f2f2f2; }
.menu-btn { font-size: 1.7rem; }
.yt-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f0f0f;
  font-weight: 850;
  font-size: 1.55rem;
  white-space: nowrap;
}
.yt-brand i {
  color: var(--primary);
  font-size: 2rem;
}
.youtube-search {
  width: min(720px, 100%);
  min-height: 44px;
  display: grid;
  grid-template-columns: 116px 1fr 72px;
  align-items: stretch;
}
.live-search-wrap {
  position: relative;
  width: min(720px, 100%);
}
.youtube-search select {
  border: 1px solid #d3d3d3;
  border-right: 0;
  border-radius: 999px 0 0 999px;
  padding: 0 12px 0 18px;
  outline: 0;
  background: #fff;
  color: #0f0f0f;
  font-weight: 700;
}
.youtube-search input {
  border: 1px solid #d3d3d3;
  border-right: 0;
  border-radius: 0;
  padding: 0 22px;
  min-width: 0;
  outline: 0;
  font-size: 1.05rem;
  background: #fff;
}
.youtube-search:focus-within select,
.youtube-search:focus-within input {
  border-color: #1c62b9;
  box-shadow: inset 0 0 0 1px #1c62b9;
}
.youtube-search button {
  border: 1px solid #d3d3d3;
  border-radius: 0 999px 999px 0;
  background: #f8f8f8;
  font-size: 1.45rem;
}
.youtube-search button:hover { background: #f0f0f0; }
.live-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 72px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(0,0,0,.14);
  overflow: hidden;
  z-index: 80;
}
.live-search-results.show { display: block; }
.live-search-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  color: #0f0f0f;
}
.live-search-item:hover { background: #f2f2f2; }
.live-search-item i { font-size: 1.2rem; color: #606060; }
.live-search-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .95rem;
}
.live-search-item span { color: var(--muted); font-size: .8rem; }
.live-search-empty { padding: 14px; color: var(--muted); }
.create-btn {
  min-height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: #0f0f0f;
  background: #f2f2f2;
  font-weight: 750;
}
.create-btn i { font-size: 1.25rem; }
.create-btn:hover { background: #e9e9e9; color: #0f0f0f; }
.searchbar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  min-height: 48px;
  width: min(560px, 100%);
}
.searchbar input { border: 0; outline: 0; width: 100%; }
.avatar-btn { border: 0; background: transparent; padding: 0; }
.avatar-btn img, .profile-row img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.page-head h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.45rem); letter-spacing: 0; }
.eyebrow { margin: 0 0 4px; color: var(--primary); font-weight: 800; text-transform: uppercase; font-size: .76rem; }
.btn { border-radius: 999px; font-weight: 650; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.stat-card, .panel, .type-card, .file-card, .upload-zone {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(23, 32, 51, .05);
}
.stat-card { min-height: 128px; padding: 22px; position: relative; overflow: hidden; }
.stat-card span { color: var(--muted); display: block; margin-bottom: 10px; }
.stat-card strong { font-size: 1.8rem; }
.stat-card i { position: absolute; right: 20px; bottom: 12px; color: rgba(37,99,235,.16); font-size: 4rem; }
.type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.type-card { padding: 18px; color: var(--text); display: grid; gap: 6px; }
.type-card i { font-size: 1.6rem; }
.type-card span { color: var(--muted); }
.type-card strong { font-size: 1.5rem; }
.panel { padding: 20px; }
.panel h2 { font-size: 1.15rem; margin: 0 0 14px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.activity-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-item span, .file-meta span, .profile-row span { color: var(--muted); display: block; font-size: .88rem; }
.empty-state { color: var(--muted); text-align: center; padding: 28px; }
.empty-state.wide { grid-column: 1 / -1; }

.toolbar {
  display: grid;
  grid-template-columns: 1fr 220px auto auto auto;
  gap: 10px;
  margin-bottom: 12px;
}
.breadcrumb-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin: 12px 0 18px;
}
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.file-grid.list-view { grid-template-columns: 1fr; }
.file-card {
  min-height: 108px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
}
.file-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f2f5f9;
  font-size: 1.45rem;
  overflow: hidden;
}
.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.file-open-link {
  grid-column: 1 / 3;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: inherit;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 0;
}
.file-open-link:hover .file-meta strong { color: var(--primary); }
.file-meta { min-width: 0; }
.file-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-zone {
  min-height: 410px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 34px;
  border-style: dashed;
}
.upload-zone.drag-over { border-color: var(--primary); background: var(--soft); }
.upload-zone > i { color: var(--primary); font-size: 4rem; }
.upload-zone h2 { font-size: 1.35rem; margin-top: 10px; }
.upload-zone p { color: var(--muted); }
.upload-zone input { max-width: 460px; }
.preview-modal .modal-body {
  min-height: 70vh;
  display: grid;
  place-items: center;
  background: #111827;
}
.preview-modal iframe, .preview-modal video, .preview-modal audio, .preview-modal img {
  width: 100%;
  max-height: 72vh;
  border: 0;
  object-fit: contain;
}
.preview-modal audio { background: #fff; border-radius: 8px; padding: 18px; }
.profile-row { display: flex; gap: 14px; align-items: center; }

.library-hero {
  min-height: 180px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #101827, #1b3a4b 58%, #0f766e);
  color: #fff;
}
.library-hero h1 { font-size: clamp(2rem, 6vw, 4.2rem); line-height: 1; margin: 0 0 8px; }
.library-hero p { margin: 0; color: rgba(255,255,255,.78); }
.media-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.youtube-chips {
  display: flex;
  gap: 10px;
  padding: 0;
  margin-bottom: 0;
  scrollbar-width: none;
}
.library-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.library-filter-row .youtube-chips {
  flex: 1;
  min-width: 0;
}
.sort-inline {
  flex: 0 0 190px;
}
.sort-inline .form-select {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 650;
}
.youtube-chips::-webkit-scrollbar { display: none; }
.media-tabs a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  background: var(--soft);
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 800;
  min-height: 44px;
  white-space: nowrap;
}
.media-tabs a.active { background: #0f0f0f; color: #fff; }
.media-tabs i { font-size: 1.2rem; }
.media-tabs strong { color: inherit; opacity: .7; font-size: .9rem; }
.library-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 720px) auto;
  gap: 10px;
  margin-bottom: 22px;
  align-items: center;
}
.youtube-toolbar {
  max-width: none;
  justify-content: space-between;
}
.featured-video, .video-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr);
  gap: 22px;
  margin-bottom: 24px;
  align-items: center;
}
.video-showcase {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.video-showcase-copy { padding: 10px; }
.featured-frame, .video-thumb, .mini-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: #111827;
}
.featured-frame { aspect-ratio: 16 / 9; }
.featured-frame video, .video-thumb video, .mini-thumb video,
.video-thumb img, .mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-thumb .video-placeholder,
.mini-thumb .video-placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.video-thumb img,
.mini-thumb img {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.video-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #1f2937;
  color: rgba(255,255,255,.72);
  font-size: 2.6rem;
}
.featured-frame span, .video-thumb i, .mini-thumb i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 3rem;
  background: rgba(0,0,0,.16);
}
.video-thumb > i,
.mini-thumb > i {
  z-index: 2;
}
img.thumb-img-failed {
  display: none !important;
}
.featured-video h2 { font-size: clamp(1.6rem, 4vw, 3rem); line-height: 1.05; margin-bottom: 10px; }
.featured-video p:not(.eyebrow) { color: var(--muted); }
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 30px 24px;
}
.youtube-video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.video-card {
  color: var(--text);
  display: grid;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 12px;
}
.video-card:hover { transform: translateY(-1px); }
.video-thumb { aspect-ratio: 16 / 9; }
.youtube-video-card .video-thumb { border-radius: 10px; }
.video-thumb i { font-size: 2.55rem; opacity: .92; }
.video-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  background: rgba(0,0,0,.72);
  color: #fff;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: .78rem;
  font-weight: 700;
}
.video-card-body { display: grid; gap: 4px; padding: 0 2px; }
.youtube-card-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
}
.channel-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0f0f0f;
  color: #fff;
  font-weight: 800;
}
.youtube-video-card .video-card-body strong {
  font-size: 1rem;
  line-height: 1.35;
  color: #0f0f0f;
}
.video-card strong, .related-video strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.video-card span, .related-video span { color: var(--muted); font-size: .9rem; }
.youtube-section { margin-top: 4px; }
.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 12px;
}
.section-line h2 { margin: 0; font-size: 1.25rem; font-weight: 800; }
.section-line span { color: var(--muted); }
.library-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 34px 0 8px;
}
.page-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-pills a,
.page-pills span {
  min-width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #0f0f0f;
  font-weight: 750;
}
.page-pills a:hover { background: #f2f2f2; }
.page-pills a.active {
  background: #0f0f0f;
  color: #fff;
}
.page-summary {
  color: var(--muted);
  font-weight: 650;
  margin-left: 6px;
}
.music-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 90px;
}
.music-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: grid;
  grid-template-columns: 38px 38px 1fr 120px 42px;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  text-align: left;
}
.music-row:hover { background: #f8fafc; }
.music-row.active { background: var(--soft); color: var(--primary); }
.track-num, .music-row span { color: var(--muted); }
.audio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 96px;
}
.audio-card {
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  text-align: left;
  color: var(--text);
  padding: 0;
}
.audio-card:hover strong { color: var(--primary); }
.audio-art {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #111827, #334155);
  color: #fff;
  font-size: 3rem;
}
.audio-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.audio-card strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}
.audio-card span { color: var(--muted); }
.audio-dock {
  position: fixed;
  left: 280px;
  right: 24px;
  bottom: 18px;
  z-index: 25;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(23,32,51,.18);
  border-radius: 8px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 520px);
  gap: 16px;
  align-items: center;
}
.audio-dock span { display: block; color: var(--muted); font-size: .88rem; }
.audio-dock audio { width: 100%; }
.image-gallery {
  columns: 4 220px;
  column-gap: 14px;
}
.image-tile {
  width: 100%;
  display: inline-block;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.image-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
  color: var(--text);
  text-decoration: none;
}
.image-tile img { width: 100%; display: block; }
.image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #eef4ff, #e6f7f4);
  color: var(--primary);
  font-size: 2.4rem;
}
.image-tile span { display: block; padding: 10px 12px; color: var(--text); font-weight: 650; }
.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.pdf-card {
  min-height: 250px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 10px;
  align-content: start;
  color: var(--text);
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.pdf-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  color: var(--text);
  text-decoration: none;
}
.pdf-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  color: #dc2626;
  font-size: 3rem;
}
.pdf-thumb img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pdf-thumb-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  transform: scale(1);
  transform-origin: top left;
}
.pdf-card > i { color: #dc2626; font-size: 3.2rem; }
.pdf-card span { color: var(--muted); font-size: .9rem; }
.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  min-width: 0;
  overflow: hidden;
}
.watch-layout.theater { grid-template-columns: 1fr; }
.watch-layout.theater .watch-side { display: none; }
.player-shell {
  background: #0f172a;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(23,32,51,.18);
}
.watch-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111827;
  display: block;
}
.watch-details {
  padding: 16px 2px 4px;
  margin-top: 10px;
}
.watch-main h1 {
  margin: 0 0 8px;
  font-size: clamp(1rem, 1.35vw, 1.28rem);
  line-height: 1.3;
  letter-spacing: 0;
  font-weight: 750;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.watch-meta { display: flex; gap: 8px; color: var(--muted); flex-wrap: wrap; }
.watch-meta span {
  background: #f1f3f5;
  border-radius: 999px;
  padding: 6px 10px;
  color: #4b5563;
  font-weight: 650;
}
.watch-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.watch-actions .btn {
  border-radius: 999px;
  border: 0;
  background: #f1f3f5;
  font-weight: 700;
}
.watch-actions .btn:hover { background: #e5e7eb; }
.watch-side {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  align-self: start;
  position: sticky;
  top: 18px;
  min-width: 0;
  overflow: hidden;
}
.watch-side h2 { font-size: 1.1rem; margin-bottom: 14px; }
.related-video {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  color: var(--text);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.related-video:last-child { border-bottom: 0; }
.related-video:hover strong { color: var(--primary); }
.related-video > div { min-width: 0; }
.mini-thumb { aspect-ratio: 16 / 9; }
.mini-thumb i { font-size: 1.4rem; }

.mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(23,32,51,.08);
  z-index: 30;
}
.mobile-nav a {
  flex: 1;
  text-align: center;
  color: var(--muted);
  padding: 8px 4px 10px;
  font-size: 1.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: color .12s;
}
.mobile-nav a.active,
.mobile-nav a:hover { color: var(--primary); }
.mobile-nav a::after {
  content: attr(data-label);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .2px;
}

@media (max-width: 991px) {
  .admin-login-shell { grid-template-columns: 1fr; }
  .admin-login-card { width: min(100%, 520px); justify-self: center; }
  .landing-hero,
  .landing-features { grid-template-columns: 1fr; }
  .landing-preview { max-width: 620px; }
  .sidebar { display: none; }
  .content { margin-left: 0; width: 100%; padding: 18px; padding-bottom: 86px; }
  .mobile-nav { display: flex; }
  .youtube-topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    min-height: 54px;
  }
  .topbar-left { min-width: auto; gap: 8px; }
  .topbar-left .yt-brand span { display: none; }
  .topbar-center {
    flex: 1;
    min-width: 0;
    justify-content: stretch;
  }
  .live-search-wrap { width: 100%; }
  .youtube-search {
    width: 100%;
    grid-template-columns: 1fr 42px;
    min-height: 38px;
    border-radius: 999px;
    border: 1px solid #e0e0e0;
    background: #f8f8f8;
  }
  .youtube-search select { display: none; }
  .youtube-search input {
    border: 0;
    background: transparent;
    padding: 0 14px;
    font-size: .9rem;
    border-radius: 999px 0 0 999px;
  }
  .youtube-search button {
    border: 0;
    border-radius: 0 999px 999px 0;
    background: transparent;
    font-size: 1.15rem;
    color: #606060;
  }
  .live-search-results { right: 0; left: 0; }
  .topbar-actions { gap: 2px; }
  .topbar-actions .create-btn { display: none; }
  .mic-btn { display: none; }
  .library-filter-row {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .library-filter-row .youtube-chips {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .sort-inline { flex: 0 0 auto; width: auto; max-width: none; }
  .sort-inline .form-select {
    min-height: 34px;
    padding: 0 24px 0 10px;
    font-size: .8rem;
    border-radius: 999px;
  }
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .media-tabs {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .media-tabs::-webkit-scrollbar { display: none; }
  .media-tabs a {
    padding: 6px 12px;
    font-size: .78rem;
    min-height: 32px;
    flex-shrink: 0;
    gap: 6px;
  }
  .media-tabs strong { font-size: .75rem; }
  .library-toolbar, .featured-video, .watch-layout, .audio-dock { grid-template-columns: 1fr; }
  .youtube-video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-side { position: static; }
  .audio-dock { left: 12px; right: 12px; bottom: 78px; }
}

@media (max-width: 575px) {
  .admin-login-page { padding: 16px; }
  .admin-login-info, .admin-login-card { border-radius: 18px; padding: 22px; }
  .admin-login-grid { grid-template-columns: 1fr; }
  .admin-login-links { flex-direction: column; }
  .landing-page { padding: 20px 16px 34px; }
  .landing-nav { align-items: flex-start; flex-direction: column; margin-bottom: 34px; }
  .landing-copy h1 { font-size: 2.45rem; }
  .landing-actions .btn { width: 100%; justify-content: center; }
  .preview-grid { grid-template-columns: 1fr; }
  .login-panel, .install-card { padding: 26px; }
  .type-grid { grid-template-columns: 1fr; }
  .youtube-topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 8px;
    min-height: 50px;
  }
  .topbar-left { gap: 4px; }
  .topbar-left .menu-btn { width: 36px; height: 36px; font-size: 1.4rem; }
  .topbar-left .yt-brand { font-size: 1.3rem; gap: 4px; }
  .topbar-left .yt-brand i { font-size: 1.5rem; }
  .youtube-search { min-height: 36px; }
  .youtube-search input { font-size: .85rem; padding: 0 10px; }
  .youtube-search button { font-size: 1.1rem; width: 36px; }
  .topbar-actions { gap: 2px; }
  .topbar-actions .icon-btn { width: 34px; height: 34px; font-size: 1.1rem; }
  .topbar-actions .avatar-btn img { width: 30px; height: 30px; }
  .file-card { grid-template-columns: auto 1fr auto; padding: 12px; }
  .youtube-video-grid { grid-template-columns: 1fr; }
  .page-summary { flex-basis: 100%; text-align: center; margin-left: 0; }
}


/* Rich file thumbnails */
.file-thumb-rich {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}
.file-thumb-rich img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}
.thumb-audio-art {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  font-size: 1.4rem;
  border-radius: 10px;
}
.thumb-pdf-art {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  color: #dc2626;
  font-size: 1.6rem;
  border-radius: 10px;
}

/* Audio art placeholder with bars animation */
.audio-art-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.audio-art-placeholder i {
  font-size: 2.4rem;
}
.audio-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}
.audio-bars span {
  display: block;
  width: 4px;
  background: rgba(255,255,255,.7);
  border-radius: 2px;
  animation: audioBar 1.2s ease-in-out infinite;
}
.audio-bars span:nth-child(1) { height: 30%; animation-delay: 0s; }
.audio-bars span:nth-child(2) { height: 60%; animation-delay: 0.15s; }
.audio-bars span:nth-child(3) { height: 100%; animation-delay: 0.3s; }
.audio-bars span:nth-child(4) { height: 45%; animation-delay: 0.45s; }
@keyframes audioBar {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.4); }
}


/* Dashboard recent files thumbnails */
.dash-file-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
img.dash-file-thumb {
  display: inline-block;
}
.dash-thumb-audio {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  font-size: 1rem;
}
.dash-thumb-pdf {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  color: #dc2626;
  font-size: 1.1rem;
}


/* YouTube-style custom video player */
.yt-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.yt-player-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.yt-player-wrap.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  aspect-ratio: auto;
  border-radius: 0;
}

/* Overlay */
.yt-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}
.yt-big-play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2rem;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity .2s, transform .2s;
}
.yt-player-wrap.is-paused .yt-big-play,
.yt-player-wrap.show-play-icon .yt-big-play {
  opacity: 1;
  transform: scale(1);
}
.yt-player-wrap.is-playing .yt-big-play {
  opacity: 0;
  transform: scale(0.8);
}

/* Seek indicators */
.yt-seek-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  font-size: 1.3rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.yt-seek-indicator span { font-size: .75rem; font-weight: 700; }
.yt-seek-indicator.left { left: 15%; }
.yt-seek-indicator.right { right: 15%; }
.yt-seek-indicator.flash { opacity: 1; }

/* Spinner */
.yt-spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.yt-player-wrap.is-buffering .yt-spinner { opacity: 1; }

/* Controls */
.yt-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  padding: 24px 12px 10px;
  opacity: 0;
  transition: opacity .25s;
}
.yt-player-wrap:hover .yt-controls,
.yt-player-wrap.is-paused .yt-controls,
.yt-player-wrap.controls-visible .yt-controls {
  opacity: 1;
}
.yt-player-wrap.hide-cursor {
  cursor: none;
}
.yt-player-wrap.hide-cursor .yt-controls { opacity: 0; }

/* Progress bar */
.yt-progress-wrap {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 4px;
}
.yt-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,.25);
  border-radius: 2px;
  position: relative;
  transition: height .1s;
}
.yt-progress-wrap:hover .yt-progress-bar {
  height: 5px;
}
.yt-progress-buffered {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: rgba(255,255,255,.35);
  border-radius: 2px;
}
.yt-progress-played {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: #ff0033;
  border-radius: 2px;
}
.yt-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff0033;
  transform: translate(-50%, -50%) scale(0);
  transition: transform .1s;
}
.yt-progress-wrap:hover .yt-progress-thumb {
  transform: translate(-50%, -50%) scale(1);
}
.yt-progress-tooltip {
  position: absolute;
  bottom: 22px;
  left: 0;
  transform: translateX(-50%);
  background: rgba(0,0,0,.8);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.yt-progress-wrap:hover .yt-progress-tooltip { opacity: 1; }

/* Controls row */
.yt-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.yt-controls-left,
.yt-controls-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.yt-ctrl-btn {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background .15s;
}
.yt-ctrl-btn:hover { background: rgba(255,255,255,.15); }
.yt-time {
  color: rgba(255,255,255,.9);
  font-size: .82rem;
  font-weight: 600;
  margin-left: 6px;
  white-space: nowrap;
}

/* Volume */
.yt-volume-group {
  display: flex;
  align-items: center;
  gap: 0;
}
.yt-volume-slider {
  width: 0;
  opacity: 0;
  transition: width .2s, opacity .2s;
  accent-color: #fff;
  height: 4px;
  cursor: pointer;
}
.yt-volume-group:hover .yt-volume-slider {
  width: 64px;
  opacity: 1;
}

/* Speed menu */
.yt-speed-menu {
  position: relative;
}
.yt-speed-options {
  position: absolute;
  bottom: 44px;
  right: 0;
  background: rgba(20,20,20,.95);
  border-radius: 10px;
  padding: 8px 0;
  display: none;
  min-width: 130px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.yt-speed-options.show { display: block; }
.yt-speed-options button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 8px 18px;
  text-align: left;
  font-size: .88rem;
  cursor: pointer;
}
.yt-speed-options button:hover { background: rgba(255,255,255,.1); }
.yt-speed-options button.active { color: #ff0033; font-weight: 700; }


/* YouTube Music style track list & player */
.ytm-track-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 100px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.ytm-track {
  display: grid;
  grid-template-columns: 36px 48px 1fr 40px;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  transition: background .12s;
  cursor: pointer;
}
.ytm-track:hover { background: #f2f2f2; }
.ytm-track.is-active { background: rgba(255,0,51,.05); }
.ytm-track.is-active .ytm-track-num { color: var(--primary); }
.ytm-track.is-active .ytm-track-info strong { color: var(--primary); }
.ytm-track-num {
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  font-size: .9rem;
}
.ytm-track.is-active .ytm-track-num::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  animation: ytmPulse 1.4s infinite;
}
.ytm-track.is-active .ytm-track-num span { display: none; }
.ytm-track-art {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, #334155);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.ytm-track-art img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ytm-track-info {
  min-width: 0;
}
.ytm-track-info strong {
  display: block;
  font-size: .95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.ytm-track-info span {
  color: var(--muted);
  font-size: .82rem;
}
.ytm-track-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: var(--muted);
  opacity: 0;
  transition: opacity .15s;
}
.ytm-track:hover .ytm-track-play { opacity: 1; }
.ytm-track.is-active .ytm-track-play { opacity: 1; color: var(--primary); }

@keyframes ytmPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* Player bar */
.ytm-player {
  position: fixed;
  left: 228px;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: #1d1d1d;
  color: #fff;
  box-shadow: 0 -4px 24px rgba(0,0,0,.25);
  transform: translateY(100%);
  transition: transform .3s ease;
}
.ytm-player.is-active { transform: translateY(0); }
.ytm-player-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255,255,255,.12);
  cursor: pointer;
  z-index: 2;
}
.ytm-player-progress:hover { height: 6px; top: -1px; }
.ytm-player-progress-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
  transition: width .25s linear;
}
.ytm-player-progress-buffered {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: rgba(255,255,255,.2);
}
.ytm-player-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 20px;
  gap: 16px;
  min-height: 72px;
}
.ytm-player-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.ytm-player-art {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.ytm-player-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ytm-player-song {
  min-width: 0;
}
.ytm-player-song strong {
  display: block;
  font-size: .95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ytm-player-song span {
  color: rgba(255,255,255,.55);
  font-size: .82rem;
}
.ytm-player-center {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ytm-ctrl {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.75);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: color .12s, background .12s;
}
.ytm-ctrl:hover { color: #fff; background: rgba(255,255,255,.1); }
.ytm-ctrl.is-on { color: var(--primary); }
.ytm-ctrl-play {
  width: 48px;
  height: 48px;
  background: #fff;
  color: #0f0f0f !important;
  font-size: 1.5rem;
}
.ytm-ctrl-play:hover { background: #e5e5e5; color: #0f0f0f !important; }
.ytm-player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.ytm-player-time {
  font-size: .8rem;
  color: rgba(255,255,255,.6);
  font-weight: 600;
  white-space: nowrap;
}
.ytm-volume-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ytm-volume-slider {
  width: 80px;
  accent-color: #fff;
  height: 3px;
  cursor: pointer;
}

/* Responsive player */
@media (max-width: 991px) {
  .ytm-player { left: 0; }
  .ytm-player-inner { grid-template-columns: 1fr auto; gap: 10px; padding: 8px 12px; }
  .ytm-player-right { display: none; }
  .ytm-track { grid-template-columns: 28px 40px 1fr 36px; gap: 10px; padding: 8px 12px; }
  .ytm-track-art { width: 40px; height: 40px; }
}
@media (max-width: 575px) {
  .ytm-player-center { gap: 2px; }
  .ytm-ctrl { width: 36px; height: 36px; font-size: 1rem; }
  .ytm-ctrl-play { width: 42px; height: 42px; font-size: 1.3rem; }
  .ytm-player-song strong { font-size: .85rem; }
  .ytm-player-art { width: 40px; height: 40px; }
}

body.sidebar-collapsed .ytm-player { left: 0; }


/* Listen page - YouTube Music style */
.listen-page {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 60px;
}
.listen-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
  align-items: center;
  padding: 32px 0 40px;
}
.listen-art {
  width: 280px;
  height: 280px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
  display: grid;
  place-items: center;
}
.listen-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.listen-art-placeholder {
  color: rgba(255,255,255,.5);
  font-size: 5rem;
}
.listen-eyebrow {
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: .76rem;
  letter-spacing: .5px;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.listen-info h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  margin: 0 0 12px;
  line-height: 1.2;
  word-break: break-word;
}
.listen-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 24px;
}
.listen-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Listen player controls */
.listen-player {
  background: #f8f9fa;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 24px;
}
.listen-progress-wrap {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.listen-time-current,
.listen-time-total {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.listen-progress-bar {
  height: 5px;
  background: #ddd;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
}
.listen-progress-bar:hover { height: 7px; }
.listen-progress-buffered {
  position: absolute;
  inset: 0;
  right: auto;
  background: #c5c5c5;
  border-radius: 4px;
}
.listen-progress-played {
  position: absolute;
  inset: 0;
  right: auto;
  background: var(--primary);
  border-radius: 4px;
}
.listen-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  transform: translate(-50%, -50%) scale(0);
  transition: transform .1s;
}
.listen-progress-bar:hover .listen-progress-thumb { transform: translate(-50%, -50%) scale(1); }
.listen-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.listen-ctrl {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.listen-ctrl:hover { background: #e9ecef; }
.listen-ctrl.is-on { color: var(--primary); }
.listen-ctrl-play {
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: #fff !important;
  font-size: 1.6rem;
}
.listen-ctrl-play:hover { background: var(--primary-dark); color: #fff !important; }
.listen-volume-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.listen-ctrl-sm {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  cursor: pointer;
}
.listen-ctrl-sm:hover { color: var(--text); }
.listen-volume-slider {
  width: 100px;
  accent-color: var(--primary);
  height: 4px;
  cursor: pointer;
}

/* Sections */
.listen-section {
  margin-top: 36px;
}
.listen-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.listen-section-head h2 {
  font-size: 1.2rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.listen-section-head h2 i { color: var(--primary); }

/* Queue list */
.listen-queue {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.listen-queue-item {
  display: grid;
  grid-template-columns: 32px 44px 1fr 36px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.listen-queue-item:last-child { border-bottom: 0; }
.listen-queue-item:hover { background: #f8f9fa; text-decoration: none; color: var(--text); }
.listen-queue-num {
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  font-size: .85rem;
}
.listen-queue-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, #334155);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.listen-queue-art img { width: 100%; height: 100%; object-fit: cover; }
.listen-queue-info { min-width: 0; }
.listen-queue-info strong {
  display: block;
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.listen-queue-info span { color: var(--muted); font-size: .8rem; }
.listen-queue-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  opacity: 0;
  transition: opacity .15s;
}
.listen-queue-item:hover .listen-queue-play { opacity: 1; color: var(--primary); }

/* More music grid */
.listen-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.listen-more-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  transition: transform .12s, box-shadow .12s;
  display: grid;
  gap: 8px;
}
.listen-more-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  text-decoration: none;
  color: var(--text);
}
.listen-more-art {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2rem;
}
.listen-more-art img { width: 100%; height: 100%; object-fit: cover; }
.listen-more-card strong {
  font-size: .88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.listen-more-card span { color: var(--muted); font-size: .8rem; }

@media (max-width: 768px) {
  .listen-hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
    padding: 20px 0;
  }
  .listen-art {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }
  .listen-meta { justify-content: center; }
  .listen-more-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}


/* Music grid view */
.music-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.music-grid-card {
  display: grid;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  transition: transform .12s;
}
.music-grid-card:hover {
  transform: translateY(-2px);
  color: var(--text);
  text-decoration: none;
}
.music-grid-card:hover strong { color: var(--primary); }
.music-grid-art {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.music-grid-art img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.music-grid-art-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,.5);
  font-size: 2rem;
}
.music-grid-play-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.4);
  color: #fff;
  font-size: 1.6rem;
  opacity: 0;
  transition: opacity .2s;
}
.music-grid-card:hover .music-grid-play-overlay { opacity: 1; }
.music-grid-card strong {
  font-size: .78rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}
.music-grid-card span {
  color: var(--muted);
  font-size: .72rem;
}

@media (max-width: 575px) {
  .music-grid-view { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}


/* Image view page */
.imgview-page { max-width: 1000px; margin: 0 auto; padding-bottom: 60px; }
.imgview-main { margin-bottom: 36px; }
.imgview-stage {
  position: relative;
  background: #0f0f0f;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  max-height: 70vh;
  cursor: grab;
}
.imgview-stage img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  transition: transform .2s;
  user-select: none;
  -webkit-user-drag: none;
}
.imgview-stage.is-dragging { cursor: grabbing; }

/* Toolbar */
.imgview-toolbar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 6px 10px;
  opacity: 0;
  transition: opacity .2s;
}
.imgview-stage:hover .imgview-toolbar { opacity: 1; }
.imgview-tool {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #fff;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s;
}
.imgview-tool:hover { background: rgba(255,255,255,.15); color: #fff; }
.imgview-zoom-label {
  color: rgba(255,255,255,.7);
  font-size: .72rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

/* Navigation arrows */
.imgview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s;
}
.imgview-stage:hover .imgview-nav { opacity: 1; }
.imgview-nav:hover { background: rgba(0,0,0,.75); }
.imgview-nav-prev { left: 14px; }
.imgview-nav-next { right: 14px; }

/* Details */
.imgview-details { padding: 18px 0 0; }
.imgview-details h1 {
  font-size: 1.3rem;
  margin: 0 0 8px;
  word-break: break-word;
}
.imgview-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 14px;
}
.imgview-meta span { display: inline-flex; align-items: center; gap: 5px; }
.imgview-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Sections */
.imgview-section { margin-top: 32px; }
.imgview-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.imgview-section-head h2 {
  font-size: 1.15rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.imgview-section-head h2 i { color: var(--primary); }

/* Related images row */
.imgview-related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.imgview-related-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
}
.imgview-related-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s;
}
.imgview-related-item:hover img { transform: scale(1.05); }
.imgview-related-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.3);
  color: #fff;
  font-size: 1.3rem;
  opacity: 0;
  transition: opacity .2s;
}
.imgview-related-item:hover .imgview-related-overlay { opacity: 1; }

/* More images grid */
.imgview-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.imgview-more-item {
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.imgview-more-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  color: var(--text);
  text-decoration: none;
}
.imgview-more-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.imgview-more-item strong {
  display: block;
  padding: 8px 10px;
  font-size: .76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .imgview-stage { min-height: 240px; max-height: 50vh; }
  .imgview-related { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .imgview-more-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}


/* PDF thumb placeholder in library */
.pdf-thumb-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
}
.pdf-thumb-placeholder i { font-size: 2.4rem; }
.pdf-thumb-placeholder span {
  font-size: .7rem;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

/* PDF Reader page */
.pdfreader-page { padding-bottom: 60px; }

.pdfreader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.pdfreader-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pdfreader-back {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 1.1rem;
  transition: background .12s;
  flex-shrink: 0;
}
.pdfreader-back:hover { background: var(--soft); }
.pdfreader-title-wrap { min-width: 0; }
.pdfreader-title-wrap h1 {
  font-size: 1.1rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdfreader-title-wrap span { color: var(--muted); font-size: .8rem; }
.pdfreader-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.pdfreader-tool {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s;
}
.pdfreader-tool:hover { background: var(--soft); color: var(--text); }
.pdfreader-tool.is-active { background: var(--soft); color: var(--primary); }
.pdfreader-zoom-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 38px;
  text-align: center;
}
.pdfreader-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
}

/* PDF Viewer frame */
.pdfreader-viewer {
  background: #525659;
  border-radius: 10px;
  overflow: auto;
  margin-bottom: 24px;
  position: relative;
  min-height: 500px;
  max-height: 82vh;
}
.pdfreader-viewer:fullscreen {
  max-height: none;
  border-radius: 0;
}
.pdfreader-canvas-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  gap: 16px;
  min-height: 460px;
}
.pdfreader-canvas-wrap canvas {
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
  max-width: 100%;
  display: block;
}
.pdfreader-canvas-wrap.scroll-mode {
  gap: 12px;
}
.pdfreader-canvas-wrap .pdfreader-scroll-page {
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
  max-width: 100%;
}
.pdfreader-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  font-weight: 600;
}
.pdfreader-viewer.dark-mode {
  background: #1a1a1a;
}
.pdfreader-viewer.dark-mode canvas,
.pdfreader-viewer.dark-mode .pdfreader-scroll-page {
  filter: invert(0.88) hue-rotate(180deg);
}
.pdfreader-page-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 54px;
  text-align: center;
}

/* Book info panel */
.pdfreader-info { margin-bottom: 32px; }
.pdfreader-info-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: start;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.pdfreader-cover {
  width: 120px;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #fee2e2, #fef3c7);
  box-shadow: 4px 4px 16px rgba(0,0,0,.12);
}
.pdfreader-cover img { width: 100%; height: 100%; object-fit: cover; }
.pdfreader-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  text-align: center;
  color: #dc2626;
}
.pdfreader-cover-placeholder i { font-size: 2rem; }
.pdfreader-cover-placeholder strong {
  font-size: .65rem;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.pdfreader-info-meta h2 { font-size: 1.1rem; margin: 0 0 10px; word-break: break-word; }
.pdfreader-meta-items {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: 14px;
}
.pdfreader-meta-items span { display: inline-flex; align-items: center; gap: 4px; }
.pdfreader-info-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Sections */
.pdfreader-section { margin-top: 32px; }
.pdfreader-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.pdfreader-section-head h2 {
  font-size: 1.15rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pdfreader-section-head h2 i { color: var(--primary); }

/* Related PDFs - book shelf style */
.pdfreader-related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.pdfreader-book-card {
  display: grid;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  transition: transform .12s;
}
.pdfreader-book-card:hover { transform: translateY(-3px); color: var(--text); text-decoration: none; }
.pdfreader-book-card:hover strong { color: var(--primary); }
.pdfreader-book-cover {
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #fee2e2, #fef3c7);
  box-shadow: 3px 3px 12px rgba(0,0,0,.1);
}
.pdfreader-book-cover img { width: 100%; height: 100%; object-fit: cover; }
.pdfreader-book-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #dc2626;
  font-size: 2.2rem;
}
.pdfreader-book-info { min-width: 0; }
.pdfreader-book-info strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .82rem;
  line-height: 1.3;
}
.pdfreader-book-info span { color: var(--muted); font-size: .75rem; }

/* More PDFs grid */
.pdfreader-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}
.pdfreader-more-card {
  display: grid;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  transition: transform .12s;
}
.pdfreader-more-card:hover { transform: translateY(-2px); color: var(--text); text-decoration: none; }
.pdfreader-more-card:hover strong { color: var(--primary); }
.pdfreader-more-cover {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #fee2e2, #fef3c7);
  box-shadow: 2px 2px 8px rgba(0,0,0,.08);
}
.pdfreader-more-cover img { width: 100%; height: 100%; object-fit: cover; }
.pdfreader-more-card strong {
  font-size: .76rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}
.pdfreader-more-card span { color: var(--muted); font-size: .7rem; }

@media (max-width: 768px) {
  .pdfreader-header { flex-direction: column; align-items: flex-start; }
  .pdfreader-viewer iframe { height: 60vh; }
  .pdfreader-info-card { grid-template-columns: 80px 1fr; gap: 14px; }
  .pdfreader-cover { width: 80px; height: 110px; }
  .pdfreader-related { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}


/* Autoplay button */
.yt-ctrl-btn.yt-autoplay-on { color: var(--primary); }


/* Mobile sidebar overlay */
@media (max-width: 991px) {
  body.sidebar-mobile-open .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,.2);
    padding-top: 14px;
    animation: slideInLeft .2s ease;
  }
  body.sidebar-mobile-open .sidebar .brand { display: flex !important; }
  body.sidebar-mobile-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99;
    animation: fadeIn .2s ease;
  }
}
@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Notification system */
.notif-wrap {
  position: relative;
}
.notif-bell-btn {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 4px;
  line-height: 1;
}
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,.15);
  z-index: 90;
  overflow: hidden;
}
.notif-dropdown.show { display: block; }
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.notif-header strong { font-size: 1.05rem; }
.notif-list {
  max-height: 400px;
  overflow-y: auto;
}
.notif-loading {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.notif-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  transition: background .12s;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: #f8f9fa; }
.notif-item.unread { background: #f0f7ff; }
.notif-item.unread:hover { background: #e3f0ff; }
.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--soft);
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 1rem;
}
.notif-content { min-width: 0; }
.notif-content strong {
  display: block;
  font-size: .88rem;
  line-height: 1.3;
  margin-bottom: 2px;
}
.notif-content span {
  color: var(--muted);
  font-size: .78rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-time {
  color: var(--muted);
  font-size: .7rem;
  white-space: nowrap;
  margin-top: 2px;
}
.notif-empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 575px) {
  .notif-dropdown { width: calc(100vw - 20px); right: -40px; }
}


/* Thumbnail overlay on placeholders */
.music-grid-art { position: relative; }
.music-grid-art > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.music-grid-play-overlay { z-index: 2; }
.ytm-track-art { position: relative; overflow: hidden; }
.ytm-track-art > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.ytm-track-art > i { position: relative; z-index: 0; }
.pdf-thumb { position: relative; }
.pdf-thumb > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  border-radius: 8px;
}
.pdf-thumb-placeholder { position: relative; z-index: 0; width: 100%; height: 100%; }


/* Dark mode */
body.theme-dark {
  --bg: #0f0f0f;
  --panel: #1d1d1d;
  --line: #2d2d2d;
  --text: #f1f1f1;
  --muted: #aaa;
  --soft: #272727;
}
body.theme-dark .sidebar { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .youtube-topbar { background: #0f0f0f; border-color: #2d2d2d; }
body.theme-dark .app-shell:not(.admin-shell) .content { background: #0f0f0f; }
body.theme-dark .youtube-search { border-color: #3d3d3d; }
body.theme-dark .youtube-search input { background: #121212; color: #f1f1f1; border-color: #3d3d3d; }
body.theme-dark .youtube-search select { background: #121212; color: #f1f1f1; border-color: #3d3d3d; }
body.theme-dark .youtube-search button { background: #272727; color: #f1f1f1; border-color: #3d3d3d; }
body.theme-dark .icon-btn { color: #f1f1f1; }
body.theme-dark .icon-btn:hover { background: #272727; }
body.theme-dark .yt-brand { color: #f1f1f1; }
body.theme-dark .media-tabs a { background: #272727; color: #f1f1f1; }
body.theme-dark .media-tabs a.active { background: #f1f1f1; color: #0f0f0f; }
body.theme-dark .mobile-nav { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .notif-dropdown { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .notif-item:hover { background: #272727; }
body.theme-dark .notif-item.unread { background: #1a2332; }
body.theme-dark .dropdown-menu { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .dropdown-item { color: #f1f1f1; }
body.theme-dark .dropdown-item:hover { background: #272727; }
body.theme-dark .channel-dot { background: #f1f1f1; color: #0f0f0f; }
body.theme-dark .video-card-body strong { color: #f1f1f1; }
body.theme-dark .sidebar nav a { color: #aaa; }
body.theme-dark .sidebar nav a.active, body.theme-dark .sidebar nav a:hover { background: #272727; color: #f1f1f1; }
body.theme-dark .file-card, body.theme-dark .pdf-card, body.theme-dark .image-tile { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .ytm-track-list { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .ytm-track:hover { background: #272727; }
body.theme-dark .listen-player { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .listen-queue { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .listen-queue-item { border-color: #2d2d2d; }
body.theme-dark .listen-queue-item:hover { background: #272727; }
body.theme-dark .listen-more-card { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .panel { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .stat-card { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .type-card { background: #1d1d1d; border-color: #2d2d2d; }
body.theme-dark .form-control, body.theme-dark .form-select { background: #272727; border-color: #3d3d3d; color: #f1f1f1; }
body.theme-dark .btn-light { background: #272727; border-color: #3d3d3d; color: #f1f1f1; }
body.theme-dark .btn-outline-primary { color: var(--primary); border-color: var(--primary); }
body.theme-dark .table { color: #f1f1f1; }
body.theme-dark .progress { background: #272727; }

/* Favorites heart button */
.fav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  transition: color .15s, transform .15s;
}
.fav-btn:hover { color: var(--primary); transform: scale(1.2); }
.fav-btn.is-fav { color: var(--primary); }

/* Watch history progress bar on cards */
.video-thumb-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,.3);
}
.video-thumb-progress-bar {
  height: 100%;
  background: var(--primary);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--soft) 25%, #e8e8e8 50%, var(--soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
body.theme-dark .skeleton {
  background: linear-gradient(90deg, #272727 25%, #333 50%, #272727 75%);
  background-size: 200% 100%;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-thumb { aspect-ratio: 16/9; border-radius: 10px; }
.skeleton-text { height: 14px; margin: 8px 0; width: 80%; }
.skeleton-text-sm { height: 12px; margin: 4px 0; width: 60%; }


/* Page transitions */
.page-transition-out {
  animation: pageOut .2s ease forwards;
}
.page-transition-in {
  animation: pageIn .25s ease;
}
@keyframes pageOut {
  to { opacity: 0; transform: translateY(8px); }
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Drag and drop */
.file-card.is-dragging {
  opacity: .5;
  transform: scale(.95);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.file-card.drag-over {
  border-color: var(--primary);
  background: rgba(255,0,51,.04);
  box-shadow: inset 0 0 0 2px var(--primary);
}
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: .85;
  transform: rotate(2deg);
  box-shadow: 0 12px 32px rgba(0,0,0,.2);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 16px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: .88rem;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drag-ghost i { color: var(--primary); font-size: 1.2rem; }


/* Image lazy blur-up */
.blur-up {
  filter: blur(12px);
  transform: scale(1.04);
  transition: filter .4s ease, transform .4s ease;
}
.blur-up.loaded {
  filter: blur(0);
  transform: scale(1);
}

/* Video chapters */
.yt-chapters {
  margin-top: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.yt-chapters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.yt-chapters-header h3 { margin: 0; font-size: .95rem; font-weight: 700; }
.yt-chapter-list { max-height: 260px; overflow-y: auto; }
.yt-chapter-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s;
}
.yt-chapter-item:last-child { border-bottom: 0; }
.yt-chapter-item:hover { background: var(--soft); }
.yt-chapter-item.is-active { background: rgba(255,0,51,.06); }
.yt-chapter-time {
  font-size: .8rem;
  font-weight: 700;
  color: var(--primary);
  font-family: monospace;
}
.yt-chapter-title { font-size: .85rem; font-weight: 600; }
.yt-chapter-delete {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .9rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
.yt-chapter-item:hover .yt-chapter-delete { opacity: 1; }
.yt-chapter-add {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}
.yt-chapter-add input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: .82rem;
  background: var(--bg);
  color: var(--text);
}
.yt-chapter-add button {
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}

/* Chapter markers on progress bar */
.yt-chapter-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255,255,255,.6);
  border-radius: 2px;
  z-index: 1;
  pointer-events: none;
}


/* Bulk operations */
.bulk-bar {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f0f0f;
  color: #fff;
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
  z-index: 60;
  transition: transform .25s ease;
  font-size: .88rem;
  font-weight: 650;
}
.bulk-bar.show { transform: translateX(-50%) translateY(0); }
.bulk-bar button {
  border: 0;
  background: rgba(255,255,255,.15);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.bulk-bar button:hover { background: rgba(255,255,255,.25); }
.bulk-bar .bulk-close { background: transparent; font-size: 1.1rem; padding: 4px 8px; }
.file-card .bulk-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,.7);
  background: rgba(0,0,0,.3);
  display: none;
  place-items: center;
  z-index: 3;
  cursor: pointer;
}
.file-card:hover .bulk-check,
.file-card.bulk-selected .bulk-check { display: grid; }
.file-card.bulk-selected .bulk-check { background: var(--primary); border-color: var(--primary); color: #fff; }
body.theme-dark .bulk-bar { background: #1d1d1d; }
