/* ========================================================================
   STREAMGET — App Dashboard Styles
   ======================================================================== */

/* === LAYOUT — push footer to viewport bottom === */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


/* === APP NAV === */
.app-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--sh-xs);
}

.app-nav-row1 {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  padding: 0 28px;
  gap: 12px;
}

.app-nav-row1 .logo {
  flex-shrink: 0
}

.app-nav-row1 .nav-spacer {
  flex: 1
}

/* === APP HERO HEADLINE === */
.app-hero {
  text-align: center;
  padding: 28px 16px 20px;
}

.app-hero-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.app-hero-sub {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text3);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .app-hero { padding: 20px 12px 16px; }
  .app-hero-title { font-size: 22px; }
  .app-hero-sub { font-size: 13px; }
}

/* Back Link */
.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  transition: all var(--tr);
  margin-left: 8px;
}

.back-link:hover {
  background: var(--surface2);
  color: var(--text)
}

.back-link svg {
  width: 16px;
  height: 16px
}

/* Settings Button */
.settings-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  transition: all var(--tr);
  flex-shrink: 0;
}

.settings-btn:hover {
  background: var(--surface2);
  color: var(--text)
}

.settings-btn svg {
  width: 20px;
  height: 20px
}

/* === APP LAYOUT === */
.app-body {
  flex: 1;
  max-width: var(--max-w-narrow);
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
}

/* === URL INPUT AREA === */
.url-section {
  margin-bottom: 24px
}

.url-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border-md);
  border-radius: var(--r-pill);
  padding: 6px 6px 6px 20px;
  gap: 8px;
  box-shadow: var(--sh-md);
  transition: border-color var(--tr), box-shadow var(--tr);
}

.url-bar:focus-within {
  border-color: var(--accent);
  box-shadow: var(--sh-lg), 0 0 0 3px var(--accent-glow);
}

.url-icon {
  color: var(--text3);
  flex-shrink: 0;
  display: flex
}

.url-icon svg {
  width: 20px;
  height: 20px
}

.url-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  outline: none;
  min-width: 0;
}

.url-input::placeholder {
  color: var(--text3)
}

.paste-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--surface2);
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--tr);
  flex-shrink: 0;
}

.paste-btn:hover {
  background: var(--surface3);
  color: var(--text)
}

.paste-btn svg {
  width: 15px;
  height: 15px
}

.go-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--tr);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(26, 115, 232, .3);
}

.go-btn:hover {
  background: var(--accent-hover)
}

.go-btn:active {
  transform: scale(.97)
}

.go-btn svg {
  width: 16px;
  height: 16px
}

/* Smart Mode Toggle */
.smart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 8px;
}

.smart-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  font-family: var(--font-ui);
}

.smart-label svg {
  width: 14px;
  height: 14px;
  color: var(--accent)
}

.url-hint {
  font-size: 12px;
  color: var(--text3)
}

/* === TOGGLE SWITCH === */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute
}

.t-track {
  position: absolute;
  inset: 0;
  background: var(--surface3);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--tr);
}

.toggle input:checked+.t-track {
  background: var(--accent)
}

.t-track::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform var(--tr);
  box-shadow: var(--sh-xs);
}

.toggle input:checked+.t-track::after {
  transform: translateX(18px)
}

/* === SUPPORTED PLATFORMS STRIP === */
.platforms-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: var(--sh-xs);
  overflow-x: auto;
  scrollbar-width: none;
}

.platforms-strip::-webkit-scrollbar {
  display: none
}

.ps-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}

.ps-icons {
  display: flex;
  align-items: center;
  gap: 10px
}

.ps-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-ui);
  white-space: nowrap;
  user-select: none;
}

.ps-icon svg {
  width: 14px;
  height: 14px;
  display: none; /* Hide icons on desktop — text names only */
}

/* X is just one letter — show its icon on desktop instead of text */
.ps-icon-x svg {
  display: block;
}
.ps-icon-x span {
  display: none;
}

.ps-spacer {
  flex: 1
}

/* Presence pill */
.presence-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface2);
  border: 1px solid var(--border);
  font-family: var(--font-ui);
  white-space: nowrap;
  flex-shrink: 0;
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  animation: presencePulse 2s ease-in-out infinite;
}

@keyframes presencePulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0);
  }
}

.presence-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.presence-count.bounce {
  animation: countBounce .3s ease;
}

@keyframes countBounce {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }
}

.presence-text {
  font-size: 12px;
  color: var(--text3);
}

/* === RESULT CARD === */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-md);
  margin-bottom: 16px;
  animation: resultReveal .35s cubic-bezier(.4, 0, .2, 1) both;
}

.rc-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.rc-thumb {
  width: 140px;
  height: 80px;
  border-radius: var(--r-sm);
  background: var(--surface2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.rc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity var(--tr);
}

.rc-thumb:hover .play-overlay {
  opacity: 1
}

.play-circle {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, .9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-circle svg {
  width: 16px;
  height: 16px;
  margin-left: 2px;
  color: #000
}

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

.rc-title {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  flex-wrap: wrap;
}

.meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text3)
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  margin-left: auto;
  flex-shrink: 0;
}

/* Quality Row */
.quality-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
}

.q-label {
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
  margin-right: 4px;
  white-space: nowrap;
}

.q-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1
}

.q-btn {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border-md);
  background: transparent;
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--tr);
}

.q-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft)
}

.q-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text)
}

.q-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .3px;
  background: var(--accent);
  color: white;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 3px;
  vertical-align: middle;
}

/* === SMART FORMAT BAR === */
.fmt-bar {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-top: 2px;
  transition: all .25s ease;
  border-left: 3px solid var(--border);
}

/* State 1: Disabled */
.fmt-bar.fmt-disabled {
  opacity: 0.38;
  pointer-events: none;
}

.fmt-bar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text3);
  font-family: var(--font-ui);
}

.fmt-bar-placeholder svg {
  width: 14px;
  height: 14px
}

/* State 2: Audio mode */
.fmt-bar.fmt-audio {
  opacity: 1;
  pointer-events: auto;
  border-left-color: #4caf50;
  background: rgba(76, 175, 80, 0.04);
}

/* State 3: Video mode */
.fmt-bar.fmt-video {
  opacity: 1;
  pointer-events: auto;
  border-left-color: var(--accent);
  background: rgba(26, 115, 232, 0.04);
}

/* Format bar label row */
.fmt-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.fmt-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
}

.fmt-label svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0
}

.fmt-audio .fmt-label {
  color: #4caf50
}

.fmt-video .fmt-label {
  color: var(--accent)
}

.fmt-hint {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--font-ui);
}

/* Format chips */
.fmt-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fmt-chip {
  padding: 6px 16px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border-md);
  background: transparent;
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--tr);
  display: flex;
  align-items: center;
  gap: 5px;
}

.fmt-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.fmt-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.fmt-audio .fmt-chip.active {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.12);
  color: #2e7d32;
}

.fmt-audio .fmt-chip:hover {
  border-color: #4caf50;
  color: #4caf50;
  background: rgba(76, 175, 80, 0.08);
}

.fmt-chip-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .3px;
  background: var(--accent);
  color: white;
  padding: 1px 5px;
  border-radius: 4px;
}

.fmt-audio .fmt-chip-badge {
  background: #4caf50
}

/* Download action row */
.dl-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 16px;
  gap: 12px;
}

.dl-summary {
  font-size: 13px;
  color: var(--text3);
  font-family: var(--font-ui);
}

.dl-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 24px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: white;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--tr);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(26, 115, 232, .35);
}

.dl-btn:hover {
  background: var(--accent-hover)
}

.dl-btn:active {
  transform: scale(.97)
}

.dl-btn svg {
  width: 16px;
  height: 16px
}

.dl-btn.dl-disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

.dl-btn.dl-processing {
  opacity: 0.7;
  pointer-events: none;
  box-shadow: none;
  background: var(--text3);
}

.spin-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


/* === SECTION HEADERS === */
.sec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
}

.sec-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .7px;
}

.sec-action {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: background var(--tr);
}

.sec-action:hover {
  background: var(--accent-soft)
}

/* === QUEUE ITEM === */
.qi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--tr);
  overflow: hidden;
}

.qi:hover {
  box-shadow: var(--sh)
}

/* Preparing shimmer — subtle gradient sweep while server processes */
.qi-preparing {
  position: relative;
  overflow: hidden;
}

.qi-preparing::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.04) 40%,
    rgba(0, 0, 0, 0.06) 50%,
    rgba(0, 0, 0, 0.04) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

[data-theme="dark"] .qi-preparing::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 40%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(255, 255, 255, 0.04) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.qi-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px
}

.qi-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qi-icon svg {
  width: 18px;
  height: 18px
}

.qi-det {
  flex: 1;
  min-width: 0
}

.qi-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.qi-sub {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  gap: 8px;
  align-items: center;
}

.qi-status {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  flex-shrink: 0
}

.s-done {
  background: var(--success-soft);
  color: var(--success)
}

.s-active {
  background: var(--accent-soft);
  color: var(--accent-text)
}

.s-queued {
  background: var(--surface2);
  color: var(--text2)
}

.s-error {
  background: var(--danger-soft);
  color: var(--danger)
}

.s-paused {
  background: var(--warn-soft);
  color: var(--warn)
}

.qi-actions {
  display: flex;
  gap: 4px
}

.qi-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  transition: all var(--tr);
}

.qi-action:hover {
  background: var(--surface2);
  color: var(--text)
}

.qi-action svg {
  width: 16px;
  height: 16px
}

/* Progress */
.prog-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
}

.prog-track {
  flex: 1;
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

.pf-active {
  background: linear-gradient(90deg, var(--accent), #34a8ff);
  position: relative;
  overflow: hidden;
}

.pf-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%)
  }

  to {
    transform: translateX(100%)
  }
}

.pf-done {
  background: var(--success);
  width: 100% !important
}

.pf-queued {
  background: var(--surface3);
  width: 0%
}

.pf-error {
  background: var(--danger)
}

.pf-paused {
  background: var(--warn)
}

.prog-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  min-width: 38px;
  text-align: right;
  font-family: var(--font-ui);
}

.qi-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text2);
}

.qi-speed-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap
}

.qi-speed-badge,
.qi-eta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
}

.qi-speed-badge {
  color: var(--accent-text)
}

.qi-footer-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  padding: 0;
  transition: opacity var(--tr);
}

.qi-footer-link:hover {
  opacity: .8
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text2);
}

.empty-state svg {
  width: 56px;
  height: 56px;
  color: var(--surface3);
  margin: 0 auto 16px;
  display: block;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 4px
}

.empty-state small {
  font-size: 12px;
  color: var(--text3)
}

/* === TAB CONTENT === */
.tab-content {
  display: none
}

.tab-content.active {
  display: block
}

/* === RESPONSIVE === */

/* Mobile */
@media(max-width:768px) {

  /* Nav */
  .app-nav-row1 {
    padding: 0 16px;
    gap: 8px;
  }

  .back-link {
    margin-left: 4px;
    padding: 6px 8px
  }

  .back-link span {
    display: none
  }

  /* Tabs */
  .app-tabs-bar {
    margin-bottom: 16px
  }

  .app-tab {
    padding: 10px 14px;
    font-size: 13px
  }

  /* App body */
  .app-body {
    padding: 16px 12px
  }

  /* URL Bar — icon-only paste */
  .url-bar {
    padding: 4px 4px 4px 12px;
    border-radius: var(--r-lg)
  }

  .paste-btn span,
  .paste-text {
    display: none
  }

  .paste-btn {
    padding: 8px 10px;
    gap: 0
  }

  .go-btn {
    padding: 10px 16px;
    gap: 6px
  }

  .go-btn .go-text {
    display: none
  }



  .url-hint {
    display: none
  }

  /* Platforms strip */
  .platforms-strip {
    padding: 12px;
    gap: 10px
  }

  .ps-label {
    display: none
  }

  .ps-icon span {
    display: none
  }

  .ps-icon {
    padding: 6px;
  }

  /* On mobile: show icons, hide text */
  .ps-icon svg {
    display: block;
    width: 16px;
    height: 16px;
  }

  .presence-text {
    display: none
  }

  /* Modal — full screen on mobile */
  .modal-box {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }

  /* Queue items */
  .qi-top {
    flex-wrap: wrap
  }

  .qi-det {
    min-width: calc(100% - 100px)
  }

  .qi-status {
    font-size: 11px;
    padding: 3px 8px
  }
}

/* Small phones */
@media(max-width:480px) {
  .app-nav-row1 {
    padding: 0 16px;
  }

  .app-tab {
    padding: 8px 12px;
    font-size: 12px
  }

  .app-body {
    padding: 12px 10px
  }

  .url-bar {
    gap: 4px
  }

  .go-btn {
    padding: 9px 14px;
    font-size: 13px
  }

  .stats-row {
    gap: 8px
  }

  .stat-card {
    padding: 12px 14px
  }

  .stat-val {
    font-size: 18px
  }

  .stat-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 8px
  }

  .stat-icon svg {
    width: 14px;
    height: 14px
  }

  .qi {
    padding: 12px 14px
  }

  .qi-icon {
    width: 32px;
    height: 32px
  }

  .qi-icon svg {
    width: 14px;
    height: 14px
  }
}

/* ========================================================================
   SKELETON LOADING — Google-style shimmer
   ======================================================================== */

/* Shimmer gradient animation */
@keyframes skel-shimmer {
  0% {
    background-position: -400px 0
  }

  100% {
    background-position: 400px 0
  }
}

/* Base skeleton element */
.skel {
  background: linear-gradient(90deg, var(--skel-base) 25%, var(--skel-shine) 37%, var(--skel-base) 63%);
  background-size: 800px 100%;
  animation: skel-shimmer 1.6s ease-in-out infinite;
  border-radius: var(--r-sm);
}

/* Skeleton color tokens */
:root {
  --skel-base: #e8eaed;
  --skel-shine: #f8f9fa;
}

[data-theme="dark"] {
  --skel-base: #2d2f31;
  --skel-shine: #3c3e42;
}

/* Skeleton card — mirrors .result-card layout */
.skel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-md);
  margin-bottom: 16px;
}

/* Skeleton header — mirrors .rc-header */
.skel-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

/* Thumbnail placeholder */
.skel-thumb {
  width: 140px;
  height: 80px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
}

/* Info area */
.skel-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Title lines */
.skel-title {
  height: 14px;
  border-radius: 7px;
  width: 85%;
}

.skel-title-short {
  height: 14px;
  border-radius: 7px;
  width: 55%;
}

/* Meta pills */
.skel-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.skel-pill {
  height: 22px;
  border-radius: var(--r-pill);
  width: 60px;
}

.skel-pill-md {
  width: 80px
}

.skel-pill-lg {
  width: 100px
}

/* Quality row placeholder */
.skel-quality {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.skel-q-label {
  height: 12px;
  width: 44px;
  border-radius: 6px;
  margin-right: 4px;
}

.skel-q-btn {
  height: 32px;
  width: 64px;
  border-radius: var(--r-pill);
}

.skel-q-btn.wide {
  width: 88px
}

.skel-q-select {
  height: 32px;
  width: 72px;
  border-radius: var(--r-sm);
}

.skel-dl-btn {
  height: 38px;
  width: 120px;
  border-radius: var(--r-pill);
  margin-left: auto;
}

/* Status cycling text */
.skel-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text2);
  animation: skel-pulse 2s ease-in-out infinite;
}

.skel-status svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}

@keyframes skel-pulse {

  0%,
  100% {
    opacity: .7
  }

  50% {
    opacity: 1
  }
}

/* URL bar loading state */
.url-bar.is-loading {
  opacity: .6;
  pointer-events: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Result card reveal animation */
.result-card-reveal {
  animation: resultReveal .35s cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes resultReveal {
  from {
    opacity: 0;
    transform: translateY(6px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* Skeleton container */
#skelContainer {
  display: none;
}

#skelContainer.show {
  display: block;
  animation: resultReveal .25s cubic-bezier(.4, 0, .2, 1) both;
}

/* === SKELETON RESPONSIVE === */
@media (max-width: 768px) {
  .skel-header {
    flex-direction: row
  }

  .skel-thumb {
    width: 110px;
    height: 62px
  }

  .skel-quality {
    flex-wrap: wrap;
    gap: 8px
  }

  .skel-dl-btn {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .skel-thumb {
    width: 90px;
    height: 52px
  }

  .skel-q-btn {
    width: 56px;
    height: 30px
  }

  .skel-q-btn.wide {
    width: 72px
  }
}

/* === QUEUE RESPONSIVE === */
@media (max-width: 600px) {
  .qi-top {
    flex-wrap: wrap;
    gap: 8px;
  }
  .qi-det {
    width: calc(100% - 50px);
    flex: none;
  }
  .qi-status {
    order: 3;
  }
  .qi-actions {
    order: 4;
    margin-left: auto;
  }
}

/* ========================================================================
   CONTACT DEVELOPER SECTION
   ======================================================================== */

.app-contact {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  margin-top: auto;
  padding: 32px 24px 0;
}

.app-contact-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}

.app-contact-text {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text2);
}

.app-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  padding: 8px 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-md);
  background: var(--surface);
  transition: all var(--tr);
  white-space: nowrap;
  text-decoration: none;
}

.app-contact-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.25);
}

.app-contact-btn svg {
  flex-shrink: 0;
}

/* ========================================================================
   APP FOOTER
   ======================================================================== */

.app-footer {
  max-width: var(--max-w-narrow);
  margin: 24px auto 0;
  padding: 24px 24px 32px;
  text-align: center;
}

.app-footer span {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text3);
}

.app-footer p {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.6;
  margin-top: 8px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .app-contact-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 16px 20px;
  }
  .app-footer {
    padding: 20px 16px 28px;
  }
}

/* ========================================================================
   TOAST NOTIFICATIONS — Apple glassmorphism × Google simplicity
   ======================================================================== */

.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast, 600);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  max-width: 420px;
  pointer-events: auto;
  white-space: nowrap;

  /* Glass effect — light */
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.35);

  /* Entry animation */
  animation: toastIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Dark theme glass */
[data-theme="dark"] .toast {
  background: rgba(30, 31, 33, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.25),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.06);
}

/* Status dot */
.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.toast-msg {
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
}

/* Type colors — dot + subtle glow */
.toast-info .toast-dot {
  background: var(--accent);
  color: var(--accent);
}
.toast-success .toast-dot {
  background: var(--success);
  color: var(--success);
}
.toast-warn .toast-dot {
  background: var(--warn);
  color: var(--warn);
}
.toast-error .toast-dot {
  background: var(--danger);
  color: var(--danger);
}

/* Entry: spring slide up from below */
@keyframes toastIn {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Exit: slide down + fade */
.toast-exit {
  animation: toastOut 0.35s cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes toastOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
}

/* Mobile: slightly smaller padding, full-width constraint */
@media (max-width: 480px) {
  .toast-container {
    bottom: 20px;
    width: calc(100% - 32px);
    left: 50%;
  }
  .toast {
    max-width: 100%;
    padding: 10px 18px;
    font-size: 13px;
  }
}