:root {
  color-scheme: dark;
  --bg: #050608;
  --bg-2: #0a0d11;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.13);
  --surface-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.09);
  --text: #f6f8fb;
  --muted: rgba(246, 248, 251, 0.74);
  --faint: rgba(246, 248, 251, 0.58);
  --cyan: #8fe7ff;
  --coral: #ff8f7b;
  --lime: #d7ff76;
  --violet: #bca8ff;
  --gold: #f2d69b;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(143, 231, 255, 0.14), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(255, 143, 123, 0.12), transparent 26%),
    linear-gradient(145deg, #030405 0%, #080a0e 42%, #0d1016 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-ring, rgba(143, 231, 255, 0.8));
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(48px);
  opacity: 0.42;
  pointer-events: none;
}

.ambient-one {
  width: 360px;
  height: 360px;
  left: -120px;
  top: 26%;
  background: rgba(143, 231, 255, 0.18);
}

.ambient-two {
  right: -120px;
  bottom: 8%;
  width: 420px;
  height: 420px;
  background: rgba(215, 255, 118, 0.1);
}

.glass-panel {
  position: relative;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055)),
    rgba(8, 10, 14, 0.58);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(26px) saturate(142%);
}

.glass-panel::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.18), transparent 32%, rgba(255, 255, 255, 0.05));
  content: "";
  opacity: 0.55;
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.sidebar {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 36px);
  padding: 18px;
  border-radius: var(--radius-lg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 6px 18px;
  background: transparent;
  text-align: left;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(143, 231, 255, 0.24), rgba(255, 143, 123, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 14px 34px rgba(0, 0, 0, 0.38);
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.nav-item,
.momentum-row,
.icon-button {
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  transform: translateY(-1px);
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

button .icon,
a .icon {
  pointer-events: none;
}

.sidebar-search,
.mobile-search,
.search-page-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.18);
}

.sidebar-search label,
.mobile-search label,
.search-page-form label {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-search input,
.mobile-search input,
.search-page-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  text-overflow: ellipsis;
}

.sidebar-search div,
.mobile-search div,
.search-page-form div {
  display: grid;
  gap: 8px;
}

.mobile-search {
  display: none;
  margin-top: 0;
}

.search-page-form {
  margin-top: 0;
}

.search-scope-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search-summary {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
}

.search-summary > span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-summary div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-summary strong {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.search-summary em {
  color: #1d56bd;
  font-style: normal;
}

.microcopy {
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 5px;
  font-size: 40px;
  line-height: 1;
}

h2 {
  font-size: 31px;
  line-height: 1.05;
}

h3 {
  font-size: 18px;
  line-height: 1.18;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.profile-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.profile-strip span,
.platform-badge,
.data-badge,
.chip,
.text-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.profile-strip span {
  padding: 0 12px;
}

.source-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  max-width: min(360px, 100%);
  padding: 0 12px;
  border: 1px solid rgba(38, 54, 76, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.source-status-pill em {
  overflow: hidden;
  color: var(--faint);
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
}

.source-status-pill.is-live,
.data-badge.is-live {
  border-color: rgba(65, 179, 154, 0.3);
  background: rgba(65, 179, 154, 0.12);
  color: #126956;
}

.source-status-pill.is-cached,
.data-badge.is-cached {
  border-color: rgba(39, 110, 241, 0.24);
  background: rgba(39, 110, 241, 0.1);
  color: #1d56bd;
}

.source-status-pill.is-loading,
.data-badge.is-loading {
  border-color: rgba(143, 231, 255, 0.38);
  background: rgba(143, 231, 255, 0.14);
  color: #126174;
}

.source-status-pill.is-demo,
.source-status-pill.is-fallback,
.data-badge.is-demo,
.data-badge.is-fallback {
  border-color: rgba(222, 107, 89, 0.24);
  background: rgba(222, 107, 89, 0.08);
  color: #8e3629;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.brief-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.brief-main,
.library-layout {
  display: grid;
  gap: 16px;
}

.hero-brief {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 196px;
  padding: 26px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.hero-brief h2 {
  max-width: 760px;
}

.hero-brief p {
  max-width: 780px;
  margin-top: 14px;
}

.hero-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.primary-action,
.solid-action,
.ghost-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.primary-action,
.solid-action {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, rgba(143, 231, 255, 0.96), rgba(215, 255, 118, 0.86));
  box-shadow: 0 18px 42px rgba(143, 231, 255, 0.16);
  color: #061014;
}

.ghost-action {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.primary-action:hover,
.solid-action:hover,
.ghost-action:hover {
  transform: translateY(-1px);
}

.full {
  width: 100%;
}

.filter-row {
  display: flex;
  gap: 8px;
  min-height: 62px;
  padding: 12px;
  overflow-x: auto;
  border-radius: 20px;
}

.scope-row,
.age-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 62px;
  padding: 12px;
  border-radius: 20px;
}

.scope-row > span,
.age-row > span {
  margin-right: 4px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-radius: 22px;
}

.search-panel label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-panel input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.search-panel input:focus {
  border-color: rgba(143, 231, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 4px rgba(143, 231, 255, 0.12);
}

.chip {
  min-width: max-content;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
}

.chip.is-active,
.text-chip.is-active {
  border-color: rgba(143, 231, 255, 0.42);
  background: rgba(143, 231, 255, 0.14);
  color: var(--text);
}

.category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-chip {
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.04);
}

.trend-grid,
.library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.trend-card,
.saved-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    background 200ms ease;
}

.trend-media {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 168px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 24px;
  background:
    radial-gradient(circle at 72% 24%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    #10141a;
  isolation: isolate;
}

.trend-media::before,
.trend-media::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.trend-media::before {
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(135deg, black, transparent 82%);
}

.trend-media::after {
  right: 18px;
  bottom: 16px;
  width: 86px;
  height: 122px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 42%, transparent), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 18px 34px rgba(0, 0, 0, 0.38);
  transform: rotate(3deg);
}

.media-luxury::after {
  border-radius: 999px 999px 18px 18px;
}

.media-receipts::after {
  width: 104px;
  height: 98px;
  border-radius: 12px;
  transform: rotate(-3deg);
}

.media-retail::after {
  width: 78px;
  border-radius: 10px;
  transform: rotate(-7deg);
}

.media-fashion::after {
  width: 112px;
  height: 112px;
  border-radius: 50%;
}

.media-community::after {
  width: 112px;
  height: 76px;
  border-radius: 16px;
}

.media-glass {
  position: absolute;
  z-index: 1;
  left: 16px;
  top: 16px;
  display: grid;
  gap: 6px;
  width: min(62%, 260px);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.media-glass strong {
  color: white;
  font-size: 22px;
  line-height: 1.05;
}

.media-platform,
.media-footer span {
  color: rgba(246, 248, 251, 0.7);
  font-size: 12px;
  font-weight: 800;
}

.media-platform {
  color: var(--accent);
}

.media-footer {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 12px;
  left: 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.source-preview {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
}

.source-preview .icon {
  color: var(--cyan);
}

.source-preview p {
  color: rgba(246, 248, 251, 0.78);
  font-size: 13px;
  line-height: 1.45;
}

.source-preview.large {
  max-width: 720px;
  background: rgba(143, 231, 255, 0.07);
}

.trend-card {
  cursor: pointer;
}

.trend-card:hover {
  border-color: rgba(143, 231, 255, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07)),
    rgba(8, 10, 14, 0.62);
  transform: translateY(-3px);
}

.card-meta,
.detail-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.platform-badge {
  min-height: 30px;
  padding: 0 10px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.data-badge {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
  letter-spacing: 0;
}

.card-meta strong,
.detail-title strong {
  margin-left: auto;
  color: var(--lime);
}

.card-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-status-row span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.card-status-row span:first-child {
  border-color: rgba(39, 110, 241, 0.18);
  background: rgba(39, 110, 241, 0.08);
  color: #1d56bd;
}

.video-card .card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-card .ghost-action {
  width: 100%;
  min-width: 0;
  padding-inline: 10px;
}

.ghost-action span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ghost-action.is-source-unavailable,
.ghost-action[aria-disabled="true"] {
  border-color: rgba(222, 107, 89, 0.24);
  background: rgba(222, 107, 89, 0.08);
  color: #8e3629;
  pointer-events: none;
}

.ghost-action.is-source-preview-unavailable {
  border-color: rgba(159, 107, 31, 0.24);
  background: rgba(159, 107, 31, 0.07);
}

.why-box,
.strategy-note {
  padding: 14px;
  border: 1px solid rgba(143, 231, 255, 0.16);
  border-radius: 18px;
  background: rgba(143, 231, 255, 0.07);
}

.why-box span,
.strategy-note span {
  display: block;
  margin-bottom: 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.why-box p,
.strategy-note p {
  color: rgba(246, 248, 251, 0.78);
  font-size: 13px;
}

.card-actions,
.detail-actions,
.transform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ghost-action.is-fallback-link {
  border-color: rgba(222, 107, 89, 0.28);
  background: rgba(222, 107, 89, 0.08);
  color: #8e3629;
}

.right-rail {
  position: sticky;
  top: 124px;
  display: grid;
  gap: 16px;
}

.signal-panel,
.studio-mini {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cyan);
}

.section-heading h2 {
  font-size: 18px;
}

.momentum-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 34px;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  text-align: left;
}

.momentum-row:hover {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.08);
}

.momentum-row span {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.momentum-row strong {
  color: var(--lime);
  font-size: 12px;
}

meter {
  width: 72px;
  height: 8px;
}

meter::-webkit-meter-bar {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

meter::-webkit-meter-optimum-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
}

.detail-layout,
.studio-layout {
  display: grid;
  gap: 18px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: stretch;
  gap: 18px;
  padding: 28px;
  border-radius: var(--radius-lg);
}

.detail-hero p {
  max-width: 900px;
}

.detail-copy {
  display: grid;
  align-content: center;
  gap: 18px;
}

.trend-media-detail {
  min-height: 360px;
}

.trend-media-detail .media-glass {
  width: min(68%, 340px);
  padding: 18px;
}

.trend-media-detail .media-glass strong {
  font-size: 34px;
}

.trend-media-detail::after {
  right: 34px;
  bottom: 52px;
  width: 136px;
  height: 192px;
}

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-stats span {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-stats strong {
  color: var(--text);
}

.detail-editorial {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-lg);
}

.detail-editorial div {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.18);
}

.detail-editorial span {
  display: block;
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-editorial h3 {
  margin-bottom: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stats-layout {
  display: grid;
  gap: 16px;
}

.stats-layout .filter-stack {
  order: 0;
}

.stats-back {
  justify-self: start;
}

.stats-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 20px;
  align-items: stretch;
  padding: 22px;
  border-radius: var(--radius-lg);
}

.stats-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  min-width: 0;
}

.stats-hero .trend-media-detail {
  width: 100%;
  min-height: 0;
  align-self: center;
}

.stats-hero .trend-media-detail .media-glass strong {
  font-size: clamp(24px, 2.6vw, 34px);
}

.stats-copy h2 {
  overflow-wrap: anywhere;
  font-size: clamp(24px, 2.4vw, 36px);
  line-height: 1.08;
}

.stats-copy p {
  color: rgba(23, 32, 51, 0.72);
}

.card-description {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(23, 32, 51, 0.62);
  font-size: 14px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.stats-status-row span {
  min-height: 34px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
}

.metric-card {
  display: grid;
  gap: 7px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.metric-card span,
.metric-card em,
.stats-panel > span,
.stats-panel dt {
  color: var(--faint);
  font-size: 11px;
  font-weight: 900;
  font-style: normal;
  text-transform: none;
}

.metric-card strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: clamp(19px, 1.9vw, 21px);
  line-height: 1.05;
}

.metric-card em {
  align-self: end;
  text-transform: none;
  line-height: 1.25;
}

.stats-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stats-filter-drawer {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
}

.stats-filter-drawer > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 16px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.stats-filter-drawer > summary::-webkit-details-marker {
  display: none;
}

.stats-filter-drawer > summary .icon {
  color: #1d56bd;
}

.stats-filter-drawer .filter-stack {
  padding: 0 14px 14px;
}

.stats-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 184px;
  padding: 18px;
  border-radius: var(--radius-lg);
}

.stats-panel-wide {
  grid-column: 1 / -1;
}

.stats-panel dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.stats-panel dl div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.stats-panel dd {
  margin: 0;
  color: var(--text);
  font-weight: 850;
  line-height: 1.35;
}

.source-metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.source-metric-list strong {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  font-size: 20px;
}

.source-metric-list span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 900;
}

.insight-block {
  min-height: 188px;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.insight-block h3 {
  margin-bottom: 12px;
}

.insight-block ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.studio-layout {
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  align-items: start;
}

.studio-composer,
.preview-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.provider-note {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(215, 255, 118, 0.16);
  border-radius: 16px;
  background: rgba(215, 255, 118, 0.07);
}

.provider-note strong {
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.provider-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.studio-composer {
  position: sticky;
  top: 124px;
}

.studio-strategist-note {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(143, 231, 255, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(143, 231, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.2);
}

.studio-strategist-note span,
.preview-sparks strong {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.studio-strategist-note p {
  color: rgba(246, 248, 251, 0.78);
  font-size: 13px;
  line-height: 1.5;
}

.prompt-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  color: rgba(246, 248, 251, 0.82);
  font-size: 12px;
  font-weight: 800;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.prompt-chip:hover {
  border-color: rgba(143, 231, 255, 0.32);
  background: rgba(143, 231, 255, 0.12);
  color: var(--text);
  transform: translateY(-1px);
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  outline: none;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 14px;
}

textarea {
  min-height: 132px;
  padding: 15px;
  resize: vertical;
}

select {
  height: 46px;
  padding: 0 13px;
}

textarea:focus,
select:focus {
  border-color: rgba(143, 231, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(143, 231, 255, 0.08);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.preview-top,
.version-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.empty-preview {
  display: grid;
  min-height: 360px;
  place-items: center;
  padding: 28px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-preview-rich {
  align-content: center;
  gap: 13px;
  background:
    radial-gradient(circle at 50% 0%, rgba(143, 231, 255, 0.12), transparent 40%),
    rgba(255, 255, 255, 0.025);
}

.empty-preview-rich > p {
  max-width: 620px;
}

.preview-sparks {
  display: grid;
  width: min(560px, 100%);
  gap: 8px;
  margin-top: 2px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.2);
  text-align: left;
}

.preview-sparks small {
  color: rgba(246, 248, 251, 0.72);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.empty-trends {
  display: grid;
  grid-column: 1 / -1;
  min-height: 280px;
  place-items: center;
  padding: 32px;
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-trends span {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(143, 231, 255, 0.22);
  border-radius: 22px;
  background: rgba(143, 231, 255, 0.1);
  color: var(--cyan);
}

.empty-trends p {
  max-width: 540px;
  margin: 10px 0 18px;
}

.loading-trends {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
}

.trend-grid-status {
  grid-column: 1 / -1;
}

.loading-copy {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.loading-copy > span:not(.data-badge) {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(143, 231, 255, 0.24);
  border-radius: 18px;
  background: rgba(143, 231, 255, 0.12);
  color: #126174;
}

.loading-copy h3 {
  margin-bottom: 4px;
}

.loading-copy p {
  font-size: 13px;
  line-height: 1.45;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.skeleton-card {
  display: grid;
  gap: 10px;
  min-height: 232px;
  padding: 12px;
  border: 1px solid rgba(38, 54, 76, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
}

.skeleton-media,
.skeleton-line {
  position: relative;
  overflow: hidden;
  border-radius: 13px;
  background: rgba(38, 54, 76, 0.08);
}

.skeleton-media {
  aspect-ratio: 16 / 9;
}

.skeleton-line {
  height: 13px;
}

.skeleton-line.is-short {
  width: 42%;
}

.skeleton-line.is-mid {
  width: 68%;
}

.skeleton-media::after,
.skeleton-line::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
  content: "";
  transform: translateX(-100%);
  animation: loading-sheen 1.35s ease-in-out infinite;
}

@keyframes loading-sheen {
  to {
    transform: translateX(100%);
  }
}

.generating-panel {
  display: grid;
  min-height: 460px;
  place-items: center;
  padding: 28px;
  border: 1px solid rgba(143, 231, 255, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(143, 231, 255, 0.055);
  text-align: center;
}

.thinking-orb {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(143, 231, 255, 0.24), rgba(215, 255, 118, 0.12));
  color: var(--cyan);
  animation: pulse-orb 1.6s ease-in-out infinite;
}

.skeleton-list {
  display: grid;
  width: min(480px, 100%);
  gap: 10px;
  margin-top: 20px;
}

.skeleton-list span {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.skeleton-list span::after {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  animation: shimmer 1.15s linear infinite;
  content: "";
}

.empty-preview span {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 22px;
  background: rgba(143, 231, 255, 0.1);
  color: var(--cyan);
}

.version-list {
  display: grid;
  gap: 14px;
}

.version-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.22);
}

.version-head h3 {
  font-size: 16px;
}

.version-head div {
  display: flex;
  gap: 8px;
}

pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  color: rgba(246, 248, 251, 0.82);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.65;
}

.library-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.saved-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}

.brief-preview {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 18%, rgba(143, 231, 255, 0.14), transparent 32%),
    rgba(0, 0, 0, 0.2);
}

.brief-preview span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.brief-preview strong {
  font-size: 26px;
  line-height: 1.05;
}

.question {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.18);
}

.question legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.question-hint {
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.country-search {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  outline: none;
}

.country-search:focus {
  border-color: rgba(39, 110, 241, 0.48);
  box-shadow: 0 0 0 3px rgba(39, 110, 241, 0.1);
}

.country-grid {
  max-height: min(230px, 34dvh);
  overflow: auto;
  padding-right: 4px;
}

.option-pill.is-hidden {
  display: none;
}

.option-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.option-pill input:checked + span {
  border-color: rgba(215, 255, 118, 0.42);
  background: rgba(215, 255, 118, 0.13);
  color: var(--text);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, calc(100vw - 44px));
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 20px;
}

.toast span {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(143, 231, 255, 0.12);
  color: var(--cyan);
}

.toast p {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .sidebar {
    padding: 14px;
  }

  .brand span:not(.brand-mark),
  .nav-item span {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .brief-layout,
  .studio-layout {
    grid-template-columns: 1fr;
  }

  .right-rail,
  .studio-composer {
    position: static;
  }

  .detail-hero,
  .detail-editorial,
  .stats-hero {
    grid-template-columns: 1fr;
  }

  .detail-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .ambient {
    display: none;
  }

  .app-shell {
    display: block;
    padding: 10px;
  }

  .workspace,
  .topbar,
  .brief-layout,
  .brief-main,
  .hero-brief,
  .search-page-form,
  .filter-stack,
  .filter-panel,
  .trend-grid,
  .trend-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .sidebar {
    position: static;
    inset: auto;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    height: auto;
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 22px;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand span:not(.brand-mark),
  .nav-item span {
    display: block;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
  }

  .nav-item {
    flex-direction: column;
    gap: 4px;
    min-height: 58px;
    justify-content: center;
    padding: 6px 4px;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.055);
    font-size: 11px;
    line-height: 1.05;
  }

  .nav-item.is-active {
    border-color: rgba(143, 231, 255, 0.42);
    background: rgba(143, 231, 255, 0.16);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  .workspace {
    gap: 10px;
    padding-bottom: 0;
  }

  .topbar,
  .hero-brief,
  .preview-top,
  .version-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions {
    justify-items: stretch;
  }

  .topbar {
    min-height: auto;
  }

  .profile-strip {
    justify-content: flex-start;
  }

  .source-status-pill {
    width: 100%;
    justify-content: space-between;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 24px;
  }

  .trend-grid,
  .library-grid,
  .detail-grid,
  .control-grid,
  .metric-grid,
  .stats-panels,
  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .loading-copy {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .loading-copy .data-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .card-actions,
  .detail-actions,
  .transform-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stats-hero,
  .metric-grid,
  .stats-panel {
    padding: 14px;
  }

  .insight-row {
    grid-template-columns: 1fr;
  }

  .primary-action,
  .solid-action,
  .ghost-action {
    width: 100%;
  }

  .trend-media {
    min-height: 148px;
  }

  .trend-media-detail {
    min-height: 280px;
  }

  .stats-hero .trend-media-detail .media-glass {
    width: min(78%, 270px);
    padding: 14px;
  }

  .stats-hero .trend-media-detail .media-glass strong {
    font-size: 24px;
  }

  .media-glass {
    width: min(72%, 260px);
  }

  .toast {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .brief-preview strong {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .trend-card,
  .glass-panel,
  .ambient {
    animation: rise-in 420ms ease both;
  }

  .ambient {
    animation: float-soft 9s ease-in-out infinite alternate;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-soft {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(18px, -14px, 0);
  }
}

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

@keyframes pulse-orb {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(143, 231, 255, 0.24);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(143, 231, 255, 0);
    transform: scale(1.03);
  }
}

/* Public demo direction: lighter, simpler, and more source-focused. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-2: #eef3f8;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --surface-soft: rgba(255, 255, 255, 0.58);
  --line: rgba(38, 54, 76, 0.16);
  --line-soft: rgba(38, 54, 76, 0.1);
  --text: #172033;
  --muted: rgba(23, 32, 51, 0.68);
  --faint: rgba(23, 32, 51, 0.52);
  --cyan: #276ef1;
  --coral: #de6b59;
  --lime: #24745f;
  --violet: #7257d6;
  --gold: #9f6b1f;
  --shadow: 0 24px 70px rgba(41, 55, 82, 0.14);
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 15% 10%, rgba(109, 183, 255, 0.28), transparent 26%),
    radial-gradient(circle at 85% 12%, rgba(255, 143, 123, 0.18), transparent 24%),
    linear-gradient(145deg, #fbfcff 0%, #edf4f8 52%, #f8f0e8 100%);
}

.ambient {
  opacity: 0.28;
}

.ambient-one {
  background: rgba(109, 183, 255, 0.34);
}

.ambient-two {
  background: rgba(255, 172, 133, 0.24);
}

.glass-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.glass-panel::before {
  opacity: 0.42;
}

.app-shell-simple {
  grid-template-columns: 248px minmax(0, 1fr);
}

.app-shell-simple .nav-list {
  margin-top: 12px;
}

.single-column {
  display: block;
}

.hero-clean {
  min-height: 176px;
}

.hero-clean h2 {
  max-width: 820px;
}

.hero-clean p {
  color: rgba(23, 32, 51, 0.7);
}

.search-panel input {
  background: rgba(255, 255, 255, 0.72);
}

.primary-action,
.solid-action {
  background: linear-gradient(135deg, #276ef1, #41b39a);
  box-shadow: 0 16px 34px rgba(39, 110, 241, 0.18);
  color: #fff;
}

.ghost-action {
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
}

.video-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-card {
  cursor: default;
  gap: 14px;
  padding: 16px;
}

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

.video-card h3 {
  display: -webkit-box;
  min-height: 48px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 20px;
}

.video-card > p {
  min-height: 52px;
}

.source-simple {
  background: rgba(39, 110, 241, 0.055);
}

.source-simple .icon {
  color: #276ef1;
}

.hashtag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.insight-row {
  display: grid;
  grid-template-columns: 1.3fr auto auto;
  gap: 8px;
}

.insight-row span {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(36, 116, 95, 0.12);
  border-radius: 14px;
  background: rgba(65, 179, 154, 0.07);
  color: rgba(23, 32, 51, 0.68);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.insight-row strong {
  display: block;
  margin-bottom: 2px;
  color: #24745f;
  font-size: 11px;
  text-transform: none;
}

.hashtag-row span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(39, 110, 241, 0.13);
  border-radius: 999px;
  background: rgba(39, 110, 241, 0.07);
  color: #1d56bd;
  font-size: 12px;
  font-weight: 800;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-row span {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-row strong {
  color: var(--text);
}

.trend-media {
  --platform-accent: var(--accent);
  background:
    radial-gradient(circle at 72% 24%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.24)),
    #edf3f8;
}

.platform-tiktok {
  --platform-accent: #25f4ee;
}

.platform-instagram {
  --platform-accent: #e4405f;
}

.platform-facebook {
  --platform-accent: #1877f2;
}

.platform-x {
  --platform-accent: #0f1419;
}

.platform-youtube {
  --platform-accent: #ff0033;
}

.platform-linkedin {
  --platform-accent: #0a66c2;
}

.trend-thumbnail {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: saturate(1.06) contrast(0.94);
}

.thumbnail-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 0;
  padding: 0;
  background:
    radial-gradient(circle at 78% 42%, color-mix(in srgb, var(--platform-accent) 24%, transparent), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), color-mix(in srgb, var(--platform-accent) 16%, #edf3f8));
  pointer-events: none;
}

.platform-logo-fallback {
  display: grid;
  place-items: center;
  width: auto;
  height: 112%;
  max-width: none;
  max-height: none;
  aspect-ratio: 1;
  margin-right: clamp(6px, 4%, 34px);
  filter: drop-shadow(0 18px 28px rgba(23, 32, 51, 0.18));
}

.platform-logo-fallback svg,
.platform-logo-fallback img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.thumbnail-fallback span {
  width: max-content;
  max-width: 100%;
  justify-self: end;
  align-self: end;
  margin: 0 clamp(12px, 4%, 34px) 12px 0;
  padding: 5px 9px;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: rgba(23, 32, 51, 0.62);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.trend-media.has-thumbnail-fallback .trend-thumbnail {
  display: none;
}

.trend-media.has-source-thumbnail .thumbnail-fallback {
  opacity: 0;
}

.trend-media::before,
.trend-media::after {
  display: none;
}

.media-glass,
.media-footer {
  z-index: 2;
}

.media-glass {
  background: rgba(255, 255, 255, 0.58);
}

.media-glass strong {
  color: var(--text);
}

.media-platform,
.media-footer span {
  color: rgba(23, 32, 51, 0.62);
}

.sidebar-search,
.mobile-search,
.search-page-form {
  background: rgba(255, 255, 255, 0.5);
}

.sidebar-search input,
.mobile-search input,
.search-page-form input {
  background: rgba(255, 255, 255, 0.72);
}

.onboarding-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: auto;
  background: rgba(237, 244, 248, 0.72);
  backdrop-filter: blur(18px);
}

.onboarding {
  display: grid;
  width: min(860px, 100%);
  max-height: min(860px, calc(100dvh - 44px));
  gap: 18px;
  padding: 24px;
  overflow: auto;
  border-radius: 30px;
}

.onboarding-head {
  display: flex;
  gap: 16px;
  align-items: center;
}

.onboarding-head p {
  margin-top: 8px;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.onboarding-actions {
  position: sticky;
  bottom: -1px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  background: linear-gradient(180deg, transparent, var(--bg-2) 28%, var(--bg-2));
}

.onboarding-actions .primary-action {
  min-width: min(248px, 100%);
  text-align: center;
  white-space: normal;
}

.onboarding-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.08);
}

.onboarding-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #276ef1, #41b39a);
  transition: width 220ms ease;
}

.confirm-panel {
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 12%, rgba(39, 110, 241, 0.1), transparent 34%),
    rgba(255, 255, 255, 0.58);
}

.confirm-panel span {
  color: #1d56bd;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.confirm-panel small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

textarea,
select {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.option-pill span {
  background: rgba(255, 255, 255, 0.66);
}

.option-pill input:checked + span {
  border-color: rgba(39, 110, 241, 0.34);
  background: rgba(39, 110, 241, 0.1);
  color: #1d56bd;
}

.brief-preview,
.question,
.version-card,
.detail-editorial div {
  background: rgba(255, 255, 255, 0.52);
}

.library-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.search-quota-note {
  margin: -2px 0 0;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 16px;
  align-items: start;
}

.settings-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.settings-layout .settings-panel:first-child {
  grid-row: span 2;
}

.settings-panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.settings-panel-head > span {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(39, 110, 241, 0.14);
  border-radius: 16px;
  background: rgba(39, 110, 241, 0.08);
  color: #1d56bd;
}

.settings-panel-head h2 {
  margin-top: 4px;
  font-size: 22px;
}

.settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-fieldset legend {
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-option-grid {
  margin-top: 0;
}

.settings-segment {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-segment label {
  min-width: 0;
}

.settings-segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-segment span {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.settings-segment input:checked + span {
  border-color: rgba(39, 110, 241, 0.34);
  background: rgba(39, 110, 241, 0.11);
  color: #1d56bd;
}

.settings-segment-wrap span {
  min-width: 72px;
}

.quota-card {
  display: grid;
  gap: 5px;
  padding-top: 4px;
}

.quota-card span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.quota-card strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.settings-actions {
  grid-column: 1 / -1;
  justify-self: end;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050608;
  --bg-2: #0a0d11;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.13);
  --surface-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.09);
  --text: #f6f8fb;
  --muted: rgba(246, 248, 251, 0.74);
  --faint: rgba(246, 248, 251, 0.58);
  --cyan: #8fe7ff;
  --coral: #ff8f7b;
  --lime: #d7ff76;
  --violet: #bca8ff;
  --gold: #f2d69b;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 18% 16%, rgba(143, 231, 255, 0.14), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(255, 143, 123, 0.12), transparent 26%),
    linear-gradient(145deg, #030405 0%, #080a0e 42%, #0d1016 100%);
}

:root[data-theme="dark"] .glass-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055)),
    rgba(8, 10, 14, 0.58);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

:root[data-theme="dark"] .hero-clean p,
:root[data-theme="dark"] .stats-copy p,
:root[data-theme="dark"] .card-description,
:root[data-theme="dark"] .source-preview p,
:root[data-theme="dark"] .insight-row span {
  color: rgba(246, 248, 251, 0.74);
}

:root[data-theme="dark"] .sidebar-search,
:root[data-theme="dark"] .mobile-search,
:root[data-theme="dark"] .search-page-form,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] .country-search,
:root[data-theme="dark"] .sidebar-search input,
:root[data-theme="dark"] .mobile-search input,
:root[data-theme="dark"] .search-page-form input,
:root[data-theme="dark"] .search-panel input {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

:root[data-theme="dark"] .ghost-action,
:root[data-theme="dark"] .option-pill span,
:root[data-theme="dark"] .settings-segment span,
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .stats-panel dl div,
:root[data-theme="dark"] .source-metric-list strong,
:root[data-theme="dark"] .stats-filter-drawer,
:root[data-theme="dark"] .skeleton-card,
:root[data-theme="dark"] .card-status-row span {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

:root[data-theme="dark"] .source-status-pill {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

:root[data-theme="dark"] .source-status-pill.is-live,
:root[data-theme="dark"] .data-badge.is-live {
  border-color: rgba(65, 179, 154, 0.36);
  background: rgba(65, 179, 154, 0.14);
  color: #8ff0d3;
}

:root[data-theme="dark"] .source-status-pill.is-cached,
:root[data-theme="dark"] .data-badge.is-cached,
:root[data-theme="dark"] .settings-segment input:checked + span,
:root[data-theme="dark"] .option-pill input:checked + span {
  border-color: rgba(143, 231, 255, 0.42);
  background: rgba(143, 231, 255, 0.14);
  color: var(--text);
}

:root[data-theme="dark"] .trend-media {
  background:
    radial-gradient(circle at 72% 24%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    #10141a;
}

:root[data-theme="dark"] .media-glass {
  background: rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .media-glass strong {
  color: #fff;
}

@media (max-width: 1180px) {
  .video-grid,
  .library-grid,
  .settings-layout,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-layout .settings-panel:first-child {
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .app-shell-simple {
    display: block;
  }

  .sidebar-search {
    display: none;
  }

  .mobile-search {
    display: grid;
    padding: 12px;
    border-radius: 20px;
  }

  .app-shell-simple .nav-list {
    grid-template-columns: repeat(4, 1fr);
  }

  .video-grid,
  .library-grid,
  .settings-layout,
  .settings-fields,
  .metric-grid,
  .stats-panels {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    justify-self: stretch;
  }

  .onboarding-grid,
  .onboarding-actions {
    grid-template-columns: 1fr;
  }

  .onboarding-actions,
  .search-panel {
    display: grid;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }
}

/* Gen Z feed pass: faster first read, clearer modes, richer cards. */
.hero-clean {
  min-height: 142px;
  padding: 24px;
}

.hero-clean h2 {
  max-width: 900px;
  font-size: clamp(28px, 4vw, 48px);
}

.hero-clean p {
  max-width: 880px;
  margin-top: 10px;
}

.hero-signal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-signal-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(39, 110, 241, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(23, 32, 51, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.hero-signal-strip .icon {
  width: 15px;
  height: 15px;
  color: #276ef1;
}

.filter-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  order: 2;
}

.filter-stack-personal {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter-stack-search {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 116px;
  padding: 12px;
  border-radius: 18px;
}

.filter-panel > span {
  overflow: hidden;
  color: var(--faint);
  font-size: 11px;
  font-weight: 950;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.filter-options,
.filter-expansion,
.filter-expansion-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-options {
  align-content: flex-start;
}

.filter-panel .chip {
  min-width: 0;
  max-width: 100%;
  min-height: 32px;
  padding: 0 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.54);
  color: rgba(23, 32, 51, 0.68);
  font-size: 11px;
  text-overflow: ellipsis;
}

.filter-panel .chip.is-active,
.filter-panel .chip.has-selection {
  border-color: rgba(39, 110, 241, 0.24);
  background: rgba(39, 110, 241, 0.1);
  color: #1d56bd;
}

.filter-expansion {
  padding-top: 3px;
  border-top: 1px solid rgba(38, 54, 76, 0.08);
}

.mode-area-expansion {
  align-content: flex-start;
}

.filter-expansion-tall {
  display: grid;
  gap: 8px;
}

.filter-expansion-grid {
  max-height: 188px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.filter-search {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(38, 54, 76, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  outline: none;
}

.filter-search:focus {
  border-color: rgba(39, 110, 241, 0.28);
  box-shadow: 0 0 0 4px rgba(39, 110, 241, 0.08);
}

.filter-expansion .is-hidden {
  display: none;
}

.mode-chip {
  display: inline-grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(38, 54, 76, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  color: rgba(23, 32, 51, 0.68);
  text-align: left;
}

.mode-chip:hover,
.mode-chip.is-active {
  border-color: rgba(39, 110, 241, 0.24);
  background: rgba(39, 110, 241, 0.1);
  color: #1d56bd;
}

.mode-chip .icon {
  width: 15px;
  height: 15px;
}

.mode-chip strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-grid {
  order: 4;
}

.load-more {
  order: 5;
}

.trend-dna {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.trend-dna span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(36, 116, 95, 0.12);
  border-radius: 999px;
  background: rgba(65, 179, 154, 0.08);
  color: #24745f;
  font-size: 11px;
  font-weight: 900;
}

.quick-take {
  display: -webkit-box;
  min-height: 44px;
  overflow: hidden;
  color: rgba(23, 32, 51, 0.68);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.quick-take strong {
  color: var(--text);
  font-weight: 900;
}

.video-card {
  border-radius: 24px;
}

.video-card h3 {
  min-height: 46px;
}

.video-card > p.card-description {
  min-height: 0;
}

.card-about strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
}

.stats-copy .trend-dna {
  max-width: 620px;
}

.stats-panel-wide p {
  color: rgba(23, 32, 51, 0.72);
}

@media (max-width: 1180px) {
  .filter-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-stack-search {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .hero-clean {
    min-height: auto;
    padding: 20px;
  }

  .hero-clean h2 {
    font-size: 27px;
  }

  .hero-clean p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .hero-signal-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .hero-signal-strip span {
    flex: 0 0 auto;
  }

  .filter-stack {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    min-height: 0;
  }

  .filter-options {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .filter-panel .chip,
  .mode-chip {
    flex: 0 0 auto;
  }

  .quick-take {
    min-height: auto;
  }
}

:root[data-theme="dark"] .onboarding-backdrop {
  background: rgba(3, 4, 5, 0.72);
}

:root[data-theme="dark"] .onboarding-progress {
  background: rgba(255, 255, 255, 0.1);
}

/* TikTok-style Atelier feed: dark glass surfaces, media-first, one electric accent. */
:root {
  --social-bg: #08080d;
  --social-text: #f3f4f8;
  --social-muted: rgba(243, 244, 248, 0.6);
  --social-line: rgba(255, 255, 255, 0.09);
  --social-card: #10101a;
  --social-card-text: #f3f4f8;
  --option-bg: rgba(255, 255, 255, 0.06);
  --option-text: #f3f4f8;
  --option-border: rgba(255, 255, 255, 0.12);
  --option-selected-bg: linear-gradient(135deg, #7c5cff 0%, #3ec6ff 100%);
  --option-selected-text: #fff;
  --accent: #7c5cff;
  --accent-2: #3ec6ff;
  --accent-grad: linear-gradient(135deg, #7c5cff 0%, #3ec6ff 100%);
  --accent-soft: rgba(124, 92, 255, 0.16);
  --accent-ring: rgba(124, 92, 255, 0.55);
  --accent-glow: 0 10px 30px rgba(101, 92, 255, 0.32);
}

:root[data-theme="light"] {
  --social-bg: #f6f6fa;
  --social-text: #12121a;
  --social-muted: rgba(18, 18, 26, 0.6);
  --social-line: rgba(18, 18, 26, 0.1);
  --social-card: #fff;
  --social-card-text: #12121a;
  --option-bg: rgba(18, 18, 26, 0.05);
  --option-text: #12121a;
  --option-border: rgba(18, 18, 26, 0.13);
  --option-selected-bg: linear-gradient(135deg, #6d4aff 0%, #1fb3f5 100%);
  --option-selected-text: #fff;
  --accent: #6d4aff;
  --accent-2: #1fb3f5;
  --accent-grad: linear-gradient(135deg, #6d4aff 0%, #1fb3f5 100%);
  --accent-soft: rgba(109, 74, 255, 0.12);
  --accent-ring: rgba(109, 74, 255, 0.5);
  --accent-glow: 0 10px 26px rgba(109, 74, 255, 0.28);
}

body,
:root[data-theme="light"] body {
  background:
    radial-gradient(1100px 700px at 88% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(900px 640px at -8% 108%, rgba(62, 198, 255, 0.07), transparent 58%),
    var(--social-bg);
  background-attachment: fixed;
  color: var(--social-text);
}

.ambient {
  display: none;
}

.social-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 0;
  min-height: 100dvh;
  padding: 0;
  background: transparent;
}

.social-shell.has-search-drawer {
  grid-template-columns: 230px 340px minmax(0, 1fr);
}

.social-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 100dvh;
  flex-direction: column;
  gap: 18px;
  padding: 24px 16px;
  border: 0;
  border-right: 1px solid var(--social-line);
  border-radius: 0;
  background: color-mix(in srgb, var(--social-bg) 76%, transparent);
  box-shadow: none;
  color: var(--social-text);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.social-sidebar::before {
  display: none;
}

.social-sidebar .brand {
  gap: 10px;
  padding: 0 6px 4px;
  color: var(--social-text);
}

.social-sidebar .brand-mark {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: var(--accent-grad);
  box-shadow: var(--accent-glow);
  color: #fff;
}

.social-sidebar .brand strong {
  color: var(--social-text);
  font-size: 18px;
  font-weight: 900;
}

.social-sidebar .brand small {
  color: var(--social-muted);
}

.sidebar-search-trigger,
.inverse-control,
.social-sidebar .nav-item,
.category-option {
  display: flex;
  align-items: center;
  min-height: 50px;
  gap: 11px;
  padding: 0 14px;
  border: 1px solid var(--option-border);
  border-radius: 13px;
  background: var(--option-bg);
  box-shadow: none;
  color: var(--option-text);
  font-weight: 800;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.sidebar-search-trigger {
  width: 100%;
  justify-content: flex-start;
}

.social-sidebar .nav-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.social-sidebar .nav-item {
  justify-content: flex-start;
  width: 100%;
  padding: 0 14px;
  color: var(--option-text);
}

.social-sidebar .nav-item span {
  display: inline;
}

.sidebar-search-trigger:hover,
.inverse-control:hover,
.social-sidebar .nav-item:hover,
.category-option:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--option-border));
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--option-bg));
  color: var(--social-text);
  transform: translateY(-1px);
}

.sidebar-search-trigger.is-active,
.social-sidebar .nav-item.is-active,
.category-option.is-active {
  border-color: transparent;
  background: var(--option-selected-bg);
  color: var(--option-selected-text);
  box-shadow: var(--accent-glow);
  transform: none;
}

.social-workspace {
  display: block;
  min-width: 0;
  min-height: 100dvh;
  background: transparent;
  color: var(--social-text);
}

.search-drawer {
  position: sticky;
  top: 0;
  z-index: 19;
  display: grid;
  height: 100dvh;
  align-content: start;
  gap: 30px;
  padding: 30px 26px;
  overflow-y: auto;
  border-right: 1px solid var(--social-line);
  background: color-mix(in srgb, var(--social-bg) 82%, transparent);
  color: var(--social-text);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.search-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-drawer-head h2 {
  font-size: 30px;
  line-height: 1;
}

.search-drawer-close {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--option-border);
  border-radius: 50%;
  background: var(--option-bg);
  color: var(--social-text);
  transition: background 150ms ease, border-color 150ms ease;
}

.search-drawer-close:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--option-border));
  background: var(--accent-soft);
}

.search-drawer-form {
  display: grid;
  gap: 14px;
}

.search-drawer-form label {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-drawer-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--option-border);
  border-radius: 13px;
  background: var(--option-bg);
  color: var(--social-text);
  font: inherit;
  font-weight: 700;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-drawer-form input::placeholder {
  color: var(--social-muted);
}

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

.search-drawer-form .search-quota-note {
  margin: 0;
  color: var(--social-muted);
  font-size: 12px;
  font-weight: 750;
}

.search-drawer-form > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.search-drawer-form .primary-action,
.search-drawer-form .ghost-action {
  min-height: 46px;
  border: 0;
  border-radius: 13px;
  background: var(--accent-grad);
  box-shadow: var(--accent-glow);
  color: #fff;
  font-weight: 800;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.search-drawer-form .primary-action:hover,
.search-drawer-form .ghost-action:hover {
  transform: translateY(-1px);
}

.search-drawer-form .ghost-action {
  border: 1px solid var(--option-border);
  background: var(--option-bg);
  box-shadow: none;
  color: var(--social-text);
}

.for-you-layout {
  position: relative;
  height: 100dvh;
  overflow: hidden;
}

.for-you-feed {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.for-you-feed::-webkit-scrollbar {
  display: none;
}

.for-you-item {
  display: grid;
  min-height: 100dvh;
  padding: 16px 28px;
  place-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.for-you-item.is-unavailable {
  display: none;
}

.for-you-stage {
  display: grid;
  grid-template-columns: minmax(0, auto) 72px;
  gap: 18px;
  align-items: end;
}

.for-you-media {
  position: relative;
  display: block;
  width: auto;
  height: min(820px, calc(100dvh - 32px));
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: #101013;
  color: #fff;
  isolation: isolate;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 4px 16px rgba(0, 0, 0, 0.35);
  transition: border-color 240ms ease, box-shadow 240ms ease;
}

.for-you-media.is-live {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.62),
    0 0 52px var(--accent-soft),
    0 4px 16px rgba(0, 0, 0, 0.35);
}

/* The embed is swapped into this slot by hand so scrolling never rebuilds the feed. */
.for-you-screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 1;
  background: #000;
  transition: opacity 220ms ease;
}

/* Clips the Instagram embed to its media region: header shifted out the top,
   caption/"More videos" chrome cropped past the bottom, video centered on black. */
.ig-embed-crop {
  position: relative;
  overflow: hidden;
  background: #000;
}

.ig-embed-crop .inline-source-player {
  inset: auto;
  left: 0;
}

.for-you-screen:empty {
  pointer-events: none;
}

/* Standby preloads warm up behind the poster; only the active card shows its player. */
.for-you-media:not(.is-live) .for-you-screen {
  visibility: hidden;
  opacity: 0;
}

/* Players that report playback states (TikTok/YouTube) stay hidden behind our
   poster until the video actually plays, so their splash screens never flash.
   Once a frame has played, the mask never re-arms — pausing must not cover it. */
.for-you-media.is-live.is-reporting:not(.has-played) .for-you-screen {
  opacity: 0;
}

.for-you-tap {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  width: 100%;
  height: 100%;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.for-you-media.is-live .for-you-tap {
  display: none;
}

.for-you-tap .media-play-mark {
  position: static;
  width: 76px;
  height: 76px;
  transform: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(12, 12, 16, 0.55);
  opacity: 0.95;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.45);
  transition: transform 180ms ease, background 180ms ease, opacity 180ms ease;
}

.for-you-tap .media-play-mark .icon {
  width: 30px;
  height: 30px;
  margin-left: 3px;
}

.for-you-tap:hover .media-play-mark,
.for-you-tap:focus-visible .media-play-mark {
  opacity: 1;
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.2);
}

.inline-player {
  cursor: default;
  isolation: isolate;
}

.inline-source-player {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.inline-player-controls {
  position: absolute;
  z-index: 7;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 7px;
  pointer-events: none;
}

.inline-player-start {
  position: absolute;
  z-index: 6;
  inset: 50% auto auto 50%;
  display: grid;
  width: 64px;
  height: 64px;
  padding: 0;
  place-items: center;
  translate: -50% -50%;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
}

.inline-player.is-playing .inline-player-start {
  display: none;
}

.inline-player-start:hover,
.inline-player-start:focus-visible {
  background: #fff;
  color: #000;
}

.inline-player-start .icon {
  width: 24px;
  height: 24px;
}

.inline-player-control {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.inline-player-control:hover,
.inline-player-control:focus-visible {
  background: #fff;
  color: #000;
}

.inline-player-control .icon {
  width: 16px;
  height: 16px;
}

.social-thumbnail,
.archive-media .trend-thumbnail {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* A broken image must never leak its alt text over the card; the platform
     fallback layer underneath carries the label instead. */
  color: transparent;
  font-size: 0;
  overflow: hidden;
}

.social-thumbnail-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #181818;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.media-play-mark,
.archive-play-mark {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
}

.media-play-mark {
  top: 50%;
  left: 50%;
  width: 66px;
  height: 66px;
  transform: translate(-50%, -50%) scale(0.94);
}

.archive-media:hover .archive-play-mark,
.archive-media:focus-visible .archive-play-mark {
  opacity: 1;
}

.for-you-caption {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 76px 18px 18px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.42) 46%, rgba(0, 0, 0, 0.82) 100%);
  color: #fff;
  text-align: left;
  pointer-events: none;
  transition: opacity 200ms ease;
}

/* Once the embed owns the frame it also owns its own overlays, so ours steps back. */
.for-you-media.is-live .for-you-caption {
  opacity: 0;
}

.for-you-media.is-live:hover .for-you-caption,
.for-you-media.is-live:focus-within .for-you-caption {
  opacity: 1;
}

.for-you-caption strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.for-you-caption span {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.94);
  font-size: 14px;
  line-height: 1.4;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.for-you-caption small {
  padding: 4px 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.for-you-comments {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(420px, 92vw);
}

.for-you-comments-scrim {
  border: 0;
  background: rgba(0, 0, 0, 0.48);
  cursor: pointer;
  animation: for-you-scrim-in 200ms ease both;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.for-you-comments-shell {
  position: relative;
  display: grid;
  overflow: hidden;
  grid-template-rows: minmax(0, 1fr);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  background: #0b0b0b;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
  animation: for-you-sheet-in 260ms cubic-bezier(0.32, 0.72, 0.28, 1) both;
}

@keyframes for-you-scrim-in {
  from {
    opacity: 0;
  }
}

@keyframes for-you-sheet-in {
  from {
    opacity: 0;
    translate: 32px 0;
  }
}

@keyframes for-you-sheet-in-up {
  from {
    opacity: 0;
    translate: 0 36px;
  }
}

.for-you-comments-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.for-you-comments .player-comments-panel {
  max-height: none;
  border-left: 0;
}

.for-you-comments .comments-head {
  padding-right: 62px;
}

.metric-rail {
  display: grid;
  gap: 14px;
  padding-bottom: 10px;
}

.metric-rail-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--social-text);
  font-style: normal;
}

.metric-rail-item i {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--option-border);
  border-radius: 50%;
  background: var(--option-bg);
  color: var(--option-text);
  font-style: normal;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.metric-action:hover i,
.metric-action:focus-visible i,
.metric-save:hover i,
.metric-save:focus-visible i {
  transform: translateY(-2px) scale(1.05);
}

.metric-rail-item .icon {
  width: 23px;
  height: 23px;
}

.metric-rail-item strong {
  max-width: 68px;
  overflow: hidden;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-save,
.metric-action {
  padding: 0;
  border: 0;
  background: transparent;
}

.metric-action {
  cursor: pointer;
}

.metric-action:hover i,
.metric-action:focus-visible i {
  border-color: var(--social-text);
}

.trends-layout,
.search-results-layout {
  min-height: 100dvh;
  padding: 20px 22px 40px;
}

.trends-category-bar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  gap: 9px;
  padding: 0 0 16px;
  overflow-x: auto;
  background: transparent;
  scrollbar-width: none;
}

.trends-category-bar::-webkit-scrollbar {
  display: none;
}

.category-option {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 17px;
  border-radius: 999px;
}

.trends-results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 8px 0 18px;
}

.trends-results-head h1 {
  margin: 0;
  color: var(--social-text);
  font-size: clamp(32px, 4vw, 54px);
  letter-spacing: -0.02em;
  line-height: 1;
}

.trends-results-head > div {
  min-width: 0;
}

.smart-search-note {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  margin: 9px 0 0;
  color: var(--social-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.smart-search-note .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

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

.search-archive-grid {
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 16px;
}

.search-archive-grid .archive-media {
  aspect-ratio: 3 / 4;
}

.archive-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--social-line);
  border-radius: 16px;
  background: var(--social-card);
  color: var(--social-card-text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.archive-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--social-line));
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
}

.archive-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #181818;
  color: #fff;
}

.archive-play-mark {
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
}

.archive-play-mark .icon {
  width: 17px;
  height: 17px;
}

.archive-copy {
  display: grid;
  gap: 7px;
  padding: 10px 11px 11px;
}

.archive-platform {
  overflow: hidden;
  color: color-mix(in srgb, var(--social-card-text) 62%, transparent);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-copy h2 {
  display: -webkit-box;
  min-height: 35px;
  overflow: hidden;
  color: var(--social-card-text);
  font-size: 13px;
  font-weight: 820;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.archive-metrics {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  color: color-mix(in srgb, var(--social-card-text) 78%, transparent);
  font-size: 11px;
  font-weight: 800;
}

/* Long compact counts ("176,82 Mn") used to spill out of their grid tracks and
   print over the neighbouring number; clipping keeps every figure in its lane. */
.archive-metrics span,
.archive-metrics button {
  display: inline-flex;
  overflow: hidden;
  min-width: 0;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.archive-metrics .icon {
  flex: 0 0 auto;
}

.archive-page-sentinel {
  height: 44px;
}

.archive-metrics button {
  justify-content: center;
  padding: 0;
  background: transparent;
  color: var(--social-card-text);
}

.archive-metrics .archive-save-button {
  gap: 3px;
  font-size: 10px;
  font-weight: 850;
}

/* Icon-only: the label was the one item left half-clipped on narrow cards. */
.archive-metrics .archive-save-button span {
  display: none;
}

.archive-metrics .icon {
  width: 13px;
  height: 13px;
}

.archive-metrics .archive-save-button .icon {
  width: 13px;
  height: 13px;
}

.player-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  padding: 18px;
  place-items: center;
  background: rgba(0, 0, 0, 0.88);
}

.player-shell {
  display: grid;
  width: min(520px, 100%);
  max-height: calc(100dvh - 36px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: #050508;
  color: #fff;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.6);
}

.player-shell.has-comments {
  width: min(940px, 100%);
}

.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.player-head-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.player-head-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.player-head strong {
  font-size: 12px;
  text-transform: uppercase;
}

.player-head span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-head button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: transparent;
  color: #fff;
}

.player-head .player-sound-button,
.player-head .player-playback-button {
  width: 34px;
  height: 34px;
  border-color: rgba(255, 255, 255, 0.3);
}

.player-head .player-sound-button .icon,
.player-head .player-playback-button .icon {
  width: 17px;
  height: 17px;
}

.source-player {
  display: block;
  width: 100%;
  height: min(72dvh, 820px);
  border: 0;
  background: #000;
}

.player-body {
  display: grid;
  min-height: 0;
}

.player-body.has-comments {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
}

.player-comments-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  max-height: min(72dvh, 820px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  background: #0b0b0b;
}

.comments-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.comments-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.comments-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.comments-status {
  display: grid;
  min-height: 180px;
  padding: 24px;
  place-items: center;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
  text-align: center;
}

.comments-error {
  color: rgba(255, 255, 255, 0.78);
}

.player-comment {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comment-avatar {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: #222;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.comment-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.comment-author {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
}

.comment-author strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-author span,
.comment-author time {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-author time {
  margin-left: auto;
}

.comment-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.comment-metrics {
  display: flex;
  gap: 14px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  font-weight: 800;
}

.comment-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comment-metrics .icon {
  width: 12px;
  height: 12px;
}

.comments-more {
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--accent-grad);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.comments-more:disabled {
  cursor: progress;
  opacity: 0.65;
}

.player-fallback {
  display: grid;
  min-height: 420px;
  padding: 24px;
  place-items: center;
  text-align: center;
}

.player-external {
  justify-content: center;
}

.player-actions {
  display: flex;
  gap: 8px;
  padding: 12px;
}

.player-actions > button {
  min-width: 0;
  flex: 1 1 0;
  justify-content: center;
}

.player-actions .icon {
  flex: 0 0 auto;
}

.social-shell .topbar {
  margin: 18px 20px 0;
  border: 1px solid var(--social-line);
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--social-text);
}

.social-shell .topbar::before {
  display: none;
}

.social-shell .settings-panel,
.social-shell .saved-card,
.social-shell .hero-brief,
.social-shell .empty-preview {
  border: 1px solid var(--social-line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--social-card) 72%, transparent);
  box-shadow: none;
  color: var(--social-text);
}

/* Settings stays TikTok-compact: one tight column, small headers, no hero padding. */
.social-shell .settings-layout {
  max-width: 560px;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.social-shell .settings-layout .settings-panel:first-child {
  grid-row: auto;
}

.social-shell .settings-panel {
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
}

.social-shell .settings-panel-head {
  gap: 10px;
}

.social-shell .settings-panel-head > span {
  width: 30px;
  height: 30px;
  border: 1px solid var(--option-border);
  border-radius: 9px;
  background: var(--option-bg);
  color: var(--social-text);
}

.social-shell .settings-panel-head > span .icon {
  width: 15px;
  height: 15px;
}

.social-shell .settings-panel-head .microcopy {
  display: none;
}

.social-shell .settings-panel-head h2 {
  margin-top: 0;
  font-size: 14px;
  font-weight: 850;
}

.social-shell .settings-fields {
  gap: 8px;
}

.social-shell .settings-fields .field > span {
  font-size: 11px;
}

.social-shell select {
  min-height: 38px;
  padding: 0 10px;
  font-size: 13px;
}

.social-shell .settings-fieldset {
  gap: 8px;
  padding: 0;
  border: 0;
}

.social-shell .settings-fieldset legend {
  margin-bottom: 6px;
  font-size: 11px;
}

.social-shell .settings-panel .option-pill > span {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.social-shell .settings-segment label > span {
  min-height: 36px;
  font-size: 12px;
}

.social-shell .settings-panel .question-hint {
  margin: 0;
  font-size: 11px;
}

.social-shell .library-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.social-shell .saved-video-card {
  overflow: hidden;
  padding: 0;
  border-radius: 16px;
  background: var(--social-card);
  transition: transform 160ms ease, border-color 160ms ease;
}

.social-shell .saved-video-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--social-line));
  transform: translateY(-3px);
}

.saved-video-card .archive-copy {
  gap: 8px;
}

.saved-video-card .archive-copy h2 {
  min-height: 0;
}

.saved-video-card .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.saved-video-card .card-actions .ghost-action {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--option-border);
  border-radius: 10px;
  background: var(--option-bg);
  color: var(--social-text);
  font-size: 11px;
  font-weight: 800;
}

.search-live-note {
  margin: 0 0 12px;
  color: var(--social-muted);
}

.account-body {
  margin: 0;
  color: var(--social-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.account-body strong {
  color: var(--social-text);
}

.account-warning {
  color: #ffb4a2;
}

.account-form {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.account-input {
  min-width: 0;
  flex: 1 1 220px;
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid var(--option-border);
  border-radius: 12px;
  background: var(--option-bg);
  color: var(--social-text);
  font: inherit;
  font-weight: 700;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

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

.account-cta {
  display: inline-flex;
  min-height: 46px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent-grad);
  box-shadow: var(--accent-glow);
  color: #fff;
  font-weight: 800;
}

.account-secondary {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  align-self: start;
  padding: 0 14px;
  border: 1px solid var(--option-border);
  border-radius: 11px;
  background: var(--option-bg);
  color: var(--social-text);
  font-size: 12px;
  font-weight: 800;
}

.onboarding-signin {
  justify-self: start;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--option-border);
  border-radius: 11px;
  background: var(--option-bg);
  color: var(--social-text);
  font-size: 12px;
  font-weight: 800;
}

/* Sidebar login: prominent like TikTok's, below the navigation. */
.sidebar-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  gap: 9px;
  margin-top: 4px;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  background: var(--accent-grad);
  box-shadow: var(--accent-glow);
  color: #fff;
  font-weight: 850;
  transition: transform 150ms ease;
}

.sidebar-login:hover {
  transform: translateY(-1px);
}

.sidebar-login.is-signed-in {
  border: 1px solid var(--option-border);
  background: var(--option-bg);
  box-shadow: none;
  color: var(--social-text);
}

/* TikTok-style login overlay. */
.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  padding: 18px;
  place-items: center;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.auth-modal {
  position: relative;
  display: grid;
  width: min(400px, 100%);
  gap: 13px;
  padding: 30px 26px 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: #121218;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.6);
  color: #f3f4f8;
}

.auth-modal h2 {
  margin: 2px 0 6px;
  text-align: center;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.01em;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #f3f4f8;
}

.auth-close .icon {
  width: 15px;
  height: 15px;
}

.auth-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #f3f4f8;
  font-weight: 800;
  transition: background 150ms ease, border-color 150ms ease;
}

.auth-option:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, rgba(255, 255, 255, 0.14));
  background: var(--accent-soft);
}

.auth-option .icon {
  width: 17px;
  height: 17px;
}

.auth-modal .account-body {
  text-align: center;
}

.auth-modal .account-form {
  justify-content: center;
}

.auth-modal .account-secondary {
  justify-self: center;
}

.auth-subtitle {
  margin: -6px 0 4px;
  text-align: center;
  color: rgba(243, 244, 248, 0.66);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}

.auth-error {
  margin: 0;
  padding: 10px 13px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 11px;
  background: rgba(255, 107, 107, 0.12);
  color: #ff9c9c;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
}

/* Official "Continue with Google" button, per Google's branding guidance:
   white surface, subtle border, the multicolor G at 18-20px. */
.auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  gap: 11px;
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #fff;
  color: #1f1f1f;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: box-shadow 150ms ease, background 150ms ease;
}

.auth-google:hover {
  background: #f7f8f8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

.auth-google .google-logo {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  color: rgba(243, 244, 248, 0.45);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.auth-form {
  display: grid;
  gap: 9px;
}

.auth-label {
  color: rgba(243, 244, 248, 0.66);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.auth-form .account-input {
  width: 100%;
  text-align: left;
}

.auth-code-input {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.42em;
}

.auth-code-input::placeholder {
  letter-spacing: 0.42em;
  color: rgba(243, 244, 248, 0.25);
}

.auth-cta {
  width: 100%;
}

.auth-cta[disabled] {
  opacity: 0.65;
}

.auth-hint {
  margin: -2px 0 0;
  text-align: center;
  color: rgba(243, 244, 248, 0.55);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.auth-legal {
  margin: 2px 0 0;
  text-align: center;
  color: rgba(243, 244, 248, 0.45);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.55;
}

.auth-legal a {
  color: rgba(243, 244, 248, 0.75);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(243, 244, 248, 0.4);
}

.auth-link {
  border: 0;
  background: none;
  padding: 4px 2px;
  color: rgba(243, 244, 248, 0.72);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.auth-link:hover {
  color: #fff;
}

.auth-link[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* Compact TikTok-style settings: account card, accordion rows, icon theme toggle. */
.settings-compact {
  display: grid;
  width: min(560px, 100%);
  gap: 14px;
}

.settings-account {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 13px;
  padding: 15px 17px;
}

@media (max-width: 620px) {
  .settings-account {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .settings-account-action {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}

.settings-account-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.settings-account-avatar .icon {
  width: 21px;
  height: 21px;
}

.settings-account-info {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.settings-account-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 800;
}

.settings-account-info span {
  color: var(--muted-text, rgba(140, 140, 155, 0.9));
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.settings-account-action {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 15px;
  font-size: 12.5px;
}

.settings-list {
  display: grid;
  padding: 4px 0;
}

.settings-row {
  border-bottom: 1px solid var(--option-border);
}

.settings-row:last-of-type {
  border-bottom: 0;
}

.settings-row-head {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  gap: 11px;
  padding: 0 17px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.settings-row-label {
  flex: 0 0 auto;
  font-size: 13.5px;
  font-weight: 800;
}

.settings-row-value {
  overflow: hidden;
  flex: 1;
  color: var(--muted-text, rgba(140, 140, 155, 0.95));
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.settings-row-chevron {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--muted-text, rgba(140, 140, 155, 0.8));
  transition: transform 160ms ease;
}

.settings-row-chevron .icon {
  width: 15px;
  height: 15px;
}

.settings-row.is-open .settings-row-chevron {
  transform: rotate(180deg);
}

.settings-row-body {
  padding: 2px 17px 15px;
}

.settings-row-body .question-hint {
  margin: 0 0 8px;
}

.settings-row-static {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 11px;
  padding: 0 17px;
}

.settings-row-static .settings-row-value {
  text-align: right;
}

.settings-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.settings-pill {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--option-border);
  border-radius: 999px;
  background: var(--option-bg);
  color: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.settings-pill:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--option-border));
}

.settings-pill.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.settings-country-select {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--option-border);
  border-radius: 11px;
  background: var(--option-bg);
  color: inherit;
  font: inherit;
  font-weight: 700;
}

.theme-toggle {
  display: inline-flex;
  margin-left: auto;
  padding: 3px;
  border: 1px solid var(--option-border);
  border-radius: 999px;
  background: var(--option-bg);
  gap: 3px;
}

.theme-toggle-btn {
  display: grid;
  width: 34px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted-text, rgba(140, 140, 155, 0.9));
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.theme-toggle-btn .icon {
  width: 16px;
  height: 16px;
}

.theme-toggle-btn.is-selected {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--accent-glow);
}

.settings-compact .settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 13px 17px;
  border-top: 1px solid var(--option-border);
}

.settings-dirty {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.settings-save[disabled] {
  opacity: 0.55;
}

.settings-preview-hint {
  margin: 0;
  color: var(--muted-text, rgba(140, 140, 155, 0.85));
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

/* First-visit gate: brand + sign in / guest, nothing else. */
.welcome-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  padding: 20px;
  place-items: center;
}

.welcome-card {
  display: grid;
  width: min(400px, 100%);
  justify-items: center;
  gap: 10px;
  padding: 40px 30px 32px;
  text-align: center;
}

.welcome-mark {
  width: 54px;
  height: 54px;
  font-size: 19px;
}

.welcome-card h1 {
  margin: 6px 0 0;
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.welcome-card h1 span {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-tagline {
  margin: 0 0 14px;
  color: var(--muted-text, rgba(140, 140, 155, 0.95));
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.welcome-actions {
  display: grid;
  width: 100%;
  gap: 9px;
}

.welcome-primary,
.welcome-secondary {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  font-size: 15px;
}


.social-shell .settings-panel::before,
.social-shell .saved-card::before,
.social-shell .hero-brief::before,
.social-shell .empty-preview::before {
  display: none;
}

.social-shell .option-pill > span,
.social-shell .settings-segment label > span,
.social-shell select,
.onboarding .option-pill > span,
.onboarding .country-search {
  border: 1px solid var(--option-border);
  border-radius: 12px;
  background: var(--option-bg);
  box-shadow: none;
  color: var(--option-text);
}

.social-shell .option-pill input:checked + span,
.social-shell .settings-segment input:checked + span,
.onboarding .option-pill input:checked + span {
  border-color: transparent;
  background: var(--option-selected-bg);
  color: var(--option-selected-text);
  outline: 0;
  box-shadow: var(--accent-glow);
}

.onboarding-backdrop {
  background: color-mix(in srgb, var(--social-bg) 88%, transparent);
}

.quick-start-summary {
  display: grid;
  gap: 10px;
}

.quick-start-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--option-border);
  border-radius: 13px;
  background: var(--option-bg);
}

.quick-start-row span {
  color: var(--social-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-start-row strong {
  text-align: right;
  font-size: 14px;
  font-weight: 800;
}

.onboarding {
  border: 1px solid var(--social-line);
  background: var(--social-bg);
  box-shadow: none;
  color: var(--social-text);
}

.onboarding::before {
  display: none;
}

@media (max-width: 1180px) and (min-width: 901px) {
  .social-shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }

  .social-shell.has-search-drawer {
    grid-template-columns: 205px 310px minmax(0, 1fr);
  }

  .social-sidebar {
    padding-inline: 12px;
  }

  .social-sidebar .brand span:not(.brand-mark),
  .social-sidebar .nav-item span,
  .social-sidebar .sidebar-search-trigger span {
    display: inline;
  }

  .for-you-media {
    height: min(720px, calc(100dvh - 30px));
  }

  .archive-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  }
}

@media (max-width: 900px) {
  .social-shell,
  .social-shell.has-search-drawer {
    display: block;
    min-height: 100dvh;
  }

  .social-sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 120;
    display: grid;
    width: 100%;
    height: 72px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 0;
    border-top: 1px solid var(--social-line);
  }

  .sidebar-login {
    min-height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    margin-top: 0;
    padding: 5px 3px;
    border-radius: 13px;
    font-size: 9px;
    line-height: 1;
  }

  .sidebar-login span {
    display: block;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .social-sidebar .brand {
    display: none;
  }

  .sidebar-search-trigger,
  .social-sidebar .nav-item {
    min-height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 5px 3px;
    font-size: 9px;
    line-height: 1;
  }

  .sidebar-search-trigger span,
  .social-sidebar .nav-item span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .social-sidebar .nav-list {
    display: contents;
  }

  .social-workspace {
    min-height: calc(100dvh - 72px);
    padding-bottom: 72px;
  }

  .search-drawer {
    position: fixed;
    inset: 0 0 72px;
    z-index: 110;
    width: 100%;
    height: auto;
    padding: 24px 20px;
    border: 0;
  }

  .for-you-layout,
  .for-you-feed {
    height: calc(100dvh - 72px);
  }

  .for-you-item {
    min-height: calc(100dvh - 72px);
    padding: 0;
    place-items: stretch;
  }

  .for-you-stage {
    position: relative;
    width: 100%;
    height: calc(100dvh - 72px);
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
  }

  .for-you-media {
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .for-you-media.is-live {
    box-shadow: none;
  }

  /* Rail floats over the video the way it does in a native short-form feed. */
  .for-you-stage .metric-rail {
    position: absolute;
    z-index: 7;
    right: 8px;
    bottom: 112px;
    padding-bottom: 0;
  }

  .for-you-stage .metric-rail-item {
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.66);
  }

  .for-you-stage .metric-rail-item i {
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(12, 12, 16, 0.44);
    color: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .for-you-caption {
    padding: 64px 78px 20px 14px;
  }

  .for-you-comments {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) min(72dvh, 560px);
  }

  .for-you-comments-shell {
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.45);
    animation-name: for-you-sheet-in-up;
  }

  .metric-rail {
    gap: 9px;
  }

  .metric-rail-item i {
    width: 44px;
    height: 44px;
  }

  .metric-rail-item strong {
    font-size: 9px;
  }

  .trends-layout,
  .search-results-layout {
    min-height: calc(100dvh - 72px);
    padding: 12px 10px 26px;
  }

  .trends-results-head {
    align-items: center;
    margin: 6px 0 12px;
  }

  .trends-results-head h1 {
    font-size: 34px;
  }

  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .search-archive-grid {
    gap: 10px;
  }

  .archive-copy {
    padding: 8px;
  }

  .archive-copy h2 {
    font-size: 12px;
  }

  .archive-metrics {
    font-size: 10px;
  }

  .player-actions {
    gap: 6px;
    padding: 8px;
  }

  .player-actions > button {
    padding-inline: 8px;
    font-size: 10px;
  }

  .player-backdrop {
    padding: 0 0 72px;
  }

  .player-shell {
    width: 100%;
    max-height: calc(100dvh - 72px);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .source-player {
    height: calc(100dvh - 174px);
  }

  .player-body.has-comments {
    height: calc(100dvh - 174px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 42dvh) minmax(0, 1fr);
  }

  .player-body.has-comments .source-player {
    height: 42dvh;
    min-height: 220px;
  }

  .player-comments-panel {
    max-height: none;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .for-you-feed {
    scroll-behavior: auto;
  }

  .media-play-mark,
  .archive-play-mark,
  .sidebar-search-trigger,
  .social-sidebar .nav-item,
  .category-option,
  .for-you-media,
  .for-you-screen,
  .metric-rail-item i {
    transition: none;
  }

  .for-you-comments-scrim,
  .for-you-comments-shell {
    animation: none;
  }
}

:root[data-theme="dark"] .brief-preview,
:root[data-theme="dark"] .question,
:root[data-theme="dark"] .version-card,
:root[data-theme="dark"] .detail-editorial div,
:root[data-theme="dark"] .confirm-panel {
  background: rgba(255, 255, 255, 0.07);
}

:root[data-theme="dark"] .quick-take,
:root[data-theme="dark"] .stats-panel-wide p,
:root[data-theme="dark"] .media-platform,
:root[data-theme="dark"] .media-footer span {
  color: rgba(246, 248, 251, 0.74);
}

:root[data-theme="dark"] .trend-dna span,
:root[data-theme="dark"] .hashtag-row span,
:root[data-theme="dark"] .stat-row span,
:root[data-theme="dark"] .insight-row span {
  border-color: rgba(143, 231, 255, 0.18);
  background: rgba(143, 231, 255, 0.09);
  color: rgba(246, 248, 251, 0.78);
}

:root[data-theme="dark"] .insight-row strong,
:root[data-theme="dark"] .confirm-panel span {
  color: #8fe7ff;
}

:root[data-theme="dark"] .thumbnail-fallback {
  background:
    radial-gradient(circle at 78% 42%, color-mix(in srgb, var(--platform-accent) 32%, transparent), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), color-mix(in srgb, var(--platform-accent) 18%, #10141a));
}

:root[data-theme="dark"] .thumbnail-fallback span {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.34);
  color: rgba(246, 248, 251, 0.72);
}

/* ---------------------------------------------------------------------------
   Sound toggle: the single always-reachable volume control. In the For You
   feed it sits at the top of the metric rail (right above the view count);
   the player modal and inline player carry the same button as an icon.
--------------------------------------------------------------------------- */
.sound-toggle {
  cursor: pointer;
}

/* Sound-on state gets the accent so the rail reads at a glance. */
.rail-sound-toggle:not(.is-muted) i {
  border-color: var(--accent, #6d4aff);
  background: color-mix(in srgb, var(--accent, #6d4aff) 22%, transparent);
  color: var(--accent, #6d4aff);
}

/* Watch-history row: keep the clear button compact so the count stays visible.
   (The mobile breakpoint stretches .ghost-action to 100%; width:auto undoes it.) */
.settings-clear-watched {
  width: auto;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
  white-space: nowrap;
}

.settings-clear-watched[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

/* Saved-state feedback on every save control. */
.metric-save.is-saved i {
  border-color: var(--accent, #6d4aff);
  background: var(--accent, #6d4aff);
  color: #fff;
}

.archive-save-button.is-saved,
.player-actions .inverse-control.is-saved {
  color: var(--accent, #6d4aff);
}

/* ---------------------------------------------------------------------------
   Onboarding polish: step dots under the progress bar, centered account link,
   and a touch more breathing room around the step header.
--------------------------------------------------------------------------- */
.onboarding-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--option-border, rgba(127, 127, 127, 0.35));
  transition: transform 180ms ease, background 180ms ease;
}

.onboarding-dot.is-active {
  transform: scale(1.3);
  background: var(--accent, #6d4aff);
}

.onboarding-dot.is-done {
  background: color-mix(in srgb, var(--accent, #6d4aff) 55%, transparent);
}

.onboarding-head h2 {
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.2;
}

.onboarding-actions-spacer {
  min-width: 1px;
}

.onboarding > .onboarding-signin {
  justify-self: center;
  margin-top: 2px;
}
