/* ══════════════════════════════════════════════════════════════════════
   TikTok Exclusive — Monochrome Pro UI
   Pure Black & White Media Command Deck
   ══════════════════════════════════════════════════════════════════════ */

/* ── Reset & Variables ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Monochrome Surfaces */
  --bg-deep:       #000000;
  --bg-canvas:     #09090b;
  --bg-card:       #121214;
  --bg-card-hover: #18181b;
  --bg-elevated:   #202024;
  --bg-input:      #09090b;
  --bg-dock:       rgba(18, 18, 20, 0.94);

  /* Monochrome Borders */
  --border-subtle: #27272a;
  --border-light:  rgba(255, 255, 255, 0.1);
  --border-hover:  #3f3f46;
  --border-active: #ffffff;

  /* Typography */
  --text-primary:  #ffffff;
  --text-secondary:#a1a1aa;
  --text-muted:    #71717a;
  --text-inverted: #000000;

  /* Pure Monochrome Accents */
  --white:         #ffffff;
  --black:         #000000;

  /* Geometry */
  --radius-xs:     4px;
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-full:   9999px;

  /* Transitions */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --duration:      180ms;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  position: relative;
  background: var(--bg-deep);
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--white);
  color: var(--black);
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ── App Layout ── */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
}

.topbar-inner {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-header-row {
  display: contents;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  user-select: none;
}

.brand-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon {
  width: 18px;
  height: 18px;
  color: var(--black);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-title strong {
  font-weight: 800;
}

.brand-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.nav-label-short {
  display: none;
}

.nav-label-full {
  display: inline-block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: all var(--duration) var(--ease-out);
}

.nav-icon {
  width: 14px;
  height: 14px;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.nav-item.is-active {
  color: var(--black);
  background: var(--white);
}

.topbar-session {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.session-pill.is-online {
  color: var(--white);
}

.session-pill.is-offline {
  color: var(--text-muted);
}

.pulse-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
}

.offline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  background: transparent;
}

/* ── Buttons (Black & White) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
  background: #e4e4e7;
  border-color: #e4e4e7;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--white);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-danger:hover:not(:disabled) {
  color: var(--white) !important;
  background: var(--bg-card-hover) !important;
  border-color: var(--white) !important;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ── Main Container ── */
.main-content {
  flex: 1;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 24px 32px 100px;
}

/* ── Auth Alert Banner ── */
.auth-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 24px;
}

.auth-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-banner-icon {
  color: var(--white);
  flex-shrink: 0;
}

.auth-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--white);
}

.auth-banner-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.auth-banner-desc code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-deep);
  color: var(--white);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* ═══════════════════════════════════════════════════════════
   COMMAND DECK
   ═══════════════════════════════════════════════════════════ */
.command-deck {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}

/* Mode Switch Tabs */
.deck-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.deck-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: all var(--duration) var(--ease-out);
}

.deck-tab:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.deck-tab.is-active {
  background: var(--bg-elevated);
  border-color: var(--white);
  color: var(--white);
}

.deck-tab.is-active .deck-tab-icon {
  color: var(--white);
}

.deck-tab-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease-out);
}

.deck-tab-content {
  display: flex;
  flex-direction: column;
}

.deck-tab-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.deck-tab-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.deck-tab.is-active .deck-tab-sub {
  color: var(--text-secondary);
}

/* Deck Card */
.deck-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.deck-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-header {
  margin-bottom: 2px;
}

.panel-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.panel-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.45;
}

/* High Contrast Input */
.input-glow-group {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 6px 4px 12px;
  transition: border-color var(--duration) var(--ease-out);
}

.input-glow-group:focus-within {
  border-color: var(--white);
}

.input-icon-slot {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  margin-right: 10px;
}

.at-symbol {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
}

.glow-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 0;
}

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

.action-field-btn {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.btn-spin-icon {
  flex-shrink: 0;
}

/* Sample Chips */
.sample-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.sample-label {
  color: var(--text-muted);
  font-weight: 600;
}

.sample-chip {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--white);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.sample-chip:hover {
  background: var(--bg-elevated);
  border-color: var(--white);
}

.sample-hint {
  color: var(--text-muted);
}

/* Direct Textarea */
.direct-input-wrap {
  display: flex;
  flex-direction: column;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px 6px;
  transition: border-color var(--duration) var(--ease-out);
}

.direct-input-wrap:focus-within {
  border-color: var(--white);
}

.direct-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
}

.direct-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
}

.direct-counter {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.direct-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

#direct-btn {
  height: 42px;
  padding: 0 24px;
  font-weight: 700;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Folder destination picker in Panel 3 */
.folder-destination-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 10px;
}

.destination-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.destination-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.destination-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dest-pill {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.dest-pill:hover {
  color: var(--white);
  border-color: var(--border-hover);
}

.dest-pill.is-active {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.dest-subpanel {
  margin-top: 4px;
}

.select-field {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 12.5px;
  padding: 8px 10px;
  outline: none;
  cursor: pointer;
}

.select-field:focus {
  border-color: var(--white);
}

/* ═══════════════════════════════════════════════════════════
   Custom Select Component (Obsidian Monolith Monochrome)
   ═══════════════════════════════════════════════════════════ */
.custom-select-wrap {
  position: relative;
  width: 100%;
  user-select: none;
}

.custom-select-trigger {
  width: 100%;
  min-height: 42px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  outline: none;
  text-align: left;
}

.custom-select-trigger:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.custom-select-trigger:focus-visible,
.custom-select-wrap.is-open .custom-select-trigger {
  border-color: var(--white);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
  background: var(--bg-card-hover);
}

.custom-select-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.custom-select-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.custom-select-wrap.is-open .custom-select-icon,
.custom-select-trigger:hover .custom-select-icon {
  color: var(--white);
}

.custom-select-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--white);
  font-size: 13px;
}

.custom-select-value.is-placeholder {
  color: var(--text-muted);
}

.custom-select-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  display: flex;
  align-items: center;
}

.custom-select-wrap.is-open .custom-select-arrow {
  transform: rotate(180deg);
  color: var(--white);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #121214;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 1050;
  padding: 6px;
  display: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.custom-select-wrap.is-open .custom-select-dropdown {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.custom-select-search {
  padding: 4px 6px 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.custom-select-search-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
}

.custom-select-search-inner:focus-within {
  border-color: var(--white);
}

.custom-select-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 12px;
  width: 100%;
}

.custom-select-search-input::placeholder {
  color: var(--text-muted);
}

.custom-select-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.custom-select-list::-webkit-scrollbar {
  width: 5px;
}
.custom-select-list::-webkit-scrollbar-track {
  background: transparent;
}
.custom-select-list::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}
.custom-select-list::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

.custom-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.12s ease;
  background: transparent;
  border: 1px solid transparent;
  outline: none;
  text-align: left;
  width: 100%;
}

.custom-select-item:hover,
.custom-select-item.is-highlighted {
  background: var(--bg-card-hover);
  color: var(--white);
}

.custom-select-item.is-selected {
  background: #18181b;
  border-color: var(--border-subtle);
  color: var(--white);
  font-weight: 600;
}

.custom-select-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.custom-select-item-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.12s ease;
}

.custom-select-item:hover .custom-select-item-icon,
.custom-select-item.is-selected .custom-select-item-icon {
  color: var(--white);
}

.custom-select-item-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-item-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-deep);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  line-height: 14px;
}

.custom-select-item.is-selected .custom-select-item-badge {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.custom-select-item-check {
  color: var(--white);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.12s ease;
}

.custom-select-item.is-selected .custom-select-item-check {
  opacity: 1;
  transform: scale(1);
}

.custom-select-empty {
  padding: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* Compact Custom Select (for Library Controls Bar) */
.custom-select-wrap.custom-select-compact {
  width: auto;
}

.custom-select-wrap.custom-select-compact .custom-select-trigger {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
  gap: 6px;
}

.custom-select-wrap.custom-select-compact .custom-select-trigger:hover {
  background: var(--bg-card-hover);
  color: var(--white);
}

.custom-select-wrap.custom-select-compact.has-selection .custom-select-trigger {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.custom-select-wrap.custom-select-compact.has-selection .custom-select-icon,
.custom-select-wrap.custom-select-compact.has-selection .custom-select-arrow {
  color: var(--black);
}

.custom-select-wrap.custom-select-compact.has-selection .custom-select-value {
  color: var(--black);
  font-weight: 700;
}

.custom-select-wrap.custom-select-compact .custom-select-dropdown {
  min-width: 220px;
  width: max-content;
  max-width: 320px;
  right: auto;
}

.custom-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Scan Progress */
.scan-progress-box {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.scan-progress-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.scan-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
}

.scan-status-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--white);
  font-family: 'JetBrains Mono', monospace;
}

.scan-progress-track {
  height: 3px;
  background: var(--bg-deep);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.scan-progress-fill {
  height: 100%;
  background: var(--white);
  border-radius: var(--radius-full);
  width: 30%;
  animation: mono-progress 1.6s ease-in-out infinite;
}

/* Scan Error Alert Card */
.scan-error-card {
  margin-top: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.scan-error-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 260px;
}

.scan-error-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: #18181b;
  border: 1px solid var(--border-subtle);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scan-error-text-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.scan-error-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
}

.scan-error-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.scan-error-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Direct Download Progress Card on Home */
.direct-download-progress-card {
  margin-top: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  animation: cardFadeIn 220ms ease;
}

.direct-dl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.direct-dl-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
}

.direct-dl-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.direct-dl-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.direct-dl-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
}

@keyframes mono-progress {
  0% { transform: translateX(-100%); width: 30%; }
  50% { width: 50%; }
  100% { transform: translateX(350%); width: 30%; }
}

/* ═══════════════════════════════════════════════════════════
   RESULTS SECTION
   ═══════════════════════════════════════════════════════════ */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.target-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.target-profile-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.target-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--white);
  object-fit: cover;
  background: var(--bg-deep);
}

.target-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.target-title-block {
  display: flex;
  flex-direction: column;
}

.target-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.target-handle {
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.target-stats-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  padding: 6px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-align: center;
  min-width: 76px;
}

.stat-chip-num {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--white);
}

.stat-chip-num.is-exclusive {
  color: var(--white);
}

.stat-chip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Filter Bar */
.results-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.filter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.filter-pill:hover {
  color: var(--white);
  background: var(--bg-card-hover);
}

.filter-pill.is-active {
  background: var(--white);
  color: var(--black);
}

.pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.pill-dot.is-exclusive { background: var(--black); }
.pill-dot.is-public { background: var(--text-muted); }

.filter-pill:not(.is-active) .pill-dot.is-exclusive {
  background: var(--white);
}

.pill-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: var(--border-light);
}

.filter-pill.is-active .pill-count {
  background: rgba(0, 0, 0, 0.15);
  color: var(--black);
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════
   VIDEO CARDS (Pure Monochrome)
   ═══════════════════════════════════════════════════════════ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.video-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--duration) var(--ease-out);
  cursor: pointer;
  user-select: none;
}

.video-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.video-card.is-selected {
  border-color: var(--white);
  box-shadow: 0 0 0 1px var(--white);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 14;
  background: var(--bg-deep);
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.05);
}

.card-img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-deep);
}

.card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 40%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}

/* Inverted White Exclusive Badge */
.card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.tag-exclusive {
  background: var(--white);
  color: var(--black);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 3px;
}

.tag-public {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.tag-downloaded {
  background: var(--bg-card);
  border: 1px solid var(--white);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  gap: 3px;
}

.pill-dot.is-undownloaded {
  background: var(--white);
}

.video-card.is-downloaded .card-img {
  opacity: 0.85;
}
/* Custom Checkbox */
.card-check-wrap {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease-out);
}

.video-card.is-selected .custom-checkbox {
  background: var(--white);
  border-color: var(--white);
}

.check-tick {
  width: 11px;
  height: 11px;
  color: var(--black);
  stroke-width: 3.5;
  display: none;
}

.video-card.is-selected .check-tick {
  display: block;
}

.card-overlay-meta {
  position: absolute;
  bottom: 6px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
}

.card-stat-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.card-duration {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.card-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-caption {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.card-date {
  font-size: 11px;
  color: var(--text-muted);
}

.single-dl-icon {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: var(--radius-xs);
}

.filter-empty-state {
  text-align: center;
  padding: 40px 16px;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   FLOATING ACTION DOCK
   ═══════════════════════════════════════════════════════════ */
.floating-action-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  width: calc(100% - 64px);
  max-width: 760px;
  animation: slideUp 200ms var(--ease-out);
}

@keyframes slideUp {
  from { transform: translate(-50%, 30px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.dock-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-dock);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-full);
  padding: 6px 10px 6px 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85);
  gap: 14px;
}

.dock-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dock-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}

.dock-badge-count {
  background: var(--white);
  color: var(--black);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 800;
}

.dock-total-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: 4px;
}

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

.dock-actions .btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.dock-actions .btn-primary {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.dock-actions .btn-ghost {
  border-color: var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
}

.dock-actions .btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--white);
  border-color: var(--border-hover);
}

.dock-segmented-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
}

.dock-seg-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  white-space: nowrap;
}

.dock-seg-pills {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
  line-height: 1.2;
}

.seg-btn:hover {
  color: var(--white);
}

.seg-btn.is-active {
  background: var(--white);
  color: var(--black);
  font-weight: 800;
}

.concurrency-select option,
.select-field option,
select option {
  background-color: #121214 !important;
  color: #ffffff !important;
  padding: 6px 10px;
}

/* Topbar Badge */
.nav-badge {
  background: var(--white);
  color: var(--black);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════
   DOWNLOADER MANAGER PAGE (Dedicated Tab)
   ═══════════════════════════════════════════════════════════ */
.downloader-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.downloader-top-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.downloader-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.downloader-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.downloader-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Active Progress Card */
.downloader-active-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.active-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.active-status-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.active-status-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.active-state-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  width: fit-content;
}

.active-task-desc {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.active-pct-display {
  display: flex;
  align-items: center;
}

.active-pct-num {
  font-size: 1.45rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: var(--white);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.dl-progress-track {
  height: 6px;
  background: var(--bg-deep);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.dl-progress-fill {
  height: 100%;
  background: var(--white);
  border-radius: var(--radius-full);
  transition: width 300ms var(--ease-out);
}

.dl-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 6px;
}

.dl-stat-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
}

.dl-stat-num {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--white);
}

.dl-stat-num.is-failed {
  color: var(--white);
  opacity: 0.8;
}

.dl-stat-num.is-skipped {
  color: var(--text-muted);
}

.dl-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

/* History Card */
.downloader-history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.history-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}

.history-count {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.history-filter-pills {
  display: flex;
  align-items: center;
  gap: 4px;
}

.history-table-container {
  min-height: 120px;
}

.history-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--duration) var(--ease-out);
}

.history-row:hover {
  border-color: var(--border-hover);
}

.history-col-status {
  flex-shrink: 0;
}

.history-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  display: inline-block;
  white-space: nowrap;
}

.hbadge-success {
  background: var(--white);
  color: var(--black);
}

.hbadge-failed {
  background: var(--bg-card);
  border: 1px solid var(--white);
  color: var(--white);
}

.hbadge-skipped {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.history-col-info {
  flex: 1;
  min-width: 0;
}

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

.history-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.history-folder-tag {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  color: var(--white);
  font-family: 'JetBrains Mono', monospace;
}

.history-time {
  font-family: 'JetBrains Mono', monospace;
}

.history-error-msg {
  color: var(--text-muted);
  font-style: italic;
}

.history-col-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

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

/* ═══════════════════════════════════════════════════════════
   TERMINAL DRAWER
   ═══════════════════════════════════════════════════════════ */
.download-section {
  margin-top: 32px;
}

.terminal-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-indicator.is-running {
  background: var(--white);
}

.terminal-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.terminal-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--white);
  border: 1px solid var(--border-subtle);
}

.terminal-screen {
  padding: 14px 18px;
  max-height: 260px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.terminal-line {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  word-break: break-all;
}

.terminal-line.log-info {
  color: var(--text-secondary);
}

.terminal-line.log-success {
  color: var(--white);
  background: var(--bg-card);
}

.terminal-line.log-error {
  color: #e4e4e7;
  border-left: 2px solid var(--text-muted);
  padding-left: 8px;
}

.terminal-line.log-done {
  color: var(--white);
  font-weight: 700;
  border-left: 2px solid var(--white);
  padding-left: 8px;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   LIBRARY
   ═══════════════════════════════════════════════════════════ */
.library-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.library-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.library-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.library-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.library-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.library-subtitle code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--white);
}

.library-stats-pill {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-md);
}

.stat-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
}

.stat-unit {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.library-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.library-controls-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.library-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.library-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  min-width: 240px;
}

.library-search-box:focus-within {
  border-color: var(--white);
}

.search-box-icon {
  color: var(--text-muted);
}

.library-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
}

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

.library-folder-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.folder-tag {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.folder-tag:hover {
  background: var(--bg-card-hover);
  color: var(--white);
}

.folder-tag.is-active {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.folder-tag-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  background: var(--bg-deep);
  color: var(--text-muted);
  padding: 0 5px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  line-height: 16px;
  height: 16px;
}

.folder-tag.is-active .folder-tag-badge {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* View Switcher */
.library-view-switcher {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.view-btn:hover {
  color: var(--white);
}

.view-btn.is-active {
  background: var(--white);
  color: var(--black);
}

/* Library Container */
.library-container.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.library-container.view-grid .file-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.library-container.view-grid .file-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.library-container.view-grid .file-card.is-selected {
  border-color: var(--white);
  box-shadow: 0 0 0 1px var(--white);
}

.library-container.view-grid .file-check-box {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-xs);
  padding: 3px;
}

.library-container.view-grid .file-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 14;
  background: var(--bg-deep);
  border: none;
  border-radius: 0;
  overflow: hidden;
  display: block;
}

.file-thumb-img,
.file-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.library-container.view-grid .file-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  opacity: 0;
  transition: all var(--duration) var(--ease-out);
  pointer-events: none;
}

.library-container.view-grid .file-card:hover .file-play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.08);
}

.library-container.view-grid .file-format-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--white);
}

/* ── Google Drive Card Badge & Indicators ── */
.file-gdrive-badge,
.file-storage-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 10, 12, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--white);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: all 0.15s ease;
  white-space: nowrap;
  max-width: calc(100% - 16px);
  box-sizing: border-box;
}

.file-gdrive-badge:hover,
.file-storage-badge:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  transform: translateY(-1px);
}

.file-storage-badge.badge-both {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}
.file-storage-badge.badge-both:hover {
  background: #10b981;
  color: #000;
  border-color: #10b981;
}

.file-storage-badge.badge-gdrive {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.6);
  color: #60a5fa;
}
.file-storage-badge.badge-gdrive:hover {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.file-storage-badge.badge-local {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #cbd5e1;
}

/* Cloud Poster for Google Drive video without local thumbnail */
.file-thumb-cloud {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.35), rgba(15, 23, 42, 0.85));
  color: #60a5fa;
  user-select: none;
}
.file-thumb-cloud svg {
  filter: drop-shadow(0 4px 10px rgba(59, 130, 246, 0.4));
}
.file-thumb-cloud .file-cloud-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #93c5fd;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

.text-cloud {
  color: #60a5fa !important;
}
.text-cloud svg {
  color: #60a5fa !important;
}

.btn-mp3-card.is-disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
}

.file-gdrive-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.file-gdrive-meta svg {
  color: var(--white);
}

.btn-gdrive-card.is-synced {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: var(--white) !important;
  color: var(--white) !important;
}

.btn-gdrive-card.is-synced:hover {
  background: var(--white) !important;
  color: var(--black) !important;
}

/* ── Topbar Sync ke Drive Button ── */
.btn-sync-gdrive {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease-out);
}

.btn-sync-gdrive:hover {
  background: var(--bg-card-hover);
  border-color: var(--white);
  color: var(--white);
}

.btn-sync-gdrive.is-syncing {
  border-color: var(--white);
  color: var(--white);
  pointer-events: none;
}

.btn-sync-gdrive.is-syncing .btn-sync-gdrive-icon {
  animation: spin 1s linear infinite;
}

.sync-gdrive-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  background: var(--bg-deep);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  line-height: 14px;
}

.btn-sync-gdrive:hover .sync-gdrive-badge {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.library-container.view-grid .file-details {
  padding: 10px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.library-container.view-grid .file-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  min-height: 34px;
}

.library-container.view-grid .file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  padding: 6px 8px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.library-container.view-grid .file-actions::-webkit-scrollbar {
  display: none;
}

.library-container.view-grid .file-actions .btn {
  flex-shrink: 0;
}

/* List Mode */
.library-container.view-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.library-container.view-list .file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  transition: all var(--duration) var(--ease-out);
}

.library-container.view-list .file-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.library-container.view-list .file-card.is-selected {
  background: var(--bg-elevated);
  border-color: var(--white);
}

.library-container.view-list .file-visual {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-xs);
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.library-container.view-list .file-thumb-img,
.library-container.view-list .file-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-container.view-list .file-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  pointer-events: none;
  opacity: 0.85;
}

.library-container.view-list .file-play-icon svg {
  width: 10px;
  height: 10px;
  margin-left: 1px;
}

.library-container.view-list .file-format-tag,
.library-container.view-list .file-gdrive-badge,
.library-container.view-list .file-storage-badge {
  display: none !important;
}

.library-container.view-list .file-details {
  flex: 1;
  min-width: 0;
}

.library-container.view-list .file-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.file-folder-badge {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.file-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.library-empty-card {
  max-width: 480px;
  width: 100%;
  margin: 50px auto;
  text-align: center;
  padding: 44px 28px;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 400px;
  margin-bottom: 6px;
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
dialog.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  max-width: 500px;
  width: calc(100% - 32px);
  padding: 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  outline: none;
  overflow: visible;
}

dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-box {
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: var(--radius-xs);
}

.modal-close:hover {
  color: var(--white);
  background: var(--bg-card-hover);
}

.modal-body {
  padding: 20px;
}

.modal-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-deep);
  padding: 3px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.tab-btn.is-active {
  background: var(--white);
  color: var(--black);
}

.guide-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}

.guide-steps {
  font-size: 12px;
  color: var(--text-secondary);
  padding-left: 18px;
  line-height: 1.55;
}

.guide-steps li {
  margin-bottom: 3px;
}

.guide-steps code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-deep);
  color: var(--white);
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.cookie-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  outline: none;
  resize: vertical;
  line-height: 1.45;
}

.cookie-textarea:focus {
  border-color: var(--white);
}

.text-input {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color var(--duration) var(--ease-out);
}

.text-input:focus {
  border-color: var(--white);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.modal-footer .btn {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

.modal-footer .btn-primary {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.browser-login-card {
  padding: 6px 0;
}

.tab-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.browser-action-row {
  margin: 16px 0 8px;
}

.tab-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* Login Modal Enhancements for Deployment */
.tab-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.tab-btn.is-active .tab-badge {
  background: rgba(0, 0, 0, 0.12);
  color: var(--black);
}

.tab-badge-highlight {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.tab-btn.is-active .tab-badge-highlight {
  background: var(--black);
  color: var(--white);
}

.login-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
}

.login-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.login-status-pill.is-active {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.login-status-pill.is-offline {
  background: rgba(255, 69, 58, 0.15);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.3);
}

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

.login-alert-deploy {
  background: rgba(255, 159, 10, 0.08);
  border: 1px solid rgba(255, 159, 10, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #f5a623;
  line-height: 1.5;
}

.companion-tokens-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.companion-token-badge {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  color: var(--text-muted);
}

.companion-token-badge.is-present {
  border-color: rgba(52, 199, 89, 0.4);
  color: #34c759;
  background: rgba(52, 199, 89, 0.06);
}

/* ═══════════════════════════════════════════════════════════
   CUSTOM VIDEO PLAYER (Pure Monochrome Pro)
   ═══════════════════════════════════════════════════════════ */
.player-modal {
  max-width: 480px !important;
  width: calc(100% - 32px) !important;
  background: #000000 !important;
  border: 1px solid var(--border-hover) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95) !important;
  overflow: hidden !important;
}

.player-modal-box {
  display: flex;
  flex-direction: column;
  background: #000000;
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(18, 18, 20, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
}

.player-topbar-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.player-now-playing {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.player-modal-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.player-topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.player-btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease-out);
}

.player-btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--white);
}

.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 14;
  max-height: 68vh;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.custom-video-el {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
}

.player-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 180ms var(--ease-out);
  z-index: 5;
}

.player-stage.is-paused .player-center-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.player-controls-deck {
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 16, 0.95);
  border-top: 1px solid var(--border-subtle);
  padding: 8px 12px 10px;
  user-select: none;
}

.player-timeline-wrap {
  width: 100%;
  padding: 6px 0;
  cursor: pointer;
}

.player-timeline-track {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  transition: height 120ms ease;
}

.player-timeline-wrap:hover .player-timeline-track {
  height: 6px;
}

.player-timeline-buffer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  width: 0%;
}

.player-timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--white);
  border-radius: var(--radius-full);
  width: 0%;
}

.player-timeline-thumb {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  transition: transform 120ms ease;
}

.player-timeline-wrap:hover .player-timeline-thumb {
  transform: translateY(-50%) scale(1);
}

.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

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

.player-btn-control {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease-out);
}

.player-btn-control:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.player-time-display {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 4px;
}

.player-time-display #player-current-time {
  color: var(--white);
}

.player-speed-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.player-speed-btn:hover {
  color: var(--white);
  border-color: var(--white);
}

.player-volume-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.player-vol-slider {
  width: 50px;
  height: 3px;
  accent-color: var(--white);
  cursor: pointer;
}

/* ── Disk Space Meter (Library Header) ── */
.disk-space-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  min-width: 170px;
}

.disk-space-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
}

.disk-name {
  font-weight: 700;
  color: var(--white);
}

.disk-val {
  color: var(--text-muted);
}

.disk-bar-track {
  height: 3px;
  background: var(--bg-deep);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.disk-bar-fill {
  height: 100%;
  background: var(--white);
  border-radius: var(--radius-full);
}

/* ── Quick Bookmarks / Pin Bar (Home) ── */
.quick-bookmarks-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 4px;
  overflow-x: auto;
}

.bookmarks-label-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.bookmarks-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.bookmark-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--white);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration) var(--ease-out);
}

.bookmark-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--white);
}

.bookmark-chip-rm {
  opacity: 0.5;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.bookmark-chip-rm:hover {
  opacity: 1;
}

.target-card-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pin-action-btn {
  font-size: 12px;
}

.dock-quality-pill {
  font-size: 11px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  background: var(--white);
  color: var(--black);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.04em;
}

/* ── Google Drive Topbar & Modal Styles ── */
.topbar-gdrive-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease-out);
}

.topbar-gdrive-btn:hover {
  border-color: var(--white);
  color: var(--white);
}

.topbar-gdrive-btn.is-active {
  border-color: var(--border-hover);
  color: var(--white);
}

.gdrive-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gdrive-badge.badge-off {
  background: var(--bg-deep);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.gdrive-badge.badge-ready {
  background: var(--bg-card);
  color: var(--white);
  border: 1px solid var(--border-hover);
}

.gdrive-badge.badge-auto {
  background: var(--white);
  color: var(--black);
}

.btn-dock-gdrive {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-dock-gdrive.is-active {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.btn-gdrive-card {
  color: var(--text-secondary);
}

.btn-gdrive-card:hover {
  color: var(--white);
  border-color: var(--white);
}

.gdrive-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--radius-xs);
  padding: 3px 6px;
}

.gdrive-link-badge:hover {
  border-color: var(--white);
}

dialog#gdrive-modal {
  max-width: 620px !important;
  width: calc(100% - 32px) !important;
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.gdrive-modal-box {
  max-width: 100% !important;
  width: 100% !important;
  max-height: 92vh;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.gdrive-form-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.gdrive-modal-body {
  padding: 20px 22px 22px;
  overflow-y: auto;
  flex: 1;
}

.gdrive-modal-body::-webkit-scrollbar {
  width: 6px;
}
.gdrive-modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.gdrive-modal-body::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}
.gdrive-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

.gdrive-icon-wrap {
  background: var(--bg-card);
  border-color: var(--border-hover);
  color: var(--white);
}

/* Status Banner */
.gdrive-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  transition: all var(--duration) var(--ease-out);
}

.gdrive-status-card.is-connected {
  border-color: rgba(255, 255, 255, 0.35);
  background: #141417;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.04);
}

.gdrive-status-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.gdrive-status-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #121214;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gdrive-pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.2s ease;
}

.gdrive-pulse-indicator.is-running {
  background: var(--white);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  animation: pulseGlow 1.8s infinite;
}

.gdrive-status-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.gdrive-status-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gdrive-status-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.gdrive-status-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.gdrive-status-card.is-connected .gdrive-status-pill {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.gdrive-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Toggle Switches Grid */
.gdrive-options-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.gdrive-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  transition: all var(--duration) var(--ease-out);
}

.gdrive-toggle-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.gdrive-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.gdrive-toggle-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}

.gdrive-toggle-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Custom Switch Toggle Slider */
.gdrive-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.gdrive-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.gdrive-switch-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gdrive-switch-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gdrive-switch input[type="checkbox"]:checked + .gdrive-switch-slider {
  background: var(--white);
  border-color: var(--white);
}

.gdrive-switch input[type="checkbox"]:checked + .gdrive-switch-slider::before {
  transform: translateX(18px);
  background: var(--black);
}

/* Form Controls */
.gdrive-field-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
}

.form-label-left {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--white);
}

.form-label-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.form-label-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  padding: 1px 7px;
  border-radius: var(--radius-xs);
}

.form-label-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gdrive-upload-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--white);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.gdrive-upload-btn:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.form-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.form-badge.is-valid {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.form-input-wrap {
  position: relative;
  width: 100%;
}

.form-input {
  width: 100%;
  height: 42px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: all var(--duration) var(--ease-out);
  box-sizing: border-box;
}

.form-input:hover {
  border-color: var(--border-hover);
}

.form-input:focus {
  border-color: var(--white);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
  background: var(--bg-card-hover);
}

.form-input-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
}

.form-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 2px;
}

.form-hint-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.form-hint code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  color: var(--white);
}

.form-textarea-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-sm);
}

.form-textarea {
  width: 100%;
  min-height: 120px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 12px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  line-height: 1.55;
  transition: all var(--duration) var(--ease-out);
  box-sizing: border-box;
}

.form-textarea:hover {
  border-color: var(--border-hover);
}

.form-textarea:focus {
  border-color: var(--white);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
  background: var(--bg-card-hover);
}

.form-textarea-mono {
  font-family: 'JetBrains Mono', monospace;
}

.form-textarea-wrap.is-dragover .form-textarea {
  border-color: var(--white);
  background: #18181b;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* OAuth Prompt Box inside GDrive Modal */
.gdrive-oauth-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #141417;
  border: 1px solid var(--white);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 10px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
}

.gdrive-oauth-prompt-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.gdrive-oauth-prompt-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--white);
}

.gdrive-oauth-prompt-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.btn-oauth-login {
  background: var(--white) !important;
  color: var(--black) !important;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.btn-oauth-login:hover {
  background: #e4e4e7 !important;
  transform: translateY(-1px);
}

/* Setup Stepper Guide */
.gdrive-guide-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.gdrive-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.gdrive-guide-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
}

.gdrive-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px dashed var(--border-hover);
  padding-bottom: 1px;
  transition: all var(--duration) var(--ease-out);
}

.gdrive-guide-link:hover {
  color: var(--white);
  border-bottom-color: var(--white);
}

.gdrive-steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.gdrive-steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 800;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-text strong {
  color: var(--white);
  font-weight: 700;
}

.step-text em {
  color: var(--white);
  font-style: normal;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gdrive-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
  flex-shrink: 0;
  margin: 0;
}

.gdrive-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* ── Custom Confirmation Dialog ── */
.confirm-dialog-modal {
  max-width: 440px !important;
  width: calc(100% - 32px) !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-hover) !important;
  padding: 0 !important;
}

.confirm-modal-box {
  display: flex;
  flex-direction: column;
  padding: 22px 20px 18px;
  background: var(--bg-card);
}

.confirm-modal-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.confirm-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.confirm-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.confirm-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
}

.confirm-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.confirm-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.btn-danger-confirm {
  background: var(--white) !important;
  color: var(--black) !important;
  border-color: var(--white) !important;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   COOL STUDIO ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes laserShimmer {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(200%); }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.pulse-indicator.is-running {
  animation: pulseGlow 1.8s infinite;
}

.video-card {
  animation: cardEnter 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dl-progress-fill {
  position: relative;
  overflow: hidden;
}

.dl-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
  animation: laserShimmer 1.8s infinite;
}
/* ═══════════════════════════════════════════════════════════
   FEATURE 1 & 2: TIKTOK FYP OFFLINE PLAYER & HOVER MOTION
   ═══════════════════════════════════════════════════════════ */
.btn-mode-fyp {
  background: var(--white) !important;
  color: var(--black) !important;
  font-weight: 700;
  border-color: var(--white) !important;
}

.file-thumb-hover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 220ms ease;
  z-index: 3;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   TIKTOK FYP PRO STUDIO (Authentic TikTok Web Workstation)
   ═══════════════════════════════════════════════════════════ */
.fyp-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  touch-action: none;
}

/* Ambient Background Blur on Large Displays */
.fyp-ambient-backdrop {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(0.22) contrast(1.1);
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
  transform: scale(1.1);
  transition: background-image 400ms ease, opacity 400ms ease;
}

.fyp-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  z-index: 2;
}

/* Top Floating Command Bar */
.fyp-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.4) 65%, transparent 100%);
  pointer-events: none;
  gap: 12px;
}

.fyp-top-bar > * {
  pointer-events: auto;
}

.fyp-top-left,
.fyp-top-center,
.fyp-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fyp-brand-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 18, 20, 0.85);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.fyp-brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.fyp-brand-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--white);
}

.fyp-active-folder-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fyp-counter-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  background: rgba(18, 18, 20, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--white);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
}

.fyp-mode-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 18, 20, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.fyp-mode-toggle:hover,
.fyp-mode-toggle.is-loop {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.fyp-btn-glass {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(18, 18, 20, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  outline: none;
}

.fyp-btn-glass:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  transform: scale(1.06);
}

/* Volume Hover Slider Group */
.fyp-volume-control {
  position: relative;
  display: flex;
  align-items: center;
}

.fyp-volume-slider-wrap {
  position: absolute;
  top: 50%;
  right: calc(100% + 8px);
  transform: translateY(-50%) scaleX(0);
  transform-origin: right center;
  background: rgba(18, 18, 20, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), opacity 180ms ease;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}

.fyp-volume-control:hover .fyp-volume-slider-wrap,
.fyp-volume-control:focus-within .fyp-volume-slider-wrap {
  transform: translateY(-50%) scaleX(1);
  opacity: 1;
  pointer-events: auto;
}

.fyp-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.fyp-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
}

.fyp-speed-pill-btn {
  width: auto;
  padding: 0 10px;
  border-radius: var(--radius-full);
}

.fyp-speed-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
}

/* ── Theater Stage Frame ── */
.fyp-theater-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.fyp-theater-frame {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000000;
}

/* Desktop Wide Layout Enhancement */
@media (min-width: 880px) {
  .fyp-theater-frame {
    max-width: min(calc((100vh - 80px) * 9 / 16), 460px);
    height: calc(100vh - 72px);
    margin-top: 56px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95);
  }
}

.fyp-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  background: #000000;
}

@media (max-width: 768px) {
  .fyp-top-bar {
    padding: 10px 12px;
    gap: 6px;
  }
  .fyp-active-folder-pill {
    display: none;
  }
  .fyp-counter-pill {
    padding: 3px 8px;
    font-size: 11px;
    white-space: nowrap;
  }
  .fyp-mode-toggle {
    padding: 3px 8px;
    font-size: 11px;
  }
  .fyp-top-right .fyp-speed-pill-btn,
  .fyp-top-right button[title*="Pintasan Keyboard"],
  .fyp-top-right button[title*="Picture-in-Picture"],
  .fyp-top-right button[title*="Layar Penuh"] {
    display: none;
  }
  .fyp-sidebar {
    right: 8px;
    bottom: 64px;
    gap: 10px;
  }
  .fyp-avatar-circle {
    width: 38px;
    height: 38px;
  }
  .fyp-action-btn svg {
    width: 24px;
    height: 24px;
  }
  .fyp-action-label {
    font-size: 11px;
  }
  .fyp-bottom-bar {
    padding: 24px 54px 10px 12px;
  }
  .fyp-caption-text {
    font-size: 12.5px;
    max-height: 34px;
  }
}

.fyp-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
  display: block;
}

.fyp-play-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(18, 18, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
}

.fyp-heart-pop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: var(--white);
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), opacity 300ms ease;
}

.fyp-heart-pop.is-active {
  transform: translate(-50%, -50%) scale(1.4);
  opacity: 1;
}

/* Desktop Floating Up & Down Arrow Controls */
.fyp-desktop-nav {
  position: absolute;
  display: none;
  flex-direction: column;
  gap: 14px;
  z-index: 35;
}

@media (min-width: 880px) {
  .fyp-desktop-nav {
    display: flex;
    left: calc(50% + min(calc((100vh - 80px) * 9 / 32), 230px) + 26px);
    top: calc(50% + 28px);
    transform: translateY(-50%);
  }
}
.fyp-nav-arrow-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #121214;
  border: 1px solid var(--border-subtle);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  outline: none;
}

.fyp-nav-arrow-btn:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  transform: scale(1.1);
}

.fyp-nav-arrow-btn:active {
  transform: scale(0.96);
}

.fyp-nav-arrow-btn:focus:not(:focus-visible) {
  background: #121214;
  color: var(--white);
  border-color: var(--border-subtle);
}

.fyp-nav-arrow-btn:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* Right Floating Action Rail */
.fyp-sidebar {
  position: absolute;
  right: 12px;
  bottom: 84px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.fyp-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transition: transform var(--duration) var(--ease-out);
}

.fyp-avatar-circle:hover {
  transform: scale(1.08);
}

.fyp-avatar-letter {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
}

.fyp-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: transform var(--duration) var(--ease-out);
  outline: none;
}

.fyp-action-btn:hover {
  transform: scale(1.12);
}

.fyp-action-label {
  font-size: 10.5px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.9);
}

.fyp-action-btn.is-liked .fyp-heart-icon {
  fill: var(--white);
  stroke: var(--white);
  transform: scale(1.18);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
}

/* Spinning Vinyl Record */
@keyframes spinDisc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fyp-disc-wrap {
  width: 38px;
  height: 38px;
  margin-top: 4px;
}

.fyp-disc {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle, #27272a 35%, #09090b 60%, #18181b 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}

.fyp-disc.is-spinning {
  animation: spinDisc 4s linear infinite;
}

.fyp-disc-core {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--white);
}

/* Bottom Meta & Music Info */
.fyp-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  padding: 32px 72px 14px 14px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 65%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.fyp-caption-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: auto;
}

.fyp-author-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.fyp-author-tag {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--white);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  letter-spacing: -0.01em;
}

.fyp-folder-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--white);
  padding: 1px 7px;
  border-radius: var(--radius-xs);
}

.fyp-res-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  background: #121214;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
}

.fyp-caption-text {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.4;
  max-height: 40px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  word-break: break-word;
}

@keyframes musicMarquee {
  0% { transform: translateX(0%); }
  50% { transform: translateX(-50%); }
  100% { transform: translateX(0%); }
}

.fyp-music-ticker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11.5px;
  overflow: hidden;
  white-space: nowrap;
}

.fyp-music-track-wrap {
  overflow: hidden;
  max-width: 220px;
}

.fyp-music-track {
  display: inline-block;
  white-space: nowrap;
  animation: musicMarquee 12s linear infinite;
}

/* Scrubber & Telemetry Row */
.fyp-scrubber-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  pointer-events: auto;
  padding-top: 4px;
}

.fyp-time-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  min-width: 34px;
  text-align: center;
}

.fyp-progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  transition: height 140ms ease;
}

.fyp-scrubber-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  transform: translateX(-50%);
  background: rgba(18, 18, 20, 0.95);
  border: 1px solid var(--border-subtle);
  color: var(--white);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  z-index: 30;
}

.fyp-progress-track:hover {
  height: 6px;
}

.fyp-progress-fill {
  height: 100%;
  background: var(--white);
  width: 0%;
  border-radius: var(--radius-full);
  transition: width 80ms linear;
}

/* ── Slide-Out Playlist Drawer ── */
.fyp-playlist-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: #09090b;
  border-left: 1px solid var(--border-subtle);
  z-index: 60;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.9);
  animation: drawerSlideIn 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.fyp-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.fyp-drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fyp-drawer-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--white);
}

.fyp-drawer-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.fyp-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color var(--duration) ease;
}

.fyp-drawer-close:hover {
  color: var(--white);
}

.fyp-drawer-search-wrap {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.fyp-drawer-search-input {
  width: 100%;
  background: #121214;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--white);
  outline: none;
}

.fyp-drawer-search-input:focus {
  border-color: var(--white);
}

.fyp-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fyp-drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: #121214;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.fyp-drawer-item:hover {
  background: #18181b;
  border-color: var(--border-subtle);
}

.fyp-drawer-item.is-active {
  background: #18181b;
  border-color: var(--white);
}

.fyp-drawer-thumb {
  width: 42px;
  height: 56px;
  border-radius: 4px;
  background: #000000;
  object-fit: cover;
  flex-shrink: 0;
}

.fyp-drawer-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fyp-drawer-video-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fyp-drawer-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ── Metadata & Shortcuts Modals ── */
.fyp-metadata-card,
.fyp-shortcuts-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 70;
  background: #121214;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  animation: popIn 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { transform: translate(-50%, -46%) scale(0.96); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.fyp-meta-card-header,
.fyp-shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.fyp-meta-card-title,
.fyp-shortcuts-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--white);
}

.fyp-meta-card-close,
.fyp-shortcuts-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
}

.fyp-meta-card-close:hover,
.fyp-shortcuts-close:hover {
  color: var(--white);
}

.fyp-meta-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fyp-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
}

.fyp-meta-label {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.fyp-meta-val {
  font-family: 'JetBrains Mono', monospace;
  color: var(--white);
  text-align: right;
  word-break: break-all;
}

.fyp-shortcuts-list {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fyp-shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.fyp-shortcut-row kbd {
  font-family: 'JetBrains Mono', monospace;
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
}

/* ── Clean UI Mode (Pure Gestures Only) ── */
.fyp-container.is-clean-mode .fyp-top-bar,
.fyp-container.is-clean-mode .fyp-sidebar,
.fyp-container.is-clean-mode .fyp-bottom-bar,
.fyp-container.is-clean-mode .fyp-desktop-nav {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(12px) !important;
  transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1), transform 220ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.fyp-container.is-clean-mode .fyp-top-bar {
  transform: translateY(-12px) !important;
}

/* Floating Restore Pill */
.fyp-clean-restore-pill {
  position: absolute;
  bottom: 24px;
  right: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 18, 20, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all 220ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.fyp-container.is-clean-mode .fyp-clean-restore-pill {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.fyp-clean-restore-pill:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
  transform: translateY(-2px);
}

/* Favorites Badges & Controls */
.btn-fav-card.is-fav svg {
  fill: var(--white);
  stroke: var(--white);
}

.file-card.is-favorite .file-visual::after {
  content: '♥';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(18, 18, 20, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  z-index: 5;
  pointer-events: none;
}

/* Watchlist Items */
.watchlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  gap: 12px;
  transition: all var(--duration) var(--ease-out);
}

.watchlist-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.watchlist-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.watchlist-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watchlist-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.watchlist-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Ngrok Tunnel Modal & UI ── */
.pulse-indicator.is-off {
  background: var(--text-muted);
  box-shadow: none;
  animation: none;
}

.tunnel-status-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tunnel-status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--white);
}

.tunnel-active-box {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tunnel-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.tunnel-url-row .glow-field {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--white);
}

.tunnel-qr-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.tunnel-qr-wrap {
  width: 108px;
  height: 108px;
  border-radius: var(--radius-xs);
  background: #ffffff;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tunnel-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tunnel-qr-desc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tunnel-qr-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--white);
}

.tunnel-qr-sub {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tunnel-cli-note {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.tunnel-cli-note code {
  color: var(--white);
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* Direct Link Live Thumbnail Preview */
.direct-preview-card {
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: cardFadeIn 200ms ease;
}

.direct-preview-thumb-wrap {
  width: 58px;
  height: 80px;
  border-radius: var(--radius-xs);
  background: #000000;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

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

.direct-preview-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: var(--white);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  line-height: 1;
}

.direct-preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.direct-preview-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.direct-preview-author {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--white);
}

.direct-preview-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  background: #18181b;
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
}

.direct-preview-title {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.direct-preview-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* iOS Shortcut Modal */

/* Auto Install Shortcut Card */
.shortcut-auto-install-card {
  background: var(--bg-card);
  border: 1px solid var(--white);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.auto-install-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-install-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--white);
}

.auto-install-rec {
  background: var(--white);
  color: var(--black);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  line-height: 1;
}

.auto-install-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--white);
}

.auto-install-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auto-install-btn {
  width: 100%;
  height: 44px;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin-top: 4px;
}

.auto-install-subnote {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.shortcut-server-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.shortcut-url-row .glow-field {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--white);
}

.shortcut-server-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.shortcut-steps-card {
  margin-top: 16px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shortcut-steps-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 2px;
}

.shortcut-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-num-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--white);
  color: var(--black);
  font-weight: 800;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-desc {
  font-size: 12.5px;
  color: var(--white);
  line-height: 1.45;
}

.step-desc strong {
  color: var(--white);
}
/* ═══════════════════════════════════════════════════════════
   LOGS TERMINAL PAGE (Dedicated Tab)
   ═══════════════════════════════════════════════════════════ */
.logs-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.logs-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.logs-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.logs-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.logs-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logs-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  flex-wrap: wrap;
}

.logs-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  flex: 1;
  min-width: 260px;
}

.logs-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
}

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

.logs-level-pills {
  display: flex;
  align-items: center;
  gap: 4px;
}

.logs-console-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
}

.console-terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}

.console-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.console-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-hover);
}

.console-bar-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
}

.console-bar-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--white);
  background: var(--bg-deep);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.console-screen {
  padding: 18px 20px;
  min-height: 440px;
  max-height: 68vh;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #000000;
}

.console-empty-prompt {
  color: var(--text-muted);
  font-style: italic;
  padding: 24px 0;
  text-align: center;
}

.log-prefix {
  color: var(--text-muted);
  margin-right: 6px;
  user-select: none;
}
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 16px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 100%;
  margin: 0;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.footer-dot {
  opacity: 0.3;
}

.footer-version {
  font-family: 'JetBrains Mono', monospace;
  color: var(--white);
}

/* ── Downloader Footer Link ── */
.downloader-footer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 20px;
}

.downloader-footer-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN SYSTEM
   ═══════════════════════════════════════════════════════════ */

/* Tablet & Smaller Screens */
@media (max-width: 900px) {
  .topbar-inner {
    padding: 0 16px;
  }

  .deck-tabs {
    grid-template-columns: 1fr;
  }

  .dl-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .floating-action-dock {
    width: calc(100% - 24px);
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
  }

  .target-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .results-controls {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mobile Screens (<= 680px) */
@media (max-width: 680px) {
  /* Topbar Fluid Touch Navigation */
  .topbar {
    height: auto !important;
    min-height: auto !important;
    padding: 8px 0 !important;
  }

  .topbar-inner {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 0 12px !important;
  }

  .topbar-header-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .topbar-brand {
    gap: 8px;
  }

  .topbar-brand .brand-badge {
    width: 28px;
    height: 28px;
  }

  .topbar-brand .brand-title {
    font-size: 13.5px;
  }

  .topbar-brand .brand-tag {
    display: none;
  }

  .topbar-session {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .topbar-session button span:not(.gdrive-badge):not(.pulse-indicator),
  .topbar-session .btn span:not(.gdrive-badge):not(.pulse-indicator) {
    display: none !important;
  }

  .topbar-session .btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--radius-sm) !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }

  .topbar-session .btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  .topbar-session .badge-off {
    display: none !important;
  }

  .topbar-session .gdrive-badge {
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    font-size: 11px !important;
    padding: 1px 4px !important;
    line-height: 1 !important;
    border-radius: var(--radius-xs) !important;
    transform: scale(0.85);
  }

  .session-text {
    display: none !important;
  }

  .session-pill {
    padding: 6px !important;
    border-radius: var(--radius-full) !important;
    min-width: unset !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .session-pill .pulse-indicator {
    margin: 0 !important;
  }
  .topbar-nav {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    width: 100% !important;
    gap: 4px !important;
    padding: 0 !important;
    margin-top: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
  }

  .nav-label-full {
    display: none !important;
  }

  .nav-label-short {
    display: inline-block !important;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
  }

  .nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 2px !important;
    font-size: 11px !important;
    text-align: center !important;
    border-radius: var(--radius-xs) !important;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    position: relative !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .nav-item.is-active {
    background: var(--white);
    color: var(--black) !important;
    border-color: var(--white);
  }

  .nav-item.is-active .nav-icon {
    stroke: var(--black);
  }

  .nav-icon {
    width: 15px;
    height: 15px;
  }

  .nav-badge {
    position: absolute !important;
    top: 2px !important;
    right: 4px !important;
    background: var(--black) !important;
    color: var(--white) !important;
    border: 1px solid var(--border-subtle) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    font-family: 'JetBrains Mono', monospace !important;
    padding: 0 4px !important;
    height: 14px !important;
    line-height: 12px !important;
    border-radius: var(--radius-full) !important;
    pointer-events: none !important;
    z-index: 2 !important;
    margin-left: 0 !important;
  }

  .nav-item.is-active .nav-badge {
    background: var(--black) !important;
    color: var(--white) !important;
    border-color: var(--black) !important;
  }
  /* Main Container */
  .main-content {
    padding: 16px 12px 90px;
  }

  /* Scan Target Hero & Cards */
  .deck-card {
    padding: 16px 14px;
    border-radius: var(--radius-md);
  }

  .panel-title {
    font-size: 1.15rem;
  }
  .panel-subtitle {
    font-size: 12px;
  }

  .input-glow-group {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    align-items: stretch;
  }

  .input-icon-slot {
    display: none;
  }

  .action-field-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    height: 48px;
    font-size: 13.5px;
    font-weight: 700;
  }

  .direct-submit-row {
    width: 100% !important;
    margin-top: 14px !important;
  }

  .direct-submit-row .btn,
  #direct-btn {
    width: 100% !important;
    height: 48px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    border-radius: var(--radius-sm) !important;
  }

  /* Target Profile Header */
  .target-profile-card {
    padding: 14px;
  }

  .target-stats-group {
    width: 100%;
    justify-content: space-between;
  }

  /* Video Grid on Mobile */
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .video-card-body {
    padding: 8px;
  }

  .video-title {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  /* Floating Action Dock on Mobile */
  .floating-action-dock {
    width: calc(100% - 16px);
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .dock-container {
    flex-direction: column;
    border-radius: var(--radius-md);
    gap: 8px;
    padding: 10px;
  }

  .dock-info {
    width: 100%;
    justify-content: space-between;
  }

  .dock-actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .dock-segmented-group {
    width: 100%;
    justify-content: space-between;
  }

  .btn-dock-gdrive {
    width: 100%;
    justify-content: center;
  }

  .dock-actions .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }

  /* Downloader Page on Mobile */
  .downloader-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .downloader-top-actions {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .downloader-top-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .downloader-active-card {
    padding: 14px;
  }

  .active-card-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .active-pct-display {
    align-self: flex-end;
  }

  .dl-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .dl-stat-box {
    padding: 10px 8px;
  }

  .dl-stat-num {
    font-size: 1.15rem;
  }

  /* Downloader History Rows on Mobile */
  .history-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 10px;
  }

  .history-col-actions {
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid var(--border-subtle);
    padding-top: 8px;
  }

  .downloader-footer-link {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .downloader-footer-link .btn {
    justify-content: center;
  }

  /* Library Page on Mobile */
  .library-top-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .library-header-text {
    text-align: left;
  }

  .library-top-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .library-top-actions .disk-space-card {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 8px 10px !important;
  }

  .library-top-actions .library-stats-pill {
    grid-column: 2 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    justify-content: center !important;
    padding: 8px 10px !important;
  }

  .library-top-actions #btn-refresh-library {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 42px !important;
    justify-content: center !important;
    padding: 0 8px !important;
  }

  .library-top-actions #btn-gen-thumbs {
    grid-column: 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 42px !important;
    justify-content: center !important;
    padding: 0 8px !important;
  }

  .library-top-actions .btn-mode-fyp {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    height: 46px !important;
    justify-content: center !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    padding: 0 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .library-top-actions .btn-library-explorer {
    display: none !important;
  }
  .library-controls-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }

  .library-controls-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .library-search-box {
    width: 100%;
    min-width: 0;
  }

  .library-folder-tags {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    width: 100%;
    padding-bottom: 2px;
  }

  .library-folder-tags::-webkit-scrollbar {
    display: none;
  }

  .library-controls-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  /* Library Video Grid: Exactly 2 Columns on Mobile */
  .library-container.view-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .library-container.view-grid .file-card {
    border-radius: var(--radius-sm);
  }

  .library-container.view-grid .file-visual {
    aspect-ratio: 9 / 13;
  }

  .library-container.view-grid .file-name {
    font-size: 11px;
    line-height: 1.3;
    min-height: 28px;
    -webkit-line-clamp: 2;
  }

  .library-container.view-grid .file-actions {
    padding: 6px 6px 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    scrollbar-width: none !important;
    width: 100% !important;
  }

  .library-container.view-grid .file-actions::-webkit-scrollbar {
    display: none !important;
  }

  .library-container.view-grid .file-actions .btn {
    flex-shrink: 0 !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  /* Library List Mode on Mobile */
  .library-container.view-list .file-card {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  .library-container.view-list .file-check-box {
    order: 1;
  }

  .library-container.view-list .file-visual {
    order: 2;
    width: 44px !important;
    height: 44px !important;
  }

  .library-container.view-list .file-details {
    order: 3;
    flex: 1 1 calc(100% - 90px) !important;
    min-width: 0;
  }

  .library-container.view-list .file-actions {
    order: 4;
    width: 100% !important;
    justify-content: flex-end !important;
    border-top: 1px solid var(--border-subtle);
    padding-top: 8px !important;
    margin-top: 2px;
    gap: 8px !important;
  }

  /* Logs Page on Mobile */
  .logs-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .logs-top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .logs-controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .logs-search-box {
    width: 100%;
    min-width: 0;
  }

  .logs-level-pills {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .console-screen {
    padding: 12px;
    font-size: 11px;
    line-height: 1.6;
    max-height: 55vh;
  }

  /* Modals on Mobile */
  .modal-box,
  .gdrive-modal-box,
  .confirm-modal-box {
    width: calc(100% - 20px) !important;
    max-height: 90vh;
    padding: 16px !important;
    border-radius: var(--radius-md) !important;
  }

  .gdrive-modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .gdrive-footer-right {
    flex-direction: column;
    width: 100%;
  }

  .gdrive-footer-right .btn,
  #btn-gdrive-test {
    width: 100%;
    justify-content: center;
  }

  /* Toast Notification */
  #toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    width: 100%;
  }
}

/* Extra Small Screens (<= 380px) */
@media (max-width: 380px) {
  .topbar-brand span:not(.brand-tag) {
    font-size: 13px;
  }

  .topbar-brand .brand-tag {
    display: none;
  }

  .session-text {
    display: none;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .dl-stats-grid {
    grid-template-columns: 1fr;
  }
}
