:root {
  --bg-body: #090a0f;
  --bg-surface: #11131a;
  --bg-elevated: #171a24;
  --bg-hover: #1e2230;
  --bg-header: rgba(9, 10, 15, 0.88);
  --border-subtle: #1e2230;
  --border-focus: #33394e;
  --accent: #e11d48;
  --accent-hover: #f43f5e;
  --accent-soft: rgba(225, 29, 72, 0.14);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #0ea5e9;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --container-width: 1360px;
  --transition: 0.18s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: none;
}

body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: 'Inter', 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 40px;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: none;
  -webkit-tap-highlight-color: transparent;
}

.show-on-mobile-inline {
  display: none;
}

.admin-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.admin-header-subtitle {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.lights-off {
  background-color: #020204;
}
body.lights-off .site-header,
body.lights-off .player-meta-section,
body.lights-off .player-sidebar {
  opacity: 0.12;
  transition: opacity 0.35s ease;
}
body.lights-off .site-header:hover,
body.lights-off .player-meta-section:hover,
body.lights-off .player-sidebar:hover {
  opacity: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: #25293a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #383e56;
}

/* Centered Container System */
.app-container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.app-container.theater-expanded {
  max-width: 1680px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.5px;
}

.brand-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  letter-spacing: 0.4px;
}

/* Search Bar */
.header-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search-field {
  width: 100%;
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 34px 0 36px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.search-field::placeholder {
  color: var(--text-muted);
}

.search-field:focus {
  border-color: var(--border-focus);
  background: var(--bg-elevated);
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: none;
}
.search-clear-btn:hover {
  color: var(--text-primary);
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nas-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}
.nas-badge:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.status-indicator.offline {
  background: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Hero Banner inside Container */
.hero-section {
  margin-top: 14px;
  margin-bottom: 16px;
}

.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center 20%;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(9, 10, 15, 0.96) 0%, rgba(9, 10, 15, 0.82) 45%, rgba(9, 10, 15, 0.25) 100%),
              linear-gradient(0deg, rgba(9, 10, 15, 0.95) 0%, rgba(9, 10, 15, 0.2) 60%, transparent 100%);
}

.hero-body {
  position: relative;
  z-index: 2;
  padding: 18px 24px;
  max-width: 640px;
}

.hero-meta-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.hero-title {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.hero-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Summary Metrics Bar */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metric-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-label {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1px;
}

/* Actress Strip */
.section-block {
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.actress-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.actress-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.actress-pill:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-focus);
}
.actress-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #fff;
}

.actress-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated);
}

.actress-pill-name {
  font-size: 12.5px;
  font-weight: 500;
}

.actress-pill-count {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 99px;
}

/* Toolbar & Filter Controls */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
}

.filter-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.filter-btn.active {
  background: var(--text-primary);
  color: var(--bg-body);
  border-color: var(--text-primary);
  font-weight: 600;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-control {
  height: 32px;
  padding: 0 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
}
.select-control:focus {
  border-color: var(--border-focus);
}

/* Movies Grid inside Container */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

/* Movie Card */
.movie-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.movie-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  background: var(--bg-elevated);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  background: #0d0f17;
  overflow: hidden;
  display: block;
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.movie-card:hover .card-poster {
  transform: scale(1.03);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 10, 15, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}
.movie-card:hover .card-overlay {
  opacity: 1;
}

.play-trigger {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(225, 29, 72, 0.95);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* Progress bar on watched cards */
.watch-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
}
.watch-progress-fill {
  height: 100%;
  background: var(--accent);
}

/* Clean Badges */
.card-badges-top {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  gap: 4px;
  flex-wrap: wrap;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.3;
  backdrop-filter: blur(6px);
}

.tag-code {
  background: rgba(15, 17, 26, 0.85);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: 'JetBrains Mono', monospace;
}

.tag-sub {
  background: rgba(14, 165, 233, 0.9);
  color: #fff;
}

.tag-uncen {
  background: rgba(225, 29, 72, 0.9);
  color: #fff;
}

.tag-quality {
  background: rgba(15, 17, 26, 0.82);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-versions {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.3), rgba(245, 158, 11, 0.35));
  color: #fef08a;
  border: 1px solid rgba(245, 158, 11, 0.45);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-subline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.card-actress-link {
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-actress-link:hover {
  color: var(--accent);
}

.card-title-link {
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.card-title-link:hover {
  color: #fff;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11px;
  color: var(--text-muted);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.icon-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.icon-btn.active {
  color: var(--accent);
}
.icon-btn.bookmark-btn.active {
  color: #f59e0b;
}
.icon-btn.bookmark-btn:hover {
  color: #f59e0b;
}

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover:not(:disabled) {
  border-color: var(--border-focus);
  color: var(--text-primary);
}
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==================== PRO PLAYER LAYOUT ==================== */
.player-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  margin-top: 20px;
}

.app-container.theater-expanded .player-layout {
  grid-template-columns: 1fr;
}

.video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.video-stage:fullscreen,
.video-stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  border: none;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.video-element.fit-cover {
  object-fit: cover;
}
.video-element.fit-fill {
  object-fit: fill;
}

/* Tap to Play Overlay for Mobile */
.tap-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  z-index: 20;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  user-select: none;
}
.tap-play-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.tap-play-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(230, 57, 70, 0.5);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tap-play-overlay:active .tap-play-btn {
  transform: scale(0.92);
}
.tap-play-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Alternate Video Quality / Multi-part Versions Selector */
.variants-selector-card {
  margin-top: 10px;
  background: var(--bg-surface);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.variants-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.variants-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #fbbf24;
}

.variants-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

.variants-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.variant-pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.variant-pill-btn.active {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.25), rgba(245, 158, 11, 0.3));
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(229, 9, 20, 0.25);
}

.variant-pill-check {
  color: #10b981;
  font-weight: 800;
  font-size: 13px;
}

/* Pro Player Control Strip & Collapsible Deck Container */
.player-deck-container {
  margin-top: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
}

.player-deck-container.is-expanded {
  border-color: rgba(255, 255, 255, 0.16);
}

.deck-toggle-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-surface);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
  user-select: none;
}

.deck-toggle-bar:hover {
  background: var(--bg-elevated);
}

.player-deck-container.is-expanded .deck-toggle-bar {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.player-control-deck {
  background: var(--bg-surface);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
  border: none;
  border-radius: 0;
}

.deck-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.deck-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.deck-group .btn.btn-sm,
.deck-group .select-control {
  height: 27px;
  padding: 0 9px;
  font-size: 11.5px;
  border-radius: var(--radius-sm);
}

.deck-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-right: 4px;
  font-weight: 500;
}

.marker-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.marker-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}
.marker-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.marker-chip .del-marker {
  color: var(--text-muted);
  font-size: 11px;
  padding-left: 4px;
}
.marker-chip .del-marker:hover {
  color: var(--accent);
}

/* ==================== ADMIN PANEL LAYOUT ==================== */
.admin-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
}

.admin-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition);
}
.admin-tab:hover {
  color: var(--text-primary);
}
.admin-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.015);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  height: 38px;
  padding: 0 12px;
  background: var(--bg-body);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}
.form-input:focus {
  border-color: var(--border-focus);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* ==================== iOS FROSTED GLASS MOBILE BOTTOM NAV ==================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 480px;
  height: 62px;
  background: rgba(15, 18, 28, 0.72);
  backdrop-filter: blur(32px) saturate(210%);
  -webkit-backdrop-filter: blur(32px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  box-shadow: 
    0 16px 42px rgba(0, 0, 0, 0.65),
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.28),
    inset 0 -1px 1px rgba(0, 0, 0, 0.4);
  z-index: 120;
  padding: 0 6px;
  justify-content: space-around;
  align-items: center;
  transition: transform 0.25s ease, background 0.25s ease;
}

.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  color: rgba(255, 255, 255, 0.52);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.15px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 2px;
  border-radius: 24px;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.mob-nav-item span {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

.mob-nav-item svg {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease, stroke 0.2s ease;
}

.mob-nav-item:active {
  transform: scale(0.88);
}

.mob-nav-item:hover {
  color: rgba(255, 255, 255, 0.85);
}

.mob-nav-item.active {
  color: #ff3366;
  background: rgba(255, 51, 102, 0.14);
  border-color: rgba(255, 51, 102, 0.28);
  box-shadow: 0 0 16px rgba(255, 51, 102, 0.22);
}

.mob-nav-item.active svg {
  stroke: #ff3366;
  filter: drop-shadow(0 0 8px rgba(255, 51, 102, 0.6));
  transform: translateY(-1px);
}

.mob-nav-item.active span {
  font-weight: 700;
  color: #fff;
  letter-spacing: 0px;
}

/* Spinner */
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== FOLDER EXPLORER & VISUAL FOLDER CARDS ==================== */
.folder-browser-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 14px;
  transition: var(--transition);
}

.folder-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
  color: #fff;
  background: var(--bg-body);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.folder-title-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: #fff;
}
.folder-browser-panel.is-expanded .folder-title-btn {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.folder-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  border-bottom: none;
}

/* Expanded state adds room for the grid */
.folder-browser-panel.is-expanded {
  padding: 12px 14px 14px;
}

.folder-browser-panel.is-expanded .folder-nav-header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.crumb-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-body);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb-item:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-elevated);
}
.crumb-item.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.crumb-sep {
  color: var(--text-muted);
  font-size: 11px;
  user-select: none;
}

.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.folder-card {
  background: var(--bg-body);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.folder-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  background: var(--bg-elevated);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.folder-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #0c0e16;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

/* 2x2 Collage inside Folder Preview */
.folder-collage-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1.5px;
  width: 100%;
  height: 100%;
  background: #07080d;
}
.folder-collage-4 img,
.folder-collage-2 img,
.folder-single-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.folder-collage-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5px;
  width: 100%;
  height: 100%;
  background: #07080d;
}
.folder-card:hover .folder-single-img {
  transform: scale(1.04);
}

.folder-preview-badges {
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.folder-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(9, 10, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 10px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.folder-count-pill {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(225, 29, 72, 0.92);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.folder-body {
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 3px;
}

.folder-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.folder-card:hover .folder-name {
  color: #fff;
}

.folder-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.folder-quick-play {
  position: absolute;
  inset: 0;
  background: rgba(9, 10, 15, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: var(--transition);
}
.folder-card:hover .folder-quick-play {
  opacity: 1;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
@media (max-width: 1280px) {
  .movies-grid,
  .folders-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1024px) {
  .movies-grid,
  .folders-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .player-layout {
    grid-template-columns: 1fr;
  }
  .metrics-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
  .site-header {
    background: rgba(13, 16, 25, 0.75) !important;
    backdrop-filter: blur(28px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 -1px 0 rgba(255, 255, 255, 0.08) !important;
  }
  .site-header .search-field {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-radius: 9999px !important;
    color: #fff !important;
  }
  .site-header .btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 9999px;
  }
  .site-header .btn-primary {
    background: linear-gradient(135deg, #ff2a55 0%, #e11d48 100%) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 3px 12px rgba(225, 29, 72, 0.4) !important;
  }
  .app-container {
    padding: 0 14px;
  }
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 0;
    gap: 10px;
  }
  .header-search {
    order: 3;
    max-width: 100%;
    flex: 1 1 100%;
  }
  .nas-badge span.nas-host-label,
  .hide-below-md,
  .hide-on-mobile {
    display: none !important;
  }
  .show-on-mobile-inline {
    display: inline !important;
  }
  .player-header-inner,
  .admin-top-header-inner {
    flex-wrap: nowrap !important;
  }
  .player-back-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .admin-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 14px 0;
  }
  .admin-header-bar h1 {
    font-size: 16.5px !important;
    line-height: 1.35;
  }
  .admin-header-bar p {
    font-size: 12px !important;
    line-height: 1.4;
  }
  .admin-header-bar > div:last-child {
    width: 100%;
  }
  .admin-header-bar #adm-btn-scan {
    width: 100%;
    justify-content: center;
  }
  .panel-card {
    padding: 14px;
    margin-bottom: 14px;
  }
  .panel-title {
    font-size: 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .admin-tabs {
    margin-bottom: 16px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .admin-tabs::-webkit-scrollbar {
    display: none;
  }
  .admin-tab {
    padding: 8px 12px;
    font-size: 12.5px;
    flex-shrink: 0;
  }
  .movies-grid,
  .folders-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .metrics-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .hero-card {
    min-height: 220px;
  }
  .hero-body {
    padding: 18px;
  }
  .hero-title {
    font-size: 17px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .mobile-bottom-nav {
    display: flex;
  }
}

/* ==================== CONTINUE WATCHING SHELF ==================== */
.continue-watching-section {
  margin-bottom: 20px;
}

.continue-watching-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.continue-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.continue-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.continue-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  display: block;
}

.continue-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.continue-card:hover .continue-poster {
  transform: scale(1.04);
}

.continue-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.continue-card:hover .continue-overlay {
  opacity: 1;
}

.continue-play-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.5);
}

.continue-dismiss-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #bbb;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  z-index: 5;
  transition: background 0.2s, color 0.2s;
}

.continue-dismiss-btn:hover {
  background: var(--accent);
  color: #fff;
}

.continue-badge-rem {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 4;
}

.continue-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.continue-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.continue-title:hover {
  color: var(--accent);
}

.continue-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==================== RESUME PROMPT & BUFFER INDICATORS ==================== */
.resume-prompt-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(229, 9, 20, 0.12);
  border: 1px solid rgba(229, 9, 20, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-primary);
  flex-wrap: wrap;
  animation: fadeInDown 0.3s ease;
}

.resume-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 8px var(--accent);
}

.buffer-indicator-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 500;
  color: #e2e8f0;
  z-index: 15;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: opacity 0.3s ease, background 0.3s ease;
}

.buffer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.buffer-dot.buffering {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  animation: pulse 0.9s infinite alternate ease-in-out;
}

.buffer-dot.error {
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e;
}

.buffer-speed-badge {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
}

@keyframes pulse {
  from { opacity: 0.5; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.1); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== LOGIN MODAL ==================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.is-active,
.modal-backdrop.open {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.modal-content-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7);
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.modal-backdrop.is-active .modal-content-card {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: #fff;
  border-color: var(--border-focus);
}

/* ==================== PLAYER SEMANTIC LAYOUT CLASSES ==================== */
.player-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}

.player-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.player-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.player-header-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.player-header-name,
.player-header-sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.deck-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.deck-toggle-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.deck-toggle-summary {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-toggle-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 600;
  flex-shrink: 0;
}

.deck-seek-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.player-meta-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.player-meta-title-wrap {
  min-width: 0;
  flex: 1;
}

.player-movie-title {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  word-break: break-word;
}

.player-action-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.player-info-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
}

.player-stream-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.player-stream-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.player-nas-path {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  word-break: break-all;
}

.jav-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  background: var(--bg-surface);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* ==================== ACTRESS SHOWCASE & RELATED TABS ==================== */
.actress-showcase-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.actress-showcase-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.actress-showcase-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  background: #0d0f17;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.4);
}

.actress-showcase-info {
  min-width: 0;
  flex: 1;
}

.actress-showcase-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.actress-showcase-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.actress-showcase-badge {
  display: inline-block;
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}

.actress-view-all-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: rgba(225, 29, 72, 0.12);
  color: var(--accent);
  border: 1px solid rgba(225, 29, 72, 0.35);
  transition: var(--transition);
}

.actress-view-all-btn:hover {
  background: var(--accent);
  color: #fff;
}

.related-tabs-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.related-tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.related-tab-btn:hover {
  color: #fff;
  border-color: var(--border-focus);
}

.related-tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.4);
}

.related-card-item {
  display: flex;
  flex-direction: row;
  height: 88px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}

.related-card-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.related-card-thumb {
  width: 136px;
  height: 100%;
  position: relative;
  flex-shrink: 0;
  background: #0d0f17;
  overflow: hidden;
}

.related-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.related-card-item:hover .related-card-img {
  transform: scale(1.05);
}

.related-card-details {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  flex: 1;
}

.related-card-actress {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-card-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.related-card-item:hover .related-card-title {
  color: #fff;
}

.related-card-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-stage.hide-controls .buffer-indicator-pill {
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* ==================== SMALL SCREEN & MOBILE REFINEMENTS ==================== */
@media (max-width: 1024px) {
  .metrics-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .hide-below-lg {
    display: none !important;
  }
  .related-movies-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .continue-card {
    flex: 0 0 190px;
  }
  .continue-media {
    aspect-ratio: 16 / 9;
  }

  /* Player Header Compact Single Row */
  .player-header-inner {
    height: 50px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .btn-label-desktop {
    display: none !important;
  }
  .player-back-btn {
    padding: 6px 10px;
  }
  .player-header-code {
    font-size: 12.5px;
  }
  .player-header-name,
  .player-header-sub {
    font-size: 12.5px;
  }

  /* Video Stage & Overlays on Mobile */
  .video-stage {
    border-radius: var(--radius-sm);
  }
  .buffer-indicator-pill {
    top: 8px;
    left: 8px;
    right: auto;
    padding: 3px 8px;
    font-size: 10px;
  }
  .tap-play-btn,
  .tap-play-circle {
    width: 56px;
    height: 56px;
  }
  .tap-play-btn svg,
  .tap-play-circle svg {
    width: 24px;
    height: 24px;
  }
  .tap-play-text,
  .tap-play-label {
    padding: 4px 10px;
    font-size: 11.5px;
  }

  /* Pro Player Control Deck on Mobile */
  .deck-toggle-bar {
    padding: 8px 10px;
  }
  .deck-toggle-summary {
    display: none;
  }
  .player-control-deck,
  .player-control-deck .deck-body {
    padding: 10px;
    gap: 8px;
  }
  .player-control-deck .deck-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .player-control-deck .deck-group {
    width: 100%;
    justify-content: space-between;
  }
  .deck-seek-group {
    flex-direction: column;
    align-items: stretch !important;
    gap: 6px;
  }
  .deck-seek-btns {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    width: 100%;
  }
  .deck-seek-btns .btn,
  .deck-seek-btns .deck-btn {
    padding: 6px 0;
    text-align: center;
    justify-content: center;
    font-size: 11.5px;
  }
  .player-control-deck .btn.btn-sm,
  .player-control-deck .select-control,
  .player-control-deck .deck-btn,
  .player-control-deck .deck-select {
    min-height: 32px;
    font-size: 12px;
  }

  /* Movie Meta & Actions on Mobile */
  .player-meta-section,
  .player-synopsis-card,
  .player-meta-card {
    padding: 12px;
  }
  .player-meta-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .player-movie-title {
    font-size: 16px;
  }
  .player-action-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
  }
  .player-action-btns .btn {
    justify-content: center;
    padding: 7px 6px;
    font-size: 11.5px;
    white-space: nowrap;
  }
  .player-info-strip {
    gap: 8px 14px;
    font-size: 12px;
  }
  .player-stream-row {
    flex-direction: column;
    align-items: stretch;
  }
  .player-stream-btns {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 6px;
  }
  .player-stream-btns .deck-label {
    width: 100%;
    font-size: 11.5px;
    margin-bottom: 2px;
    color: var(--text-muted);
  }
  .player-stream-btns .btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    font-size: 11px;
    padding: 6px 6px;
    white-space: nowrap;
  }

  .movie-synopsis-box {
    padding: 12px !important;
  }
  .jav-meta-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px 10px;
  }

  /* Home Page Folder Panel & Filter Bar on Mobile */
  .folder-browser-panel:not(.is-expanded) #folder-jump-select,
  .folder-browser-panel:not(.is-expanded) #folder-sort-select {
    display: none;
  }
  .toolbar-right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .toolbar-right .select-control {
    width: 100%;
  }
  .filter-pills {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .filter-pills::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 640px) {
  .related-movies-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .related-card {
    padding: 6px;
    gap: 10px;
  }
  .related-thumb {
    width: 116px;
  }

  /* YouTube Custom Controls on Mobile Phones */
  .yt-controls-gradient {
    height: 96px;
  }
  .yt-timeline-container {
    padding: 10px 10px 4px;
  }
  .yt-progress-bar {
    height: 5px;
  }
  .yt-scrubber-thumb {
    transform: translateY(-50%) scale(0.85);
    width: 13px;
    height: 13px;
  }
  .yt-controls-bar {
    padding: 0 8px 6px;
    gap: 4px;
  }
  .yt-controls-left,
  .yt-controls-right {
    gap: 2px;
  }
  .yt-control-btn {
    width: 30px;
    height: 30px;
  }
  .yt-control-btn svg {
    width: 16px;
    height: 16px;
  }
  .yt-volume-slider {
    display: none !important;
  }
  .yt-time-display {
    font-size: 11px;
    margin-left: 4px;
  }
  .yt-preview-card {
    width: 148px;
    bottom: 22px;
  }
  .yt-preview-time-badge {
    font-size: 10.5px;
    padding: 2px 4px;
  }
}

@media (max-width: 480px) {
  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-bottom-nav {
    width: calc(100% - 18px);
    height: 58px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding: 0 4px;
  }
  .mob-nav-item {
    height: 44px;
    font-size: 9.5px;
    border-radius: 22px;
  }
  .app-container {
    padding: 0 14px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }
  .site-header {
    margin-bottom: 10px;
  }
  .header-inner {
    gap: 8px;
  }
  .brand-text {
    font-size: 15px;
  }
  .brand-sub,
  .hide-on-xs,
  .yt-hide-xs {
    display: none !important;
  }
  .metrics-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .metric-box {
    padding: 10px;
    border-radius: var(--radius-md);
  }
  .metric-label {
    font-size: 10.5px;
  }
  .metric-value {
    font-size: 14px;
  }
  .hero-card {
    min-height: 180px;
    border-radius: var(--radius-md);
  }
  .hero-body {
    padding: 14px;
  }
  .hero-title {
    font-size: 15px;
    line-height: 1.35;
  }
  .hero-subtitle {
    font-size: 11.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero-actions .btn {
    padding: 7px 12px;
    font-size: 12px;
  }
  .continue-card {
    flex: 0 0 160px;
    border-radius: var(--radius-md);
  }
  .continue-title {
    font-size: 11.5px;
  }
  .movies-grid,
  .folders-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .movie-card {
    border-radius: var(--radius-md);
  }
  .card-poster {
    aspect-ratio: 16 / 10;
  }
  .card-body {
    padding: 8px;
  }
  .card-title-link {
    font-size: 11.5px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }
  .card-footer {
    font-size: 10px;
  }
  .tag {
    font-size: 9.5px;
    padding: 1.5px 5px;
  }
  .resume-prompt-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .resume-prompt-banner > div:last-child {
    display: flex;
    width: 100%;
    gap: 6px;
  }
  .resume-prompt-banner > div:last-child .btn {
    flex: 1;
    justify-content: center;
  }
  .player-action-btns .btn span {
    font-size: 11px;
  }
  .modal-dialog {
    padding: 14px;
    max-height: 92vh;
    overflow-y: auto;
  }
}

/* ==================== YOUTUBE-STYLE CUSTOM PLAYER & TIMELINE SCRUB PREVIEW ==================== */

.yt-controls-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 25;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.video-stage.hide-controls .yt-controls-overlay {
  opacity: 0;
  pointer-events: none;
}
.video-stage.hide-controls {
  cursor: none;
}

.yt-controls-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.45) 55%, transparent 100%);
  pointer-events: none;
}

/* Timeline Container */
.yt-timeline-container {
  position: relative;
  width: 100%;
  padding: 14px 16px 6px;
  cursor: pointer;
  pointer-events: auto;
  z-index: 30;
}

.yt-progress-bar {
  position: relative;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  transition: height 0.15s ease;
}
.yt-timeline-container:hover .yt-progress-bar,
.yt-timeline-container.is-scrubbing .yt-progress-bar {
  height: 8px;
}

.yt-progress-bg {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.22);
  border-radius: inherit;
}

.yt-progress-buffered {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.42);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.yt-progress-hover {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.28);
  border-radius: inherit;
  pointer-events: none;
}

.yt-progress-played {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: #e11d48;
  border-radius: inherit;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.6);
}

.yt-scrubber-thumb {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 15px;
  height: 15px;
  background: #fff;
  border: 3px solid #e11d48;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.yt-timeline-container:hover .yt-scrubber-thumb,
.yt-timeline-container.is-scrubbing .yt-scrubber-thumb {
  transform: translateY(-50%) scale(1);
}

/* ==================== YOUTUBE PREVIEW TOOLTIP ==================== */
.yt-preview-card {
  position: absolute;
  bottom: 28px;
  transform: translateX(-50%);
  width: 196px;
  background: #090b10;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.12s ease;
}

.yt-preview-thumb-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-preview-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yt-preview-spinner {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-preview-time-badge {
  text-align: center;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
  background: #0e111a;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  letter-spacing: 0.5px;
}

/* Controls Bottom Bar */
.yt-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 14px 10px;
  color: #fff;
  pointer-events: auto;
  z-index: 30;
}

.yt-controls-left,
.yt-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.yt-control-btn {
  background: none;
  border: none;
  color: #f1f5f9;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}
.yt-control-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: scale(1.08);
}
.yt-control-btn:active {
  transform: scale(0.95);
}

.yt-volume-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.yt-volume-slider {
  width: 0;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.2s ease;
  accent-color: #e11d48;
  height: 4px;
  cursor: pointer;
}
.yt-volume-group:hover .yt-volume-slider,
.yt-volume-slider:focus {
  width: 64px;
  opacity: 1;
}

.yt-time-display {
  font-size: 12.5px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: #e2e8f0;
  margin-left: 6px;
  white-space: nowrap;
}

/* ==================== ACTRESS HUB MODAL & CARDS ==================== */
.actress-hub-dialog {
  max-width: 960px;
  width: 95%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.actress-hub-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.actress-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  overflow-y: auto;
  max-height: 55vh;
  padding-right: 4px;
}

.actress-hub-card {
  background: var(--bg-body);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.actress-hub-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.25);
}

.actress-hub-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  border: 2px solid var(--border-subtle);
  background: #0d0f17;
}

.actress-hub-card:hover .actress-hub-avatar {
  border-color: var(--accent);
}

.actress-hub-name {
  font-weight: 700;
  font-size: 12.5px;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.actress-hub-count {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

/* ==================== PLAYLISTS MODAL & LIST ==================== */
.playlists-dialog {
  max-width: 600px;
  width: 95%;
  max-height: 85vh;
}

.playlists-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
}

.playlist-card-item {
  background: var(--bg-body);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.playlist-card-item:hover {
  background: var(--bg-surface);
  border-color: var(--border-focus);
}

/* ==================== STAR RATING & PRIVATE NOTES ==================== */
.player-user-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.star-rating-box {
  display: inline-flex;
  gap: 4px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.star-item {
  color: #475569;
  transition: color 0.15s ease, transform 0.15s ease;
}

.star-item:hover,
.star-item.active {
  color: #f59e0b;
}

.star-item:hover {
  transform: scale(1.2);
}

/* ==================== HOTKEYS GUIDE MODAL ==================== */
.hotkeys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.hotkey-item {
  background: var(--bg-body);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.hotkey-item kbd {
  background: #1e293b;
  color: #f8fafc;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid #475569;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  box-shadow: 0 2px 0 #0f172a;
  flex-shrink: 0;
}

/* ==========================================================================
   SAMSUNG GALAXY FOLD (FOLD 7 / 6 / 5) TAILORED RESPONSIVE OPTIMIZATION
   Cover Screen (จอนอก: ~375px - 412px, 21.5:9 Ultra-Tall Narrow)
   Main Screen (จอใน: ~768px - 884px, Square/Tablet Aspect Ratio & Flex Mode)
   ========================================================================== */

/* -------------------------------------------------------------
   1. COVER SCREEN (จอนอก: Folded Narrow & Tall 375px - 430px)
   ------------------------------------------------------------- */
@media screen and (max-width: 430px) {
  :root {
    --safe-bottom: env(safe-area-inset-bottom, 14px);
    --safe-top: env(safe-area-inset-top, 0px);
  }

  body {
    padding-bottom: calc(78px + var(--safe-bottom));
  }

  /* iOS Frosted Glass Capsule Dock for Cover Screen */
  .mobile-bottom-nav {
    width: calc(100% - 16px);
    max-width: 396px;
    height: 56px;
    bottom: calc(6px + var(--safe-bottom));
    padding: 0 4px;
    background: rgba(15, 18, 28, 0.75);
    backdrop-filter: blur(28px) saturate(210%);
    -webkit-backdrop-filter: blur(28px) saturate(210%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9999px;
    box-shadow: 
      0 12px 36px rgba(0, 0, 0, 0.7),
      0 3px 8px rgba(0, 0, 0, 0.35),
      inset 0 1px 1px rgba(255, 255, 255, 0.28),
      inset 0 -1px 1px rgba(0, 0, 0, 0.4);
  }

  .mob-nav-item {
    height: 42px;
    font-size: 9px;
    gap: 1.5px;
    border-radius: 20px;
  }
  .mob-nav-item svg {
    width: 16px;
    height: 16px;
  }

  .app-container {
    padding: 0 12px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  /* Compact Responsive Header for Narrow Cover Screen */
  .site-header {
    margin-bottom: 8px;
    padding-top: var(--safe-top);
    background: rgba(13, 16, 25, 0.75) !important;
    backdrop-filter: blur(28px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 -1px 0 rgba(255, 255, 255, 0.08) !important;
  }

  .header-inner {
    height: auto;
    padding: 6px 0;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .brand-link {
    gap: 6px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .brand-text {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: -0.3px;
    white-space: nowrap;
  }

  .brand-sub,
  .nas-badge span.nas-host-label,
  .admin-header-subtitle,
  .hide-on-xs,
  .hide-below-md,
  .hide-on-mobile {
    display: none !important;
  }

  /* Prevent Word Wrapping / Awkward Line Breaks on Small Screens */
  .btn,
  .btn span,
  .tag,
  .filter-btn,
  .filter-btn span,
  .admin-tab,
  .admin-tab span,
  .related-tab-btn,
  .related-tab-btn span,
  .variant-pill-btn,
  .player-back-btn,
  .player-back-btn span,
  .nas-badge,
  .folder-title-btn,
  .crumb-item {
    white-space: nowrap !important;
    word-break: keep-all !important;
  }

  .metric-box {
    padding: 8px 10px;
    min-width: 0;
    gap: 6px;
  }
  .metric-box > div {
    min-width: 0;
    flex: 1;
  }
  .metric-label {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .metric-value {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .section-header {
    gap: 8px;
    flex-wrap: nowrap;
  }
  .section-title {
    font-size: 13px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .section-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-body {
    padding: 14px;
    width: 100%;
  }
  .hero-title {
    font-size: 15.5px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }
  .hero-subtitle {
    font-size: 11.5px;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero-actions {
    gap: 8px;
    flex-wrap: nowrap;
  }
  .hero-actions .btn {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
    font-size: 12px;
  }

  /* Resume Banner & Actress Showcase on Small Screens */
  .resume-prompt-banner {
    padding: 10px 12px;
    font-size: 12px;
    gap: 8px;
  }
  .resume-prompt-banner > div:last-child {
    width: 100%;
    display: flex;
    gap: 6px;
  }
  .resume-prompt-banner > div:last-child .btn {
    flex: 1;
    justify-content: center;
  }

  .actress-showcase-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .actress-showcase-header .btn {
    width: 100%;
    justify-content: center;
  }

  .related-tabs-bar {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 4px;
    scrollbar-width: none;
  }
  .related-tabs-bar::-webkit-scrollbar {
    display: none;
  }
  .related-tab-btn {
    flex: 1 0 auto;
    padding: 6px 10px;
    font-size: 11.5px;
  }

  /* Admin Storage & Cards on Narrow Screens */
  .admin-storage-grid {
    gap: 6px !important;
  }
  .admin-storage-box {
    padding: 8px 4px !important;
  }
  .admin-storage-label {
    font-size: 10px !important;
  }
  #ov-disk-total,
  #ov-disk-used,
  #ov-disk-free {
    font-size: 13px !important;
  }

  .header-actions {
    gap: 6px;
  }

  .nas-badge {
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }

  .header-search {
    order: 3;
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .search-field {
    height: 35px !important;
    font-size: 12px !important;
    padding: 0 28px 0 32px !important;
    border-radius: 9999px !important;
  }

  .search-icon {
    left: 10px !important;
    width: 13px !important;
    height: 13px !important;
  }

  /* Cover Screen Catalog Grid: Perfectly balanced 2-column layout inside container */
  .movies-grid,
  .folders-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }

  .movie-card {
    border-radius: var(--radius-md);
  }

  .card-poster {
    aspect-ratio: 16 / 10;
  }

  .card-body {
    padding: 6px 7px;
    gap: 3px;
  }

  .card-subline {
    font-size: 10px;
    gap: 4px;
  }

  .card-title-link {
    font-size: 11px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    margin-bottom: 2px;
  }

  .card-footer {
    font-size: 9.5px;
    padding-top: 3px;
  }

  /* Tag wrapping on Cover Screen cards */
  .card-badges-top {
    top: 5px;
    left: 5px;
    right: 5px;
    gap: 3px;
  }

  .tag {
    font-size: 9px;
    padding: 1.5px 4.5px;
    border-radius: 3px;
  }

  /* Filter pills with momentum scrolling */
  .filter-pills {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 4px 0 8px 0;
    scrollbar-width: none;
  }
  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  /* Cover Screen Video Player */
  .player-layout {
    margin-top: 6px;
    gap: 10px;
  }

  .video-stage {
    border-radius: var(--radius-md) !important;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  }

  /* Cover Screen Variant Switcher (FHD / HD / Parts) */
  .variants-selector-card {
    padding: 8px 10px;
    gap: 5px;
    margin-top: 8px;
    border-radius: var(--radius-md);
  }

  .variants-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .variants-title {
    font-size: 11.5px;
    gap: 5px;
  }

  .variants-hint {
    font-size: 10px;
    opacity: 0.8;
  }

  .variants-btn-group {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .variants-btn-group::-webkit-scrollbar {
    display: none;
  }

  .variant-pill-btn {
    flex-shrink: 0;
    font-size: 11px;
    padding: 4px 10px;
    gap: 4px;
    border-radius: 9999px;
  }

  /* Stream Row: 3 Equal Buttons Spanning Full Width */
  .player-stream-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-top: 8px;
  }

  .player-stream-btns {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 5px;
  }

  .player-stream-btns .deck-label {
    width: 100%;
    font-size: 11px;
    margin-bottom: 2px;
    color: var(--text-muted);
  }

  .player-stream-btns .btn {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    justify-content: center;
    font-size: 10px;
    padding: 6px 2px;
    white-space: nowrap;
    border-radius: var(--radius-sm);
  }

  .player-nas-path {
    font-size: 9.5px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Pro Control Deck on Cover Screen */
  .deck-toggle-bar {
    padding: 7px 10px;
  }
  .deck-toggle-title {
    font-size: 12px;
  }
  .deck-toggle-summary {
    display: none;
  }

  .player-control-deck {
    padding: 8px;
    gap: 6px;
  }

  /* Metadata & Actions */
  .player-meta-top {
    flex-direction: column;
    gap: 8px;
  }

  .player-movie-title {
    font-size: 14px;
    line-height: 1.35;
  }

  .player-action-btns {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
  }

  .player-action-btns .btn {
    width: 100%;
    font-size: 11.5px !important;
    padding: 8px 6px !important;
    justify-content: center !important;
    text-align: center;
    border-radius: var(--radius-sm);
  }

  /* Catalog Toolbar Badges & Selects */
  .toolbar-right {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .toolbar-right #active-playlist-badge,
  .toolbar-right #active-actress-badge,
  .toolbar-right #active-folder-badge,
  .toolbar-right #btn-clear-history {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    display: flex;
    justify-content: space-between;
  }

  .toolbar-right .select-control {
    width: 100%;
    font-size: 11.5px;
    height: 32px;
    padding: 0 6px;
  }

  /* Responsive Modals on Cover Screen */
  .actress-hub-toolbar {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .actress-hub-toolbar .form-input,
  .actress-hub-toolbar .select-control {
    width: 100% !important;
  }
  .actress-hub-dialog,
  .playlists-dialog {
    width: calc(100vw - 20px) !important;
    max-width: 100% !important;
    padding: 16px 12px !important;
    max-height: 86vh !important;
  }
  .actress-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .player-info-strip {
    font-size: 11.5px;
    gap: 6px 12px;
  }

  .jav-meta-grid {
    grid-template-columns: repeat(2, 1fr);
    font-size: 11px;
    gap: 6px;
    padding: 8px;
  }

  /* Related Works List on Cover Screen: Compact horizontal card */
  .related-movies-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .related-card-item {
    gap: 10px;
  }

  .related-card-thumb {
    width: 110px;
    flex-shrink: 0;
  }

  .related-card-title {
    font-size: 11px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }
}

/* -------------------------------------------------------------
   2. MAIN SCREEN (จอใน: Unfolded Square-ish Tablet 680px - 960px)
   ------------------------------------------------------------- */
@media screen and (min-width: 680px) and (max-width: 960px) {
  /* Catalog: 3 columns at ~700-800px, 4 columns at 820px+ */
  .movies-grid,
  .folders-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .card-poster {
    aspect-ratio: 16 / 10;
  }

  .card-title-link {
    font-size: 12.5px;
    line-height: 1.38;
  }

  /* Metrics Strip: 4 items neatly side-by-side in single row */
  .metrics-strip {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px;
  }
  .metric-box {
    padding: 10px 12px;
  }
  .metric-value {
    font-size: 16px;
  }

  /* Hero Featured Banner on Unfolded Screen */
  .hero-card {
    min-height: 220px;
    border-radius: var(--radius-md);
  }
  .hero-body {
    padding: 22px;
  }
  .hero-title {
    font-size: 20px;
    line-height: 1.35;
  }
  .hero-subtitle {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  /* Fold Unfolded Player Page: Proportional video height (does not monopolize square screen) */
  .player-layout {
    grid-template-columns: 1fr !important;
    gap: 16px;
    margin-top: 12px;
  }

  .video-stage {
    aspect-ratio: 16 / 9;
    max-height: 52vh;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  }

  /* Fold Unfolded Video Controls & Deck */
  .player-deck-container {
    margin-top: 10px;
  }

  .deck-toggle-summary {
    display: inline;
    font-size: 12px;
  }

  .variants-selector-card {
    padding: 10px 14px;
    gap: 8px;
    margin-top: 10px;
  }
  .variants-title {
    font-size: 13px;
  }
  .variant-pill-btn {
    font-size: 12px;
    padding: 5px 12px;
  }

  .player-stream-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .player-stream-btns .btn {
    font-size: 11.5px;
    padding: 6px 12px;
  }

  /* Related Works Grid on Unfolded Screen: 2 to 3 columns of cards */
  .related-movies-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .related-card-item {
    gap: 12px;
    padding: 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
  }

  .related-card-thumb {
    width: 130px;
    flex-shrink: 0;
  }

  .related-card-title {
    font-size: 12px;
    line-height: 1.35;
  }

  .jav-meta-grid {
    grid-template-columns: repeat(3, 1fr);
    font-size: 12px;
    gap: 10px;
  }
}

@media screen and (min-width: 820px) and (max-width: 960px) {
  .movies-grid,
  .folders-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .related-movies-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px;
  }
}

/* -------------------------------------------------------------
   3. FOLD FLEX MODE (Partially Folded / Tabletop L-Shape Mode)
   Ratio close to 1:1, phone bent 90-120 degrees on desk
   ------------------------------------------------------------- */
@media screen and (min-width: 600px) and (max-width: 960px) and (min-aspect-ratio: 10/12) and (max-aspect-ratio: 12/10) {
  /* Upper half: Video Stage stays locked in top portion */
  .video-stage {
    max-height: 48vh;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  /* Lower half: Acts as control panel console on bottom surface */
  .variants-selector-card {
    background: rgba(17, 19, 26, 0.98);
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  }

  .player-control-deck {
    background: rgba(17, 19, 26, 0.98);
  }
}
