:root {
  color-scheme: dark;
  --bg: #03030a;
  --body-bg:
    radial-gradient(circle at 16% 0%, rgba(255, 63, 171, 0.18), transparent 25rem),
    radial-gradient(circle at 88% 8%, rgba(53, 183, 255, 0.16), transparent 27rem),
    linear-gradient(145deg, #03030a 0%, #111024 52%, #040610 100%);
  --panel: #0d0d16;
  --panel-fill: rgba(13, 13, 22, 0.92);
  --panel-strong: #151423;
  --surface: #080812;
  --surface-hover: #101121;
  --field-bg: #10111d;
  --chip-bg: rgba(255, 63, 171, 0.08);
  --button-secondary-bg: rgba(255, 255, 255, 0.045);
  --button-primary-bg: #f8fafc;
  --button-primary-ink: #03030a;
  --bar-bg: #11121d;
  --toast-bg: #101020;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --ink: #fbfbff;
  --muted: #a7a7bb;
  --line: #2b2c43;
  --line-soft: #1c1d31;
  --green: #35b7ff;
  --cyan: #8b63ff;
  --rose: #ff3fab;
  --amber: #bd5cff;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f8f7ff;
  --body-bg:
    radial-gradient(circle at 12% 0%, rgba(255, 63, 171, 0.12), transparent 25rem),
    radial-gradient(circle at 88% 4%, rgba(53, 183, 255, 0.14), transparent 27rem),
    linear-gradient(145deg, #ffffff 0%, #f0efff 52%, #f7fbff 100%);
  --panel: #ffffff;
  --panel-fill: rgba(255, 255, 255, 0.94);
  --panel-strong: #f1f0fb;
  --surface: #ffffff;
  --surface-hover: #f7f4ff;
  --field-bg: #ffffff;
  --chip-bg: rgba(104, 80, 240, 0.055);
  --button-secondary-bg: rgba(20, 20, 45, 0.045);
  --button-primary-bg: #111024;
  --button-primary-ink: #ffffff;
  --bar-bg: #ecebfa;
  --toast-bg: #ffffff;
  --shadow: 0 18px 55px rgba(20, 20, 45, 0.12);
  --ink: #111024;
  --muted: #6f7085;
  --line: #cccbe0;
  --line-soft: #dfdeed;
  --green: #168cd8;
  --cyan: #6651c8;
  --rose: #c82983;
  --amber: #8d48bf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--body-bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

a {
  color: inherit;
}

.legal-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 72px;
  color: var(--ink);
}

.legal-home-link {
  display: inline-flex;
  margin-bottom: 24px;
  background: linear-gradient(90deg, var(--rose), var(--cyan), var(--green));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.legal-page h1 {
  font-size: clamp(2.1rem, 7vw, 4.2rem);
  line-height: 0.95;
}

.legal-updated {
  margin: 12px 0 36px;
  color: var(--muted);
  font-weight: 700;
}

.legal-page section {
  padding: 24px 0;
  border-top: 1px solid var(--line-soft);
}

.legal-page h2 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.legal-page p {
  max-width: 74ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.legal-page a:not(.legal-home-link) {
  color: var(--green);
  font-weight: 800;
}

.app-shell {
  width: min(1480px, calc(100% - 24px));
  margin: 0 auto;
  padding: 8px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 6px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 0;
  margin: -2px 0 10px;
}

.brand-eyebrow {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  line-height: 1.1;
  text-align: center;
  margin-bottom: -10px;
}

.brand-logo {
  width: clamp(124px, 13vw, 178px);
  height: clamp(124px, 13vw, 178px);
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-tagline {
  max-width: 430px;
  margin: -18px 0 0;
  background: linear-gradient(90deg, var(--rose), var(--cyan), var(--green));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-size: clamp(0.82rem, 1.8vw, 1rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.45;
  text-align: center;
}

.theme-logo-light {
  display: none;
}

:root[data-theme="light"] .theme-logo-dark {
  display: none;
}

:root[data-theme="light"] .theme-logo-light {
  display: block;
}

.eyebrow,
.metric-card span,
.insight-box span,
.pipeline-card span,
.select-label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1;
}

.lede {
  max-width: 680px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.4;
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

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

.button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.button-primary {
  background: var(--button-primary-bg);
  color: var(--button-primary-ink);
}

.button-secondary {
  background: var(--button-secondary-bg);
  border-color: var(--line);
  color: var(--ink);
}

.icon-button {
  width: 42px;
  padding: 0;
  border-color: var(--line);
  background: var(--button-secondary-bg);
  color: var(--ink);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.message-top-button {
  position: relative;
}

.message-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  padding: 0 6px;
}

.message-badge[hidden] {
  display: none;
}

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

.metric-card,
.panel,
.stack-section {
  background: var(--panel-fill);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  display: flex;
  min-height: 34px;
  flex-direction: column;
  justify-content: center;
  padding: 5px 8px;
}

.metric-card strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(0.92rem, 1.8vw, 1.12rem);
  line-height: 1;
}

.metric-card span {
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 10px;
}

.panel {
  padding: 22px;
}

.trending-panel {
  padding: 12px;
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading.compact {
  align-items: flex-start;
}

h2 {
  font-size: 1.45rem;
  line-height: 1.15;
}

.panel-heading p,
.section-heading p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.trending-panel .panel-heading,
.video-stats {
  display: none;
}

.select-label {
  display: grid;
  gap: 4px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.category-strip {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 16px;
  overflow-x: auto;
  padding: 2px 0 6px;
}

.category-chip {
  min-height: 44px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--button-secondary-bg);
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 0.95rem;
  font-weight: 900;
  padding: 0 20px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.category-chip:hover,
.category-chip.active {
  border-color: rgba(53, 183, 255, 0.3);
  background: rgba(53, 183, 255, 0.1);
  color: var(--green);
}

.category-chip.theme-viral.active {
  border-color: rgba(139, 99, 255, 0.34);
  background: rgba(139, 99, 255, 0.11);
  color: var(--cyan);
}

.category-chip.theme-products.active {
  border-color: rgba(63, 216, 166, 0.34);
  background: rgba(63, 216, 166, 0.1);
  color: var(--green);
}

.category-chip.theme-random.active {
  border-color: rgba(255, 64, 129, 0.34);
  background: rgba(255, 64, 129, 0.11);
  color: var(--pink);
}

.feed-status-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(139, 99, 255, 0.08), rgba(53, 183, 255, 0.07));
  padding: 12px;
}

.feed-status-card.theme-products {
  background: linear-gradient(135deg, rgba(63, 216, 166, 0.09), rgba(53, 183, 255, 0.06));
}

.feed-status-card.theme-random {
  background: linear-gradient(135deg, rgba(255, 64, 129, 0.1), rgba(191, 86, 255, 0.07));
}

.feed-status-card strong,
.feed-status-card b {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
}

.feed-status-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.feed-status-meta {
  text-align: right;
}

.feed-status-pulse,
.pulse-loader {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--cyan), var(--green));
  box-shadow: 0 0 26px rgba(53, 183, 255, 0.18);
}

.feed-status-pulse::after,
.pulse-loader::after {
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: var(--panel);
  content: "";
}

.feed-status-card.is-warming .feed-status-pulse,
.pulse-loader {
  animation: pulseGlow 1.1s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

.search-field {
  display: grid;
  gap: 7px;
}

.search-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

select,
input {
  height: 40px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--ink);
  padding: 0 12px;
}

textarea {
  min-height: 112px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--ink);
  padding: 12px;
}

.controls select {
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.controls .select-label span {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

input::placeholder {
  color: #687385;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(53, 183, 255, 0.24);
  border-radius: 999px;
  background: rgba(53, 183, 255, 0.08);
  color: var(--green);
  padding: 0 12px;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.top-status {
  flex: 0 0 auto;
}

.review-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-fill);
  box-shadow: var(--shadow);
}

.review-footer strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.94rem;
}

.review-footer p {
  max-width: 78ch;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.review-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.review-footer a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}

.video-list,
.breakdown-list {
  display: grid;
  gap: 16px;
}

.video-row {
  display: grid;
  gap: 9px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.video-row:hover {
  border-color: #3b4b60;
  background: var(--surface-hover);
}

.preview {
  display: grid;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(139, 99, 255, 0.18), transparent 52%),
    linear-gradient(160deg, #18212d, #0c1118);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.preview iframe {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
}

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

.preview.has-image::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.36));
}

.preview-label {
  position: relative;
  z-index: 1;
}

.preview-play {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 1;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.preview-play::before {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid white;
  content: "";
}

.preview.is-playing .preview-play {
  opacity: 0;
}

.preview-rose {
  background:
    linear-gradient(135deg, rgba(255, 63, 171, 0.18), transparent 52%),
    linear-gradient(160deg, #26151b, #0c1118);
}

.preview-green {
  background:
    linear-gradient(135deg, rgba(53, 183, 255, 0.18), transparent 52%),
    linear-gradient(160deg, #14221a, #0c1118);
}

.preview-amber {
  background:
    linear-gradient(135deg, rgba(242, 188, 87, 0.28), transparent 52%),
    linear-gradient(160deg, #251d12, #0c1118);
}

.preview-blue {
  background:
    linear-gradient(135deg, rgba(123, 162, 255, 0.28), transparent 52%),
    linear-gradient(160deg, #151b2b, #0c1118);
}

.video-title {
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.3;
}

.video-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.video-copy {
  min-width: 0;
}

.video-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.video-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.video-stats span {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: #c0c8d2;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1;
  padding: 5px 8px;
}

:root[data-theme="light"] .video-stats span {
  color: #526174;
}

.trend {
  text-align: right;
  min-width: 150px;
}

.trend strong {
  display: block;
  color: var(--green);
  font-size: 1.05rem;
}

.trend span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

.trend em {
  display: inline-block;
  margin-top: 7px;
  color: var(--cyan);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
}

.trend .watch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-top: 7px;
  border: 1px solid rgba(53, 183, 255, 0.24);
  border-radius: 999px;
  background: rgba(53, 183, 255, 0.08);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.trend .watch-link:hover {
  background: rgba(53, 183, 255, 0.13);
}

.trend .watch-link.disabled {
  border-color: var(--line-soft);
  background: var(--button-secondary-bg);
  color: var(--muted);
}

.trend .message-trend-button {
  width: auto;
  cursor: pointer;
  font: inherit;
}

.trend .reaction-trend-button {
  border-color: rgba(139, 99, 255, 0.24);
  background: rgba(139, 99, 255, 0.08);
  color: var(--cyan);
  cursor: pointer;
  font: inherit;
}

.video-row.theme-viral {
  border-color: rgba(139, 99, 255, 0.16);
}

.video-row.theme-products {
  border-color: rgba(63, 216, 166, 0.18);
}

.video-row.theme-random {
  border-color: rgba(255, 64, 129, 0.18);
}

.video-topline,
.why-badges,
.feedback-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.video-topline {
  margin-bottom: 7px;
}

.rank-badge,
.feed-mini-pill,
.why-badges span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 6px 8px;
  text-transform: uppercase;
}

.rank-badge {
  color: var(--cyan);
}

.theme-products .rank-badge,
.theme-products .feed-mini-pill {
  color: var(--green);
}

.theme-random .rank-badge,
.theme-random .feed-mini-pill {
  color: var(--pink);
}

.why-badges {
  margin: 9px 0 2px;
}

.feedback-mini {
  margin-top: 8px;
  justify-content: flex-end;
}

.feedback-mini button {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--button-secondary-bg);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 850;
  padding: 6px 8px;
}

.feedback-mini button:hover {
  border-color: rgba(53, 183, 255, 0.26);
  color: var(--ink);
}

.reaction-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 12, 0.72);
  backdrop-filter: blur(14px);
}

.reaction-modal[hidden] {
  display: none;
}

.reaction-dialog {
  display: grid;
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  gap: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  padding: 18px;
}

.reaction-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.reaction-video {
  display: grid;
  grid-template-columns: minmax(150px, 0.5fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.reaction-video img,
.reaction-video .message-trend-fallback {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
}

.reaction-video strong,
.reaction-video span,
.reaction-video em {
  display: block;
}

.reaction-video strong {
  font-size: 1rem;
  line-height: 1.3;
}

.reaction-video span,
.reaction-video em {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

.reaction-video em {
  color: var(--cyan);
  font-style: normal;
  font-weight: 800;
}

.reaction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state {
  display: grid;
  gap: 6px;
  justify-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 34px 18px;
  text-align: center;
}

.pulse-empty {
  gap: 10px;
  min-height: 220px;
}

.pulse-loader {
  width: 58px;
  height: 58px;
}

.pulse-loader::after {
  inset: 14px;
}

.empty-state strong {
  color: var(--ink);
}

.breakdown-row {
  display: grid;
  gap: 8px;
}

.breakdown-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.breakdown-label span:last-child {
  color: var(--muted);
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bar-bg);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.insight-box {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 63, 171, 0.12), transparent 58%),
    var(--surface);
}

.insight-box strong {
  display: block;
  margin-top: 8px;
  font-size: 1.2rem;
  line-height: 1.25;
}

.stack-section {
  margin-top: 18px;
  padding: 22px;
}

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

.pipeline-card {
  min-height: 108px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.settings-page {
  max-width: 780px;
}

.messages-page {
  max-width: 980px;
}

.messages-panel {
  padding: 24px;
}

.messages-heading,
.conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.messages-heading p:not(.eyebrow),
.conversation-header p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.messages-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.45fr);
  gap: 16px;
  margin-top: 22px;
}

.thread-list,
.conversation-pane {
  min-height: 520px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.thread-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 10px;
}

.thread-button {
  position: relative;
  display: grid;
  width: 100%;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 12px;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.thread-button:hover,
.thread-button.active {
  border-color: rgba(53, 183, 255, 0.24);
  background: rgba(53, 183, 255, 0.08);
}

.thread-name {
  font-weight: 900;
}

.thread-meta,
.thread-preview {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.thread-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.thread-unread {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: var(--rose);
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 0 6px;
}

.conversation-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.conversation-header {
  border-bottom: 1px solid var(--line-soft);
  padding: 16px;
}

.conversation-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.conversation-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.message-stream {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 16px;
}

.message-bubble {
  display: grid;
  max-width: min(82%, 440px);
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 12px;
}

.message-bubble.from-me {
  justify-self: end;
  border-color: rgba(53, 183, 255, 0.24);
  background: rgba(53, 183, 255, 0.08);
}

.message-bubble.from-them {
  justify-self: start;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

.message-meta strong {
  color: var(--ink);
}

.message-bubble p {
  line-height: 1.45;
}

.message-trend-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
}

.message-trend-card img,
.message-trend-fallback {
  width: 92px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
}

.message-trend-fallback {
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.message-trend-card strong,
.message-trend-card span,
.message-trend-card a {
  display: block;
}

.message-trend-card strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.message-trend-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.message-trend-card a {
  margin-top: 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
}

.message-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding: 12px;
}

.message-composer input {
  min-width: 0;
}

.settings-panel {
  padding: 24px;
}

.settings-heading,
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.settings-row-block {
  align-items: stretch;
}

.source-status-list {
  display: grid;
  min-width: min(320px, 100%);
  gap: 8px;
}

.source-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--button-secondary-bg);
  padding: 10px 12px;
}

.source-status-row div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.source-status-row span {
  color: var(--muted);
  font-weight: 800;
}

.source-status-row em,
.source-status-row small {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1.3;
}

.source-status-row em {
  color: var(--cyan);
  font-weight: 850;
}

.source-status-row small {
  max-width: 42ch;
}

.source-status-row strong {
  flex: 0 0 auto;
  color: var(--green);
}

.intelligence-card {
  display: grid;
  min-width: min(360px, 100%);
  max-width: 460px;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--button-secondary-bg);
  padding: 12px;
}

.intelligence-card strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.intelligence-card span,
.intelligence-card small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.intelligence-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.intelligence-chip-list b {
  border: 1px solid rgba(53, 183, 255, 0.18);
  border-radius: 999px;
  background: rgba(53, 183, 255, 0.08);
  color: var(--green);
  font-size: 0.68rem;
  line-height: 1;
  padding: 6px 8px;
}

.creator-scout-form,
.creator-scout-list {
  display: grid;
  min-width: min(460px, 100%);
  max-width: 560px;
  gap: 10px;
}

.creator-scout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

.creator-scout-form input,
.creator-scout-form select {
  width: 100%;
  min-width: 0;
}

.creator-scout-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.creator-scout-summary span,
.creator-scout-item {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--button-secondary-bg);
}

.creator-scout-summary span {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 850;
  padding: 7px 9px;
}

.creator-scout-item {
  display: grid;
  gap: 4px;
  color: inherit;
  padding: 10px 12px;
  text-decoration: none;
}

.creator-scout-item span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.creator-scout-item strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.creator-scout-item em {
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
}

.compact-empty {
  min-height: auto;
  padding: 16px;
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.settings-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.settings-row {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.settings-row h3 {
  margin: 0;
  font-size: 1rem;
}

.settings-row p {
  max-width: 520px;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.theme-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.theme-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.theme-switch span {
  position: relative;
  width: 58px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.theme-switch span::before {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--ink);
  content: "";
  transition: transform 160ms ease;
}

.theme-switch input:checked + span {
  border-color: rgba(53, 183, 255, 0.3);
  background: rgba(53, 183, 255, 0.13);
}

.theme-switch input:checked + span::before {
  transform: translateX(26px);
}

.pipeline-card strong {
  display: block;
  margin-top: 14px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.pipeline-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: calc(100% - 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--toast-bg);
  color: var(--ink);
  padding: 12px 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 900px) {
  .panel-heading,
  .section-heading,
  .settings-heading,
  .settings-row,
  .messages-heading,
  .conversation-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
    width: 100%;
  }

  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .controls {
    grid-template-columns: 1fr;
  }

  .creator-scout-grid {
    grid-template-columns: 1fr;
  }

  .trending-panel {
    grid-column: 1 / -1;
  }

  .review-footer {
    grid-template-columns: 1fr;
  }

  .review-footer nav {
    justify-content: flex-start;
  }

  .messages-layout {
    grid-template-columns: 1fr;
  }

  .thread-list,
  .conversation-pane {
    min-height: 0;
  }

  .thread-list {
    max-height: 280px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 22px;
  }

  .pipeline-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .metric-card {
    min-height: 30px;
    padding: 4px 5px;
  }

  .metric-card span {
    font-size: 0.48rem;
    line-height: 1.05;
  }

  .metric-card strong {
    font-size: clamp(0.78rem, 3.8vw, 0.96rem);
  }

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

  .video-caption {
    grid-template-columns: 1fr;
  }

  .trend {
    text-align: left;
  }

  .preview {
    width: 100%;
    height: auto;
  }

  .reaction-video {
    grid-template-columns: 1fr;
  }

  .button {
    flex: 1 1 150px;
  }

  .icon-button {
    flex: 0 0 42px;
  }

  .message-composer,
  .message-trend-card {
    grid-template-columns: 1fr;
  }

  .message-bubble {
    max-width: 100%;
  }

  .message-trend-card img,
  .message-trend-fallback {
    width: 100%;
  }

  .brand-block {
    align-items: center;
  }

  .brand-logo {
    width: 116px;
    height: 116px;
  }

  .brand-tagline {
    max-width: 310px;
  }
}
