:root {
  color-scheme: dark;
  --bg: #08080c;
  --surface: rgba(18, 18, 26, 0.86);
  --surface-strong: #15151e;
  --surface-soft: #1b1b26;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f7f7fb;
  --muted: #9999ab;
  --muted-strong: #b9b9c8;
  --pink: #ff2d86;
  --cyan: #27e8e8;
  --lime: #bdff65;
  --danger: #ff6e7c;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.38);
  --radius: 22px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3f7;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-soft: #eceef4;
  --line: rgba(20, 20, 35, 0.10);
  --line-strong: rgba(20, 20, 35, 0.18);
  --text: #101018;
  --muted: #6f7080;
  --muted-strong: #484958;
  --shadow: 0 22px 70px rgba(41, 43, 60, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.ambient {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .10;
  pointer-events: none;
  z-index: -1;
}
.ambient-one { background: var(--pink); top: -16rem; right: 5%; }
.ambient-two { background: var(--cyan); top: 25rem; left: -20rem; }

.site-header {
  width: min(1480px, calc(100% - 48px));
  height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.04em;
}
.brand > span:last-child span { color: var(--pink); }
.brand-mark { position: relative; width: 29px; height: 29px; display: inline-block; }
.brand-mark i, .brand-mark b {
  position: absolute;
  inset: 4px 8px;
  display: block;
  border-radius: 7px 2px 7px 2px;
  transform: skew(-13deg);
}
.brand-mark i { background: var(--cyan); transform: translate(-4px, 3px) skew(-13deg); }
.brand-mark b { background: var(--pink); transform: translate(4px, -3px) skew(-13deg); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface);
  backdrop-filter: blur(14px);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #f0b747; box-shadow: 0 0 0 4px rgba(240,183,71,.1); }
.mode-pill.live .status-dot { background: #47db8b; box-shadow: 0 0 0 4px rgba(71,219,139,.1); }
.mode-pill.demo .status-dot { background: var(--cyan); box-shadow: 0 0 0 4px rgba(39,232,232,.1); }
.icon-button {
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
}
.icon-button svg { width: 18px; }

main { width: min(1480px, calc(100% - 48px)); margin: 0 auto; }
.hero { padding: 82px 0 58px; max-width: 1120px; }
.eyebrow, .section-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.eyebrow span { width: 26px; height: 1px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.hero h1 {
  margin: 0;
  max-width: 980px;
  font-size: clamp(48px, 6.8vw, 104px);
  line-height: .94;
  letter-spacing: -.072em;
  font-weight: 860;
}
.hero h1 em { color: var(--pink); font-style: normal; position: relative; }
.hero h1 em::after { content: ''; position: absolute; left: 4%; right: 0; bottom: -5px; height: 4px; border-radius: 50%; background: linear-gradient(90deg, var(--pink), transparent); transform: rotate(-2deg); opacity: .75; }
.hero > p { max-width: 750px; margin: 26px 0 34px; color: var(--muted-strong); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.65; }

.search-shell { max-width: 1050px; }
.search-main {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 10px 10px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.search-main > svg { width: 22px; color: var(--muted); }
.search-main input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 17px;
}
.search-main input::placeholder { color: var(--muted); }
.search-main button, .apply-button {
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--pink), #fa176c);
  color: white;
  min-height: 52px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(255,45,134,.22);
}
.search-main button:hover, .apply-button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.search-main button:disabled { opacity: .7; cursor: wait; }
.button-arrow { font-size: 20px; font-weight: 400; }
.quick-topics { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 13px; padding-left: 10px; color: var(--muted); font-size: 12px; }
.quick-topics button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 10px; color: var(--muted-strong); cursor: pointer; }
.quick-topics button:hover { border-color: var(--line-strong); color: var(--text); }

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 34px;
  padding: 26px 0 80px;
  border-top: 1px solid var(--line);
}
.filters {
  align-self: start;
  position: sticky;
  top: 20px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(20px);
}
.panel-heading, .results-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading h2, .results-toolbar h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.04em; }
.text-button { border: 0; background: none; color: var(--pink); font-size: 12px; font-weight: 800; cursor: pointer; padding: 4px; }
.filter-group { padding: 22px 0; border-bottom: 1px solid var(--line); }
.filter-group > label, .range-label label { display: block; margin-bottom: 10px; color: var(--muted-strong); font-size: 12px; font-weight: 750; }
.select-wrap { position: relative; }
.select-wrap select, .sort-control select {
  width: 100%; appearance: none; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--text); outline: 0;
}
.select-wrap select { height: 44px; padding: 0 38px 0 13px; }
.select-wrap svg { position: absolute; right: 13px; top: 50%; width: 16px; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.custom-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.custom-dates label span { display: block; margin: 0 0 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.custom-dates input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px; color: var(--text); background: var(--surface-soft); }
.range-label { display: flex; align-items: center; justify-content: space-between; }
.range-label output { color: var(--cyan); font-size: 12px; font-weight: 800; }
input[type="range"] { width: 100%; accent-color: var(--pink); }
.range-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.segmented { display: grid; grid-template-columns: repeat(3,1fr); padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.segmented button { border: 0; border-radius: 8px; background: transparent; color: var(--muted); padding: 8px 4px; cursor: pointer; font-size: 12px; font-weight: 750; }
.segmented button.active { background: var(--surface-strong); color: var(--text); box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.apply-button { width: 100%; justify-content: center; min-height: 46px; margin-top: 20px; }
.score-explainer { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; margin-top: 22px; }
.score-orbit { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--pink); display: grid; place-items: center; color: var(--pink); font-size: 12px; font-weight: 900; box-shadow: inset 0 0 18px rgba(255,45,134,.12); }
.score-explainer strong { font-size: 12px; }
.score-explainer p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

.results-area { min-width: 0; }
.results-toolbar { margin-bottom: 22px; }
.results-toolbar h2 { font-size: clamp(24px, 3vw, 34px); }
.results-toolbar p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.sort-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.sort-control select { width: 130px; height: 39px; padding: 0 30px 0 11px; }
.export-button { height: 39px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; font-size: 11px; font-weight: 750; }
.export-button svg { width: 15px; }
.export-button:disabled { opacity: .4; cursor: not-allowed; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--line); }
.summary-strip article { padding: 15px 17px; background: var(--surface); }
.summary-strip span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.summary-strip strong { display: block; margin-top: 5px; font-size: 18px; letter-spacing: -.035em; }
.video-grid, .skeleton-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.video-card { min-width: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.video-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.media-link { position: relative; display: block; aspect-ratio: 4 / 4.4; overflow: hidden; background: var(--surface-soft); }
.video-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.video-card:hover .video-thumb { transform: scale(1.045); }
.media-gradient { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), transparent 45%, rgba(0,0,0,.75)); }
.duration-badge, .rank-badge, .open-indicator { position: absolute; z-index: 1; border-radius: 999px; background: rgba(8,8,12,.74); backdrop-filter: blur(9px); color: white; font-size: 10px; font-weight: 750; }
.duration-badge { left: 11px; bottom: 11px; padding: 5px 8px; }
.rank-badge { left: 11px; top: 11px; padding: 5px 8px; }
.open-indicator { right: 11px; bottom: 11px; padding: 5px 8px; opacity: 0; transform: translateY(5px); transition: .2s ease; }
.video-card:hover .open-indicator { opacity: 1; transform: none; }
.score-badge { position: absolute; top: 10px; right: 10px; width: 50px; height: 50px; border-radius: 50%; display: grid; place-content: center; text-align: center; color: white; background: rgba(8,8,12,.78); border: 2px solid var(--pink); box-shadow: 0 0 20px rgba(255,45,134,.2); }
.score-badge span { font-size: 7px; text-transform: uppercase; letter-spacing: .1em; opacity: .78; }
.score-badge strong { font-size: 16px; line-height: 1; }
.card-content { padding: 14px; }
.creator-row { display: flex; align-items: center; gap: 9px; text-decoration: none; min-width: 0; }
.creator-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--surface-soft); }
.creator-row > span:nth-of-type(1) { min-width: 0; }
.creator-row strong, .creator-row small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.creator-row strong { max-width: 135px; font-size: 11px; }
.creator-row small { margin-top: 1px; color: var(--muted); font-size: 9px; }
.verified { flex: 0 0 auto; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; background: var(--cyan); color: #061010; font-size: 9px; font-weight: 950; }
.posted-time { margin-left: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.video-title { margin: 13px 0 9px; min-height: 37px; font-size: 13px; line-height: 1.42; letter-spacing: -.015em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.hashtags { min-height: 18px; display: flex; gap: 5px; overflow: hidden; white-space: nowrap; }
.hashtags span { color: var(--cyan); font-size: 9px; }
.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.metrics-row span { min-width: 0; display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9px; }
.metrics-row svg { width: 12px; flex: 0 0 auto; }
.metrics-row b { overflow: hidden; text-overflow: ellipsis; color: var(--muted-strong); font-weight: 750; }
.velocity-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 8px; }
.velocity-row > span { display: flex; align-items: center; gap: 4px; }
.velocity-row i { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.velocity-row b { color: var(--lime); }
.engagement { color: var(--muted-strong); }
.message-card { padding: 32px; border: 1px dashed var(--line-strong); border-radius: 18px; color: var(--muted-strong); background: var(--surface); text-align: center; line-height: 1.6; }
.message-card strong { display: block; color: var(--text); margin-bottom: 5px; }

.skeleton-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.skeleton-media { aspect-ratio: 4/4.4; }
.skeleton-content { padding: 14px; }
.skeleton-line { height: 11px; margin: 10px 0; border-radius: 99px; }
.skeleton-line.short { width: 55%; }
.skeleton-media, .skeleton-line { background: linear-gradient(90deg, var(--surface-soft), var(--surface-strong), var(--surface-soft)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

footer { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 26px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; text-align: center; }

@media (max-width: 1180px) {
  .video-grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .filters { position: static; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 20px; }
  .panel-heading, .score-explainer { grid-column: 1 / -1; }
  .apply-button { align-self: end; margin-bottom: 22px; }
  .summary-strip { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 650px) {
  .site-header, main, footer { width: min(100% - 28px, 1480px); }
  .site-header { height: 68px; }
  .mode-pill { display: none; }
  .hero { padding: 52px 0 38px; }
  .hero h1 { font-size: clamp(44px, 14vw, 66px); }
  .hero > p { font-size: 15px; }
  .search-main { grid-template-columns: 22px 1fr; padding: 14px 16px; }
  .search-main button { grid-column: 1 / -1; width: 100%; justify-content: center; }
  .filters { grid-template-columns: 1fr; }
  .panel-heading, .score-explainer { grid-column: auto; }
  .results-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: space-between; }
  .sort-control { flex: 1; }
  .sort-control select { width: 100%; }
  .video-grid, .skeleton-grid { grid-template-columns: 1fr; }
  .media-link { aspect-ratio: 4/4.1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
