:root {
  --background: 245, 247, 250;
  --foreground: 20, 23, 30;
  --card: 255, 255, 255;
  --primary: 14, 165, 233;
  --border: 222, 226, 230;
  --muted-foreground: 100, 116, 139;
  --muted: 234, 236, 240;
  --orange: rgb(255, 102, 0);
  --app-font: 'Space Grotesk Qwantium', sans-serif;
  --btn-radius: 6px;

  /* Single source of truth for horizontal page padding */
  --page-x-pad: 2rem;
}

.dark {
  --background: 14, 17, 22;
  --foreground: 230, 230, 230;
  --card: 26, 29, 36;
  --primary: 34, 211, 238;
  --border: 42, 47, 58;
  --muted-foreground: 156, 163, 175;
  --muted: 42, 47, 58;
}

* {
  box-sizing: border-box;
  font-family: var(--app-font, 'Space Grotesk Qwantium', sans-serif);
  margin: 0;
  padding: 0;
}

body {
  padding: 0;
  background-color: rgb(var(--background));
  color: rgb(var(--foreground));
  line-height: 1.5;
  transition: background 0.2s ease, color 0.2s ease;
}

/* ── Header ── */
header {
  top: 0;
  z-index: 100;
  background: rgba(var(--background), 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgb(var(--border));
}

.search-header {
  display: flex;
  align-items: center;
  padding: 0.75rem var(--page-x-pad);
  gap: 1.5rem;
}

.search-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: rgb(var(--foreground));
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.search-logo .orange-text {
  color: var(--orange);
}

.search-logo img {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
}

.search-form-wrap {
  flex: 1;
  max-width: 780px;
}

.search-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.search-header-input {
  width: 100%;
  padding: 0.65rem 3rem 0.65rem 2.75rem;
  border-radius: 9999px;
  border: 2px solid rgb(var(--border));
  background: rgb(var(--card));
  color: rgb(var(--foreground));
  outline: none;
  font-size: 0.95rem;
  font-family: var(--app-font, 'Space Grotesk Qwantium', sans-serif);
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.search-header-input:focus {
  border-color: rgb(var(--primary));
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.08);
}

.dark .search-header-input:focus {
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.08);
}

.search-lead {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  stroke: rgb(var(--muted-foreground));
  fill: none;
  pointer-events: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  z-index: 2;
}

.search-submit {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgb(var(--primary));
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.search-submit:hover {
  background: rgba(14, 165, 233, 0.9);
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.15);
}

.search-submit:active {
  transform: translateY(-50%) scale(0.95);
}

.search-submit svg {
  width: 0.95rem;
  height: 0.95rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-actions {
  display: flex;
  margin-left: auto;
  gap: 0.35rem;
  align-items: center;
}

.icon-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  color: rgb(var(--foreground));
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
}

.icon-btn:hover {
  background-color: rgb(var(--muted));
}

.icon-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  fill: none;
}

/* ── Nav tabs ── */
.search-nav {
  display: flex;
  padding: 0 var(--page-x-pad);
  gap: 0.25rem;
}

.nav-btn {
  background: transparent;
  border: none;
  color: rgb(var(--muted-foreground));
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.875rem;
  font-family: var(--app-font, 'Space Grotesk Qwantium', sans-serif);
  font-weight: 500;
  position: relative;
  white-space: nowrap;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: rgb(var(--primary));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn.active {
  color: rgb(var(--primary));
}

.nav-btn.active::after {
  width: 100%;
  left: 0;
}

.nav-btn:hover:not(.active) {
  color: rgb(var(--foreground));
}

.nav-btn:hover:not(.active)::after {
  width: 60%;
  left: 20%;
  background-color: rgb(var(--muted-foreground));
  opacity: 0.5;
}

.nav-btn svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Time filter bar ── */
.time-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px var(--page-x-pad) 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.time-filter-bar::-webkit-scrollbar {
  display: none;
}

.time-btn {
  background: transparent;
  border: 1px solid rgb(var(--border));
  color: rgb(var(--muted-foreground));
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--app-font, 'Space Grotesk Qwantium', sans-serif);
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition:
    color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 0.3s ease, clip-path 0.3s ease;
}

.time-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.time-btn::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: rgb(var(--primary));
  border-radius: 9999px;
  z-index: -1;
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 0.3s ease, clip-path 0.3s ease;
}

.time-btn:hover:not(.active) {
  border-color: rgb(var(--foreground));
  color: rgb(var(--foreground));
  transform: translateY(-1px);
}

.time-btn:active:not(.active) {
  transform: translateY(0);
}

.time-btn.active {
  border-color: transparent;
  color: #fff;
}

.time-btn.active::before {
  opacity: 1;
  transform: scale(1);
}

.time-btn-region {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid rgb(var(--border));
  border-radius: 5px;
}

.time-btn-region::before {
  display: none;
}

.time-btn-region svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.time-btn-region:hover {
  color: rgb(var(--primary));
}

/* ── Content layout ── */
.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--page-x-pad);
  display: flex;
  gap: 2.5rem;
  width: 100%;
}

.content {
  padding: 1.5rem 0;
  max-width: 680px;
  flex: 1;
  min-width: 0;
  margin-right: 28px;
  margin-left: 28px;
}

.results-sidebar {
  width: 320px;
  flex-shrink: 0;
  padding: 1.5rem 0;
}

.results-meta {
  font-size: 0.8rem;
  color: rgb(var(--muted-foreground));
  margin-bottom: 1.25rem;
}

/* ── Web results ── */
.result-card {
  margin-bottom: 1.75rem;
  min-width: 0;
  overflow: hidden;
}

#resultsMain.web-results-mcard .result-card {
  padding: 1.25rem 1.5rem;
  border: 1px solid rgb(var(--border));
  border-radius: 0.875rem;
  background-color: rgb(var(--card));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}

#resultsMain.web-results-mcard .result-card:hover {
  border-color: rgb(var(--primary));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.dark #resultsMain.web-results-mcard .result-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#resultsMain.web-results-mcard .result-breadcrumb {
  gap: 8px;
  font-size: 0.82rem;
}

#resultsMain.web-results-mcard .result-title a {
  font-size: 1.15rem;
}

#resultsMain.web-results-mcard .result-desc {
  font-size: 0.95rem;
  line-height: 1.6;
}

#resultsMain.web-results-mcard .sitelinks-row {
  margin-top: 0.875rem;
}

/* Magazine web layout */
#resultsMain.web-results-magazine .result-card {
  padding: 1.25rem 1.4rem;
  border: 1px solid rgb(var(--border));
  border-radius: 0.875rem;
  background-color: rgb(var(--card));
  box-shadow: none;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#resultsMain.web-results-magazine .result-card:hover {
  border-color: rgb(var(--primary));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#resultsMain.web-results-magazine .result-card-featured {
  padding: 1.75rem;
  border: 1.5px solid rgb(var(--primary));
  border-radius: 0.875rem;
  background: linear-gradient(135deg,
      rgba(var(--primary), 0.07) 0%,
      rgba(var(--primary), 0.02) 100%);
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.06);
  margin-bottom: 0.75rem;
}

#resultsMain.web-results-magazine .result-card-featured:hover {
  border-color: rgb(var(--primary));
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.12);
}

.dark #resultsMain.web-results-magazine .result-card-featured {
  background: linear-gradient(135deg,
      rgba(var(--primary), 0.12) 0%,
      rgba(var(--primary), 0.04) 100%);
  box-shadow: 0 2px 12px rgba(34, 211, 238, 0.1);
}

.dark #resultsMain.web-results-magazine .result-card-featured:hover {
  box-shadow: 0 6px 24px rgba(34, 211, 238, 0.16);
}

#resultsMain.web-results-magazine .result-card-featured .result-breadcrumb {
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
}

#resultsMain.web-results-magazine .result-card-featured .result-title a {
  font-size: 1.55rem;
  line-height: 1.25;
  font-weight: 700;
}

#resultsMain.web-results-magazine .result-card-featured .result-desc {
  font-size: 1rem;
  line-height: 1.7;
  margin-top: 0.875rem;
  opacity: 0.9;
}

#resultsMain.web-results-magazine .result-card-magazine {
  padding: 1.1rem 1.4rem;
}

#resultsMain.web-results-magazine .result-card-magazine:first-of-type {
  border-top: 1px solid rgb(var(--border));
}

#resultsMain.web-results-magazine .result-card-magazine .result-breadcrumb {
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

#resultsMain.web-results-magazine .result-card-magazine .result-title a {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

#resultsMain.web-results-magazine .result-card-magazine .result-title a:hover {
  color: rgb(var(--primary));
}

#resultsMain.web-results-magazine .result-card-magazine .result-desc {
  font-size: 0.88rem;
  margin-top: 0.4rem;
  opacity: 0.85;
}

/* Modern web layout */
#resultsMain.web-results-modern .result-card {
  position: relative;
  padding: 1rem 1.15rem 1rem 1.4rem;
  margin-bottom: 0.6rem;
  border-radius: 1rem;
  background-color: transparent;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#resultsMain.web-results-modern .result-card::before {
  content: '';
  position: absolute;
  left: 0.3rem;
  top: 1.3rem;
  bottom: 1.3rem;
  width: 2px;
  border-radius: 999px;
  background: rgb(var(--primary));
  opacity: 0.6;
  transform: scaleY(0.5);
  transform-origin: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#resultsMain.web-results-modern .result-card:hover {
  background-color: rgb(var(--card));
  border-color: rgb(var(--border));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.dark #resultsMain.web-results-modern .result-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

#resultsMain.web-results-modern .result-card:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

#resultsMain.web-results-modern .result-breadcrumb {
  gap: 8px;
  font-size: 0.78rem;
  opacity: 0.75;
}

#resultsMain.web-results-modern .result-favicon {
  border-radius: 6px;
  padding: 2px;
  background: rgb(var(--muted));
}

#resultsMain.web-results-modern .result-title {
  margin-top: 0.3rem;
}

#resultsMain.web-results-modern .result-title a {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

#resultsMain.web-results-modern .result-desc {
  font-size: 0.92rem;
  line-height: 1.65;
  margin-top: 0.5rem;
  opacity: 0.82;
}

#resultsMain.web-results-modern .sitelinks-row {
  margin-top: 1rem;
  gap: 0.5rem;
}

#resultsMain.web-results-modern .sitelink-item {
  border-radius: 0.7rem;
}

.result-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: rgb(var(--muted-foreground));
  margin-bottom: 3px;
  min-width: 0;
}

.result-breadcrumb>span:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.result-favicon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  object-fit: contain;
  flex-shrink: 0;
}

.result-title a {
  color: rgb(var(--primary));
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: break-word;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.result-title-video-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.result-title a:hover {
  text-decoration: underline;
}

.result-desc {
  font-size: 0.9rem;
  color: rgb(var(--foreground));
  opacity: 0.8;
  margin-top: 4px;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
}

.result-age {
  font-size: 0.76rem;
  color: rgb(var(--muted-foreground));
  margin-top: 3px;
}

/* ── Gwiazdkowa ocena (Brave rating) ── */
.result-rating {
  display: inline-flex;
  align-items: center;
  margin-top: 2px;
  line-height: 1;
}

.result-rating-stars {
  position: relative;
  display: inline-block;
  width: 76px;
  height: 15px;
}

.result-rating-stars-bg,
.result-rating-stars-fg {
  display: block;
  width: 100%;
  height: 100%;
}

.result-rating-stars-bg {
  fill: rgb(var(--muted-foreground));
  opacity: 0.35;
}

.result-rating-stars-fg {
  position: absolute;
  top: 0;
  left: 0;
  fill: #f5a623;
}

/* ── Image grid ── */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.image-card {
  border-radius: 8px;
  overflow: hidden;
  background: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  transition: transform 0.2s, box-shadow 0.2s;
}

.image-card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.image-card a {
  display: block;
}

.image-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.image-card-label {
  padding: 5px 7px;
  font-size: 0.76rem;
  color: rgb(var(--muted-foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Video results ── */
.video-card {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.video-thumb-wrap {
  position: relative;
  flex-shrink: 0;
  width: 160px;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.video-thumb-wrap img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.video-duration {
  position: absolute;
  bottom: 4px;
  right: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 4px;
}

.video-info {
  flex: 1;
  min-width: 0;
}

.video-title a {
  color: rgb(var(--primary));
  font-size: 0.975rem;
  font-weight: 500;
  text-decoration: none;
  display: block;
  margin-bottom: 3px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.video-title a:hover {
  text-decoration: underline;
}

.video-meta {
  font-size: 0.8rem;
  color: rgb(var(--muted-foreground));
  overflow-wrap: break-word;
  word-break: break-word;
}

.video-desc {
  font-size: 0.86rem;
  opacity: 0.78;
  margin-top: 5px;
  line-height: 1.4;
  display: none;
}

/* ── News ── */
.news-card {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgb(var(--border));
}

.news-card:last-child {
  border-bottom: none;
}

.news-info {
  flex: 1;
  min-width: 0;
}

.news-source {
  font-size: 0.78rem;
  color: rgb(var(--muted-foreground));
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.news-source img {
  width: 13px;
  height: 13px;
  object-fit: contain;
  border-radius: 2px;
}

.news-title a {
  color: rgb(var(--foreground));
  font-size: 0.975rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: break-word;
}

.news-title a:hover {
  color: rgb(var(--primary));
}

.news-desc {
  font-size: 0.85rem;
  opacity: 0.72;
  margin-top: 4px;
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg,
      rgb(var(--border)) 25%,
      rgba(var(--border), 0.4) 50%,
      rgb(var(--border)) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.sk-url {
  height: 11px;
  width: 36%;
  margin-bottom: 9px;
}

.sk-title {
  height: 18px;
  width: 66%;
  margin-bottom: 9px;
}

.sk-line {
  height: 13px;
  margin-bottom: 7px;
}

/* ── State messages ── */
.state-msg {
  padding: 3rem 0;
  opacity: 0.5;
  font-size: 1rem;
}

.error-msg {
  padding: 1rem 1.25rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  color: #ef4444;
  font-size: 0.9rem;
}

/* ── Floating sticky search ── */
#stickySearch {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  width: 95%;
  max-width: 500px;
  z-index: 10000;
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
  pointer-events: none;
}

#stickySearch.is-active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.fsearch-inner-box {
  background: rgba(var(--card), 0.82);
  backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(var(--border), 0.5);
  border-radius: 28px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.dark .fsearch-inner-box {
  background: rgba(var(--card), 0.85);
  border-color: rgba(var(--border), 0.4);
}

.fsearch-top-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.fsearch-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 16px;
  font-size: 16px;
  color: inherit;
  font-family: var(--app-font, 'Space Grotesk Qwantium', sans-serif);
}

.fsearch-submit-trigger {
  background: rgb(var(--primary));
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.fsearch-nav-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding: 2px 4px 6px;
  overflow-x: auto;
}

.fsearch-nav-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(var(--muted), 0.6);
  border: none;
  padding: 7px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  color: inherit;
  font-family: var(--app-font, 'Space Grotesk Qwantium', sans-serif);
}

.dark .fsearch-nav-btn {
  background: rgba(var(--muted), 0.7);
  color: rgb(var(--muted-foreground));
}

.fsearch-nav-btn.is-active {
  background: rgb(var(--primary));
  color: #fff !important;
}

/* ── Related searches ── */
.related-searches-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(var(--border));
}

.related-searches-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(var(--muted-foreground));
  margin-bottom: 10px;
  font-weight: 600;
}

.related-searches-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.related-chip {
  font-size: 0.825rem;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid rgb(var(--border));
  background: transparent;
  color: rgb(var(--foreground));
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--app-font, 'Space Grotesk Qwantium', sans-serif);
}

.related-chip:hover {
  background: rgb(var(--muted));
  border-color: rgb(var(--primary));
  color: rgb(var(--primary));
}

/* ── AI Summary Box ── */
#ai-response-box {
  display: none;
  margin-bottom: 16px;
}

.ai-response-box-inner {
  position: relative;
  background: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  border-radius: 12px;
  padding: 14px 16px 14px 46px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgb(var(--foreground));
  animation: ai-fade-in 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  overflow-wrap: break-word;
  word-break: break-word;
}

.ai-response-box-inner::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 14px;
  font-size: 0.95rem;
  color: rgb(var(--primary));
  opacity: 0.75;
  line-height: 1;
}

.ai-response-box-inner::after {
  content: '';
  position: absolute;
  top: -9px;
  left: 12px;
  background: rgb(var(--card));
  padding: 0 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgb(var(--primary));
  border-radius: 4px;
  opacity: 0.85;
}

@keyframes ai-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-loading-skeleton {
  padding: 12px 16px;
  border: 1px solid rgb(var(--border));
  border-radius: 12px;
  font-size: 0.83rem;
  color: rgb(var(--muted-foreground));
  background: rgb(var(--card));
  position: relative;
  overflow: hidden;
}

.ai-loading-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.2) 50%,
      transparent 100%);
  transform: translateX(-100%);
  animation: ai-shimmer 1.6s infinite;
}

@keyframes ai-shimmer {
  to {
    transform: translateX(200%);
  }
}

.dark .ai-response-box-inner,
.dark .ai-loading-skeleton {
  background: rgb(var(--card));
  border-color: rgb(var(--border));
  color: rgb(var(--foreground));
}

.dark .ai-response-box-inner::after {
  background: rgb(var(--card));
}

/* ── Footer ── */
footer {
  margin-top: 3rem;
  border-top: 1px solid rgb(var(--border));
  font-size: 0.875rem;
  color: rgb(var(--muted-foreground));
}

.footer-inner {
  padding: 1rem var(--page-x-pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  text-decoration: none;
  color: rgb(var(--muted-foreground));
  font-size: 0.875rem;
  transition: color 0.15s;
}

.footer-link:hover {
  color: rgb(var(--foreground));
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .results-sidebar {
    display: none;
  }

  .content {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  :root {
    --page-x-pad: 1rem;
  }

  .search-header {
    flex-wrap: wrap;
    padding: 0.65rem var(--page-x-pad);
    gap: 0.65rem;
  }

  .search-logo {
    order: 1;
    font-size: 1.1rem;
  }

  .header-actions {
    order: 2;
  }

  .search-form-wrap {
    order: 3;
    flex: 1 0 100%;
  }

  .search-nav {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }

  .search-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .content {
    padding: 1rem 0;
    max-width: 100%;
  }

  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .video-thumb-wrap {
    width: 100px;
  }

  .video-card {
    gap: 0.65rem;
  }
}

@media (min-width: 1000px) {
  .content {
    margin-left: 200px;
    margin-right: 200px;
  }

  .search-nav {
    margin-right: 175px;
    margin-left: 175px;
  }

  .time-filter-bar {
    margin-right: 175px;
    margin-left: 175px;
  }
}

@media (min-width: 1200px) {
  .content {
    margin-left: 200px;
    margin-right: 200px;
    max-width: 800px;
  }

  .search-nav {
    margin-right: 175px;
    margin-left: 175px;
  }

  .time-filter-bar {
    margin-right: 175px;
    margin-left: 175px;
  }
}

@media (min-width: 1400px) {
  .content {
    margin-left: 200px;
    margin-right: 200px;
    max-width: 950px;
  }

  .search-nav {
    margin-right: 175px;
    margin-left: 175px;
  }

  .time-filter-bar {
    margin-right: 175px;
    margin-left: 175px;
  }
}

/* ── Button corner style (Default / Square / Futuristic) — rectangular action buttons only ── */
html.btn-style-square .ai-show-more-btn,
html.btn-style-square .mojeek-show-more-btn,
html.btn-style-square .time-btn,
html.btn-style-square .time-btn::before {
  border-radius: 0 !important;
  clip-path: none !important;
}

/* These buttons have a real 1px border, but clip-path slices straight through it
   at the cut corners. Fix: drop the native border and fake it with a ::before
   behind the button, clipped to the same cut-corner shape but 1px larger on every
   side, so only that 1px ring stays visible — following the cut too. */
html.btn-style-futuristic .ai-show-more-btn {
  position: relative;
  border-radius: 0 !important;
  border-color: transparent;
  background: rgb(var(--card));
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  z-index: 0;
}

html.btn-style-futuristic .ai-show-more-btn:hover {
  background: rgb(var(--primary));
}

html.btn-style-futuristic .ai-show-more-btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: rgb(var(--border));
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  z-index: -1;
  transition: background 0.18s;
}

html.btn-style-futuristic .ai-show-more-btn:hover::after {
  background: rgb(var(--primary));
}

html.btn-style-futuristic .mojeek-show-more-btn {
  position: relative;
  border-radius: 0 !important;
  border-color: transparent;
  background: rgb(var(--card));
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  z-index: 0;
}

html.btn-style-futuristic .mojeek-show-more-btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: rgb(var(--border));
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
  z-index: -1;
  transition: background 0.18s;
}

html.btn-style-futuristic .mojeek-show-more-btn:hover:not(:disabled)::after {
  background: rgb(var(--primary));
}

/* .time-btn already uses ::before for the active-state fill animation, so the
   border fix uses ::after instead — kept separate from that logic. Only visible
   while not .active, since .active hides the real border anyway. */
html.btn-style-futuristic .time-btn,
html.btn-style-futuristic .time-btn::before {
  border-radius: 0 !important;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

html.btn-style-futuristic .time-btn {
  border-color: transparent;
  background: rgb(var(--background));
}

html.btn-style-futuristic .time-btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: rgb(var(--border));
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  z-index: -2;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

html.btn-style-futuristic .time-btn.active::after {
  opacity: 0;
}

/* ── Search bar style (Default / Square / Futuristic) ── */
html.search-style-square .search-header-input,
html.search-style-square .search-submit,
html.search-style-square .fsearch-inner-box,
html.search-style-square .fsearch-submit-trigger {
  border-radius: 0 !important;
  clip-path: none !important;
}

/* Futuristic: same cut-corner treatment used for buttons, applied to the
   search pill, its submit circle-turned-cut-corner, and the floating
   sticky search box + its trigger. The input itself keeps a real border
   since it has no competing ::before/::after usage. */
html.search-style-futuristic .search-header-input {
  position: relative;
  z-index: 1;
  border-radius: 0;
  border-color: rgb(var(--border));
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

html.search-style-futuristic .search-header-input:focus {
  border-color: rgb(var(--primary));
}

html.search-style-futuristic .search-submit {
  border-radius: 0;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

html.search-style-futuristic .fsearch-inner-box {
  border-radius: 0;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}

html.search-style-futuristic .fsearch-submit-trigger {
  border-radius: 0;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

html.search-style-futuristic .fsearch-nav-btn {
  border-radius: 0;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
