:root {
  --fire-1: #ffc107;
  --fire-2: #ff9800;
  --fire-3: #ff6f00;
  --fire-4: #ff3d00;
  --fire-5: #d84315;

  --bg-page: #ffffff;
  --bg-page-alt: #ffffff;
  --bg-surface: #ffffff;
  --bg-elevated: #f8f9fa;
  --bg-hover: #f1f3f4;
  --bg-input: #ffffff;

  --border-color: #dfe1e5;
  --border-strong: #dadce0;
  --shadow-color: rgba(32, 33, 36, 0.12);

  --text-primary: #202124;
  --text-secondary: #4d5156;
  --text-muted: #70757a;

  --accent: #e53935;
  --accent-hover: #c62828;
  --accent-soft: rgba(229, 57, 53, 0.08);
  --accent-soft-strong: rgba(229, 57, 53, 0.14);

  --danger: #d93025;
  --success: #188038;

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 8px;

  --font-main: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Consolas', 'Courier New', monospace;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg-page: #000000;
  --bg-page-alt: #000000;
  --bg-surface: #292a2d;
  --bg-elevated: #303134;
  --bg-hover: #35363a;
  --bg-input: #303134;

  --border-color: #3c4043;
  --border-strong: #4d5156;
  --shadow-color: rgba(0, 0, 0, 0.45);

  --text-primary: #e8eaed;
  --text-secondary: #bdc1c6;
  --text-muted: #9aa0a6;

  --accent: #ff6f60;
  --accent-hover: #ff8a80;
  --accent-soft: rgba(255, 111, 96, 0.14);
  --accent-soft-strong: rgba(255, 111, 96, 0.22);

  --danger: #f28b82;
  --success: #81c995;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
}

html, body {
  height: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Sayt yuklanish animatsiyasi (minimal: olovrang aylanuvchi doira) ===== */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  transition: opacity 0.35s ease;
  overflow: hidden;
}
.page-loader.page-loader-hide {
  opacity: 0;
  pointer-events: none;
}

.page-loader-core {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Olovrang aylanuvchi doira */
.page-loader-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  border-top-color: var(--fire-3);
  border-right-color: var(--fire-2);
  animation: pageLoaderSpin 0.85s linear infinite;
}
@keyframes pageLoaderSpin {
  to { transform: rotate(360deg); }
}

button, input, textarea,
.site-header, .controls-panel, .controls-panel-inner, .control-group,
.modal-content, .result-card, .tab-btn, .tabs,
.image-card, .video-card-thumb, .history-item, .bookmark-item,
.account-switch-item, .dashboard-tabs, .dash-tab-btn, .theme-slider,
.email-input-group, .domain-addon, .custom-input, .user-profile,
.profile-card {
  transition: background-color 0.25s ease, border-color 0.25s ease,
    color 0.25s ease, box-shadow 0.25s ease;
}

.stars,
.nebula {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.stars {
  background-repeat: repeat;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 12%, #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 22% 48%, #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 38% 8%, #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 52% 68%, #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 68% 28%, #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 82% 58%, #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 94% 18%, #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 14% 82%, #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 60% 88%, #fff, transparent 60%);
  background-size: 280px 280px;
}

/* Qorong'u rejimda fon endi shunchaki qora — yulduz/tumanlik
   animatsiyalari butunlay o'chirilgan (sodda va yengil bo'lishi uchun). */
html[data-theme="dark"] .stars-near {
  opacity: 0;
  animation: none;
}

.stars-far {
  background-image:
    radial-gradient(2px 2px at 20% 20%, #fff, transparent 60%),
    radial-gradient(2px 2px at 50% 55%, #ffe0b2, transparent 60%),
    radial-gradient(2px 2px at 75% 15%, #fff, transparent 60%),
    radial-gradient(2px 2px at 30% 78%, #fff, transparent 60%),
    radial-gradient(2px 2px at 90% 80%, #ffe0b2, transparent 60%),
    radial-gradient(2px 2px at 10% 55%, #fff, transparent 60%);
  background-size: 460px 460px;
}

html[data-theme="dark"] .stars-far {
  opacity: 0;
  animation: none;
}

@keyframes twinkle {
  from { opacity: 0.12; }
  to   { opacity: 0.4; }
}

@keyframes drift {
  from { background-position: 0 0; }
  to   { background-position: 900px 500px; }
}

.nebula {
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

html[data-theme="dark"] .nebula {
  opacity: 0;
  animation: none;
}

.nebula-1 {
  width: 45vw;
  height: 45vw;
  max-width: 520px;
  max-height: 520px;
  top: -12%;
  left: -10%;
  background: radial-gradient(circle, var(--fire-3), transparent 70%);
}

.nebula-2 {
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  bottom: -18%;
  right: -12%;
  background: radial-gradient(circle, var(--fire-5), transparent 70%);
}

@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(30px, -20px) scale(1.08); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Mobil qurilmalarda sticky header + backdrop-filter birgalikda scroll'ni
   qattiq sekinlashtiradi (har freym'da blur qayta hisoblanadi). Kichik
   ekranlarda blur'ni butunlay o'chirib, oddiy fon bilan almashtiramiz —
   bu scroll silliqligini sezilarli darajada yaxshilaydi. */
@media (max-width: 768px) {
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-surface);
  }
}

.site-header-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.site-brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(45deg, var(--fire-4), var(--fire-2), var(--fire-1));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 7s ease infinite;
  flex-shrink: 0;
}

.page-content {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.5s ease both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.header {
  text-align: center;
  margin: 8px 0 26px;
}

.logo {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(45deg, var(--fire-4), var(--fire-2), var(--fire-1));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 7s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-input {
  flex: 1;
  padding: 13px 20px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  outline: none;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-input);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.search-input:focus {
  border-color: transparent;
  background: var(--bg-input);
  box-shadow: 0 1px 6px var(--shadow-color), 0 0 0 1px var(--accent);
}

.search-btn {
  padding: 13px 26px;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, opacity 0.2s ease;
}

.search-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.search-btn:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.search-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .tab-btn {
    padding: 9px 12px;
    font-size: 0.84rem;
  }
}

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

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hidden {
  display: none !important;
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  color: var(--text-secondary);
  font-weight: 600;
}

.orbit-spinner {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  position: relative;
  animation: spin 0.9s linear infinite;
}

.orbit-dot {
  display: none;
}

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

.results-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-card {
  background: var(--bg-surface);
  padding: 16px 18px 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  border-left: 3px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
  animation: fadeInUp 0.3s ease both;
  content-visibility: auto;
  contain-intrinsic-size: 0 90px;
}

.result-card:hover {
  border-left-color: var(--accent);
  background: var(--bg-elevated);
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.result-index {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-strong);
  border-radius: 6px;
  padding: 1px 6px;
  letter-spacing: 0.5px;
}

.result-url {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--success);
  text-decoration: none;
  word-break: break-all;
}

.result-url:hover {
  text-decoration: underline;
}

.result-title a {
  font-size: 1.15rem;
  color: var(--accent);
  text-decoration: none;
  margin: 4px 0;
  display: inline-block;
  transition: color 0.2s ease;
}

.result-title a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.result-snippet {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-top: 4px;
}

.empty-message {
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
  padding: 20px 0;
}

.error-card {
  background: rgba(217, 48, 37, 0.06);
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 600;
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.image-card-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  content-visibility: auto;
  contain-intrinsic-size: 0 120px;
}

.image-card {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  transition: border-color 0.15s ease, filter 0.15s ease;
  display: block;
}

.image-card-btn:hover .image-card,
.image-card-btn:focus-visible .image-card {
  border-color: var(--accent);
  filter: brightness(1.04);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.video-card-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  content-visibility: auto;
  contain-intrinsic-size: 0 120px;
}

.video-card-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, filter 0.15s ease;
}

.video-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(32, 33, 36, 0.55);
  color: #fff;
  font-size: 1rem;
  padding-left: 3px;
  pointer-events: none;
  transition: background 0.15s ease;
}

.video-card-btn:hover .video-card-thumb,
.video-card-btn:focus-visible .video-card-thumb {
  border-color: var(--accent);
  filter: brightness(1.04);
}

.video-card-btn:hover .video-card-play,
.video-card-btn:focus-visible .video-card-play {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.08);
}

.lightbox-video-wrap {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.lightbox-video {
  width: 100%;
  max-height: 60vh;
  display: block;
}

.lightbox-content {
  max-width: 640px;
  text-align: center;
}

.lightbox-img-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
  max-height: 60vh;
}

.lightbox-img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.lightbox-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  word-break: break-word;
}

.lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.lightbox-btn {
  flex: 1 1 auto;
  min-width: 150px;
  padding: 11px 16px;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.lightbox-btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.lightbox-btn-outline:hover {
  background: var(--accent-soft);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-elevated);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.top-bar-spacer {
  flex: 1;
}

.profile-toggle-btn {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
  padding: 0;
  overflow: hidden;
  color: var(--text-secondary);
}

.profile-toggle-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.profile-toggle-btn:active {
  transform: scale(0.96);
}

.profile-toggle-btn.open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.menu-guest-icon {
  width: 22px;
  height: 22px;
}

.menu-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.menu-notify-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-surface);
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.controls-panel {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  background: var(--bg-page);
  border: none;
  border-radius: 0;
  box-shadow: none;
  z-index: 500;
  animation: panelIn 0.18s ease both;
  overflow-y: auto;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.controls-panel-inner {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 0 40px;
}

.controls-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 12px 0 4px 12px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
}

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

.controls-back-btn:hover {
  background: var(--bg-hover);
}

.control-group {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.control-group:last-child {
  border-bottom: none;
}

.control-group-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.theme-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.theme-switch-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 500;
}

.theme-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.theme-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.theme-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.theme-toggle input:checked + .theme-slider {
  background: var(--accent);
}

.theme-toggle input:checked + .theme-slider::before {
  transform: translateX(18px);
}

.theme-toggle input:focus-visible + .theme-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  width: 100%;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.auth-btn-login {
  background: var(--fire-4);
  border: 1px solid var(--fire-5);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.12);
}

.auth-btn-login:hover {
  background: var(--fire-3);
}

.auth-btn-login:active {
  transform: scale(0.98);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  background: var(--fire-5);
}

.auth-btn-signup {
  background: linear-gradient(135deg, #2b2f36, #14161a);
  border: 1px solid #14161a;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.25);
}

.auth-btn-signup:hover {
  background: linear-gradient(135deg, #3a3f47, #1c1e22);
}

.auth-btn-signup:active {
  transform: scale(0.98);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  width: 100%;
  text-align: center;
  background: var(--danger);
  border: 1px solid transparent;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.12);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.logout-btn:hover {
  background: #c62828;
}

.logout-btn:active {
  transform: scale(0.98);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.user-profile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  padding: 14px 16px;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--border-color);
}

.user-profile:hover {
  background: var(--bg-hover);
}

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

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  flex-shrink: 0;
  object-fit: cover;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.Yulemdo-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.Yulemdo-badge.active {
  color: var(--success);
  font-weight: 600;
}

.user-info-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.account-actions {
  padding: 12px 16px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 20px;
  animation: modalOverlayFadeIn 0.22s ease;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 32px 28px 28px;
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 560px;
  max-height: 720px;
  overflow-y: auto;
  box-shadow: 0 16px 48px var(--shadow-color);
  animation: modalContentPopIn 0.28s cubic-bezier(0.2, 0.8, 0.3, 1.15);
}

@media (max-width: 600px) {
  .modal { padding: 0; }
  .modal-content {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
}

@keyframes modalOverlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalContentPopIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .modal, .modal-content {
    animation: none;
  }
}

.modal-content h2 {
  font-size: 1.2rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 2;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  transform: rotate(90deg);
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.signup-extra-fields {
  display: flex;
  flex-direction: column;
}
.signup-extra-fields.hidden {
  display: none;
}

.email-input-group {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.email-input-group input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 11px 12px;
  color: var(--text-primary);
  outline: none;
  font-size: 0.9rem;
}

.domain-addon {
  padding: 11px 12px;
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  border-left: 1px solid var(--border-color);
}

.custom-input {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  font-size: 0.9rem;
  margin-bottom: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Kichik ekranlarda @Yulemdo.uz belgisi input matniga tushib
   yashirinib qolmasligi uchun, ustma-ust joylash o'rniga
   pastga (inputning tagiga), bo'shliqsiz tushiramiz. */
@media (max-width: 480px) {
  .email-input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .email-input-group input {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }

  .domain-addon {
    border-left: none;
    border-top: none;
    text-align: left;
  }
}

.custom-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ===== Parolni ko'rsatish / yashirish (ko'z) tugmasi ===== */
.password-field-wrap {
  position: relative;
  margin-bottom: 12px;
}
.password-field-wrap .custom-input {
  margin-bottom: 0;
  padding-right: 42px;
}
.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 50%;
}
.password-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.password-toggle-btn svg {
  width: 19px;
  height: 19px;
}
.password-toggle-btn .eye-off-icon { display: none; }
.password-toggle-btn.is-visible .eye-icon { display: none; }
.password-toggle-btn.is-visible .eye-off-icon { display: block; }

/* ===== Qidiruv tizimini tanlash (search-box logotipi) ===== */
.input-wrapper {
  position: relative;
}
.engine-select-btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  background: var(--bg-hover);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}
.engine-select-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.engine-select-btn:hover {
  background: var(--bg-elevated);
}
.input-wrapper .search-input.has-engine-btn {
  padding-left: 40px;
}

.engine-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px var(--shadow-color);
  padding: 8px;
  z-index: 40;
}
.engine-dropdown.hidden { display: none; }

.engine-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.88rem;
  text-align: left;
}
.engine-option:hover {
  background: var(--bg-hover);
}
.engine-option.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.engine-option img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.engine-custom-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}
.engine-custom-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
}
.engine-custom-row input:focus {
  border-color: var(--accent);
}
.engine-custom-row button {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}
.engine-custom-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.full-width {
  width: 100%;
}

.modal-status {
  font-size: 0.8rem;
  margin-bottom: 12px;
  min-height: 18px;
}

.modal-status.error { color: var(--danger); }
.modal-status.success { color: var(--success); }

.auth-toggle-box {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.bookmark-add-btn,
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  padding: 0;
}

.bookmark-add-btn .btn-icon,
.share-btn .btn-icon {
  width: 14px;
  height: 14px;
}

.bookmark-add-btn:hover,
.share-btn:hover {
  text-decoration: underline;
}

.bookmark-add-btn:disabled,
.share-btn:disabled {
  cursor: default;
  opacity: 0.7;
  text-decoration: none;
}

.delete-bookmark-btn {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.delete-bookmark-btn:hover {
  background: rgba(217, 48, 37, 0.08);
}

.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-wrapper .search-input {
  width: 100%;
  padding-right: 40px;
}

.clear-btn {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s ease;
}

.clear-btn:hover {
  color: var(--text-primary);
}

.dashboard-modal {
  max-width: 550px !important;
  width: 95% !important;
  text-align: left !important;
}

.dashboard-tabs {
  display: flex;
  gap: 4px;
  margin: 18px 0;
  border-bottom: 1px solid var(--border-color);
}

.dash-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all 0.2s ease;
}

.dash-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dash-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.dash-content {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 5px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  gap: 8px;
  text-align: center;
}

.avatar-large {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

.profile-email-text {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

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

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.history-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  transform: translateX(2px);
}

.history-query {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.history-query .btn-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.history-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.google-btn:hover {
  background: var(--bg-hover);
  box-shadow: 0 1px 4px var(--shadow-color);
}

@media (max-width: 560px) {
  .logo { font-size: 2.3rem; }
  .page-content { padding: 24px 16px 60px; }
  .site-header-inner { padding: 10px 14px; }
  .search-box { flex-direction: column; }
  .search-btn { width: 100%; }
  .images-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

.user-balances {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  background: var(--bg-elevated);
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  margin: 4px 0;
}

.balance-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-surface);
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

.currency-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.currency-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.account-switcher-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
  max-height: 160px;
  overflow-y: auto;
}
.account-switch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.account-switch-item:hover {
  background: var(--bg-hover);
}
.account-switch-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-switch-item.active {
  border-color: var(--accent);
  color: var(--text-primary);
  font-weight: 600;
  background: var(--accent-soft);
}
.add-account-btn {
  display: block;
  margin: 2px 0 2px;
  font-size: 0.82rem;
  text-align: left;
}
.clear-history-btn {
  background: rgba(255,0,0,0.12);
  color: #ff4d4d;
  border: 1px solid #ff4d4d;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  margin-bottom: 10px;
}
.history-delete-btn {
  background: none;
  border: none;
  color: #ff4d4d;
  cursor: pointer;
  font-size: 1rem;
  margin-left: 8px;
}

body.intro-lock-scroll {
  overflow: hidden;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.intro-overlay.hidden {
  display: none;
}

.intro-blur-bg {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  background: rgba(10, 8, 20, 0.35);
  animation: introBgFadeIn 0.6s ease forwards;
}
[data-theme="light"] .intro-blur-bg {
  background: rgba(255, 255, 255, 0.35);
}

@keyframes introBgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.intro-popup-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 24px;
  width: 100%;
  max-width: 660px;
}
.intro-popup-stage.hidden {
  display: none;
}

.intro-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
}
.intro-dots .intro-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transition: transform 0.25s ease, background 0.25s ease, width 0.25s ease;
}
[data-theme="light"] .intro-dots .intro-dot {
  background: rgba(32, 33, 36, 0.22);
}
.intro-dots .intro-dot.active {
  background: linear-gradient(90deg, var(--fire-2), var(--fire-4));
  width: 20px;
  border-radius: 4px;
}
.intro-dots .intro-dot.done {
  background: rgba(255, 152, 0, 0.55);
}

.intro-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.intro-fox-wrap {
  position: relative;
  width: 340px;
  height: 340px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -26px;
  z-index: 3;
}
.intro-fox-glow {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 152, 0, 0.35), rgba(255, 61, 0, 0) 70%);
  filter: blur(6px);
  animation: introGlowPulse 2.4s ease-in-out infinite;
  z-index: 0;
}
@keyframes introGlowPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}

.intro-fox-img {
  position: relative;
  z-index: 1;
  width: 340px;
  height: 340px;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(255, 111, 0, 0.35));
}
.intro-fox-img.replay {
  /* rasm har safar almashganda animatsiyasiz, statik holda ko'rsatiladi */
}

.intro-speech-bubble {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 110px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #dfe1e5);
  border-radius: 18px;
  padding: 20px 24px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  animation: introBubbleIn 0.45s ease 0.15s both;
  display: flex;
  align-items: center;
}
@keyframes introBubbleIn {
  from { opacity: 0; transform: translateX(14px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.intro-speech-bubble::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -8px;
  transform: translateY(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: var(--bg-surface, #fff);
  border-left: 1px solid var(--border-color, #dfe1e5);
  border-bottom: 1px solid var(--border-color, #dfe1e5);
}

.intro-text {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--text-primary);
  text-align: left;
  min-height: 1.6em;
}
.intro-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  background: var(--fire-3, #ff6f00);
  vertical-align: -0.15em;
  animation: introCaretBlink 0.85s steps(1) infinite;
}
.intro-caret.done {
  display: none;
}
@keyframes introCaretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.intro-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  animation: introControlsIn 0.5s ease 0.25s both;
}
@keyframes introControlsIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.intro-skip-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 8px 6px;
  transition: color 0.2s ease;
}
[data-theme="light"] .intro-skip-btn {
  color: rgba(32, 33, 36, 0.65);
}
.intro-skip-btn:hover {
  color: #fff;
}
[data-theme="light"] .intro-skip-btn:hover {
  color: var(--text-primary);
}

.intro-arrow-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--fire-2), var(--fire-4));
  box-shadow: 0 10px 24px rgba(255, 87, 34, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  animation: introArrowNudge 1.8s ease-in-out infinite;
}
.intro-arrow-btn svg {
  width: 24px;
  height: 24px;
}
.intro-arrow-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 28px rgba(255, 87, 34, 0.6);
}
.intro-arrow-btn:active {
  transform: scale(0.94);
}
@keyframes introArrowNudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.intro-card.card-out {
  animation: introCardOut 0.28s ease forwards;
}
.intro-card.card-in {
  animation: introCardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes introCardOut {
  to { opacity: 0; transform: translateY(-10px) scale(0.97); }
}
@keyframes introCardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .intro-fox-wrap, .intro-fox-img {
    width: 260px;
    height: 260px;
  }
  .intro-fox-wrap {
    margin-right: -16px;
  }
  .intro-speech-bubble {
    min-height: 96px;
    padding: 16px 18px;
  }
  .intro-text {
    font-size: 0.95rem;
    text-align: left;
  }
}

@media (max-width: 380px) {
  .intro-card {
    flex-direction: column;
  }
  .intro-fox-wrap, .intro-fox-img {
    width: 340px;
    height: 340px;
  }
  .intro-fox-wrap {
    margin-right: 0;
    margin-bottom: -90px;
  }
  .intro-speech-bubble {
    position: relative;
    z-index: 4;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  [data-theme="dark"] .intro-speech-bubble {
    background: rgba(41, 42, 45, 0.92);
  }
  .intro-speech-bubble::before {
    display: none;
  }
  .intro-text {
    text-align: center;
  }
}

.intro-lang-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.intro-lang-stage.hidden {
  display: none;
}
.intro-lang-card {
  width: 100%;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #dfe1e5);
  border-radius: 20px;
  padding: 32px 26px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  animation: introBubbleIn 0.45s ease both;
}
.intro-lang-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.intro-lang-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.intro-lang-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.intro-lang-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid var(--border-color, #dfe1e5);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}
.intro-lang-btn:hover {
  border-color: var(--fire-3);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.intro-lang-btn:active {
  transform: translateY(0);
}
.intro-lang-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
}

.lang-switch-row {
  display: flex;
  gap: 8px;
}
.lang-option-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.lang-option-btn:hover {
  border-color: var(--fire-3);
}
.lang-option-btn.active {
  background: var(--accent-soft-strong);
  border-color: var(--accent);
  color: var(--accent);
}

.top-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 200;
  background: linear-gradient(90deg, var(--fire-1), var(--fire-3), var(--fire-5), var(--fire-3), var(--fire-1));
  background-size: 200% 100%;
  animation: topLoadingSweep 1.1s linear infinite;
}

@keyframes topLoadingSweep {
  from { background-position: 0% 0; }
  to   { background-position: -200% 0; }
}

.offline-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 8, 20, 0.55);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  animation: introBgFadeIn 0.4s ease both;
}
[data-theme="light"] .offline-overlay {
  background: rgba(255, 255, 255, 0.6);
}

.offline-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  text-align: center;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32), 0 2px 10px rgba(0, 0, 0, 0.14);
  animation: introBubbleIn 0.4s ease both;
}

.offline-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 14px;
  filter: drop-shadow(0 10px 20px rgba(255, 111, 0, 0.3));
}

.offline-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.offline-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: -4px;
  color: var(--text-secondary);
}
.theme-icon-svg {
  width: 18px;
  height: 18px;
}
.theme-icon-svg.hidden {
  display: none;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 18px 0 4px;
}

.site-footer a {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-footer.hidden {
  display: none;
}

/* ============================================================
   XIZMATLAR (SERVICES) TUGMASI VA TO'LIQ EKRAN PANELI
   ============================================================ */
.services-toggle-icon {
  width: 20px;
  height: 20px;
}

/* .controls-panel klassidan barcha fullscreen xususiyatlarni meros oladi
   (position: fixed, inset: 0, 100vw/100vh) — profil paneli bilan bir xil
   xatti-harakat: fon butunlay qoplanadi, orqadagi qidiruv maydoniga
   tasodifan bosib ketish ehtimoli yo'qoladi. */
.services-panel-inner {
  max-width: 560px;
}

.services-panel-header {
  border-bottom: none;
  padding-bottom: 4px;
}

.services-panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.services-search-wrap {
  margin: 0;
}

.services-search-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.services-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.services-categories {
  padding: 10px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.services-category-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.services-category-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 2px;
}

/* Har bir kategoriya — o'z ichida "jadval" ko'rinishidagi ro'yxat:
   qatorlar bir-biriga yopishib, chiziq bilan ajratilgan holda turadi. */
.services-category-table {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.service-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.service-row:last-child {
  border-bottom: none;
}

.service-row:hover {
  background: var(--bg-hover);
}

.service-row-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.service-row-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Ikonka rasm topilmasa, butun xizmat qatori ko'rsatilmaydi */
.service-icon-missing {
  display: none !important;
}

.service-row-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-row-arrow {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ============================================================
   AYLANUVCHI BANNER KARUSELI (LOOP)
   ============================================================ */
.banner-carousel {
  width: 100%;
  overflow: hidden;
  margin: 18px 0 6px;
  border-radius: var(--radius-md);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

.banner-carousel.hidden {
  display: none;
}

.banner-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: bannerLoopScroll 28s linear infinite;
  will-change: transform;
}

.banner-carousel:hover .banner-track {
  animation-play-state: paused;
}

.banner-slide {
  flex: 0 0 auto;
  width: 260px;
  height: 110px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: block;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  transition: transform 0.2s ease;
}

.banner-slide:hover {
  transform: translateY(-2px) scale(1.01);
}

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

@keyframes bannerLoopScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .banner-track {
    animation: none;
  }
}

@media (max-width: 480px) {
  .banner-slide {
    width: 200px;
    height: 88px;
  }
}

/* ============================================================
   VIDEO LIGHTBOX: PINCH-ZOOM VA ROTATE TUZATISHLARI
   ============================================================ */
/* Modal ichida barmoqlar bilan tortish tufayli sahifa umumiy zoom holatida
   "qotib qolishining" oldini olish uchun modalning o'zi vertikal skroll bilan
   cheklanadi, pinch-zoom esa lightboxImg.js orqali (YulemdoResetPinchZoom)
   modal yopilganda avtomatik tiklanadi. */
.video-lightbox-content {
  touch-action: pan-y;
}

.lightbox-video-wrap {
  touch-action: pan-y;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-video {
  transition: transform 0.25s ease;
  transform-origin: center center;
}

.lightbox-video-rotated {
  max-height: none !important;
  max-width: 60vh;
}

.video-card-source {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
